-Version 3.5b2 (2012-03-15)\r
- Rewrote the enter key logic to normalize browser behavior.\r
- 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.\r
- Fixed bug where the selection wouldn't be correct after applying formatting and having the caret at the end of the new format node.\r
- Fixed bug where the noneditable plugin would process contents on raw input calls for example on undo/redo calls.\r
- Fixed bug where WebKit could produce an exception when a bookmark was requested when there wasn't a proper selection.\r
- 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.\r
- Fixed so alignment and indentation works properly when forced_root_blocks is set to false. It will produce a DIV by default.\r
-Version 3.5b1 (2012-03-08)\r
- Added new event class that is faster and enables support for faking events.\r
- Added new self_closing_elements, short_ended_elements, boolean_attributes, non_empty_elements and block_elements options to control the HTML Schema.\r
- Added new schema option and support for the HTML5 schema.\r
- Added new visualblocks plugin that shows html5 blocks with visual borders.\r
- Added new types and selector options to make it easier to create editor instances with different configs.\r
- Added new preview of formatting options in various listboxes.\r
- Added new preview_styles option that enables control over what gets previewed.\r
- Fixed bug where content css would be loaded twice into iframe. \r
- Fixed bug where start elements with only whitespace in the attribute part wouldn't be correctly parsed.\r
- Fixed bug where the advlink dialog would produce an error about the addSelectAccessibility function not being defined.\r
- Fixed bug where the caret would be placed at an incorrect position if span was removed by the invalid_elements setting.\r
- Fixed bug where elements inside a white space preserve element like pre didn't inherit the behavior while parsing.\r
-Version 3.4.9.x (2012-02-xx)\r
- Improved behaviour of backspacing into a table to be consistant across browsers and disable backspace when cursor immediately follows a table.\r
- Improved edit CSS style plugin for single and multiple block selection and provide option to apply style to only selected text.\r
- Fixed bug in Chrome where moving caret down in table and pasting throws errors.\r
- Corrected reference to TinyMCE trim function.\r
- Fixed bug where Ignore All in IE did not remove the underline from the selected word.\r
- Fixed bug in html source editor word wrap option not wrapping text in Webkit browsers.\r
- Fixed bug where it was possible to insert an invalid colour in the color pop-up dialog.\r
- Fixed bug in Webkit where if anchor is on last line by itself caret can not be placed after it.\r
-Version 3.4.9 (2012-02-23)\r
- 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.\r
- Fixed bug in Webkit and IE where deleting empty paragraphs would remove entire editor contents.\r
- Fixed bug where pressing enter on end of list item with a heading would create a new item with heading. \r
- Fixed edit css style dialog text-decoration none checkbox so it disables other text-decoration options when enabled.\r
- Fixed bug in Gecko where undo wasn't added when focus was lost.\r
- Fixed bug in Gecko where shift-enter in table cell ending with BR doesn't move caret to new line.\r
- Fixed bug where right-click on formatted text in IE selected the entire line.\r
- Fixed bug where text ending with space could not be unformatted in IE.\r
- Fixed bug where caret formatting would be removed when moving the caret when a selector expression was used.\r
- Fixed bug where formatting would be applied to the body element when all contents where selected and format had both inline and selector parts.\r
- Fixed bug where the media plugin would throw errors if you had iframe set as an invalid element in config.\r
- 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.\r
- Fixed bug where content css files where loaded twice into the iframe.\r
- Fixed so elements with comments would be trated as non empty elements. Patch contributed by Arjan Scherpenisse.\r
-Version 3.4.8 (2012-02-02)\r
- Fixed bug in IE where selected text ending with space cannot be formatted then formatted again to get original text.\r
- Fixed bug in IE where images larger than editor area were being deselected when toolbar buttons are clicked.\r
- Fixed bug where wrong text align buttons are active when multiple block elements are selected.\r
- Fixed bug where selected link not showing in target field of link dialog in some selection cases.\r
- Use settings for remove_trailing_br so this can be turned off instead of hard coding the value.\r
- Fixed bug in IE where the media plugin displayed null text when some values aren't filled in.\r
- Added API method 'onSetAttrib' that fires when the attribute value on a node changes.\r
- Fix font size dropdown value not being updated when text already has a font size in the advanced template.\r
- Fixed bug in IE where IE doesn't use ARIA attributes properly on options - causing labels to be read out 2 times.\r
- Fixed bug where caret cannot be placed after table if table is at end of document in IE.\r
- Fixed bug where adding range isn't always successful so we need to check range count otherwise an exception can occur.\r
- Added spacebar onclick handler to toolbar buttons to ensure that the accessibility behaviour works correctly.\r
- Fixed bug where a stranded bullet point would get created in WebKit.\r
- Fixed bug where selecting text in a blockquote and pressing backspace toggles the style.\r
- Fixed bug where pressing enter from a heading in IE, the resulting P tag below it shares the style property. \r
- Fix white space in between spans from being deleted. \r
- Fixed bug where scrollbars where visible in the character map dialog on Gecko.\r
- Fixed issue with missing translation for one of the emoticons.\r
- Fixed bug where dots in id:s where causing problems. Patch provided by Abhishek Dev.\r
- Fixed bug where urls with an at sign in the path wouldn't be parsed correctly. Patch contributed by Jason Grout.\r
- Fixed bug where Opera would remove the first character of a inline formatted word if you pressed backspace.\r
- Fixed bugs with the autoresize plugin on various browsers and removed the need for the throbber.\r
- Fixed performance issue where the contextmenu plugin would try to remove the menu even if it was removed. Patch contributed by mhu.\r
-Version 3.4.7 (2011-11-03)\r
- Modified the caret formatting behavior to word similar to common desktop wordprocessors like Word or Libre Office.\r
- Fixed bug in Webkit - Cursor positioning does not work vertically within a table cell with multiple lines of text.\r
- Fixed bug in IE where Inserting a table in IE8 places cursor in the second cell of the first row.\r
- Fixed bug in IE where editor in a frame doesn't give focus to the toolbar using ALT-F10.\r
- Fix for webkit and gecko so that deleting bullet from start of list outdents inner list items and moves first item into paragraph.\r
- Fix new list items in IE8 not displayed on a new line when list contains nested list items.\r
- Clear formatting in table cell breaks the cell.\r
- Made media type list localisable.\r
- Fix out of memory error when using prototype in media dialog.\r
- Fixed bug where could not add a space in the middle of a th cell.\r
- Fixed bug where adding a bullet between two existing bullets adds an extra one\r
- Fixed bug where trying to insert a new entry midway through a bulleted list fails dismally when the next entry is tabbed in.\r
- Fixed bug where pressing enter on an empty list item does not outdent properly in FF\r
- Fixed bug where adding a heading after a list item in a table cell changes all styles in that cell\r
- Fixed bug where hitting enter to exit from a bullet list moves cursor to the top of the page in Firefox.\r
- Fixed bug where pressing backspace would not delete HRs in Firefox and IE when next to an empty paragraph.\r
- Fixed bug where deleting part of the link text can cause a link with no destination to be saved.\r
- Fixed bug where css style border widths wasn't handled correctly in table dialog.\r
- Fixed bug where parsing invalid html contents on IE or WebKit could produce an infinite loop.\r
- Fixed bug where scripts with custom script types wasn't properly passed though the editor.\r
- Fixed issue where some Japanese kanji characters wasn't properly entity encoded when numeric entity mode was enabled.\r
- Made emoticons dialog use the keyboard naviation.\r
- Added navigation instructions to the symbols dialog.\r
- Added ability to set default values for the media plugin.\r
- Added new font_size_legacy_values option for converting old font element sizes to span with font-size properties.\r
- Fixed bug where the symbols dialog was not accessible.\r
- Added quirk for IE ensuring that the body of the document containing tinyMCE has a role="application" for accessibility.\r
- Fixed bug where the advanced color picker wasn't working properly on FF 7.\r
- Fixed issue where the advanced color picker was producing uppercase hex codes.\r
- Fixed bug where IE 8 could throw exceptions if the contents contained resizable content elements.\r
- Fixed bug where caret formatting wouldn't be correctly applied to previous sibling on WebKit.\r
- Fixed bug where the select boxes for font size/family would loose it's value on WebKit due to recent iOS fixes.\r
-Version 3.4.6 (2011-09-29)\r
- Fixed bug where list items were being created for empty divs.\r
- Added support in Media plugin for audio media using the embed tag\r
- Fixed accessibility bugs in WebKit and IE8 where toolbar items were not being read.\r
- Added new use_accessible_selects option to ensure accessible list boxes are used in all browsers (custom widget in firefox native on other browsers)\r
- Fixed bug where classid attribute was not being checked from embed objects.\r
- Fixed bug in jsrobot tests with intermittently failing.\r
- Fixed bug where anchors wasn't updated properly if you edited them using IE 8.\r
- Fixed bug where input method on WebKit on Mac OS X would fail to initialize when sometimes focusing the editor.\r
- Fixed bug where it wasn't possible to select HR elements on WebKit by simply clicking on them.\r
- Fixed bug where the media plugin wouldn't work on IE9 when not using the inlinepopups plugin.\r
- Fixed bug where hspace,vspace,align and bgcolor would be removed from object elements in the media plugin.\r
- Fixed bug where the new youtube format wouldn't be properly parsed by the media plugin.\r
- Fixed bug where the style attribute of layers wasn't properly updated on IE and Gecko.\r
- Fixed bug where editing contents in a layer would fail on Gecko since contentEditable doesn't inherit properly.\r
- Fixed bug where IE 6/7 would produce JS errors when serializing contents containing layers.\r
-Version 3.4.5 (2011-09-06)\r
- Fixed accessibility bug in WebKit where the right and left arrow keys would update native list boxes.\r
- Added new whitespace_elements option to enable users to specify specific elements where the whitespace is preserved.\r
- Added new merge_siblings option to formats. This option makes it possible to disable the auto merging of siblings when applying formats.\r
- Fixed bug in IE where trailing comma in paste plugin would cause plugin to not run correctly.\r
- Fixed bug in WebKit where console messages would be logged when deleting an empty document.\r
- Fixed bug in IE8 where caret positioned is on list item instead of paragraph when outdent splits the list\r
- Fixed bug with image dialogs not inserting an image if id was omitted from valid_elements.\r
- Fixed bug where the selection normalization logic wouldn't properly handle image elements in specific config cases.\r
- Fixed bug where the map elements coords attribute would be messed up by IE when serializing the DOM.\r
- Fixed bug where IE wouldn't properly handle custom elements when the contents was serialized.\r
- Fixed bug where you couldn't move the caret in Gecko if you focused the editor using the API or a UI control.\r
- Fixed bug where adjacent links would get merged on IE due to bugs in their link command.\r
- Fixed bug where the color split buttons would loose the selection on IE if the editor was placed in a frame/iframe.\r
- Fixed bug where floated images in WebKit wouldn't get properly linked.\r
- Fixed bug where the fullscreen mode in a separate window wasn't forced into IE9+ standards mode.\r
- Fixed bug where pressing enter in an empty editor on WebKit could produce DIV elements instead of P.\r
- Fixed bug where spans would get removed incorrectly when merging two blocks on backspace/delete on WebKit.\r
- Fixed bug where the editor contents wouldn't be completely removed on backspace/delete on WebKit.\r
- Fixed bug where the fullpage plugin wouldn't properly render style elements in the head on IE 6/7.\r
- Fixed bug where the nonbreaking_force_tab option in the nonbreaking plugin wouldn't work on Gecko/WebKit.\r
- Fixed bug where the isDirty state would become true on non IE browsers if there was an table at the end of the contents.\r
- Fixed bug where entities wasn't properly encoded on WebKit when pasting text as plain text.\r
- Fixed bug where empty editors would produce an exception of valid_elements didn't include body and forced_root_blocks where disabled.\r
- Fixed bug where the fullscreen mode wouldn't retain the header/footer in the fullpage plugin.\r
- Fixed issue where the plaintext_mode and plaintext_mode_sticky language keys where swapped.\r
-Version 3.4.4 (2011-08-04)\r
- Added new html5 audio support. Patch contributed by Ronald M. Clifford.\r
- Added mute option for video elements and preload options for video/audio patch contributed by Dmitry Kalinkin.\r
- Fixed selection to match visual selection before applying formatting changes.\r
- Fixed browser specific bugs in lists for WebKit and IE.\r
- Fixed bug where IE would scroll the window if you closed an inline dialog that was larger than the viewport. Patch by Laurence Keijmel.\r
- Fixed bug where pasting contents near a span element could remove parts of that span. Patch contributed by Wesley Walser.\r
- Fixed bug where formatting change would be lost after pressing enter.\r
- Fixed bug in WebKit where deleting across blocks would add extra styles.\r
- Fixed bug where moving cursor vertically in tables in WebKit wasn't working.\r
- Fixed bug in IE where deleting would cause error in console.\r
- Fixed bug where the formatter was not applying formats across list elements.\r
- Fixed bug where the wordcount plugin would try and update the wordcount if tinymce had been destroyed.\r
- Fixed bug where tabfocus plugin would attempt to focus elements not displayed when their parent element was hidden.\r
- Fixed bug where the contentEditable state would sometimes be removed if you deleted contents in Gecko.\r
- Fixed bug where inserting contents using mceInsertContent would fail if "span" was disabled in valid_elements.\r
- Fixed bug where initialization might fail if some resource on gecko wouldn't load properly and fire the onload event.\r
- Fixed bug where ctrl+7/8/9 keys wouldn't properly add the specific formats associated with them.\r
- Fixed bug where the HTML tags wasn't properly closed in the style plugins properties dialog.\r
- Fixed bug where the list plugin would produce an exception if the user tried to delete an element at the very first location.\r
-Version 3.4.3.2 (2011-06-30)\r
- Fixed bug where deleting all of a paragraph inside a table cell would behave badly in webkit.\r
- Fixed bugs in tests in firefox5 and WebKit.\r
- Fixed bug where selection of table cells would produce an exception on Gecko.\r
- Fixed bug where the caret wasn't properly rendered on Gecko when the editor was hidden.\r
- Fixed bug where pasting plain text into WebKit would produce a pre element it will now produce more semantic markup.\r
- Fixed bug where selecting list type formats using the advlist plugin on IE8 would loose editor selection.\r
- Fixed bug where forced root blocks logic wouldn't properly pad elements created if they contained data attributes.\r
- Fixed bug where it would remove all contents of the editor if you inserted an image when not having a caret in the document.\r
- Fixed bug where the YUI compressor wouldn't properly encode strings with only a quote in them.\r
- Fixed bug where WebKit on iOS5 wouldn't call nodeChanged when the selection was changed.\r
- Fixed bug where mceFocus command wouldn't work properly on Gecko since it didn't focus the body element.\r
- Fixed performance issue with the noneditable plugin where it would enable/disable controls to often.\r
-Version 3.4.3.1 (2011-06-16)\r
- Fixed bug where listboxes were not being handled correctly by JAWS in firefox with the o2k7 skin.\r
- Fixed bug where custom buttons were not being rendered correctly when in high contrast mode.\r
- Added support for iOS 5 that now supporting contentEditable in it's latest beta.\r
- Fixed bug where urls in style attributes with a _ character followed by a number would cause incorrect output.\r
- Fixed bug where custom_elements option wasn't working properly on IE browsers.\r
- Fixed bug where custom_elements marked as block elements wouldn't get correctly treated as block elements.\r
- Fixed bug where attributes with </> wasn't properly encoded as XML entities.\r
-Version 3.4.3 (2011-06-09)\r
- Fixed bug where deleting backwards before an image into a list would put the cursor in the wrong location.\r
- Fixed bug where styles plugin would not apply styles across multiple selected block elements correctly.\r
- Fixed bug where cursor would jump to start of document when selection contained empty table cells in IE8.\r
- Fixed bug where applied styles wouldn't be kept if you pressed enter twice to produce two paragraphs.\r
- Fixed bug where a ghost like caret would appear on Gecko when pressing enter while having a text color applied.\r
- Fixed bug where IE would produce absolute urls if you inserted a image/link and reloaded the page.\r
- Fixed bug where applying a heading style to a list item would cascade style to children list items.\r
- Fixed bug where Editor loses focus when backspacing and changing styles in WebKit.\r
- Fixed bug where exception was thrown in tinymce.util.URI when parsing a relative URI and no base_uri setting was provided.\r
- Fixed bug where alt-f10 was not always giving focus to the toolbar on Safari.\r
- Added new 'allow_html_in_named_anchor' option to allow html to occur within a named anchor tag. Use at own risk.\r
- Added plugin dependency support. Will autoload plugins specified as a dependency if they haven't been loaded.\r
- Fixed bug where the autolink plugin didn't work with non-English keyboards when pressing ).\r
- Added possibility to change properties of all table cells in a column.\r
- Added external_image_list option to get images list from user-defined variable or function.\r
- Fixed bug where the autoresize plugin wouldn't reduce the editors height on Chrome.\r
- Fixed bug where table size inputs were to small for values with size units.\r
- Fixed bug where table cell/row size input values were not validated.\r
- Fixed bug where menu item line-height would be set to wrong value by external styles.\r
- Fixed bug where hasUndo() would return wrong answer.\r
- Fixed bug where page title would be set to undefined by fullpage plugin.\r
- Fixed bug where HTML5 video properties were not updated in embedded media settings.\r
- Fixed bug where HTML comment on the first line would cause an error.\r
- Fixed bug where spellchecker menu was positioned incorrectly on IE.\r
- Fixed bug where breaking out of list elements on WebKit would produce a DIV instead of P after the list.\r
- Fixed bug where pasting from Word in IE9 would add extra BR elements when text was word wrapped.\r
- Fixed bug where numeric entities with leading zeros would produce incorrect decoding.\r
- Fixed bug where hexadecimal entities wasn't properly decoded.\r
- Fixed bug where bookmarks wasn't properly stored/restored on undo/redo.\r
- Fixed bug where the mceInsertCommand didn't retain the values of links if they contained non url contents.\r
- Fixed bug where the valid_styles option wouldn't be properly used on styles for specific elements.\r
- Fixed so contentEditable is used for the body of the editor if it's supported.\r
- Fixed so trailing BR elements gets removed even when forced_root_blocks option was set to false/null.\r
- Fixed performance issue with mceInsertCommand and inserting very simple contents.\r
- Fixed performance issue with older IE version and huge documents by optimizing the forced root blocks logic.\r
- Fixed performance issue with table plugin where it checked for selected cells to often.\r
- Fixed bug where creating a link on centered/floated image would produce an error on WebKit browsers.\r
- Fixed bug where Gecko would remove single paragraphs if there where contents before/after it.\r
- Fixed bug where the scrollbar would move up/down when pasting contents using the paste plugin.\r
-Version 3.4.2 (2011-04-07)\r
- Added new 'paste_text_sticky_default' option to paste plugin, enables you to set the default state for paste as plain text.\r
- 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.\r
- Rewritten the fullpage plugin to handle style contents better and have a more normalized behavior across browsers.\r
- Fixed bug where contents inserted with mceInsertContent wasn't parsed using the default dom parser.\r
- Fixed bug where blocks containing a single anchor element would be treated as empty.\r
- Fixed bug where merging of table cells on IE 6, 7 wouldn't look correctly until the contents was refreshed.\r
- Fixed bug where context menu wouldn't work properly on Safari since it was passing out the ctrl key as pressed.\r
- Fixed bug where image border color/style values were overwritten by advimage plugin.\r
- Fixed bug where setting border in advimage plugin would throw error in IE.\r
- Fixed bug where empty anchors list in link settings wasn't hidden.\r
- Fixed bug where xhtmlextras popups were missing localized popup-size parameters.\r
- Fixed bug where the context menu wouldn't select images on WebKit browsers.\r
- Fixed bug where paste plugin wouldn't properly extract the contents on WebKit due to recent changes in browser behavior.\r
- Fixed bug where focus of the editor would get on control contents on IE lost due to a bug in the ColorSplitButton control.\r
- Fixed bug where contextmenu wasn't disabled on noneditable elements.\r
- Fixed bug where getStyle function would trigger error when called on element without style property.\r
- Fixed bug where editor fail to load if Javascript Compressor was used.\r
- Fixed bug where list-style-type=lower-greek would produce errors in IE<8.\r
- Fixed bug where spellchecker plugin would produce errors on IE6-7.\r
- Fixed bug where theme_advanced_containers configuration option causes error.\r
- Fixed bug where the mceReplaceContent command would produce an error since it didn't correctly handle a return value.\r
- 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.\r
- Fixed bug in xhtmlxtras plugin where it wasn't possible to remove some attributes in the attributes dialog.\r
-Version 3.4.1 (2011-03-24)\r
- Added significantly improved list handling via the new 'lists' plugin.\r
- Added 'autolink' plugin to enable automatically linking URLs. Similar to the behavior IE has by default.\r
- Added 'theme_advanced_show_current_color' setting to enable the forecolor and backcolor buttons to continuously show the current text color.\r
- Added 'contextmenu_never_use_native' setting to disable the ctrl-right-click showing the native browser context menu behaviour.\r
- Added 'paste_enable_default_filters' setting to enable the default paste filters to be disabled.\r
- Fixed bug where selection locations on undo/redo didn't work correctly on specific contents.\r
- Fixed bug where an exception would be trown on IE when loading TinyMCE inside an iframe.\r
- Fixed bug where some ascii numeric entities wasn't properly decoded.\r
- Fixed bug where some non western language codes wasn't properly decoded/encoded.\r
- Fixed bug where undo levels wasn't created when deleting contents on IE.\r
- Fixed bug where the initial undo levels bookmark wasn't updated correctly.\r
- Fixed bug where search/replace wouldn't be scoped to editor instances on IE8.\r
- Fixed bug where IE9 would produce two br elements after block elements when pasting.\r
- Fixed bug where IE would place the caret at an incorrect position after a paste operation.\r
- Fixed bug where a paste operation using the keyboard would add an extra undo level.\r
- Fixed bug where some attributes/elements wasn't correctly filtered when invalid contents was inserted.\r
- Fixed bug where the table plugin couldn't correctly handle invalid table structures.\r
- Fixed bug where charset and title of the page were handled incorrectly by the fullpage plugin.\r
- Fixed bug where toggle states on some of the list boxes didn't update correctly.\r
- Fixed bug where sub/sub wouldn't work correctly when done as a caret action in Chrome 10.\r
- Fixed bug where the constrain proportions checkbox wouldn't work in the media plugin.\r
- Fixed bug where block elements containing trailing br elements wouldn't treated properly if they where invalid.\r
- Fixed bug where the color picker dialog wouldn't be rendered correctly when using the o2k7 theme.\r
- Fixed bug where setting border=0 using advimage plugin invalid style attribute content was created in Chrome.\r
- Fixed bug with references to non-existing images in css of fullpage plugin.\r
- Fixed bug where item could be unselected in spellchecker's language selector.\r
- Fixed bug where some mispelled words could be not highlighted using spellchecker plugin.\r
- Fixed bug where spellchecking would merge some words on IE.\r
- Fixed bug where spellchecker context menu was not always positioned correctly.\r
- Fixed bug with empty anchors list in advlink popup when Invisible Elements feature was disabled.\r
- Fixed bug where older IE versions wouldn't properly handle some elements if they where placed at the top of editor contents.\r
- Fixed bug where selecting the whole table would enable table tools for cells and rows.\r
- Fixed bug where it wasn't possible to replace selected contents on IE when pasting using the paste plugin.\r
- Fixed bug where setting text color in fullpage plugin doesn't work.\r
- Fixed bug where the state of checkboxes in media plugin wouldn't be set correctly.\r
- Fixed bug where black spade suit character was not included in special character selector.\r
- Fixed bug where setting invalid values for table cell size would throw an error in IE.\r
- Fixed bug where spellchecking would remove whitespace characters from PRE block in IE.\r
- Fixed bug where HR was inserted inside P elements instead of splitting them.\r
- Fixed bug where extra, empty span tags were added when using a format with both selector and inline modes.\r
- Fixed bug where bullet lists weren't always detected correctly.\r
- Fixed bug where deleting some paragraphs on IE would cause an exception.\r
- Fixed bug where the json encoder logic wouldn't properly encode \ characters.\r
- Fixed bug where the onChange event would be fired when the editor was first initialized.\r
- Fixed bug where mceSelected wouldn't be removed properly from output even if it's an internal class.\r
- Fixed issue with table background colors not being transparent. This improves compliance with users browser color preferences.\r
- Fixed issue where styles were not included when using the full page plugin.\r
- Fixed issue where drag/drop operations wasn't properly added to the undo levels.\r
- Fixed issue where colors wasn't correctly applied to elements with underline decoration.\r
- Fixed issue where deleting some paragraphs on IE would cause an exception.\r
-Version 3.4 (2011-03-10)\r
- Added accessibility example with various accessibility options contributed by Ephox.\r
- Fixed bug where attributes wasn't properly handled in the xhtmlxtras plugin.\r
- Fixed bug where the image.htm had some strange td artifacts probably due to auto merging.\r
- Fixed bug where the ToolbarGroup had an missing reference to this in it's destroy method.\r
- Fixed bug with the resizeBy function in the advanced theme where it was scaled by the wrong parent.\r
- Fixed bug where an exception would be thrown by the element if the page was served in xhtml mode.\r
- Fixed bug where mceInsertContent would throw an exception when page was served in xhtml mode.\r
- Fixed bug where you couldn't select a forground/background color when page was served in xhtml mode.\r
- Fixed bug where the editor would scroll to the toolbar when clicked due to a call to focus in ListBox.\r
- Fixed bug where pages with rtl dir wouldn't render split buttons correctly when using the o2k7 theme.\r
- Fixed bug where anchor elements with names wasn't properly collapsed as they where in 3.3.x.\r
- Fixed bug where WebKit wouldn't properly handle image selection if it was done left to right.\r
- Fixed bug where the formatter would align images when the selection range was collapsed.\r
- Fixed bug where the image button would be active when the selection range was collapsed.\r
- Fixed bug where the element_format option wasn't used by the new (X)HTML serializer logic.\r
- Fixed bug where the table cell/row dialogs would produce empty attributes.\r
- Fixed bug where the tfoot wouldn't be added to the top of the table.\r
- Fixed bug where the formatter would merge siblings with white space between them.\r
- Fixed bug where pasting headers and paragraphs would produce an extra paragraph.\r
- Fixed bug where the ColorSplitButton would throw an exception if you clicked out side a color.\r
- Fixed bug where IE9 wouldn't properly produce new paragraphs on enter if the current paragraph had formatting.\r
- Fixed bug where multiple BR elements at end of block elements where removed.\r
- Fixed bug where fullscreen plugin wouldn't correctly display the edit area on IE6 for long pages.\r
- Fixed bug where paste plugin wouldn't properly encode raw entities when pasting in plain text mode.\r
- Fixed bug where the search/replace plugin wouldn't work correctly on IE 9.\r
- Fixed so the drop menus doesn't get an outline border visible when focused, patch contributed by Ephox.\r
- Fixed so the values entered in the color picker are forced to hex values.\r
- Removed dialog workaround for IE 9 beta since the RC is now out and people should upgrade.\r
- Removed obsolete calls in various plugins to the mceBeginUndoLevel command.\r
-Version 3.4b3 (2011-02-10)\r
- Added WAI-ARIA support for the main UI and dialogs this feature was contributed by Ephox.\r
- Added iframe support to media plugin in order to handle the new YouTube HTML5 video formats.\r
- Fixed bug where anchors would wrap the text contents after it due to a bug in the DomParser logic.\r
- Fixed bug where the selected state wouldn't be removed on ListBox controls when a menu item was selected.\r
- Fixed bug where IE could throw an unspecified error exception when the getBookmark logic was executed.\r
- Fixed bug where IE would throw an invalid argument error when focus was applied to an empty editor instance.\r
- Fixed bug where applying inline format wouldn't work if the start cell in the selection was empty.\r
- Fixed bug where auto detection logic for YouTube and Google Video wouldn't work in the new media plugin.\r
- Fixed bug where td elements would get a colspan/rowspan of 1 when created by the table plugin.\r
- Fixed bug where removal/padding of empty elements wasn't handled correctly.\r
- Fixed bug where internal elements would show up in element path.\r
- Fixed bug where internal elements would get serialized as valid output.\r
- Fixed bug where color wasn't correctly applied to anchor elements.\r
- Fixed bug where float option in the style plugin dialog wouldn't be handled correctly on WebKit.\r
- Fixed bug where the tinymce.dom.TreeWalker prev function wouldn't walk the DOM correctly.\r
- Fixed bug where mceInsertContent command could produce empty block elements after the inserted content.\r
- Fixed bug where mceInsertContent command wouldn't apply visual aids on tables and similar elements.\r
- Fixed bug where empty block elements would get double br bogus elements in them.\r
- Fixed bug where the color menu wouldn't apply the color correctly on IE when the viewport was to small.\r
- Fixed bug where right clicking out side the body element of the editor iframe would prevent paste from working on IE.\r
- Fixed bug where the onContextMenu event wouldn't fire correctly on IE if you clicked out side the body element.\r
- Fixed bug where the onContextMenu event wouldn't fire correctly on modern Opera versions that now support it by default.\r
- Fixed bug where legacy content wasn't converted correctly when inserted using mceInsertContent or through the source dialog.\r
- Fixed bug where resizing images or tables wouldn't update the style attribute correctly or leave data-mce prefixed attributes.\r
- Fixed bug where adding links wouldn't work correctly when using TinyMCE jQuery version with jQuery 1.5.\r
- Fixed bug where single quotes inside param elements wasn't treated correctly by the media plugin.\r
- Fixed bug where pasting plain text in WebKit wouldn't work correctly. It will now auto detect the WebKit bug and use plain text mode.\r
- Fixed bug where the DomParser would fail to move out invalid elements within invalid elements on complex contents.\r
- Fixed bug where paste as plain text would not decode html entities properly.\r
- Fixed bug where large paragraphs would cause incorrect scrolling behavior if you would split them using enter.\r
- Fixed bug where the SaxParser wouldn't properly parse some specific short ended elements.\r
- Fixed so mceReplaceContent supports caret position and makes sure that the contents inserted gets validated.\r
- Fixed so unnecessary traling br elements in blocks gets removed on Gecko/WebKit when using mceInsertContent command.\r
- Moved some plugin css contents into the skin content css files to reduce the number of http requests.\r
- Moved some plugin specific images into the theme img directory since they can then be shared.\r
-Version 3.4b2 (2011-01-13)\r
- Added new custom flash player, this player supports mp4 and flv and has skin support.\r
- Fixed so mceInsertContent handles context correctly to enforce valid nesting of elements.\r
- Fixed bug where scrolling would become jerky on IE on some contents.\r
- Fixed bug where paste as plain text would throw exception of missing entities setting.\r
- Fixed bug where anchor nodes where removed by the new serializer engine.\r
- Fixed bug where IE would crash if when backspace where used on some specific contents.\r
- Fixed bug where pasting of plain text in WebKit would result in merging of text lines.\r
- Fixed bug where it wasn't possible to delete images or tables using backspace on IE9.\r
- Fixed bug where urls in styles would generate a JS error due to incorrect scope.\r
- Fixed bug where copy paste from Java applications would produce extra contents in FF on Mac.\r
- Fixed bug where the verify_html option wouldn't allow all elements and attributes.\r
-Version 3.4b1 (2010-12-20)\r
- Added new serialization engine that increases performance and enforces valid output according to the specified schema settings.\r
- Added new HTML parser logic used by the serialization engine and can handle malformed html contents.\r
- Added new valid_children config option, enables more fine grain control of elements can be inside other elements.\r
- Added new entities encoding logic boost performance and will only encode entities based on context i.e. attributes/text nodes.\r
- Added new protect setting that enables users to protect template items from being removed by the serializer logic.\r
- Added new {$caret} marker for the mceInsertContent command. Makes it possible to move the caret to a specific position when inserting contents.\r
- Added new validation of anchor names. Only valid W3C names will be accepted.\r
- Replaced the internal _mce_ prefixed attributes to the more standard HTML5 data-mce- prefix. This will also resolve future browser santiaztion issues.\r
- Fixed bug where the paste plugin wouldn't convert Word lists with more than 9 items to real ol lists. Patch contributed by Mike (yogaboy).\r
- Fixed bug where clicking on a format title would produce errors if the current selection didn't have any formats.\r
- Fixed bug where paste of simple texts wouldn't work correctly in Gecko using the paste plugin since it keeps block formatting.\r
- Fixed bug where confirm dialogs didn't display correctly due to resent IE9 fixes.\r
- Fixed bug where spaces in URLs wouldn't be properly encoded to %20 if the user entered them in the link dialogs. Patch contributed by Ephox.\r
- Fixed bug where the image alignment buttons wouldn't reposition the resize handles on FF due to a browser issue. Patch contributed by Ephox.\r
- Fixed bug where the compareBoundaryPoints method of the IE Range class didn't work correctly. Patch contributed by Ephox.\r
- Fixed bug where selection of elements using double click wouldn't select the clicked element but rather the parent node on FF. Patch contributed by Ephox.\r
- Fixed bug where IE would scroll the user to the current selection causing parent document to scroll as well. Patch contributed by Ephox.\r
- Fixed bug where style compression would incorrectly compress items with different values. It now only compresses if the values are the same. Patch contributed by Ephox.\r
- Fixed bug where FF would add non breaking spaces outside TD elements if formatting was applied to table cells. Patch contributed by Ephox.\r
- Fixed bug where the caret position would be lost on WebKit browsers if you pasted images multiple times. Patch contributed by Ephox.\r
- Fixed bug where non word contents like * would be counted as words in the wordcount pluging. Patch contributed by David Balatero.\r
- Fixed bug where the toggle absolute button in the layer plugin wouldn't remove the existing internal style attribute first.\r
- Fixed bug where the autosave plugin would generate an exception on IE if the user had disabled userdata persistence.\r
- Fixed bug where the paste plugin would remove dashed classes on IE since the regexps didn't include that character.\r
- Fixed bug where applying text color would not add spans inside link elements. This is needed due to CSS style inheritance.\r
- Fixed bug where applying block formats to empty elements wouldn't render correctly on IE.\r
- Fixed bug where the searchreplace plugin would add a f or r character when shortcuts where used on IE while using default dialogs.\r
- Fixed bug where Opera wouldn't load scripts correctly since the onreadystate would fire even though the script wasn't loaded.\r
- Fixed issue where wouldn't be handled correctly in the bbcode plugin if entity_encoding was set to raw.\r
- Fixed issue where contents would flicker since the content css files where asynchronously loaded.\r
- Fixed bug where WebKit wouldn't create links on images with a float style.\r
-Version 3.3.9.3 (2010-12-20)\r
- Fixed issue where WebKit wouldn't correctly apply ins/del in xhtmlxtras plugin.\r
- Fixed bug where paste as plaintext on WebKit wouldn't produce br and p elements correctly.\r
- Fixed bug where the confirm dialog texts would be incorrectly placed due to recent IE 9 workarounds in the window.css.\r
- Fixed bug where applying text color would not add spans inside link elements. This is needed due to CSS style inheritance.\r
-Version 3.3.9.2 (2010-09-29)\r
- Fixed bug where placing the caret in IE 9 beta 1 would not work correctly if you clicked out side the document body element.\r
- Fixed bug where IE 9 beta 1 wouldn't resize the editor correctly since the events didn't fire as previous versions did.\r
- Fixed bug where FF would produce an error message when being rendered inside a hidden div element.\r
- Fixed bug where resize logic could produce a cookie with a width/height less than the size of the container.\r
- Fixed bug where content_css wouldn't populate the styles dropdown correctly.\r
-Version 3.3.9.1 (2010-09-23)\r
- Fixed bug where WebKit browsers wouldn't activate the image button when images where selected.\r
- Fixed bug where Opera Presto 10.60 deletes elements when restoring bookmarks.\r
- Fixed bug where IE9 beta1 doesn't handle regexp replacement values correctly.\r
- Fixed bug where IE9 beta1 didn't render the inline dialogs correctly due to a bug with CSS clip.\r
- Fixed bug where IE9 beta1 would produce error messages on load since they removed the document.recalc method.\r
- Fixed bug where IE9 beta1 would produce <html xmlns=""> since they haven't implemented document.implementation.createDocument correctly.\r
- Fixed bug where IE9 beta1 would searchreplace doesn't work since their native DOM Range doesn't have a find method.\r
- Fixed bug where IE9 beta1 would render the source view incorrectly due to incorrect viewport size measurements.\r
- Fixed bug where IE9 beta1 would crash when running the basic functionality unit tests.\r
- Fixed bug where IE9 beta1 would wrap elements in blocks correctly due to changes to the selection object.\r
- Fixed bug where IE9 beta1 would fail to insert contents since they havn't implemented the createContextualFragment method in their DOM Range.\r
- Fixed bug where IE9 beta1 would fail to handle image selection since they currently doesn't support control selections in their DOM Range.\r
- Fixed bug where IE9 beta1 would fail to load scripts since they fire the onload event before the scripts are parsed and executed.\r
-Version 3.3.9 (2010-09-08)\r
- Fixed bug where inserting table rows into a table with subtable would produce an incorrect column count.\r
- Fixed bug where the selection of cells in a table with subtables could produce invalid selections.\r
- Fixed bug where the table plugin would produce a script error if you tried to move the caret before a first child table.\r
- Fixed bug where the keep_styles feature on IE would move the caret to an incorrect location at the end of list blocks.\r
- Fixed so attributes from legacy elements such as font gets retained when they get converted to spans.\r
- Fixed minor issue where the select boxes wouldn't be set the not set by default in the table dialog.\r
-Version 3.3.8 (2010-06-30)\r
- On IE8+ and FireFox 3.5+, dragging an image now correctly adds an undo\r
- event.\r
- Fixed bug where WebKit would not move the caret to a correct position after a paste operation.\r
- Fixed bug where WebKit would produce a div wrapper element when pasting some contents.\r
- Fixed bug where the visual chars and nonbreaking plugin wouldn't show nbsp elements correctly.\r
- Fixed bug where the format states would be enabled even after the format was removed.\r
- Fixed bug where the delete key would move the caret to an incorrect position.\r
- Fixed bug where it wasn't possible to toggle of the current font size/family/style by clicking the title item.\r
- Fixed bug where the abbr element wouldn't get serialized correctly on IE6.\r
- Fixed so that the examples checks if they are executed from the local file system since that might not work properly.\r
-Version 3.3.7 (2010-06-10)\r
- Fixed bug where context menu would produce an error on IE if you right clicked twice and left clicked once.\r
- Fixed bug where resizing of the window on WebKit browsers in fullscreen mode wouldn't position the statusbar correctly.\r
- Fixed bug where IE would produce an error if the editor was empty and you where undoing to that initial level.\r
- Fixed bug where setting the table background on gecko would produce \" entities inside the url style property.\r
- Fixed bug where the button states wouldn't be updated correctly on IE if you placed the caret inside the new element.\r
- Fixed bug where undo levels wasn't properly added after applying styles or font sizes.\r
- Fixed bug where IE would throw an error if you used "select all" on empty elements and applied formatting to that.\r
- Fixed bug where IE could select one extra character when you did a bookmark call on a caret location.\r
- Fixed bug where IE could produce a script error on delete since it would sometimes produce an invalid DOM.\r
- Fixed bug where IE would return the wrong start element if the whole element was selected.\r
- Fixed bug where formatting states wasn't updated on IE if you pressed enter at the end of a block with formatting.\r
- Fixed bug where submenus for the context menu wasn't removed correctly when the editor was destroyed.\r
- Fixed bug where Gecko could select the wrong element after applying format to multiple elements.\r
- Fixed bug where Gecko would delete parts of the previous element if the selection range was a element selection.\r
- Fixed bug where Gecko would not merge paragraph elements correctly if they contained br elements.\r
- Fixed bug where the cleanup button could produce span artifacts if you pressed it twice in a row.\r
- Fixed bug where the fullpage plugin header/footer would be have it's header reseted to it's initial state on undo.\r
- Fixed bug where an empty paragraph would be collapsed if you performed a cleanup while having the caret inside it.\r
- Fixed a few memory leaks on IE especially with drop menus in listboxes and the spellchecker.\r
- Fixed so formats applied to the current caret gets merged to reduce the number of output elements.\r
- Added the latest version of Sizzle for the CSS selector logic to fix a compatibility issue with prototype.\r
-Version 3.3.6 (2010-05-20)\r
- Fixed bug where a editor.focus call could produce errors on IE in very specific scenarios.\r
- Fixed bug where Gecko would produce an error if you unformatted text inside an empty element.\r
- Fixed bug where IE would produce an error if the caret was placed before a table and you used the align buttons.\r
- Fixed bug where the font size drop down didn't display the a preview correctly.\r
- Fixed bug where the paste plugin wouldn't include all contents some times on WebKit browsers.\r
- Fixed bug where the plain text mode toggle wouldn't work properly on WebKit.\r
- Fixed bug where the editors statusbar would become invisible when you resized the window in fullscreen mode.\r
-Version 3.3.5.1 (2010-05-07)\r
- Fixed a critical bug with the fullscreen plugin. Produced error messages when the state was toggled on/off.\r
-Version 3.3.5 (2010-05-06)\r
- Added new merge_with_parents option to formats, enables the control of removal of elements with similar parents.\r
- Fixed so the default behavior for applying classes isn't a toggle state but the old behavior from before the 3.3 release.\r
- Fixed bug where selecting contents using double click on Gecko would produce errors when using removing format.\r
- Fixed bug where the IE DOM could get messed up when non valid contents was pasted into the editor.\r
- Fixed bug where merging selected table cells using the context menu didn't work as expected.\r
- Fixed bug where some nestled formatting would be applied incorrectly.\r
- Fixed bug with enter in list items when using the force_br_newlines mode on WebKit patch contributed by Ryan Koopmans.\r
- Fixed bug where undo/redo could produce js errors on some specific operations.\r
- Fixed bug where the theme_advanced_font_sizes didn't work as before 3.3 when complex settings where used.\r
- Fixed bug where the table plugin would copy cell/row id attributes when making new rows/cells.\r
-Version 3.3.4 (2010-04-27)\r
- Fixed bug where fullscreen plugin would add two editor instances to EditorManager collection.\r
- Fixed bug where it was difficult to enter text on non western languages such as Japanese on IE.\r
- Fixed bug where removing contents from nodes could result in an exception when using undo/redo.\r
- Fixed bug with selection of images inside layers or other resizable containers on IE.\r
- Fixed so editors isn't initialized on iPhone/iPad devices since they don't have caret support.\r
-Version 3.3.3 (2010-04-19)\r
- Added new script_loaded callback function setting for the jQuery plugin.\r
- Added various fixes and new rpc methods for the spellchecker plugin. Patch contributed by Michael Peters.\r
- Removed some unnecessary inline style information from some of the dialogs.\r
- Fixed some issues with the chaining for the TinyMCE jQuery plugin.\r
- Fixed so any extra arguments passed to patched jQuery functions gets passed through. Patch contributed by Lee Henson.\r
- Fixed so spellchecking/contextmenu can be toggled on/off if the browser has native spellchecker support.\r
- Fixed bug where some texts in the new paste plugin wasn't placed in language pack.\r
- Fixed bug where IE would produce an incorrect information message when cutting.\r
- Fixed bug where removing items using the xhtmlxtras plugin wouldn't work correctly.\r
- Fixed bug where setting table background images would add extra quotes on Gecko.\r
- Fixed bug where shortcut for bold/italic/underline wouldn't work properly on WebKit.\r
- Fixed bug where IE would produce an error message if only contents was an image tag and bold was used.\r
- Fixed bug where the caret would move if alignment was applied to empty block elements.\r
- Fixed bug where some shortcut key commands wouldn't apply formatting correctly.\r
-Version 3.3.2 (2010-03-25)\r
- Fixed bug where it was possible to scale the editor iframe smaller than the editor UI.\r
- Fixed bug where some of the resizing option didn't work with the new live resize.\r
- Fixed bug where the format listbox didn't show nestled formats correctly.\r
- Fixed bug where the native listboxes didn't work correctly.\r
- Fixed bug where font size selection in using the legacyoutput plugin would produce errors.\r
- Fixed so block and blockquote formats remove their matching element regardless of it's attributes.\r
-Version 3.3.1 (2010-03-18)\r
- Added new live resize feature, the editor contents is now visible while resizing.\r
- Fixed bug where some valid_element patterns would produce an unknown property error.\r
- Fixed bug where it wasn't possible to toggle off blockquotes.\r
- Fixed bug where an undo level wasn't produced when applying formatting using the styles dropdown.\r
- Fixed bug where IE 6/7 wouldn't perform caret formatting due to a focus/event bug in IE.\r
- Fixed bug where undo/redo wasn't restoring the previous selection correctly.\r
- Fixed bug where the caret would become invisible if you resized the editor in latest Gecko.\r
- Fixed bug where the class attribute wasn't completely removed in IE 6/7 when the removeClass function was used.\r
- Fixed so the matchNode method of the Formatter class returns the matched format rule.\r
- Fixed so it's possible to apply formatting to both blocks and as inline elements.\r
-Version 3.3 (2010-03-10)\r
- Fixed bug where backspace on a table on IE would produce an empty tbody and some JS exceptions.\r
- Fixed bug where some redundant children wasn't removed properly when applying inline styles to them.\r
- Fixed bug where Chrome would produce incorect dialog sizes if the inlinepopups plugin wasn't used.\r
- Fixed bug where spans with different classes would get merged if they where siblings to each other.\r
- Fixed bug where IE 8 would crash if you used the spellchecker.\r
- Fixed bug where Input Method for non western languages didn't work correctly.\r
- Fixed bug where the UI would render incorrectly in FF 3.6 on Mac due to a bug n their rendering engine.\r
- Fixed bug where WebKit wouldn't scroll down correctly if Shift+Enter was used. Patch contributed by Thomas Andersen.\r
-Version 3.3rc1 (2010-02-23)\r
- Fixed bug with new legacyoutput plugin not working correctly on it's own.\r
- Fixed bug some performance issues with removing text formats.\r
- Fixed bug where TinyMCE specific attributes wasn't removed properly by remove format.\r
- Fixed bug where it wasn't possible to align images within inline elements.\r
- Fixed bug where Ctrl+Delete/Backspace would produce an invalid argument exception on IE.\r
- Fixed bug where the search/replace logic could produce an infinite loop on IE for reverse searches.\r
- Fixed bug where cloning formats in cells didn't work properly on IE.\r
- Fixed bug where IE6 would produce a horizontal scroll bar.\r
- Fixed so remove jQuery method removes the TinyMCE instance as well as the specified textarea.\r
- Fixed so selected rows and cells gets updated using the row/cell properties dialogs.\r
-Version 3.3b2 (2010-02-04)\r
- Fixed bug where sometimes img elements would be removed by split method in DOMUtils.\r
- Fixed bug where merging of span elements could occur on bookmark nodes.\r
- Fixed bug where classes wasn't properly removed when removeformat was used on IE 6.\r
- Fixed bug where multiple calls to an tinyMCE.init with mode set to exact could produce the same unique ID.\r
- Fixed bug with the IE selection implementation when it was feeded an document range.\r
- Fixed bug where block elements formatting wasn't properly removed by removeformat on all browsers.\r
- Fixed bug where selection location was lost if you performed a manual cleanup.\r
- Fixed bug where removeformat wouldn't remove span elements within styled block elements.\r
- Fixed bug where an error would be thrown if you clicked on the separator lines in menus.\r
- Fixed bug with the jQuery plugin adding always adding a querystring value to other resources.\r
- Fixed bug where IE would produce an error message if you had an empty editor instance.\r
- Fixed bug where Shift+Enter didn't produce br elements on WebKit browsers.\r
- Fixed bug where a temporary marker element wasn't removed by the paste plugin.\r
- Fixed bug where inserting a table would produce two undo levels instead of one.\r
-Version 3.3b1 (2010-01-25)\r
- Added new text formatting engine. Fixes a lot of browser quirks and adds new possibilities.\r
- Added new advlist plugin that enables you to set the formats of list elements.\r
- Added new paste plugin logic that enables you to retain style information from Office.\r
- Added new autosave plugin logic that automatically saves contents in local storage.\r
- Added new valid_styles option. Adds the possibility to restrict styles and their order.\r
- Added new theme_advanced_runtime_fontsize option to display the runtime font size in font size select box.\r
- Added new jquery plugin version that handles the gzip compressor amongst other things. Contributed by Speednet.\r
- Added new $ function to tinymce namespace and editor instances for the jQuery build.\r
- Added the possibility to get editors by index as well as name in the tinyMCE.editors collection.\r
- Fixed so the contents inside the editor renders in standards mode by default.\r
- Fixed bug where it wasn't possible to move the caret on short documents running in standards mode on IE.\r
- Fixed bug where the decode method of the DOMUtils class could end up in an endless loop.\r
- Fixed bug where it was possible to bypass the paste cleanup on non IE browsers if you clicked while pasting.\r
- Fixed bug where some attributes wasn't serialized correctly on IE if wildcard attribute patters where used.\r
- Fixed bug where entity decoding was performed on strings that didn't have any valid entities in them.\r
- Fixed bugs with the insertNode method of the IE DOMRange implementation. Patch contributed by Scott McNaught.\r
- Rewrote the getBookmark/moveToBookmark selection logic to boost performance on larger documents.\r
- Rewrote the table plugin to include new cell selection logic and fixed various bugs and issues.\r
- Merged the tinyMCE, tinymce and tinymce.EditorManager into the same instance makes more sense.\r
- Removed browser setting since the browser support for TinyMCE is not far better than it was when that setting was introduced.\r
- Changed the mce_ attribute prefix to the more standard _mce_ prefix. This is similar to browser vendors prefixes.\r
- Optimized performance with named entities on Gecko. Regexp replace was executing very slowly probably due to a Gecko bug.\r
- Optimized performance of the IE specific selection/range implementation.\r
- Removed the safari plugin since we now replaced all text formatting logic to custom code.\r
-Version 3.2.7 (2009-09-22)\r
- Fixed bug where uppercase paragraphs could still produce an invalid DOM tree on IE.\r
- Fixed bug where split command didn't work on WebKit since the node serializer needs a real document to work with.\r
- Fixed bug where it was impossible in Gecko to place the caret before a table if it was the first one.\r
- Fixed bug where linking to urls like ../../ would produce an extra traling slash ../..//.\r
- Fixed bug where the template cdate functionality was using an old 2.x API call. Patch contributed by vectorjohn.\r
- Fixed bug where urls to the same site but different protocol would be converted when relative_urls where set to false. Patch contributed by Ted Rust.\r
- Fixed bug where the paste plugin would remove mceItem prefixed classes.\r
- Fixed bug where the paste plugin would sometimes add items in a reverse order on WebKit.\r
- Fixed bug where the paste buttons would present an error message on Gecko even if you changed user.js. Patch contributed by Todd (teeaykay).\r
- Fixed bug where Opera would crash if you had tables incorrectly placed inside paragraphs.\r
- Fixed bug where styles elements wasn't properly processed if you had bad input HTML.\r
- Fixed bug where style attributes wasn't properly forced into a specific format.\r
- Fixed bug and issues with boolean attributes like checked, nowrap etc.\r
- Fixed bug where input elements could override attributes on form elements.\r
- Fixed bug where script or style elements could get modified by the DOMUtils processHTML method.\r
- Fixed bug where the selected attribute could get lost when force root blocks logic got executed on IE. Patch contributed by Attila Mezei-Horvati.\r
- Fixed bug where getAttribs method didn't handle boolean attributes correctly on IE.\r
- Fixed so the paste from word dialog is presented if you paste content on an IE with to restrictive security settings.\r
- Fixed so the paste_strip_class_attributes option is set to none by default in the paste plugin.\r
- Removed default border=0 on tables for the default value of valid_elements.\r
-Version 3.2.6 (2009-08-19)\r
- Added new wordcount plugin, this will display the number of typed words as you write. Contributed by Andrew Ozz.\r
- Added new getNext and getPrev methods to DOM utils. These will return the first matching sibling.\r
- Fixed bug where it was impossible to place the caret after a table on Gecko. It will now add a paragraph after tables.\r
- Fixed bug where inline dialogs would fail if used in a window opened using a showModalDialog. Patch contributed by Derek Britt.\r
- Fixed bug where IE could sometimes render a unknown runtime error on invalid input HTML.\r
- Fixed bug where some incorrectly placed tables wouldn't be moved outside the paragraphs on IE.\r
- Fixed bug where uppercase script/style element wouldn't be handled correctly and converted to valid lowercase.\r
- Fixed bug where some WebKit versions on Mac OS X would produce issues with hidden select fields.\r
- Fixed bug where the media plugin would fail on WebKit since the node wasn't properly imported to the right document.\r
- Fixed bug where absolute URLs for the TinyMCE script using a base href element would cause loading problems in IE 6/7.\r
- Fixed bug where pasting using the paste plugin wasn't possible on IE with to restrictive security settings.\r
- Fixed bug where pasting of whitespace was impossible using the new custom paste method.\r
- Fixed bug where pasting on some WebKit browsers would not work if you pasted specific contents due to a WebKit bug.\r
- Fixed bug where doctypes with multiple lines would not be parsed correctly by the fullpage plugin. Patch contributed by Colin.\r
- Fixed bug where the autoresize plugin would break the fullscreen functionality.\r
- Fixed bug where tables would be chopped up running on IE using invalid contents and pasting paragraphs into a cell.\r
- Fixed bug where the each method of jQuery build didn't iterate styleSheets. We now use the TinyMCE API one instead.\r
- Fixed bug where auto switching to paragraphs after headers some times failed in Gecko. \r
- Fixed so all editor options gets passed to the Serializer class. Patch contributed by Jasper Mattsson.\r
- Fixed so script/style blocks isn't wrapped in paragraphs as other inline elements.\r
- Fixed so the XHR requests sends the X-Requested-With HTTP header.\r
- Fixed so the data url scheme is handled in the tinymce.util.URI class.\r
- Changed inline documentation to use moxiedoc style comments.\r
- Removed the compat2x plugin people should have upgraded to the 3.x API by now. 3.0 was released more then a year ago.\r
- Re-added Gecko specific message for users who doesn't understand the security concept regarding paste.\r
-Version 3.2.5 (2009-06-29)\r
- Added new jQuery plugin for the jQuery specific package. This enables you to more easily load and use TinyMCE.\r
- Added new autoresize plugin contributed by Peter Dekkers. This plugin will auto resize the editor to the size of the contents.\r
- Fixed so all packages have the same directory structure. Previous releases had a different structure for the production package.\r
- Fixed so the paste from word dialog forces the contents to be processed as word contents even if it's not.\r
- Fixed so the jQuery build adapter build works. It's currently only excluding Sizzle.\r
- Fixed so noscript element contents is retained during the editing process.\r
- Fixed bug where the getBookmark method would need a "simple" string input when the documented way is a boolean.\r
- Fixed bug where invalid contents could break the fix_table_elements logic.\r
- Fixed bug where Sizzle specific attributes would be serialized if the valid_elements was set to *[*].\r
- Fixed bug where IE would produce an error if you specified a relative content_css and opened the paste dialog.\r
- Fixed bug where pasting images on IE would produce broken images if they came from an external site.\r
- Fixed bug where memory was leaked if you add/remove controls dynamically. Some event handlers wasn't removed properly.\r
- Fixed bug where domain relaxing wasn't treated correctly if you added it after the TinyMCE script element.\r
- Fixed bug where the activeEditor wasn't set to null if the last editor instance was removed.\r
- Fixed bug where IE was leaking memory on the onbeforeunload event due to some recently introduced logic. Patch contributed by Options.\r
- Fixed bug where inserting tables in Safari 4 didn't work due to a new WebKit bug where some element names are reserved.\r
- Fixed bug where URLs having a :// value in the query string would make it absolute regardless of URL settings.\r
- Fixed the WebKit specific bug where DOM Ranges would fail if the node wasn't attached to something in a different way.\r
- Removed the auto_resize option and the resizeToContent method from the tinymce.Editor class. Use the new autoresize plugin instead.\r
-Version 3.2.4.1 (2009-05-25)\r
- Fixed bug where Gecko browsers would produce an extra space after for example strong when loaded from sub domains.\r
- Fixed bug where script elements would be removed if they where placed inside a paragraph element.\r
- Fixed bug where IE 8 would produce 1 item remaining when loading CSS files dynamically with an empty cache.\r
- Fixed bug where bound events would be removed from other editor instances if a specific one was removed.\r
- Fixed various bugs and issues with script and style elements inside the editor.\r
- Fixed so all script contents gets wrapped in CDATA sections so that they can be parsed using a XML parser.\r
- Fixed so it's impossible for elements marked as closed to have child nodes rendered in output.\r
-Version 3.2.4 (2009-05-21)\r
- Added new paste_remove_styles/paste_remove_styles_if_webkit option to paste plugin concept contributed by Hadrien Gardeur.\r
- Added new functionality to paste plugin contributed by Scott Eade aka monkeybrain.\r
- Added new paste_block_drop option to the paste plugin this is disabled by default and will block any drag/drop event.\r
- Added new bind/unbind methods to DOMUtils these works like Event.add/Event.remove but is easier to access.\r
- Added new paste_dialog_width/paste_dialog_height options to paste pluign. Enables you to change the dialog sizes.\r
- Fixed bug on IE 8 where it would sometimes produce a "1 item remaining" status message that would never finish.\r
- Fixed bug on Safari 4 beta that would produce DOM Range exceptions on the DOMUtils split method since the browser has a bug.\r
- Fixed bug where the paste plugin could accidentally think that some word sentences was supposed to be list elements.\r
- Fixed bug where paste plugin would produce one extra empty undo level on some browsers.\r
- Fixed bug where spans wasn't produced correctly on new line when the keep_styles option was enabled.\r
- Fixed bug where the caret would be placed at the beginning of contents in IE 8 if you selected colors from the color pickers.\r
- Fixed so the Event class is a normal class instead of a static one. The tinymce.dom.Event is now a global instance of that class.\r
- Fixed so internal events for instances gets removed when the DOMUtils instance is removed.\r
- Fixed so preventDefault and stopPropagation methods can be used on the event object in all browsers.\r
-Version 3.2.3.1 (2009-05-05)\r
- Fixed bug where paragraphs containing form elements such as input or textarea would be removed.\r
- Fixed bug where some IE versions would produce a wrapper function for events attributes.\r
- Fixed bug where table cell contents could be removed if you pressed return/enter at the end of the cell contents.\r
- Fixed bug where the paste plugin would remove a extra character if the selection range was collapsed.\r
- Fixed bug where creating tables with % width wouldn't be handled correctly on WebKit browsers.\r
-Version 3.2.3 (2009-04-23)\r
- Added new paste plugin logic. This new version will autodetect Word contents and clean it up.\r
- Added a optional root element argument to getPos so you can tell it where to stop the calculation.\r
- Added new DOM ready logic to remove the usage of document.write. We now use basically the same method as jQuery.\r
- Fixed bug where WebKit browsers would fail when selecting all contents in the area using Ctrl+A.\r
- Fixed bug where IE would produce paragraphs with empty inline style elements.\r
- Fixed bug where WebKit browsers would fail when inserting tables with a non pixel width.\r
- Fixed bug where block elements could get a redundant br element at the end of the element.\r
- Fixed bug where the tabfocus plugin only worked with a single editor instance on page.\r
- Fixed bug where IE 8 was loosing caret position if the selection was collapsed and a menu was clicked.\r
- Fixed bug with application/xhtml+xml mode where menus wasn't working properly.\r
- Fixed bug where the onstop workaround fix for IE would produce errors in an ASP update panel.\r
- Fixed bug where the submit function override could produce errors if executed in the wrong scope.\r
- Fixed bug where the area element wasn't closed by a short ending.\r
- Fixed various number issues in the style plugins properties dialog. Contributed by datpaulchen.\r
- Fixed issues with size suffix values in the style plugin dialog.\r
- Fixed issue where hasDuplicate variable would leak out to the global space due to a bug in the Sizzle engine.\r
- Fixed issue where the paste event would fire a dialog warning on IE since we extracted the text contents.\r
- Updated Sizzle engine to the latest version, this version fixes a few bugs that was reported.\r
-Version 3.2.2.3 (2009-03-26)\r
- Fixed regression bug with the getPos method, it would return invalid if the view port was to small.\r
-Version 3.2.2.2 (2009-03-25)\r
- Fixed so the DOMUtils getPos method can be used cross documents if needed.\r
- Fixed bug where undo/redo wasn't working correctly in Gecko browsers.\r
-Version 3.2.2.1 (2009-03-19)\r
- Added support for tel: URL prefixes. Even though this doesn't match any official RFC.\r
- Fixed so the select method of the Selection class selects the first best suitable contents.\r
- Fixed bug where the regexps for www. prefixes for link and advlink dialogs would match wwwX.\r
- Fixed bug where the preview dialog would fail to open if the content_css wasn't defined. Patch contributed by David Bildström (ChronoZ).\r
- Fixed bug where editors wasn't converted in application/xhtml+xml mode due to an issue with Sizzle.\r
- Fixed bug where alignment would fail if multiple lines where selected.\r
- Updated Sizzle engine to the latest version, this version fixes a few bugs that was reported.\r
-Version 3.2.2 (2009-03-05)\r
- Added new CSS selector engine. Sizzle the same one that jQuery and other libraries are using.\r
- Added new is and getParents methods to the DOMUtils class. These use the new Sizzle engine to select elements.\r
- Added new removeformat_selector option, enables you to specify a CSS selector pattern of elements to remove when using removeformat.\r
- Fixed so the getParent method can take CSS expressions when selecting it's parents.\r
- Added new ant based build process, includes a new javabased preprocessor and a yuicompressor ant task.\r
- Moved the tab_focus logic into a plugin called tabfocus, so the old tab_focus option has been removed from the core.\r
- Replaced the TinyMCE custom unit testing framework with Qunit and rewrote all tests to match the new logic.\r
- Moved the examples/testcases to a root directory called tests since it now includes slickspeed.\r
- Fixed bug where nbsp wasn't replaced correctly in ForceBlocks.js. Patch contributed by thorn.\r
- Fixed bug where an dom exception would be thrown in Gecko when the theme_advanced_path path was set to false under xml application mode.\r
- Fixed bug where it was impossible to get out of a link at the end of a block element in Gecko.\r
- Fixed bug where the latest WebKit nightly would fail when changing font size and font family.\r
- Fixed bug where the latest WebKit nightly would fail when opening dialogs due to changes to the arguments object.\r
- Fixed bug where paragraphs wasn't added to elements positioned absolute using classes.\r
- Fixed bug where font size values with dot's like 1.4em would produce a class instead of the style value.\r
- Fixed bug where IE 8 would return an incorrect position for elements.\r
- Fixed bug where IE 8 would render colorpicker/filepicker icons incorrectly.\r
- Fixed bug where trailing slashes for directories in URLs would be removed.\r
- Fixed bug where autostart and other boolean values in the media dialog wouldn't be stored/parsed correctly.\r
- Fixed bug where the repaint call for the media plugin wouldn't be executed due to a typo in the source.\r
- Fixed bug where id attribute of object elements wasn't kept intact by the media plugin.\r
- Fixed bug where preview of embeded elements when the media_use_script option was used would fail.\r
- Fixed bug where inlinepopups could be rendered at an incorrect location on IE 6 while dragging.\r
- Fixed bug where the blocker shim could be placed at an incorrect location on IE 6.\r
- Fixed bug where the multiple and size attributes of select elements would produce incorrect values while running in IE.\r
- Fixed bug where IE would loose the caret position is you selected a color from the color drop down.\r
- Fixed bug where remove format wouldn't work on IE since it couldn't remove span elements that had style information.\r
- Fixed bug where Opera was removing links when removing formatting from selected contents.\r
- Fixed bug where paragraphs could be produced inside non positional elements styled with the CSS position value of static.\r
- Fixed bug where removeformat wouldn't work if you selected part of a span in IE.\r
- Fixed bug where media plugin didn't retain the style attribute on embed/object elements.\r
- Fixed bug where auto focus on empty editor instances could produce strange results if you inserted an image into it.\r
- Fixed bug where characters would be removed in FF when inserted with the mceInsertContent or selection.setContent methods.\r
- Fixed bug where warning message of missing paste support wasn't displayed on WebKit browsers.\r
- Fixed bug where anchor links could include other links. The selected range is now unlinked before adding news links to it.\r
- Fixed memory leak when TinyMCE was used with prototype. Patch contributed by James Ots.\r
- Fixed so the non documented fullpage_hide_in_source_view option for the fullpage plugin works again in the 3.x branch.\r
- Fixed so tables doesn't get inserted into paragraphs by default since it's not W3C valid. Can be disabled by using the fix_table_elements option.\r
- Fixed so the source view dialog sets a source_view state to the event object. Enables plugins to intercept the source view mode.\r
- Fixed various validation issues with the html dialogs and pages.\r
- Removed ask mode option since there is way better ways of doing this now. Use the add/remove control methods instead.\r
- Removed logic for compatibility with Safari 2.x, this browser is no longer supported since no one is using it.\r
- Removed the auto domain relaxing feature. If loading scripts cross sub domains it's better to specify the document.domain by hand.\r
-Version 3.2.1.1 (2008-11-27)\r
- Added new theme_advanced_default_background_color/theme_advanced_default_foreground_color options. Patch contributed by David Bildström (ChronoZ).\r
- Fixed font style formatting compatibility issue with Adobe Air.\r
- Fixed so legacy font elements get converted into spans even if cleanup_on_startup isn't enabled.\r
- Fixed bug where pre elements could be incorrectly modified by an IE bug workaround. Patch contributed by hu vime.\r
- Fixed bug where input elements inside inlinepopups wasn't editable in Firefox 2.\r
- Fixed bug where the xhtmlxtras plugin wasn't replacing attribute values correctly.\r
- Fixed bug where menu buttons in skin variants would look strange due to IE 8 fixes.\r
- Fixed bug where WebKit browsers would on backspace take you back to the previous page if the editor was empty.\r
- Fixed bug where DOMUtils decode method wouldn't handle strings larger than 4096kb due to node chunking.\r
- Fixed bug where meta key wasn't handled as ctrl key on Mac OS X for custom keyboard short cuts.\r
- Fixed bug where init event would get fired twice on WebKit on Mac OS X.\r
-Version 3.2.1 (2008-11-04)\r
- Added support for custom icon image for drop menus. Use icon_src to set a custom image directly.\r
- Added new media_strict option to media plugin. Enables you to control if the flash embed is strict or not. Enabled by default.\r
- Fixed so the editors script files gets dynamically loaded without using XHR or eval.\r
- Fixed so the media plugin outputs valid XHTML object elements for Flash movies. Can be disabled with the media_strict option.\r
- Fixed so dynamic loading doesn't require eval calls on non IE browsers for better Air support.\r
- Fixed bug where the editor wasn't treated as empty if the remaining paragraph had attributes.\r
- Fixed bug where id's of elements was removed ones they got wrapped in paragraphs. Patch contributed by ChronoZ.\r
- Fixed bug where WebKit browsers where placing list elements inside paragraph elements.\r
- Fixed bug where inserting images or links would produce absolute urls on WebKit browsers.\r
- Fixed bug where values for checked, readonly, disabled and selected attributes was incorrect on IE.\r
- Fixed bug where positive values for checked, readonly, disabled and selected attributes wasn't forced to valid values.\r
- Fixed bug where selecting the first option in a native select box would produce an undefined error.\r
- Fixed bug where tabindex 32768 could be outputted on IE if element attributes where cloned.\r
- Fixed bug where the media dialogs preview window would display incorrect contents due to duplicate clsid prefixes.\r
- Fixed bug where non pixel or percent heights for textarea elements would produce errors on IE.\r
- Fixed bug where cdata sections in script elements wasn't handled correctly.\r
- Fixed bug where nowrap of table cells would produce a 65535 value output.\r
- Fixed bug where media plugin would produce an error if you selected the first item in the items list.\r
- Fixed bug where media plugin would modify links with the item _value in them.\r
- Fixed so table width/height is better forced if inline_styles is enabled. Patch contributed by daKmoR.\r
- Fixed css for IE 8 such as opacity and other rendering quirks.\r
-Version 3.2.0.2 (2008-10-02)\r
- Fixed bug where the SelectBox and NativeSelectBox wasn't updated correctly if undefined was passed to them.\r
- Fixed bug where the style dropdown wasn't correctly changed back to it's original state when element had no class.\r
- Fixed bug where multiple pending font styles wasn't handled correctly.\r
- Fixed so you can disable all auto css loading for dialogs by setting the popups_css option to false.\r
-Version 3.2.0.1 (2008-09-17)\r
- Fixed bug where font sizes and faces wouldn't be changed correctly when there was a parent with a different style.\r
- Fixed bug where adding fonts to the same selection would produce redundant spans.\r
-Version 3.2 (2008-09-11)\r
- Added new text style support, it will now use span elements internally instead of font elements.\r
- Added new improved support for the theme_advanced_font_sizes option, check the Wiki for details.\r
- Added new keep_style setting that maintains the text style on return/enter on non IE browsers, enabled by default.\r
- Added new onBeforeSetContent/onBeforeGetContent/onSetContent/onGetContent events to the Selection class.\r
- Added new selectByIndex method to ListBox class. This enables you to select list items by an index instead of a value.\r
- Added new possibility to the select method of the ListBox class. This can now have a selector function as it's value argument.\r
- Added new possibility to skip the loading of popups css by setting the feature popup_css to the value false.\r
- Added new possibility to skip translation of popups by setting the translate_i18n feature to false.\r
- Added new element_format option enables you to produce HTML element endings instead of XHTML. But we are still in the XHTML is better camp.\r
- Added missing allowfullscreen and quality options for flash elements, this will now get correctly stored.\r
- Fixed bug where table cell dialog didn't close properly unless the accessibility_warnings option was set to false.\r
- Fixed bug where the modal dialog blocker element for inlinepopups wasn't placed at a correct location if the page had scroll.\r
- Fixed bug where non inline dialogs didn't close correctly if the inlinepopups plugin was used.\r
- Fixed bug where non inline dialogs could make the modal dialog blocker to work incorrectly.\r
- Fixed bug where style select wasn't populated correctly if you pressed the arrow. Patch by Hari Karam Singh.\r
- Fixed bug where toggling the fullscreen mode didn't restore scrollbars on IE when the editor was inside a frame. Patch by Jacob Barrett.\r
- Fixed bug where inserting flash contents using the template plugin didn't work correctly.\r
- Fixed bug where inserting flash contents using the selection.setContent or mceInsertContent command didn't work correctly.\r
- Fixed bug where IE would produce an exception if a comment started with -.\r
- Fixed bug where the blockquote button would wrap lists incorrectly on non IE browsers.\r
- Fixed bug where Opera would display BR elements in the element path.\r
- Fixed bug where xhtmlxtras didn't insert elements correctly on IE.\r
- Fixed bug where the buttons wasn't activated correctly in the xhtmlxtras plugin.\r
- Fixed bug where adding an object as the style attribute for the dom setAttribs method wouldn't work.\r
- Fixed bug where the background color would bleed out to parent container element in Gecko.\r
- Fixed bug where the insert column actions for tables would fail if you did it in a thead or tfoot. Patch contributed by T Andersen (tan73).\r
- Fixed bug where event blocker element wasn't positioned correctly for the inlinepopups plugin.\r
- Fixed bug where pasting from Office 2007 would produce an odd comment in the contents.\r
- Fixed bug where the paste as plain text could remove an extra character. Patch contributed by Speednet.\r
- Fixed bug where some characters where missing for the paste_replace_list option. Patch contributed by Speednet.\r
- Fixed bug where removing non existing editor instances by the mceRemoveControl command would produce an error.\r
- Fixed bug where meta elements with the name description would produce errors in IE.\r
- Fixed bug where color and background colors wouldn't be updated properly.\r
- Fixed bug where the createMenuButton of tinymce.ControlManager didn't implement the last class argument.\r
- Fixed bug where the editor_css option was relative from the TinyMCE installation directory not the current page.\r
- Fixed bug where elements wouldn't be padded if the element contained bogus br elements. For example TD elements.\r
- Fixed bug where parsing of <body > in fullpage plugin would produce an error.\r
- Fixed bug where relative urls with just ./ would become an empty string.\r
- Fixed bug where outdent button would be disabled if inline_styles where set to false.\r
- Fixed bug where replace with an empty search string would produce an error on IE.\r
- Fixed bug where restoring the overflow state of the body in fullscreen plugin running on IE would produce vertical scrollbars.\r
- Fixed bug where pressing return/enter in list items would sometimes move the caret the to top of the content area in FF.\r
- Fixed bug where the style listbox wouldn't be updated correctly if you used the use_native_selects option.\r
- Fixed bug where WebKit browsers would produce a div element when ending list elements using return.\r
- Fixed so translation of popup contents only occurs if it's needed.\r
- Optimized the URI object in regards or converting absolute URIs to relative URIs.\r
-Version 3.1.1 (2008-08-18)\r
- Added new getSize method to DOMUtils it will return the dimensions only of an element.\r
- Added new alert/confirm methods to the tinyMCEPopup class to prevent focus problems and also to shorten method calls.\r
- Added new plugin_preview_inline option to preview plugin to enable/disable native/inline dialogs.\r
- Added new readonly option. If this is set the editor will only display the contents for the user.\r
- Added missing tabindex and accesskey to input elements in the default valid_elements setup.\r
- Updated firebug lite to 1.2, to enable it use the tiny_mce_dev.js?debug=1 on the development package.\r
- Fixed so the preview dialog in the preview plugin uses inline dialogs/popups.\r
- Fixed so CDATA sections remains intact through the serialization process of the DOM tree.\r
- Fixed various issues with the getAttrib command. It will now return more correct values.\r
- Fixed bug where the embed element wasn't properly parsed in the media plugin it now supports 3 formats.\r
- Fixed bug where the noshade attribute was serialized incorrectly on IE.\r
- Fixed bug where editing an existing link element didn't force it relative.\r
- Fixed bug where image link creation fails on Safari if the image is aligned.\r
- Fixed bug where it was possible to scroll the fullscreen mode in Opera 9.50.\r
- Fixed bug where removal of center image alignment would fail. Patch contributed by Andrew Ozz.\r
- Fixed bug where inlinedialogs didn't work properly if the doctype was incorrect in IE.\r
- Fixed bug where cross domain loading didn't work correctly in Opera 9.50.\r
- Fixed bug where breaking huge text blocks with return/enter key would scroll to end of block.\r
- Fixed bug where replace button kept inserting the replacement text even if there is no more matches.\r
- Fixed bug with fullpage plugin where value wasn't set correctly. Patch contributed by Pascal Chantelois.\r
- Fixed bug where the dom utils setAttrib method call could produce an exception if the input was null/false.\r
- Fixed bug where pressing backspace would sometimes remove one extra character in Gecko browsers.\r
- Fixed bug where the native confirm/alert boxes would move focus to parent document if fired in dialogs.\r
- Fixed bug where Opera 9.50 was telling you that the selection is collapsed even when it isn't.\r
- Fixed bug where mceInsertContent would break up existing elements in Opera and Gecko.\r
- Fixed bug where TinyMCE fails to detect some keyboard combos on Mac, contributed by MattyRob.\r
- Fixed bug where replace all didn't move the caret to beginning of text before searching.\r
- Fixed bug where the oninit callback wasn't executed correctly when the strict_loading_mode option was used, thanks goes to Nicholas Oxhoej.\r
- Fixed bug where a access denied exception was thrown if some other script specified document.domain before loading TinyMCE.\r
- Fixed so setting language to empty string will skip language loading if translations are made by some backend.\r
- Fixed so dialog_type is automatically modal if you use the inlinepopups plugin use dialog_type : "window" to re-enable the old behavior.\r
-Version 3.1.0.1 (2008-06-18)\r
- Fixed bug where the Opera line break fix didn't work correctly on Mac OS X and Unix.\r
- Fixed bug where IE was producing the default value the maxlength attribute of input elements.\r
-Version 3.1.0 (2008-06-17)\r
- Fixed bug where the paste as text didn't work correctly it encoded produced paragraphs and br elements.\r
- Fixed bug where embed element in XHTML style didn't work correctly in the media plugin.\r
- Fixed bug where style elements was forced empty in IE. The will now be wrapped in a comment just like script elements.\r
- Fixed bug where some script elements wrapped in CDATA could fail to be serialized correctly.\r
- Fixed bug where FF 3 produced -moz- internal styles in some style attributes.\r
- Fixed bug where query strings and external URLs didn't work correctly in style attributes.\r
- Fixed bug where shape attribute of area elements got serialized as rect regardless of it's initial value in IE 6.\r
- Fixed bug where selection of elements inside layers would fail in IE since focus was moved to the document body.\r
- Fixed bug where pressing enter/return in an editable select box would produce an __mce_add_custom__ class value.\r
- Fixed bug where changing font size of text placed inside a colored text chunk would remove the parent node.\r
- Fixed bug where Opera 9.5 final produced a strange line break behavior due to a workaround for previous Opera versions.\r
- Fixed bug where text/background color would produce a strange focus problem when you tried to click on the body in IE.\r
- Fixed issue where selecting the title of an listbox equals the old 2.x behavior of changing the value to an empty string.\r
- Fixed issue where it was common for the media plugin to break if the _value attribute wasn't added for the param element.\r
- Fixed issue where the wrong parent editor instance might be updated if you use fullscreen mode in an incorrect way.\r
- Fixed issue where Safari was producing a warning about the base element not being closed correctly.\r
- Removed redundant form element name matching from regexp in the DOMUtils class.\r
-Version 3.0.9 (2008-06-02)\r
- Added new contextmenu_offset_x/contextmenu_offset_y options for the contextmenu plugin.\r
- Added cite attribute to the default rule for the blockquote element.\r
- Added support for using arrow keys for selection of items in listboxes.\r
- Added support for using arrow keys for selection of items in dropmenus.\r
- Fixed bug where blockformat change on elements with BR inside them didn't change correctly on Firefox.\r
- Fixed bug where removing table rows inside thead or tfoot would remove the whole table if it was the last one.\r
- Fixed bug where XHR synchronous mode didn't execute the callback handlers synchronously.\r
- Fixed bug where setting border to 0 didn't add border: 0 to the style attribute when using the advimage dialog.\r
- Fixed bug where the selection of images and table cells didn't work correctly when the editor is placed in a frame and running on IE.\r
- Fixed bug where the store/restore of a selection didn't work correctly in non IE browsers.\r
- Fixed bug where only the first element would be invalid for the invalid_elements option.\r
- Fixed bug where paste as plain text didn't encode the characters correctly when they where inserted.\r
- Fixed bug where HTML source window couldn't be maximized on Gecko when the maximizable feature was enabled.\r
- Fixed bug where color selection using the color picker could produce exception in IE.\r
- Fixed bug where font size changes could produce produce extra redundant elements.\r
- Fixed bug where IE could produce unknown runtime error if you replaced a image with another image from a separate frame.\r
- Fixed bug where the domLoaded state for the Event class wasn't set correctly if the editor was loaded dynamically using the gzip compressor.\r
- Fixed bug where handling of the base element for a page would produce incorrect urls. Based on a patch contributed by John LeSueur.\r
- Fixed bug where table constraint alert boxes was presented with an empty value and wasn't the skinned inline ones.\r
- Fixed bug where the onChange event wasn't fired when the form was submitted. It's now also triggered when the save method is called.\r
- Fixed bug where encoding set to xml didn't work as expected. It now encodes the contents into XML entities.\r
- Fixed bug where numrows didn't work correctly for the merge cells dialog of the table plugin.\r
- Fixed bug where the onGetContent event was fired even when the no_events flag was set.\r
- Fixed bug where the preview panels for the advimage and the media plugin could overflow on Safari and FF 3.\r
- Fixed bug where the editing and removal of abbr elements using the xhtmlxtras plugin working correctly on IE.\r
- Fixed bug where save button in the save plugin didn't work correctly on IE.\r
- Fixed bug where dragging layers didn't work as expected since it would snap back to it's original location if you saved.\r
- Fixed bug where the description of the template plugin dialog wasn't updated correctly.\r
- Fixed bug where the values for frame and rules in the table dialogs where swapped.\r
- Fixed bug where the elements like ins, del, cite, acronym and abbr didn't have the default editing style as the old 2.x branch.\r
- Fixed bug where ask mode would lock the focused textarea if you pressed cancel in the confirm dialog on FF 3.\r
- Fixed bug where ask mode would produce contents for empty textareas if you reloaded the page.\r
- Fixed so the onGetContent event gets the full pass through object just like the other events.\r
- Fixed so attributes for block elements remains the same when you change format of a element.\r
-Version 3.0.8 (2008-04-30)\r
- Fixed bug where IE would produce an error if textareas without names where converted.\r
- Fixed bug where editor wasn't forced empty when there was only a single br or empty paragraph left.\r
- Fixed bug where IE would produce an warning message if object elements where produced in the media plugins preview running on https.\r
- Fixed bug where new addVer function didn't handle hash items correctly. Patch contributed by Mirek Burkon.\r
- Fixed bug where font_size_style_values option wasn't applied correctly to fonts inside the editor.\r
- Fixed bug where image selection could be lost if a image was edited using context menu on IE.\r
- Fixed bug where style values wasn't updated properly due to an invalid regexp.\r
- Fixed bug where IE 6 where displaying warning message about insecure items when inserting an image while using https. Patch contributed by Norifumi Sunaoka.\r
- Fixed bug where IE was producing an auto save message if you selected a color from the color split button.\r
- Fixed bug where backspace sometimes would move the caret to the end of the previous block in Gecko.\r
- Fixed bug where the rowlayout manager didn't work as described in the documentation.\r
- Fixed bug where the default options for the fullpage plugin wasn't applied correctly.\r
- Fixed bug where selection would jump one character if you applied a styles to a words in non IE browsers.\r
- Fixed bug where undo levels wasn't added correctly if you went back in undo history and added a new event.\r
- Fixed bug where font size dropdown didn't mark the selected size in IE.\r
- Fixed bug where the size of the editor was determined using clientWidth instead of offsetWidth.\r
- Fixed so the onchange event doesn't fire on the initial undo level, it will also fire when the editor is blurred.\r
- Fixed so the advhr plugin produces XHTML valid output instead of non standard attributes.\r
- Fixed so blockquote gets converted into [quote] in when the bbcode plugin is enabled.\r
- Fixed so theme_advanced_font_sizes can be named for example Font 1=1, Font 2=2 etc.\r
- Fixed so editor_selector/editor_deselector can be regexps. By default only strings are allowed not part regexps like before.\r
- Fixed so that the version suffix is optional. It still requires the build process so you need to export it manually.\r
- Fixed so it's possible to tab to table cells in non Gecko browsers and also produce new rows if you tab at the end of a table. Contributed by Josh Peek.\r
-Version 3.0.7 (2008-04-14)\r
- Added new version suffix to all internal GET requests to make sure that the users cache gets cleared correctly.\r
- Fixed issue with isDirty returning true event if it wasn't dirty on IE due to changes in tables during initialization.\r
- Fixed memory leak in IE where if a page was unloaded before all images on the page was loaded it would leak.\r
- Fixed bug in IE where underline and strikethrough could produce an exception error message.\r
- Fixed bug where inserting paragraphs in totally empty table cells would produce odd effects.\r
- Fixed bug where layer style data wasn't updated correctly due to some performance enhancements with the DOM serializer.\r
- Fixed bug where it would convert the wrong element if there was two elements with the same name and id on the page.\r
- Fixed bug where it was possible to add style information to the body element using the style plugin.\r
- Fixed bug where Gecko would add an extra undo level some times due to the blur event.\r
- Fixed bug where the underline icon would get active if the caret was inside a link element.\r
- Fixed bug where merging th cells not working correctly. Patch contributed by André R.\r
- Fixed bug where forecolorpicker and backcolorpicker buttons where rendered incorrectly when the o2k7 skin was used.\r
- Fixed bug where comment couldn't contain -- since it's invalid markup. It will now at least not break on those invalid comments.\r
- Fixed bug where apos wasn't handled correctly in IE. It will now convert apos to ' on IE since that browser doesn't support that entity.\r
- Fixed bug where entities wasn't encoded correctly inside pre elements since they where protected from whitespace removal.\r
- Fixed bug where color split buttons where rendered incorrectly on IE6 when using the non default theme.\r
- Fixed so caret is placed after links ones they are created, to improve usability of the editor.\r
- Fixed so you can select tables by clicking on it's borders in non IE browsers to normalize the behavior.\r
- Fixed so the menus can be toggled by clicking once more on the icon in listboxes, menubuttons and splitbuttons based on code contributed by Josh Peek.\r
- Fixed so buttons can be labeled, currently only works with the default skin, so it's kind of experimental. Patch contributed by Daniel Insley.\r
- Fixed so forecolorpicker and backcolorpicker remembers the last selected color. Patch contributed by Shane Tomlinson.\r
- Fixed so that you can only execute the mceAddEditor command once for the same instance name.\r
- Fixed so command functions added with addCommand can pass though the call to default handles if it returns true.\r
-Version 3.0.6.2 (2008-04-07)\r
- Fixed bug where empty tables couldn't be edited correctly on non IE browsers if they where loaded into the editor.\r
- Fixed bug where it was impossible to resize layers correctly in IE since it thought it was an image.\r
- Fixed bug where an editor instance was stealing focus in IE resulting in a scroll to the editor on page reloads.\r
- Fixed bug where Safari was crashing on Mac OS X if you closed dialogs using the Esc key.\r
-Version 3.0.6.1 (2008-04-04)\r
- Added support for the missing mceAddFrameControl command. The input for this command has changed so consult the Wiki.\r
- Fixed bug where sub menus for the drop menus would leave an empty element behind.\r
- Fixed memory leak in IE if the editor was placed in a frame or iframe.\r
-Version 3.0.6 (2008-04-03)\r
- Added elements to the default value of valid_elements option. It now contains all XHTML strict elements and a few transitional.\r
- Added more accessibility fixes, it's now possible to navigate and close list boxes and split button menus with the keyboard.\r
- Added missing getInfo method to the contextmenu and safari plugin, this caused problems for the Drupal module.\r
- Added new inlinepopups_zindex option to the inlinepopups plugin so that you can configure the default start z-index.\r
- Added new setControlType method to the tinymce.ControlManager class. This method enables you to override the default classes.\r
- Added ability to specific an optional control class to use instead of the default one for the ControlManager methods. Based on concept by Josh Peek.\r
- Fixed bug where attribute rules for the DOM Serializer couldn't contain - or _ characters in their names.\r
- Fixed bug where inlinepopups event blocker and modal dialog blocker elements produced vertical scrollbars.\r
- Fixed bug where there was a rendering issue with quirks mode in Safari moving the resize handle to an incorrect position.\r
- Fixed bug with forecolor/backcolor controls on IE. Sometimes elements positioned relative will generate display errors.\r
- Fixed bug where a p2 was leaking out in the global name space when you selected a color from the forecolor/backcolor controls.\r
- Fixed bug where empty paragraphs didn't work as expected in browsers other than IE.\r
- Fixed bug where the load method of the tinymce.dom.ScriptLoader didn't check if the file was already loaded.\r
- Fixed bug where the load method for the PluginManager and ThemeManager didn't check if a plugin/theme by a specific name was all ready loaded.\r
- Fixed bug where the theme_advanced_link_targets option didn't work correctly with the advanced themes link dialog. Patch contributed by Arnold B.\r
- Fixed bug where the style command would merge classes into empty span elements.\r
- Fixed bug where the style command would remove empty span elements outside the current selection.\r
- Fixed bug where the fix for the Safari backspace bug removed all editor contents if it was filled with empty paragraphs.\r
- Fixed bug where alert and confirm boxes opened by the inlinepopups plugin would produce an exception if domain relaxing was used.\r
- Fixed bug where Safari was adding style attributes to all elements when you paste them into the editor.\r
- Fixed bug where the spellchecker menus was visually incorrect since the space for the non existing icon was still there.\r
- Fixed bug where remove_linebreaks option didn't remove line breaks inside the text contents of a element.\r
- Fixed bug where Safari 3.1 was introducing _mc_tmp into paragraphs due to the new querySelectorAll and a TinyMCE specific workaround.\r
- Fixed bug where getParam method in the Editor class was returning incorrect objects and would mess up the font drop down. Patch contributed by speednet.\r
- Fixed bug where the table dialog would produce an exception in IE when you edited tables since it tried to place focus in a disabled field.\r
- Fixed bug where class attribute on some span elements was removed on cleanup.\r
- Fixed bug where resizing the editor in IE could produce an exception if the editor width/height got to be a negative value.\r
- Fixed bug where wmv files wouldn't play since the src param was used instead of the url param.\r
- Fixed bug where br elements would be added here and there in Gecko. Geckos internal _moz_dirty br elements where serialized as well.\r
- Fixed bug where editing named anchors would produce two anchors instead of one updated one.\r
- Fixed bug where arrow and function keys didn't work when an noneditable element was focused within the editor.\r
- Fixed bug where the dispatcher could produce an exception if the listener list was altered inside an event callback.\r
- Fixed bug where it was impossible to totally empty the editor contents on Safari due to an mistreatment of nbsp as whitespace. Patch contributed by Andrew Ozz.\r
- Fixed bug where TinyMCE would not convert textareas with the same name attribute value. It will now generate an unique id for those textareas.\r
- Fixed bug where backspace/delete key was deleting td elements inside tables while running on Gecko.\r
- Fixed bug where Firefox 3.0b4 and Opera 9.26 where scrolling to the top of document when pressing return/enter.\r
- Fixed bug where the template plugin wasn't just inserting the mceTmpl tagged element.\r
- Fixed bug where the alert method of the default WindowManager implementation didn't translate input language strings like the inlinepopups dialog does.\r
- Fixed bugs with the backspace behavior in Gecko. The caret was placed on incorrect locations in the DOM sometimes.\r
- Fixed so advimage dialog and table dialogs has support for editable select boxes for the class value.\r
- Fixed so the media, pagebreak and spellchecker doesn't load it's default content.css file if the content_css option is set to false.\r
- Fixed so the paste_use_dialog option works again it's enabled by default but can be disabled on IE. Patch contributed by Speednet.\r
- Fixed so that the fullscreen editor is focused when switching fullscreen editing on.\r
- Fixed so it's possible to edit images and links inside tables using the context menu.\r
- Fixed so table dialogs and the advanced image dialog doesn't loose selection in IE if the dialogs where navigated/submitted with the keyboard.\r
- Fixed so the theme_advanced_blockformats options can have named items for example title 1=h1;title 2=h2.\r
- Fixed so it's possible to add a custom editor_css for the simple theme.\r
- Fixed quirks with directionality rtl, patch contributed by Andrew Ozz.\r
- Fixed so the inlinepopups default start zIndex is 300000.\r
- Fixed typo in media plugin Shockware is now replaced with Shockwave.\r
- Fixed psuedo memory leak in IE with the replaceChild method inside the DOMUtils.replace method.\r
- Fixed so memory is released when an editor instance is removed from page.\r
- Optimized the color split button menus so that they use less event handlers.\r
- Removed the util/mclayer.js file since it's no longer used by any of the TinyMCE dialogs and is considered deprecated.\r
-Version 3.0.5 (2008-03-12)\r
- Added new black skin variant to the o2k7 skin contributed by Stefan Moonen.\r
- Added new explode method to the tinymce core class. This does a split but removed whitespace it also defaults to a , delimiter.\r
- Added new detection logic for IE 8 standards mode into the DOMUtils class strMode can now be checked to see if that mode is on/off.\r
- Added new noscale option value for the scale select box for Flash in the media plugin.\r
- Fixed bug where the menu for the ColorSplitButton wasn't removed when the editor was removed.\r
- Fixed bug where font colors couldn't be edited correctly since the style of the element didn't get updated correctly.\r
- Fixed bug where class of elements would get lost when TinyMCE was fixing incorrect HTML markup.\r
- Fixed bug where table editing would produce double height values.\r
- Fixed bug where width style value wouldn't be removed if you switched width unit from cm/em to pixels or percent.\r
- Fixed bug where the search/replace input box wasn't auto focused like the other dialogs.\r
- Fixed bug where the old mceAddControl command would use the fullscreen settings next time it created an instance.\r
- Fixed bug where multiple lines where added to the target cell if you merged multiple empty cells.\r
- Fixed bug where drop down menus would be incorrectly positioned inside scrollable divs.\r
- Fixed bug where the separators of the silver skin variant didn't display correctly in IE 6.\r
- Fixed bug where createStyleSheet seems to load scripts at opposite order in some IE versions.\r
- Fixed bug where directionality could produce odd results for the UI and the dialogs.\r
- Fixed bug where the DOM serializer wouldn't serialize custom namespaced attributes in IE 6 using the *[*] valid elements rule.\r
- Fixed bug where table caption would be inserted after the thead element if you swapped a tr to be inside the thead.\r
- Fixed bug where the youtube detection logic for the media plugin was to generic.\r
- Fixed so the deprecated and undocumented theme_advanced_path_location set to none won't hide the whole statusbar.\r
- Fixed so most input lists can have whitespace in them they are now split using the new tinymce.explode method.\r
- Fixed so the popup_css and popup_css_add URLs are relative to where the current document is located.\r
- Fixed various bugs and quirks with the store/restore selection logic.\r
- Fixed so the editor starts in IE 8 standards mode but still that browser is very very buggy.\r
- Fixed so dialog_type set to modal will block the background and other inline windows and only give access to the front most window.\r
-Version 3.0.4.1 (2008-03-08)\r
- Fixed critical bug where it was impossible to edit images when inlinepopups where used due to lost selection in IE.\r
-Version 3.0.4 (2008-03-07)\r
- Added new option constrain_menus, this enables you to force view port constraints on all menus. Contributed by Shane Tomlinson.\r
- Fixed bug where table background wasn't visible inside the editor due to a default CSS rule overriding the style attribute.\r
- Fixed bug where links would get a null class added if no styles was used in IE.\r
- Fixed bug where spellchecker was auto focusing the editor in IE.\r
- Fixed bug where document.domain would produce invalid argument if the editor was loaded in IE6 over a network UNC path.\r
- Fixed bug where table height attribute was used, this is deprecated in XHTML so it now adds it as an style.\r
- Fixed bug where textareas with style values would produce error in IE.\r
- Fixed so the first element in each dialog is focused by default to enhance keyboard usage.\r
- Fixed so you can add a mceFocus class to elements to make it auto focused.\r
- Fixed so you can close dialogs using the esc key.\r
- Fixed so you can press return/enter to submit the action of each dialog.\r
- Fixed so tabbing inside an inline popups wont focus the resize anchor elements.\r
- Fixed so you can press ok in inline alert messages using the return/enter key.\r
- Fixed so textareas can be set to non px or % sizes for example em, cm, pt etc.\r
- Fixed so non pixel values can be used in width/height properties for tables.\r
- Fixed so the custom context menu can be disabled by holding down ctrl key while clicking.\r
- Fixed so the layout for the o2k7 skin looks better if you don't have separators before and after list boxes.\r
- Fixed so the sub classes get a copy of the super class constructor function to ease up type checking.\r
- Fixed so font sizes for the format block previews are normalized according to http://www.w3.org/TR/CSS21/sample.html (it can be overridden).\r
- Fixed so font sizes for h1-h6 in the default content.css is normalized according to http://www.w3.org/TR/CSS21/sample.html (it can be overridden).\r
-Version 3.0.3 (2008-03-03)\r
- Fixed bug where an error about document.domain would be thrown if TinyMCE was loaded using a different port.\r
- Fixed bug where mode exact would convert textareas without id or name if the elements option was omitted.\r
- Fixed bug where the caret could be placed at an incorrect location when backspace was used in Gecko.\r
- Fixed bug where local file:// URLs where converted into absolute domain URLs.\r
- Fixed bug where an error was produced if a editor was removed inside an editor command.\r
- Fixed bug where force_p_newlines didn't effect the paste plugin correctly.\r
- Fixed bug where the paste plugin was producing an exception on IE if you pasted contents with middots.\r
- Fixed bug where delete key could produce exceptions in Gecko sometimes due to the fix for the table cell bug.\r
- Fixed bug where the layer plugin would produce an visual add class called mceVisualAid this one is now renamed to mceItemVisualAid to mark it internal.\r
- Fixed bug where TinyMCE wouldn't initialize properly if ActiveX controls was disabled in IE.\r
- Fixed bug where tables and other elements that had visual aids on them would produce an extra space after any custom class names.\r
- Fixed bug where search with an empty string would produce some odd "invalid pointer" error in IE.\r
- Fixed bug where elements like menus where placed at incorrect positions in Opera 9.26.\r
- Fixed bug where IE was loosing focus of the editor when you clicked some dropmenu and if it was placed in a frame or iframe.\r
- Fixed bug where focus of images could be lost in IE if you focused the accessibility confirm dialog in the advimage plugin.\r
- Fixed bug where nestled font elements would produce odd output like missing font elements.\r
- Fixed bug where text colors and styles got removed if invalid_elements included the font element.\r
- Fixed bug where text-decoration set to underline or line-through would remove other styles from span elements.\r
- Fixed bug where editor contents like \n\n would be incorrectly handled and processed as real line feeds.\r
- Fixed bug where incorrectly encoded urls with ampersands in them would be decoded incorrectly.\r
- Optimized the DOMUtils decode method to be a lot faster if the string doesn't have any entities to decode.\r
-Version 3.0.2.1 (2008-02-26)\r
- Fixed alert/confirm dialogs so they display correctly.\r
-Version 3.0.2 (2008-02-26)\r
- Added new body_id option that enables you to specify the id of the body inside the editor iframe based on ideas by David Bildström (ChronoZ).\r
- Added new body_class option that enables you to set the class for the body of the editor iframe based on ideas by David Bildström (ChronoZ).\r
- Added new CSS class to the default content.css files mceForceColors that forces white background and black text can be used with the body_class option.\r
- Added new type parameter to the Editor.getParam function to reduce redundant logic for parsing hash tables.\r
- Added new isDone method to the ScriptLoaded class, this enables you to check if a script has been loaded or not.\r
- Added new resizeTo and resizeBy methods for the advanced theme. Can be called using tinyMCE.activeEditor.theme.resizeTo(w, h);\r
- Added new skin_variant option this can be used to extend existing skins with slight modifications like color.\r
- Added new variant of the o2k7 skin called "silver" based on a contribution made by Stefan Moonen.\r
- Fixed bug where the template plugin might produce errors if the template_mdate_classes wasn't configured.\r
- Fixed bug where the media plugin didn't convert the URLs for movies once they where inserted.\r
- Fixed bug where the style field for the advlink dialog didn't work correctly if you edited an existing link.\r
- Fixed bug where alignment of toolbars would fail in editor was uses in a quirks mode on IE, fix contributed by Peter Wood & Art Lawry.\r
- Fixed bug where initialization of multiple editors at the same time using the mceAddControl method would produce errors.\r
- Fixed bug where initialization of editors using mceAddControl command or new tinymce.Editor calls would fail during page load.\r
- Fixed bug where the check for domain relaxing could fail if the document.domain property was changed by another script.\r
- Fixed bug where textareas couldn't be named description or any other name that matches the meta elements in IE and Opera.\r
- Fixed bug where the element path would fail sometimes in IE due to "unknown runtime error" on innerHTML.\r
- Fixed bug where Safari would crash if you was hiding the editor before serializing the contents.\r
- Fixed bug where the editor wasn't scaled propertly in fullscreen mode using the old fullscreen_new_window option.\r
- Fixed bug where render method didn't load language packs in IE and Opera if you rendered an editor during page load.\r
- Fixed bug where resizing the browser window in fullscreen didn't resize the editor.\r
- Fixed bug where the blockquote command didn't move the caret inside the new empty blockquote if you used it on an empty document.\r
- Fixed bug where auto in a style width/height for the textarea would produce an editor with the size value of 100. Fix contributed by Shane Tomlinson.\r
- Fixed bug where restoration of selection at the beginning of an element could fail in Gecko.\r
- Fixed bug where caret restoration after a cleanup could place the it at an incorrect location.\r
- Fixed bug where delete key inside td elements would delete the cell in Gecko.\r
- Fixed so the blockquote button toggles individual lines. This behavior is a bit more like the old indentation behavior in the 2.x branch.\r
- Fixed so the dialog language packs only gets loaded the first time you open a dialog.\r
- Fixed so all classes in the whole UI is prefixed with "mce" to avoid collisions, use the skin converter to update your existing skins.\r
- Fixed so all classes in the inlinepopups logic is prefixed with "mce" to avoid collisions, use the skin converter to update your existing skins.\r
- Fixed so that the window in fullscreen mode can be resized when fullscreen_new_window option is enabled.\r
- Fixed so blockquote elements are formatted in the source output with an linefeed before and after it.\r
- Optimized the editor initialization by reducing the number of calls to getBookmark/moveToBookmark.\r
-Version 3.0.1 (2008-02-21)\r
- Added spellchecker plugin into the main package, but without any backend can be specified with the spellchecker_rpc_url option.\r
- Added src attribute for script elements to the default valid_elements option value.\r
- Added extra parameter to the class_filter callback it can now also filter out classes based on the whole CSS rule.\r
- Added support for domain relaxing, TinyMCE can now be loaded from an remote domain as long as they are on the same root domain.\r
- Added support for custom elements the new custom_elements option enables you to add non HTML elements to the editor.\r
- Added support for the W3C Selectors API that was added to latest nightly build of WebKit.\r
- Fixed bug where some object param element wasn't stored correctly using the media plugin.\r
- Fixed bug where Opera was scrolling to top of page is drop menus on list boxes where displayed.\r
- Fixed bug where IE6 was crashing if a format block was used on a container with anchor elements.\r
- Fixed bug where spans with font sizes wasn't handled correctly when editor was loading contents.\r
- Fixed bug where mode exact couldn't convert editors with name only. Id is no longer required but recommended.\r
- Fixed bug where the mceInsertRawHTML command produced an extra undo level.\r
- Fixed bug where the specific_textareas mode didn't work correctly this is the same thing as textareas now.\r
- Fixed bug where the values of input elements in the HTML page of dialogs pages where changed in IE.\r
- Fixed bug where fullscreen and fullpage plugins didn't work well together.\r
- Fixed bug where embed elements wasn't handled properly in the media plugin.\r
- Fixed bug where style information on span elements gets munged when fonts are converted to spans.\r
- Fixed bug where some entities in element attributes where encoded incorrectly in the latest WebKit build.\r
- Fixed bug where initialization would fail in IE if there where two input elements with the name submit in the form.\r
- Fixed bug where fullscreen mode didn't work correctly in IE when the fullscreen_new_window option was used.\r
- Fixed bug where invalid contents like an ul inside a p element would produce odd results in IE.\r
- Fixed bug where Opera 9.2x was placing the drop menus at incorrect locations if the editor was placed in a table.\r
- Fixed bug where Opera was producing odd results if enter/return was pressed while having forced_root_blocks disabled.\r
- Fixed bug where layer plugin was stealing focus in IE on initialization.\r
- Fixed bug where body attributes wasn't set properly in the fullpage plugin, fix contributed by Hiroaki Kawai.\r
- Fixed bug where insert image and insert link dialogs where producing an extra level in the undo history.\r
- Fixed bug where Gecko would produce an error if empty elements like <div></div> where inserted using mceInsertContent.\r
- Fixed bug where center alignment of images produced odd results inside table cells.\r
- Fixed bug where center alignment of images couldn't be toggled correctly.\r
- Fixed bug where alignment of images inside tables would produce double float style items in IE if the fix_table_elements option was enabled.\r
- Fixed bug where a variable called 'v' was polluting the global namespace. Objects tinymce and tinyMCE are the only ones allowed to be global.\r
- Fixed bug where insert table from context menu couldn't insert new tables inside existing tables.\r
- Fixed bug where Safari wouldn't produce br elements on enter when the force_br_newlines option was enabled.\r
- Fixed bug where switching cell type in table cell dialog would produce odd attributes in IE.\r
- Fixed bug where Gecko was outputting internal attributes if valid_elements where set to "*[*]".\r
- Fixed bug where the style plugin would produce non hex colors inside the dialog when running on Gecko.\r
- Fixed bug where an empty src value for insert image would remove the currently selected image if it wasn't and image element.\r
- Fixed bug where hidden input elements would break the logic for the tab_focus option.\r
- Fixed bug where save button wasn't working correctly in fullscreen mode.\r
- Fixed bug where the editor was forced to be placed in a form element if the save_onsavecallback option was used.\r
- Fixed bug where upper case param attributes wasn't parsed correctly in the media plugin.\r
- Fixed bug where render method of tinymce.Editor class would produce an exception if the strict_loading_mode option was omitted.\r
- Fixed bug where nodeChanged event could be fired while the editor was loading and there for produce an exception in FF.\r
- Fixed bug where no undo levels where added if the user created new table rows using the tab key on Gecko.\r
- Fixed bug where tables would be broken if you selected a different block format for contents withing an table cell.\r
- Fixed bug where the render method of the tinymce.Editor class didn't setup the tinymce.EditorManager.settings object correctly.\r
- Fixed bug where the advanced image dialog would go to the first tab if the alternative image was changed using the file browser link.\r
- Fixed bug where the forced_root_block option would produce BR elements inside empty blocks if the block wasn't a paragraph.\r
- Fixed bug where the forced_root_block doesn't work correctly on IE if the specified element was something else than paragraphs.\r
- Fixed bug where selection of images would get lost if user selected something from the context menu in IE.\r
- Fixed bug where the context menu plugin would pollute the global namespace with two variables p1 and p2.\r
- Fixed compatibility issue with Mootools, it is destroying document.getElementById on unload in IE. (Mantra: You don't own the internal objects).\r
- Fixed bugs where dialogs/tabs and other UI elements where rendered incorrectly in Firefox 3.\r
- Fixed so the auto CSS class importer is compatible with 2.x.\r
- Fixed so the editor UI and inlinedialogs works correctly with the YUI CSS reset package.\r
- Fixed so header and footer elements are forced to lower case when the fullpage plugin is used.\r
- Fixed so load prefixes "-" for plugins and themes isn't required if the plugin/theme was loaded by the ThemeManager/PluginManager.\r
- Fixed so the JSONRequest uses application/json content type to make Ruby on rails happy.\r
- Fixed so the CSS rule is more exact for the body in the default content.css files. Body is now defined as "body.mceContentBody" instead of just "body".\r
- Fixed so the tiny_mce_dev.js uses XHR instead of document.write to load scripts to resolve an issue with Opera 9.50.\r
- Fixed so language pack loading can be disabled by setting the language option to false. Can be useful for systems with their own language pack management.\r
-Version 3.0 (2008-01-30)\r
- Added map and area elements to the default valid_elements list and also some indentation rules.\r
- Fixed bug where empty paragraphs wasn't padded when loading contents.\r
- Fixed bug where the RowLayout manager didn't work at all.\r
- Fixed bug where style attribute data would get messed up in advimage dialog.\r
- Fixed bug where the table dialogs class select wasn't updated correctly.\r
- Fixed bug where elements would get extra whitespace around on insert when body was present in valid_elements.\r
- Fixed bug where coords attribute of the area element wasn't handled properly in IE.\r
- Fixed bug where Safari didn't produce BR elements on shift+return.\r
- Fixed bug where force blocks would cast odd invalid attribute exception in IE.\r
- Fixed bug where media plugin would produce extra whitespace before and after objects.\r
- Fixed bug where cleanup_callback could break the contents of the editor. But use the new event system instead of this option.\r
- Fixed bug where the tab_focus option didn't work between editor instanced. You can now tab between editors.\r
- Fixed bug where the load function of the ScriptLoader class didn't load single files without the load que as it was supposed to.\r
- Fixed bug where the execcommand_callback parameter order was incorrect. Recommendation use the new addCommand method.\r
- Fixed bug where range.select calls sometimes failed on some IE versions.\r
- Fixed bug where Safari was scrolling to top of document when enter/returned was pressed.\r
- Fixed bug where fullscreen_new_window option didn't work correctly.\r
- Fixed bug where the nonbreaking plugin inserted an space instead of an non breaking space the first time.\r
- Fixed bug where the visualization of non breaking spaces where visual in element path.\r
- Fixed so the focus is restored to the editor after inserting an custom character.\r
- Fixed so the isNotDirty state is set to false if a new undo level is added.\r
- Fixed so pointless style information for borders gets removed in IE.\r
- Fixed so the resize button has a se-resize cursor css value.\r
-Version 3.0rc2 (2008-01-18)\r
- Added new fix_nesting option to fix bug #1867292, this is disabled by default.\r
- Added new indentation option enables you to specify how much each indent/outdent call will add/remove.\r
- Added easier support for enabling/disabling icon columns on drop menues.\r
- Added new menu button control class. This control is very similar to the splitbutton but without any onclick action.\r
- Added support for previous tab focus (shift+tab). The tab_focus setting now takes two items next and previous element.\r
- Fixed bug where iframes inside the editor got removed in Firefox on initial load.\r
- Fixed bug where the CSS for abbr elements wasn't applied correctly in IE.\r
- Fixed bug where mceAddControl on element inside a hidden container produced errors.\r
- Fixed bug where closed anchors like <a /> produced strange results.\r
- Fixed bug where caret would jump to the top of the editor if enter was pressed a the end of a list.\r
- Fixed bug where remove editor failed if the editor wasn't properly initialized.\r
- Fixed bug where render call on for a non existing element produced exception.\r
- Fixed bug where parent window was hidden when the color picker was used in a non inlinepopups setup.\r
- Fixed bug where onchange event wasn't fired correctly on IE when color picker was used in dialogs.\r
- Fixed bug where save plugin could not save contents if the converted element wasn't an textarea.\r
- Fixed bug where events might be fired even after an editor instance was removed such as blur events.\r
- Fixed bug where an exception about undefined undo levels could be throwed sometimes.\r
- Fixed bug where the plugin_preview_pageurl option didn't work.\r
- Fixed bug where adding/removing an editor instance very fast could produce problems.\r
- Fixed bug where the link button was highlighted when an anchor element was selected.\r
- Fixed bug where the selected contents where removed if a new anchor element was added.\r
- Fixed bug where splitbuttons where rendered one pixel down in the default theme.\r
- Fixed bug where some buttons where placed at incorrect positions in the o2k7 theme.\r
- Fixed bug that made it impossible to visually disable a custom button that used an image instead of CSS sprites.\r
- Fixed bug where it wasn't possible to press delete/backspace if the editor was added+removed and re-added due to a FF bug.\r
- Fixed bug where an entities option with only 38,amp,60,lt,62,gt would fail in IE.\r
- Fixed bug where innerHTML sometimes generated unknown runtime error on IE.\r
- Fixed bug where content_css files wasn't loaded in the template preview iframe.\r
- Fixed bug where scroll position was incorrect when toggling fullscreen mode.\r
- Fixed bug where restoration of overflow didn't work correctly when disabling fullscreen mode in Opera.\r
- Fixed bug where drop menus where places at incorrect locations if the editor was placed in a scrollable container element.\r
- Fixed bug where hideMenu didn't hide sub menus correctly. It will now hide all menus recursively.\r
- Fixed so theme_advanced_path_location can be used in init options for compatibility reasons.\r
- Fixed so the drop menu colors matches the rest of o2k7 theme.\r
- Fixed so the preview example.html file is updated to the new 3.x API.\r
- Fixed so the margins are the same by default inside the editable area between IE and other browsers.\r
- Fixed so editor contents gets stored before it the onSubmit event is fired.\r
-Version 3.0rc1 (2008-01-08)\r
- Added new classes for toolbar rows in advanced theme mceToolbarRow1..n enabled you to change appearance of individual rows.\r
- Added auto detection for the strict_loading_mode option when running in application/xhtml+xml mode on Gecko.\r
- Optimized the HTML serializer by bundling some post process methods together.\r
- Fixed so that the toolbars have unique IDs, enables you to alter the toolbars using the ControlManager and the DOM.\r
- Fixed bug where delta values for dialog sizes in language packs didn't work correctly due to missing string to number casting.\r
- Fixed bug where paragraph generation logic didn't handle hr or table elements correctly if they where the only element.\r
- Fixed bug where some elements got extra linebreaks added after or before it in HTML output.\r
- Fixed bug where it was hard to modify existing style data on table rows and table cells.\r
- Fixed bug where the dom.getRect method didn't handle non pixel values correctly.\r
- Fixed bug where strikethrough and underline couldn't be toggled on existing span elements.\r
- Fixed bug where the postprocessor searched for nsbp instead of nbsp entities.\r
- Fixed bug where it was impossible to edit links that had child elements within them.\r
- Fixed bug where it was possible to click on the parent item of a submenu.\r
- Fixed bug where mouseover/mouseout images couldn't be removed in advimage dialog.\r
- Fixed bug where drop menus didn't work when running in application/xhtml+xml mode.\r
- Fixed bug where Opera added doctype to output in application/xhtml+xml mode.\r
- Fixed bug where some DOM methods didn't work correctly in the application/xhtml+xml mode.\r
- Fixed bug where the inlinepopups didn't work correctly in the application/xhtml+xml mode.\r
- Fixed bug where the ColorSplitButton didn't display correctly in the application/xhtml+xml mode.\r
- Fixed bug where the UI layout was incorrect on Gecko browsers when running in application/xhtml+xml mode.\r
- Fixed bug where the word paste plugin produced exception while running in application/xhtml+xml mode.\r
- Fixed bug where there wasn't any hidden input element generated for divs while running in application/xhtml+xml mode.\r
- Fixed bug where indentation of script/style/pre elements where incorrect.\r
- Fixed bug where script element contents was removed in IE.\r
- Fixed bug where script element contents got entity encoded.\r
- Fixed bug where you couldn't edit existing element styles using the styles plugin.\r
- Fixed bug where styles wasn't updated properly sometimes due to an performance enhancement.\r
- Fixed bug where font sizes couldn't be changed using the style plugin.\r
- Fixed bug where an error was produced in Gecko browsers when switching back from fullscreen mode.\r
- Fixed bug where Opera was producing br elements after elements like h3.\r
- Fixed bug where TinyMCE couldn't be loaded on a page using - characters in it's URL.\r
- Fixed bug where the editor container element was forced to have a specific name.\r
- Fixed bug with force_br_newlines option on Firefox, even though it should never be used (Read FAQ).\r
- Fixed bug where onclick event had an return true; prefix added when creating an popup.\r
- Fixed bug where the theme_advanced_statusbar_location option couldn't handle the value "none".\r
- Fixed issue with URLs with multiple at characters for example an Zope URI.\r
- Fixed so simple and advanced themes doesn't collide.\r
- Fixed so a elements gets removed when the href field is left empty, the href attribute is required in a link after all.\r
- Fixed so img elements gets removed when the src field is left empty, the src attribute is required for all images after all.\r
- Removed the indent and encode methods from the tinymce.dom.Serializer class due to performance enhancement and reduction of the API size.\r
-Version 3.0b3 (2007-12-14)\r
- Added new getElement method to Editor class, returns the element that was replaced with the editor instance.\r
- Added new unavailable prefix for disabled controls for accessibility reasons.\r
- Fixed bug where regexp patterns couldn't be used for the editor_selector/editor_deselector options.\r
- Fixed bug where the DOM wasn't properly initialized before the onInit event was executed in popups.\r
- Fixed bug where font sizes where reduced by font size actions on previous spans in Safari.\r
- Fixed bug where HR elements got places at the wrong location in IE.\r
- Fixed bug where align/justify didn't work correctly on multiple paragraphs.\r
- Fixed bug with missing translation for cell scope settings.\r
- Fixed bug where selection/caret position was lost on some table actions.\r
- Fixed bug where editor instances couldn't be added to hidden div elements.\r
- Fixed bug where list elements in Safari would get an odd ID attribute.\r
- Fixed bug where IE would return <html/> when the editor was completely empty.\r
- Fixed bug where accessibility title attribute for access keys wasn't setup properly.\r
- Fixed bug where forecolorpicker and backcolorpicker control names wasn't working.\r
- Fixed bug where inserting template content didn't work in Safari due to selection exception.\r
- Fixed bug where absolute URLs to remote hosts couldn't be used for background images.\r
- Fixed bug where mysterious span elements where produced in Safari when injecting HTML contents.\r
- Fixed bug where the media plugin didn't work correctly on the latest Opera 9.24.\r
- Fixed bug where indentation of HTML output wasn't applied to all block elements.\r
- Fixed bug where Safari was production DOM exception if you pressed enter in an empty editor.\r
- Fixed bug where media plugin didn't parse script tags correctly patch contributed by Mathieu Campagna.\r
- Fixed bug where the drop menus of list boxes like blockformat could produce scrolling of the page.\r
- Fixed bug where the drop menus where placed at an incorrect location if TinyMCE was placed in a scrollable div.\r
- Fixed bug where submit buttons couldn't be named submit, it's not recommended to name submit buttons submit anyway.\r
- Fixed bug where the stylelistbox produced an exception if there was only one class in the list box.\r
- Fixed bug where the stylelistbox wasn't updated correctly when the current class was removed.\r
- Fixed bug where the formatblock command sometimes removed the body element.\r
- Fixed bug where fullscreen switching in IE sometimes produced an exception when the spellchecker plugin was enabled.\r
- Fixed issue where FF produced an empty paragraph when the editor was completely empty.\r
- Fixed issue with size of image dialog in the advanced theme.\r
- Fixed issues with the bbcode plugin it now also handles spans and the [font] rule.\r
- Fixed so the style compression feature is a bit smarter to resolve issues with Opera.\r
- Reintroduced the remove_linebreaks option, this is enabled by default.\r
-Version 3.0b2 (2007-11-29)\r
- Added type and compact attributes to the default valid_elements list for the ul and ol elements.\r
- Added missing accessibility support to native list boxes in both the toolbar and dialogs.\r
- Added missing access key for the element path for accessibility reasons.\r
- Fixed support for loading themes from external URLs.\r
- Fixed bug where setOuterHTML didn't work correctly when multiple elements where passed to it.\r
- Fixed bug with visualchars plugin was moving elements around in the DOM.\r
- Fixed bug with DIV elements that got converted into editors on IE.\r
- Fixed bug with paste plugin using the old event API.\r
- Fixed bug where the spellchecker was removing the word when it was ignored.\r
- Fixed bug where fullscreen wasn't working properly.\r
- Fixed bug where the base href element and attribute was ignored.\r
- Fixed bug where redo function didn't work in IE.\r
- Fixed bug where content_css didn't work as previous 2.x branch.\r
- Fixed bug where preview dialog was throwing errors if the content_css wasn't defined.\r
- Fixed bug where the theme_advanced_path option didn't work like the 2.x branch.\r
- Fixed bug where the theme_advanced_statusbar_location was called theme_advanced_status_location.\r
- Fixed bug where the strict_loading_mode option didn't work if you created editors dynamically without using the EditorManager.\r
- Fixed bug where some language values wasn't translated such as insert and update in dialogs.\r
- Fixed bug where some image attributes wasn't stored correctly when inserting an image.\r
- Fixed bug where fullscreen mode didn't restore scrollbars when disabled.\r
- Fixed bug where there was no visual representation for tab focus in toolbars on IE.\r
- Fixed bug where HR elements wasn't treated as block elements so forced_root_block would fail on these.\r
- Fixed bug where autosave presented warning message even when the form was submitted normally.\r
- Fixed typo of openBrower it's now openBrowser in form_utils.js.\r
- Fixed various HTML problems like missing TD elements and duplicated doctypes.\r
- Fixed default values for theme_advanced_resize_horizontal, theme_advanced_resizing_use_cookie to be 2.x compatible.\r
- Moved spellchecker JS files into the development package.\r
- Removed support for theme_advanced_path_location since the theme_advanced_statusbar_location is the correct option name.\r
-Version 3.0b1 (2007-11-21)\r
- Added new tab_focus option, that enables you to specify a element id or that the next element to be focused on tab key down.\r
- Added new addQueryValueHandler method to the tinymce.Editor class.\r
- Added new class_filter option, this enables you to specify a function that can filter out CSS classes for the styles list box.\r
- Added support form [url=url]title[/url] to the bbcode plugin.\r
- Renamed the addCommandQueryState method in the tinymce.Editor class to addQueryStateHandler.\r
- Renamed loadQue to loadQueue, to correct spelling.\r
- Removed the createDOM method from the window manager and replace it with a createInstance method.\r
- Removed the add to beginning of class attribute parameter of the DOMUtils.addClass method.\r
- Fixed bug with the forced_root_block option, didn't work correctly with multiple inline elements.\r
- Fixed bug where image dialogs replaced the current image element with a new one even when it was updated.\r
- Fixed bug where the submit trigger wasn't executed when divs where converted into editor instances.\r
- Fixed bug where div elements that got converted into editors didn't get a hidden input element generated for them.\r
- Fixed bug where the the media_use_script option for the media plugin wasn't working correctly.\r
- Fixed bug where the font size and font family listboxes wasn't updated correctly on Safari.\r
- Fixed bug where the height of the fieldset in default image dialog for the advanced theme was to small.\r
- Fixed bug where the font sizes behaved incorrectly after a cleanup on Safari.\r
- Fixed bug where formatblock didn't work correctly in Safari on some elements.\r
- Fixed bug where template plugin didn't insert content correctly unless some options where specified.\r
- Fixed bug where charmap on Safari produced scrollbars.\r
- Fixed bug where there was white artifacts in some dialogs due to missing background color.\r
- Fixed bug where port was added to all external URLs if the editor was loaded from a custom port.\r
- Fixed bug where the context menus got duplicated on Safari 3.0.4 on Mac OS X.\r
- Fixed bug where dialogs like paste from word was huge on Firefox.\r
- Fixed bug with media plugin not working with windows media objects.\r
- Fixed bug where a forever loop was created if multiple instances where submitted using form.submit.\r
- Fixed bug with editing a table produce error in IE when inlinepopups where used.\r
- Fixed bug where the style plugin generated ugly looking style information in IE.\r
- Fixed bug where the inline dialogs that got opened while in fullscreen mode wasn't visible.\r
- Fixed bug where it was difficult to place the caret inside the word paste dialog.\r
- Fixed bug where Opera produced strange border in the word paste dialog.\r
- Fixed bug where viewport constraints could move a inlinepopup to a negative x, y position if the viewport was to small.\r
- Fixed bug where template plugin was producing an error due to a deprecated API call.\r
- Fixed bug where drag drop of images failed in Gecko if a document_base_url was specified.\r
- Fixed bug where Firefox 3 failed to apply block formats like H1-H6 it still breaks on DIVs this has been reported to bugzilla.\r
- Fixed bug where IE was producing a warning dialog about non secure items when running TinyMCE over HTTPS.\r
- Fixed bug where the onbeforeunload event was triggered when menus or dialogs where opened.\r
- Fixed bug where the fullscreen mode of the HTML view source box threw an error.\r
- Fixed bug where the mceFocus command didn't work correctly.\r
- Fixed bug where the selection could get lost in IE using inlinepopups.\r
- Fixed so the body of the editor area has the mceContentBody class just like the 2.x branch. \r
- Fixed so the media icon gets active when a media element is selected.\r
-Version 3.0a3 (2007-11-13)\r
- Added new experimental jQuery and Prototype framework adapters to the development package.\r
- Added new translation.html file for the development package. Helps with the internationalization of TinyMCE.\r
- Added new setup callback option, use this callback to add events to TinyMCE. This method is recommended over the old callbacks.\r
- Added new API documetation to all classes, functions, events, properties to the Wiki with examples etc.\r
- Added new init method to all plugins and themes, since it's shorter to write and it mimics interface capable languages better.\r
- Fixed various CSS issues in the default skin such as alignment of split buttons and separators.\r
- Fixed issues with mod_security. It didn't like that a content type of text/javascript was forced in a XHR.\r
- Fixed all events so that they now pass the sender object as it's first argument.\r
- Fixed some DOM methods so they now can take an array as input.\r
- Fixed so addButton and the methods of the ControlManager uses less arguments and it now uses a settings object instead.\r
- Fixed various issues with the tinymce.util.URI class.\r
- Fixed bug in IE and Safari and the on demand gzip loading feature.\r
- Fixed bug with moving inline windows sometimes failed in IE6.\r
- Fixed bug where save_callback function wasn't executed at all.\r
- Fixed bug where inlinepopups produces scrollbars if windows where moved to the corners of the browser.\r
- Fixed bug where view HTML source failed when inserting a embedded media object.\r
- Fixed bug where the listbox menus didn't display correctly on IE6.\r
- Fixed bug where undo level wasn't added when editor was blurred.\r
- Fixed bug where spellchecker wasn't disabled when fullscreen mode was enabled.\r
- Fixed bug where Firefox could crash some times when the user switched to fullscreen mode.\r
- Fixed bug where tinymce.ui.DropMenu didn't remove all item data when an item was removed from the menu.\r
- Fixed bug where anchor list in advlink dialog wasn't populated correctly in Safari.\r
- Fixed bug where it wasn't possible to edit tables in IE when inlinepopups was enabled.\r
- Fixed bug where it wasn't possible to change the table width of an existing table.\r
- Fixed bug where xhtmlxtras like abbr didn't work correctly on IE.\r
- Fixed bug where IE6 had some graphics rendering issues with the inlinepopups.\r
- Fixed bug where inlinepopup windows where moved incorrectly when they were boundary checked for min width.\r
- Fixed bug where textareas without id or name couldn't be converted into editor instances.\r
- Fixed bug where TinyMCE was stealing element focus on IE.\r
- Fixed bug where the getParam method didn't handle false values correctly.\r
- Fixed bug where inlinepopups was clipped by other TinyMCE instances or relative elements in IE.\r
- Fixed bug where the contextmenu was clipped by other TinyMCE instances or relative elements in IE.\r
- Fixed bug where listbox menus was clipped by other TinyMCE instances or relative elements in IE.\r
- Fixed bug where listboxes wasn't updated correctly when the a value wasn't found by select.\r
- Fixed various CSS issues that produced odd rendering bugs in IE.\r
- Fixed issues with tinymce.ui.DropMenu class, it required some optional settings to be specified.\r
- Fixed so multiple blockquotes can be removed with a easier method than before.\r
- Optimized some of the core API to boost performance.\r
- Removed some functions from the core API that wasn't needed.\r
-Version 3.0a2 (2007-11-02)\r
- Fixed critical bug where IE generaded an error on a hasAttribute call in the serialization engine.\r
- Fixed critical bug where some dialogs didn't open in the non dev package.\r
- Fixed bug when using the theme_advanced_styles option. Error was thrown in some dialogs.\r
- Fixed bug where the close buttons produced an error when native windows where used.\r
- Fixed bug in default skin so that split buttons gets activated correctly.\r
- Fixed so plugins can be loaded from external urls outsite the plugins directory.\r
-Version 3.0a1 (2007-11-01)\r
- Rewrote the core and most of the plugins and themes from scratch.\r
- Added new and improved serialization engine, faster and more powerful.\r
- Added new internal event system, things like editor.onClick.add(func).\r
- Added new inlinepopups plugin, the dialogs are now skinnable and uses clearlooks2 as default.\r
- Added new contextmenu plugin, context menus can now have submenus and plugins can add items on the fly.\r
- Added new skin support for the simple and advanced themes you can alter the whole UI using CSS.\r
- Added new o2k7 skin for the simple and advanced themes.\r
- Added new custom list boxes for font size/format/style etc with preview support.\r
- Added new UI management, enabled plugins to create controls like splitbuttons or menus easier.\r
- Added new JSON parser/serializer and JSON-RPC class to the core API.\r
- Added new cookie utility class to the core API.\r
- Added new Unit testing class to the core API only available in dev mode.\r
- Added new firebug lite integration when loading the dev version of TinyMCE.\r
- Added new Safari plugin, fixes lots compatibility of issues with Safari 3.x.\r
- Added new URI/URL parsing it now handles the hole RFC and even some exceptions.\r
- Added new pagebreak plugin, enables you to insert pagebreak comments like <!-- pagebreak -->\r
- Added new on demand loading of plugins and themes. Enables you to load and init TinyMCE at any time.\r
- Added new throbber/progress visualization a plugin can show/hide this when it's needed.\r
- Added new blockquote button. Enables you to wrap paragraphs in blockquotes.\r
- Added new compat2x plugin. Will provide a TinyMCE 2.x API for older plugins.\r
- Added new theme_advanced_resizing_min_width, theme_advanced_resizing_min_height options.\r
- Added new theme_advanced_resizing_max_height, theme_advanced_resizing_max_height options.\r
- Added new use_native_selects option. Enables you to toggle native listboxes on and off.\r
- Added new docs_url option enables you to specify where the TinyMCE user documentation is located.\r
- Added new frame and rules options for the table dialog.\r
- Added new global rule for valid_elements/extended_valid_elements enables you to specify global attributes for all elements.\r
- Added new deny attribute rule characher so it's possible to deny global attribute rules on specific elements.\r
- Added new unit tests in the dev package of TinyMCE. Runs tests on the core API, commands and settings of the editor.\r
- Readded the inline_styles option and enabled it by default so deprecated attributes are no longer used.\r
- Removed all button images and replaced them with CSS sprite images. Reduces the number of requests needed.\r
- Removed lots of language files and merged them into the base language files. Reduces the number of requests needed.\r
- Removed lots of unnecessary files and merged many of them together to reduce requests and improve loading speed.\r
- Reduced the over all script size by 33% and the number of files/requests by 75% so it loads a lot faster.\r
- Fixed so convert_fonts_to_spans are enabled by default. So no more font tags.\r
- Fixed so underline and strikethrough uses spans instread of deprecated U and STRIKE elements.\r
- Fixed so indent/outdent adds/removed margin-left instead of blockquotes.\r
- Fixed so alignment of paragraphs results in a text-align style value instead of the deprecated align attribute.\r
- Fixed so alignment of images uses float or vertical-align style values instead of the deprecated align attribute.\r
- Fixed so all classes from @import stylesheets gets imported into the editor.\r
- Fixed so the directionality can toggle the dir attribute on and off.\r
- Fixed so the fullscreen_settings can be used for all types of fullscreen modes.\r
- Fixed so the advanced HR dialog gets displayed when inserting a HR not only on edit.\r
- Fixed bug where word wrap didn't work in the source editor on Safari.\r
- Fixed so non HTML elements can be used within the editor such as <myns:tag>\r
- Fixed various memory leaks in IE and reduced the unload cleanups needed.\r
- Fixed so the preformatted option adds an invisible container pre tag inside the editor.\r
- Renamed the _template plugin to example and updated it to use the new 3.x API.\r
+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.
+Version 3.4b3 (2011-02-10)
+ Added WAI-ARIA support for the main UI and dialogs this feature was contributed by Ephox.
+ Added iframe support to media plugin in order to handle the new YouTube HTML5 video formats.
+ Fixed bug where anchors would wrap the text contents after it due to a bug in the DomParser logic.
+ Fixed bug where the selected state wouldn't be removed on ListBox controls when a menu item was selected.
+ Fixed bug where IE could throw an unspecified error exception when the getBookmark logic was executed.
+ Fixed bug where IE would throw an invalid argument error when focus was applied to an empty editor instance.
+ Fixed bug where applying inline format wouldn't work if the start cell in the selection was empty.
+ Fixed bug where auto detection logic for YouTube and Google Video wouldn't work in the new media plugin.
+ Fixed bug where td elements would get a colspan/rowspan of 1 when created by the table plugin.
+ Fixed bug where removal/padding of empty elements wasn't handled correctly.
+ Fixed bug where internal elements would show up in element path.
+ Fixed bug where internal elements would get serialized as valid output.
+ Fixed bug where color wasn't correctly applied to anchor elements.
+ Fixed bug where float option in the style plugin dialog wouldn't be handled correctly on WebKit.
+ Fixed bug where the tinymce.dom.TreeWalker prev function wouldn't walk the DOM correctly.
+ Fixed bug where mceInsertContent command could produce empty block elements after the inserted content.
+ Fixed bug where mceInsertContent command wouldn't apply visual aids on tables and similar elements.
+ Fixed bug where empty block elements would get double br bogus elements in them.
+ Fixed bug where the color menu wouldn't apply the color correctly on IE when the viewport was to small.
+ Fixed bug where right clicking out side the body element of the editor iframe would prevent paste from working on IE.
+ Fixed bug where the onContextMenu event wouldn't fire correctly on IE if you clicked out side the body element.
+ Fixed bug where the onContextMenu event wouldn't fire correctly on modern Opera versions that now support it by default.
+ Fixed bug where legacy content wasn't converted correctly when inserted using mceInsertContent or through the source dialog.
+ Fixed bug where resizing images or tables wouldn't update the style attribute correctly or leave data-mce prefixed attributes.
+ Fixed bug where adding links wouldn't work correctly when using TinyMCE jQuery version with jQuery 1.5.
+ Fixed bug where single quotes inside param elements wasn't treated correctly by the media plugin.
+ Fixed bug where pasting plain text in WebKit wouldn't work correctly. It will now auto detect the WebKit bug and use plain text mode.
+ Fixed bug where the DomParser would fail to move out invalid elements within invalid elements on complex contents.
+ Fixed bug where paste as plain text would not decode html entities properly.
+ Fixed bug where large paragraphs would cause incorrect scrolling behavior if you would split them using enter.
+ Fixed bug where the SaxParser wouldn't properly parse some specific short ended elements.
+ Fixed so mceReplaceContent supports caret position and makes sure that the contents inserted gets validated.
+ Fixed so unnecessary traling br elements in blocks gets removed on Gecko/WebKit when using mceInsertContent command.
+ Moved some plugin css contents into the skin content css files to reduce the number of http requests.
+ Moved some plugin specific images into the theme img directory since they can then be shared.
+Version 3.4b2 (2011-01-13)
+ Added new custom flash player, this player supports mp4 and flv and has skin support.
+ Fixed so mceInsertContent handles context correctly to enforce valid nesting of elements.
+ Fixed bug where scrolling would become jerky on IE on some contents.
+ Fixed bug where paste as plain text would throw exception of missing entities setting.
+ Fixed bug where anchor nodes where removed by the new serializer engine.
+ Fixed bug where IE would crash if when backspace where used on some specific contents.
+ Fixed bug where pasting of plain text in WebKit would result in merging of text lines.
+ Fixed bug where it wasn't possible to delete images or tables using backspace on IE9.
+ Fixed bug where urls in styles would generate a JS error due to incorrect scope.
+ Fixed bug where copy paste from Java applications would produce extra contents in FF on Mac.
+ Fixed bug where the verify_html option wouldn't allow all elements and attributes.
+Version 3.4b1 (2010-12-20)
+ Added new serialization engine that increases performance and enforces valid output according to the specified schema settings.
+ Added new HTML parser logic used by the serialization engine and can handle malformed html contents.
+ Added new valid_children config option, enables more fine grain control of elements can be inside other elements.
+ Added new entities encoding logic boost performance and will only encode entities based on context i.e. attributes/text nodes.
+ Added new protect setting that enables users to protect template items from being removed by the serializer logic.
+ Added new {$caret} marker for the mceInsertContent command. Makes it possible to move the caret to a specific position when inserting contents.
+ Added new validation of anchor names. Only valid W3C names will be accepted.
+ Replaced the internal _mce_ prefixed attributes to the more standard HTML5 data-mce- prefix. This will also resolve future browser santiaztion issues.
+ Fixed bug where the paste plugin wouldn't convert Word lists with more than 9 items to real ol lists. Patch contributed by Mike (yogaboy).
+ Fixed bug where clicking on a format title would produce errors if the current selection didn't have any formats.
+ Fixed bug where paste of simple texts wouldn't work correctly in Gecko using the paste plugin since it keeps block formatting.
+ Fixed bug where confirm dialogs didn't display correctly due to resent IE9 fixes.
+ Fixed bug where spaces in URLs wouldn't be properly encoded to %20 if the user entered them in the link dialogs. Patch contributed by Ephox.
+ Fixed bug where the image alignment buttons wouldn't reposition the resize handles on FF due to a browser issue. Patch contributed by Ephox.
+ Fixed bug where the compareBoundaryPoints method of the IE Range class didn't work correctly. Patch contributed by Ephox.
+ Fixed bug where selection of elements using double click wouldn't select the clicked element but rather the parent node on FF. Patch contributed by Ephox.
+ Fixed bug where IE would scroll the user to the current selection causing parent document to scroll as well. Patch contributed by Ephox.
+ Fixed bug where style compression would incorrectly compress items with different values. It now only compresses if the values are the same. Patch contributed by Ephox.
+ Fixed bug where FF would add non breaking spaces outside TD elements if formatting was applied to table cells. Patch contributed by Ephox.
+ Fixed bug where the caret position would be lost on WebKit browsers if you pasted images multiple times. Patch contributed by Ephox.
+ Fixed bug where non word contents like * would be counted as words in the wordcount pluging. Patch contributed by David Balatero.
+ Fixed bug where the toggle absolute button in the layer plugin wouldn't remove the existing internal style attribute first.
+ Fixed bug where the autosave plugin would generate an exception on IE if the user had disabled userdata persistence.
+ Fixed bug where the paste plugin would remove dashed classes on IE since the regexps didn't include that character.
+ Fixed bug where applying text color would not add spans inside link elements. This is needed due to CSS style inheritance.
+ Fixed bug where applying block formats to empty elements wouldn't render correctly on IE.
+ Fixed bug where the searchreplace plugin would add a f or r character when shortcuts where used on IE while using default dialogs.
+ Fixed bug where Opera wouldn't load scripts correctly since the onreadystate would fire even though the script wasn't loaded.
+ Fixed issue where wouldn't be handled correctly in the bbcode plugin if entity_encoding was set to raw.
+ Fixed issue where contents would flicker since the content css files where asynchronously loaded.
+ Fixed bug where WebKit wouldn't create links on images with a float style.
+Version 3.3.9.3 (2010-12-20)
+ Fixed issue where WebKit wouldn't correctly apply ins/del in xhtmlxtras plugin.
+ Fixed bug where paste as plaintext on WebKit wouldn't produce br and p elements correctly.
+ Fixed bug where the confirm dialog texts would be incorrectly placed due to recent IE 9 workarounds in the window.css.
+ Fixed bug where applying text color would not add spans inside link elements. This is needed due to CSS style inheritance.
+Version 3.3.9.2 (2010-09-29)
+ Fixed bug where placing the caret in IE 9 beta 1 would not work correctly if you clicked out side the document body element.
+ Fixed bug where IE 9 beta 1 wouldn't resize the editor correctly since the events didn't fire as previous versions did.
+ Fixed bug where FF would produce an error message when being rendered inside a hidden div element.
+ Fixed bug where resize logic could produce a cookie with a width/height less than the size of the container.
+ Fixed bug where content_css wouldn't populate the styles dropdown correctly.
+Version 3.3.9.1 (2010-09-23)
+ Fixed bug where WebKit browsers wouldn't activate the image button when images where selected.
+ Fixed bug where Opera Presto 10.60 deletes elements when restoring bookmarks.
+ Fixed bug where IE9 beta1 doesn't handle regexp replacement values correctly.
+ Fixed bug where IE9 beta1 didn't render the inline dialogs correctly due to a bug with CSS clip.
+ Fixed bug where IE9 beta1 would produce error messages on load since they removed the document.recalc method.
+ Fixed bug where IE9 beta1 would produce <html xmlns=""> since they haven't implemented document.implementation.createDocument correctly.
+ Fixed bug where IE9 beta1 would searchreplace doesn't work since their native DOM Range doesn't have a find method.
+ Fixed bug where IE9 beta1 would render the source view incorrectly due to incorrect viewport size measurements.
+ Fixed bug where IE9 beta1 would crash when running the basic functionality unit tests.
+ Fixed bug where IE9 beta1 would wrap elements in blocks correctly due to changes to the selection object.
+ Fixed bug where IE9 beta1 would fail to insert contents since they havn't implemented the createContextualFragment method in their DOM Range.
+ Fixed bug where IE9 beta1 would fail to handle image selection since they currently doesn't support control selections in their DOM Range.
+ Fixed bug where IE9 beta1 would fail to load scripts since they fire the onload event before the scripts are parsed and executed.
+Version 3.3.9 (2010-09-08)
+ Fixed bug where inserting table rows into a table with subtable would produce an incorrect column count.
+ Fixed bug where the selection of cells in a table with subtables could produce invalid selections.
+ Fixed bug where the table plugin would produce a script error if you tried to move the caret before a first child table.
+ Fixed bug where the keep_styles feature on IE would move the caret to an incorrect location at the end of list blocks.
+ Fixed so attributes from legacy elements such as font gets retained when they get converted to spans.
+ Fixed minor issue where the select boxes wouldn't be set the not set by default in the table dialog.
+Version 3.3.8 (2010-06-30)
+ On IE8+ and FireFox 3.5+, dragging an image now correctly adds an undo
+ event.
+ Fixed bug where WebKit would not move the caret to a correct position after a paste operation.
+ Fixed bug where WebKit would produce a div wrapper element when pasting some contents.
+ Fixed bug where the visual chars and nonbreaking plugin wouldn't show nbsp elements correctly.
+ Fixed bug where the format states would be enabled even after the format was removed.
+ Fixed bug where the delete key would move the caret to an incorrect position.
+ Fixed bug where it wasn't possible to toggle of the current font size/family/style by clicking the title item.
+ Fixed bug where the abbr element wouldn't get serialized correctly on IE6.
+ Fixed so that the examples checks if they are executed from the local file system since that might not work properly.
+Version 3.3.7 (2010-06-10)
+ Fixed bug where context menu would produce an error on IE if you right clicked twice and left clicked once.
+ Fixed bug where resizing of the window on WebKit browsers in fullscreen mode wouldn't position the statusbar correctly.
+ Fixed bug where IE would produce an error if the editor was empty and you where undoing to that initial level.
+ Fixed bug where setting the table background on gecko would produce \" entities inside the url style property.
+ Fixed bug where the button states wouldn't be updated correctly on IE if you placed the caret inside the new element.
+ Fixed bug where undo levels wasn't properly added after applying styles or font sizes.
+ Fixed bug where IE would throw an error if you used "select all" on empty elements and applied formatting to that.
+ Fixed bug where IE could select one extra character when you did a bookmark call on a caret location.
+ Fixed bug where IE could produce a script error on delete since it would sometimes produce an invalid DOM.
+ Fixed bug where IE would return the wrong start element if the whole element was selected.
+ Fixed bug where formatting states wasn't updated on IE if you pressed enter at the end of a block with formatting.
+ Fixed bug where submenus for the context menu wasn't removed correctly when the editor was destroyed.
+ Fixed bug where Gecko could select the wrong element after applying format to multiple elements.
+ Fixed bug where Gecko would delete parts of the previous element if the selection range was a element selection.
+ Fixed bug where Gecko would not merge paragraph elements correctly if they contained br elements.
+ Fixed bug where the cleanup button could produce span artifacts if you pressed it twice in a row.
+ Fixed bug where the fullpage plugin header/footer would be have it's header reseted to it's initial state on undo.
+ Fixed bug where an empty paragraph would be collapsed if you performed a cleanup while having the caret inside it.
+ Fixed a few memory leaks on IE especially with drop menus in listboxes and the spellchecker.
+ Fixed so formats applied to the current caret gets merged to reduce the number of output elements.
+ Added the latest version of Sizzle for the CSS selector logic to fix a compatibility issue with prototype.
+Version 3.3.6 (2010-05-20)
+ Fixed bug where a editor.focus call could produce errors on IE in very specific scenarios.
+ Fixed bug where Gecko would produce an error if you unformatted text inside an empty element.
+ Fixed bug where IE would produce an error if the caret was placed before a table and you used the align buttons.
+ Fixed bug where the font size drop down didn't display the a preview correctly.
+ Fixed bug where the paste plugin wouldn't include all contents some times on WebKit browsers.
+ Fixed bug where the plain text mode toggle wouldn't work properly on WebKit.
+ Fixed bug where the editors statusbar would become invisible when you resized the window in fullscreen mode.
+Version 3.3.5.1 (2010-05-07)
+ Fixed a critical bug with the fullscreen plugin. Produced error messages when the state was toggled on/off.
+Version 3.3.5 (2010-05-06)
+ Added new merge_with_parents option to formats, enables the control of removal of elements with similar parents.
+ Fixed so the default behavior for applying classes isn't a toggle state but the old behavior from before the 3.3 release.
+ Fixed bug where selecting contents using double click on Gecko would produce errors when using removing format.
+ Fixed bug where the IE DOM could get messed up when non valid contents was pasted into the editor.
+ Fixed bug where merging selected table cells using the context menu didn't work as expected.
+ Fixed bug where some nestled formatting would be applied incorrectly.
+ Fixed bug with enter in list items when using the force_br_newlines mode on WebKit patch contributed by Ryan Koopmans.
+ Fixed bug where undo/redo could produce js errors on some specific operations.
+ Fixed bug where the theme_advanced_font_sizes didn't work as before 3.3 when complex settings where used.
+ Fixed bug where the table plugin would copy cell/row id attributes when making new rows/cells.
+Version 3.3.4 (2010-04-27)
+ Fixed bug where fullscreen plugin would add two editor instances to EditorManager collection.
+ Fixed bug where it was difficult to enter text on non western languages such as Japanese on IE.
+ Fixed bug where removing contents from nodes could result in an exception when using undo/redo.
+ Fixed bug with selection of images inside layers or other resizable containers on IE.
+ Fixed so editors isn't initialized on iPhone/iPad devices since they don't have caret support.
+Version 3.3.3 (2010-04-19)
+ Added new script_loaded callback function setting for the jQuery plugin.
+ Added various fixes and new rpc methods for the spellchecker plugin. Patch contributed by Michael Peters.
+ Removed some unnecessary inline style information from some of the dialogs.
+ Fixed some issues with the chaining for the TinyMCE jQuery plugin.
+ Fixed so any extra arguments passed to patched jQuery functions gets passed through. Patch contributed by Lee Henson.
+ Fixed so spellchecking/contextmenu can be toggled on/off if the browser has native spellchecker support.
+ Fixed bug where some texts in the new paste plugin wasn't placed in language pack.
+ Fixed bug where IE would produce an incorrect information message when cutting.
+ Fixed bug where removing items using the xhtmlxtras plugin wouldn't work correctly.
+ Fixed bug where setting table background images would add extra quotes on Gecko.
+ Fixed bug where shortcut for bold/italic/underline wouldn't work properly on WebKit.
+ Fixed bug where IE would produce an error message if only contents was an image tag and bold was used.
+ Fixed bug where the caret would move if alignment was applied to empty block elements.
+ Fixed bug where some shortcut key commands wouldn't apply formatting correctly.
+Version 3.3.2 (2010-03-25)
+ Fixed bug where it was possible to scale the editor iframe smaller than the editor UI.
+ Fixed bug where some of the resizing option didn't work with the new live resize.
+ Fixed bug where the format listbox didn't show nestled formats correctly.
+ Fixed bug where the native listboxes didn't work correctly.
+ Fixed bug where font size selection in using the legacyoutput plugin would produce errors.
+ Fixed so block and blockquote formats remove their matching element regardless of it's attributes.
+Version 3.3.1 (2010-03-18)
+ Added new live resize feature, the editor contents is now visible while resizing.
+ Fixed bug where some valid_element patterns would produce an unknown property error.
+ Fixed bug where it wasn't possible to toggle off blockquotes.
+ Fixed bug where an undo level wasn't produced when applying formatting using the styles dropdown.
+ Fixed bug where IE 6/7 wouldn't perform caret formatting due to a focus/event bug in IE.
+ Fixed bug where undo/redo wasn't restoring the previous selection correctly.
+ Fixed bug where the caret would become invisible if you resized the editor in latest Gecko.
+ Fixed bug where the class attribute wasn't completely removed in IE 6/7 when the removeClass function was used.
+ Fixed so the matchNode method of the Formatter class returns the matched format rule.
+ Fixed so it's possible to apply formatting to both blocks and as inline elements.
+Version 3.3 (2010-03-10)
+ Fixed bug where backspace on a table on IE would produce an empty tbody and some JS exceptions.
+ Fixed bug where some redundant children wasn't removed properly when applying inline styles to them.
+ Fixed bug where Chrome would produce incorect dialog sizes if the inlinepopups plugin wasn't used.
+ Fixed bug where spans with different classes would get merged if they where siblings to each other.
+ Fixed bug where IE 8 would crash if you used the spellchecker.
+ Fixed bug where Input Method for non western languages didn't work correctly.
+ Fixed bug where the UI would render incorrectly in FF 3.6 on Mac due to a bug n their rendering engine.
+ Fixed bug where WebKit wouldn't scroll down correctly if Shift+Enter was used. Patch contributed by Thomas Andersen.
+Version 3.3rc1 (2010-02-23)
+ Fixed bug with new legacyoutput plugin not working correctly on it's own.
+ Fixed bug some performance issues with removing text formats.
+ Fixed bug where TinyMCE specific attributes wasn't removed properly by remove format.
+ Fixed bug where it wasn't possible to align images within inline elements.
+ Fixed bug where Ctrl+Delete/Backspace would produce an invalid argument exception on IE.
+ Fixed bug where the search/replace logic could produce an infinite loop on IE for reverse searches.
+ Fixed bug where cloning formats in cells didn't work properly on IE.
+ Fixed bug where IE6 would produce a horizontal scroll bar.
+ Fixed so remove jQuery method removes the TinyMCE instance as well as the specified textarea.
+ Fixed so selected rows and cells gets updated using the row/cell properties dialogs.
+Version 3.3b2 (2010-02-04)
+ Fixed bug where sometimes img elements would be removed by split method in DOMUtils.
+ Fixed bug where merging of span elements could occur on bookmark nodes.
+ Fixed bug where classes wasn't properly removed when removeformat was used on IE 6.
+ Fixed bug where multiple calls to an tinyMCE.init with mode set to exact could produce the same unique ID.
+ Fixed bug with the IE selection implementation when it was feeded an document range.
+ Fixed bug where block elements formatting wasn't properly removed by removeformat on all browsers.
+ Fixed bug where selection location was lost if you performed a manual cleanup.
+ Fixed bug where removeformat wouldn't remove span elements within styled block elements.
+ Fixed bug where an error would be thrown if you clicked on the separator lines in menus.
+ Fixed bug with the jQuery plugin adding always adding a querystring value to other resources.
+ Fixed bug where IE would produce an error message if you had an empty editor instance.
+ Fixed bug where Shift+Enter didn't produce br elements on WebKit browsers.
+ Fixed bug where a temporary marker element wasn't removed by the paste plugin.
+ Fixed bug where inserting a table would produce two undo levels instead of one.
+Version 3.3b1 (2010-01-25)
+ Added new text formatting engine. Fixes a lot of browser quirks and adds new possibilities.
+ Added new advlist plugin that enables you to set the formats of list elements.
+ Added new paste plugin logic that enables you to retain style information from Office.
+ Added new autosave plugin logic that automatically saves contents in local storage.
+ Added new valid_styles option. Adds the possibility to restrict styles and their order.
+ Added new theme_advanced_runtime_fontsize option to display the runtime font size in font size select box.
+ Added new jquery plugin version that handles the gzip compressor amongst other things. Contributed by Speednet.
+ Added new $ function to tinymce namespace and editor instances for the jQuery build.
+ Added the possibility to get editors by index as well as name in the tinyMCE.editors collection.
+ Fixed so the contents inside the editor renders in standards mode by default.
+ Fixed bug where it wasn't possible to move the caret on short documents running in standards mode on IE.
+ Fixed bug where the decode method of the DOMUtils class could end up in an endless loop.
+ Fixed bug where it was possible to bypass the paste cleanup on non IE browsers if you clicked while pasting.
+ Fixed bug where some attributes wasn't serialized correctly on IE if wildcard attribute patters where used.
+ Fixed bug where entity decoding was performed on strings that didn't have any valid entities in them.
+ Fixed bugs with the insertNode method of the IE DOMRange implementation. Patch contributed by Scott McNaught.
+ Rewrote the getBookmark/moveToBookmark selection logic to boost performance on larger documents.
+ Rewrote the table plugin to include new cell selection logic and fixed various bugs and issues.
+ Merged the tinyMCE, tinymce and tinymce.EditorManager into the same instance makes more sense.
+ Removed browser setting since the browser support for TinyMCE is not far better than it was when that setting was introduced.
+ Changed the mce_ attribute prefix to the more standard _mce_ prefix. This is similar to browser vendors prefixes.
+ Optimized performance with named entities on Gecko. Regexp replace was executing very slowly probably due to a Gecko bug.
+ Optimized performance of the IE specific selection/range implementation.
+ Removed the safari plugin since we now replaced all text formatting logic to custom code.
+Version 3.2.7 (2009-09-22)
+ Fixed bug where uppercase paragraphs could still produce an invalid DOM tree on IE.
+ Fixed bug where split command didn't work on WebKit since the node serializer needs a real document to work with.
+ Fixed bug where it was impossible in Gecko to place the caret before a table if it was the first one.
+ Fixed bug where linking to urls like ../../ would produce an extra traling slash ../..//.
+ Fixed bug where the template cdate functionality was using an old 2.x API call. Patch contributed by vectorjohn.
+ Fixed bug where urls to the same site but different protocol would be converted when relative_urls where set to false. Patch contributed by Ted Rust.
+ Fixed bug where the paste plugin would remove mceItem prefixed classes.
+ Fixed bug where the paste plugin would sometimes add items in a reverse order on WebKit.
+ Fixed bug where the paste buttons would present an error message on Gecko even if you changed user.js. Patch contributed by Todd (teeaykay).
+ Fixed bug where Opera would crash if you had tables incorrectly placed inside paragraphs.
+ Fixed bug where styles elements wasn't properly processed if you had bad input HTML.
+ Fixed bug where style attributes wasn't properly forced into a specific format.
+ Fixed bug and issues with boolean attributes like checked, nowrap etc.
+ Fixed bug where input elements could override attributes on form elements.
+ Fixed bug where script or style elements could get modified by the DOMUtils processHTML method.
+ Fixed bug where the selected attribute could get lost when force root blocks logic got executed on IE. Patch contributed by Attila Mezei-Horvati.
+ Fixed bug where getAttribs method didn't handle boolean attributes correctly on IE.
+ Fixed so the paste from word dialog is presented if you paste content on an IE with to restrictive security settings.
+ Fixed so the paste_strip_class_attributes option is set to none by default in the paste plugin.
+ Removed default border=0 on tables for the default value of valid_elements.
+Version 3.2.6 (2009-08-19)
+ Added new wordcount plugin, this will display the number of typed words as you write. Contributed by Andrew Ozz.
+ Added new getNext and getPrev methods to DOM utils. These will return the first matching sibling.
+ Fixed bug where it was impossible to place the caret after a table on Gecko. It will now add a paragraph after tables.
+ Fixed bug where inline dialogs would fail if used in a window opened using a showModalDialog. Patch contributed by Derek Britt.
+ Fixed bug where IE could sometimes render a unknown runtime error on invalid input HTML.
+ Fixed bug where some incorrectly placed tables wouldn't be moved outside the paragraphs on IE.
+ Fixed bug where uppercase script/style element wouldn't be handled correctly and converted to valid lowercase.
+ Fixed bug where some WebKit versions on Mac OS X would produce issues with hidden select fields.
+ Fixed bug where the media plugin would fail on WebKit since the node wasn't properly imported to the right document.
+ Fixed bug where absolute URLs for the TinyMCE script using a base href element would cause loading problems in IE 6/7.
+ Fixed bug where pasting using the paste plugin wasn't possible on IE with to restrictive security settings.
+ Fixed bug where pasting of whitespace was impossible using the new custom paste method.
+ Fixed bug where pasting on some WebKit browsers would not work if you pasted specific contents due to a WebKit bug.
+ Fixed bug where doctypes with multiple lines would not be parsed correctly by the fullpage plugin. Patch contributed by Colin.
+ Fixed bug where the autoresize plugin would break the fullscreen functionality.
+ Fixed bug where tables would be chopped up running on IE using invalid contents and pasting paragraphs into a cell.
+ Fixed bug where the each method of jQuery build didn't iterate styleSheets. We now use the TinyMCE API one instead.
+ Fixed bug where auto switching to paragraphs after headers some times failed in Gecko.
+ Fixed so all editor options gets passed to the Serializer class. Patch contributed by Jasper Mattsson.
+ Fixed so script/style blocks isn't wrapped in paragraphs as other inline elements.
+ Fixed so the XHR requests sends the X-Requested-With HTTP header.
+ Fixed so the data url scheme is handled in the tinymce.util.URI class.
+ Changed inline documentation to use moxiedoc style comments.
+ Removed the compat2x plugin people should have upgraded to the 3.x API by now. 3.0 was released more then a year ago.
+ Re-added Gecko specific message for users who doesn't understand the security concept regarding paste.
+Version 3.2.5 (2009-06-29)
+ Added new jQuery plugin for the jQuery specific package. This enables you to more easily load and use TinyMCE.
+ Added new autoresize plugin contributed by Peter Dekkers. This plugin will auto resize the editor to the size of the contents.
+ Fixed so all packages have the same directory structure. Previous releases had a different structure for the production package.
+ Fixed so the paste from word dialog forces the contents to be processed as word contents even if it's not.
+ Fixed so the jQuery build adapter build works. It's currently only excluding Sizzle.
+ Fixed so noscript element contents is retained during the editing process.
+ Fixed bug where the getBookmark method would need a "simple" string input when the documented way is a boolean.
+ Fixed bug where invalid contents could break the fix_table_elements logic.
+ Fixed bug where Sizzle specific attributes would be serialized if the valid_elements was set to *[*].
+ Fixed bug where IE would produce an error if you specified a relative content_css and opened the paste dialog.
+ Fixed bug where pasting images on IE would produce broken images if they came from an external site.
+ Fixed bug where memory was leaked if you add/remove controls dynamically. Some event handlers wasn't removed properly.
+ Fixed bug where domain relaxing wasn't treated correctly if you added it after the TinyMCE script element.
+ Fixed bug where the activeEditor wasn't set to null if the last editor instance was removed.
+ Fixed bug where IE was leaking memory on the onbeforeunload event due to some recently introduced logic. Patch contributed by Options.
+ Fixed bug where inserting tables in Safari 4 didn't work due to a new WebKit bug where some element names are reserved.
+ Fixed bug where URLs having a :// value in the query string would make it absolute regardless of URL settings.
+ Fixed the WebKit specific bug where DOM Ranges would fail if the node wasn't attached to something in a different way.
+ Removed the auto_resize option and the resizeToContent method from the tinymce.Editor class. Use the new autoresize plugin instead.
+Version 3.2.4.1 (2009-05-25)
+ Fixed bug where Gecko browsers would produce an extra space after for example strong when loaded from sub domains.
+ Fixed bug where script elements would be removed if they where placed inside a paragraph element.
+ Fixed bug where IE 8 would produce 1 item remaining when loading CSS files dynamically with an empty cache.
+ Fixed bug where bound events would be removed from other editor instances if a specific one was removed.
+ Fixed various bugs and issues with script and style elements inside the editor.
+ Fixed so all script contents gets wrapped in CDATA sections so that they can be parsed using a XML parser.
+ Fixed so it's impossible for elements marked as closed to have child nodes rendered in output.
+Version 3.2.4 (2009-05-21)
+ Added new paste_remove_styles/paste_remove_styles_if_webkit option to paste plugin concept contributed by Hadrien Gardeur.
+ Added new functionality to paste plugin contributed by Scott Eade aka monkeybrain.
+ Added new paste_block_drop option to the paste plugin this is disabled by default and will block any drag/drop event.
+ Added new bind/unbind methods to DOMUtils these works like Event.add/Event.remove but is easier to access.
+ Added new paste_dialog_width/paste_dialog_height options to paste pluign. Enables you to change the dialog sizes.
+ Fixed bug on IE 8 where it would sometimes produce a "1 item remaining" status message that would never finish.
+ Fixed bug on Safari 4 beta that would produce DOM Range exceptions on the DOMUtils split method since the browser has a bug.
+ Fixed bug where the paste plugin could accidentally think that some word sentences was supposed to be list elements.
+ Fixed bug where paste plugin would produce one extra empty undo level on some browsers.
+ Fixed bug where spans wasn't produced correctly on new line when the keep_styles option was enabled.
+ Fixed bug where the caret would be placed at the beginning of contents in IE 8 if you selected colors from the color pickers.
+ Fixed so the Event class is a normal class instead of a static one. The tinymce.dom.Event is now a global instance of that class.
+ Fixed so internal events for instances gets removed when the DOMUtils instance is removed.
+ Fixed so preventDefault and stopPropagation methods can be used on the event object in all browsers.
+Version 3.2.3.1 (2009-05-05)
+ Fixed bug where paragraphs containing form elements such as input or textarea would be removed.
+ Fixed bug where some IE versions would produce a wrapper function for events attributes.
+ Fixed bug where table cell contents could be removed if you pressed return/enter at the end of the cell contents.
+ Fixed bug where the paste plugin would remove a extra character if the selection range was collapsed.
+ Fixed bug where creating tables with % width wouldn't be handled correctly on WebKit browsers.
+Version 3.2.3 (2009-04-23)
+ Added new paste plugin logic. This new version will autodetect Word contents and clean it up.
+ Added a optional root element argument to getPos so you can tell it where to stop the calculation.
+ Added new DOM ready logic to remove the usage of document.write. We now use basically the same method as jQuery.
+ Fixed bug where WebKit browsers would fail when selecting all contents in the area using Ctrl+A.
+ Fixed bug where IE would produce paragraphs with empty inline style elements.
+ Fixed bug where WebKit browsers would fail when inserting tables with a non pixel width.
+ Fixed bug where block elements could get a redundant br element at the end of the element.
+ Fixed bug where the tabfocus plugin only worked with a single editor instance on page.
+ Fixed bug where IE 8 was loosing caret position if the selection was collapsed and a menu was clicked.
+ Fixed bug with application/xhtml+xml mode where menus wasn't working properly.
+ Fixed bug where the onstop workaround fix for IE would produce errors in an ASP update panel.
+ Fixed bug where the submit function override could produce errors if executed in the wrong scope.
+ Fixed bug where the area element wasn't closed by a short ending.
+ Fixed various number issues in the style plugins properties dialog. Contributed by datpaulchen.
+ Fixed issues with size suffix values in the style plugin dialog.
+ Fixed issue where hasDuplicate variable would leak out to the global space due to a bug in the Sizzle engine.
+ Fixed issue where the paste event would fire a dialog warning on IE since we extracted the text contents.
+ Updated Sizzle engine to the latest version, this version fixes a few bugs that was reported.
+Version 3.2.2.3 (2009-03-26)
+ Fixed regression bug with the getPos method, it would return invalid if the view port was to small.
+Version 3.2.2.2 (2009-03-25)
+ Fixed so the DOMUtils getPos method can be used cross documents if needed.
+ Fixed bug where undo/redo wasn't working correctly in Gecko browsers.
+Version 3.2.2.1 (2009-03-19)
+ Added support for tel: URL prefixes. Even though this doesn't match any official RFC.
+ Fixed so the select method of the Selection class selects the first best suitable contents.
+ Fixed bug where the regexps for www. prefixes for link and advlink dialogs would match wwwX.
+ Fixed bug where the preview dialog would fail to open if the content_css wasn't defined. Patch contributed by David Bildström (ChronoZ).
+ Fixed bug where editors wasn't converted in application/xhtml+xml mode due to an issue with Sizzle.
+ Fixed bug where alignment would fail if multiple lines where selected.
+ Updated Sizzle engine to the latest version, this version fixes a few bugs that was reported.
+Version 3.2.2 (2009-03-05)
+ Added new CSS selector engine. Sizzle the same one that jQuery and other libraries are using.
+ Added new is and getParents methods to the DOMUtils class. These use the new Sizzle engine to select elements.
+ Added new removeformat_selector option, enables you to specify a CSS selector pattern of elements to remove when using removeformat.
+ Fixed so the getParent method can take CSS expressions when selecting it's parents.
+ Added new ant based build process, includes a new javabased preprocessor and a yuicompressor ant task.
+ Moved the tab_focus logic into a plugin called tabfocus, so the old tab_focus option has been removed from the core.
+ Replaced the TinyMCE custom unit testing framework with Qunit and rewrote all tests to match the new logic.
+ Moved the examples/testcases to a root directory called tests since it now includes slickspeed.
+ Fixed bug where nbsp wasn't replaced correctly in ForceBlocks.js. Patch contributed by thorn.
+ Fixed bug where an dom exception would be thrown in Gecko when the theme_advanced_path path was set to false under xml application mode.
+ Fixed bug where it was impossible to get out of a link at the end of a block element in Gecko.
+ Fixed bug where the latest WebKit nightly would fail when changing font size and font family.
+ Fixed bug where the latest WebKit nightly would fail when opening dialogs due to changes to the arguments object.
+ Fixed bug where paragraphs wasn't added to elements positioned absolute using classes.
+ Fixed bug where font size values with dot's like 1.4em would produce a class instead of the style value.
+ Fixed bug where IE 8 would return an incorrect position for elements.
+ Fixed bug where IE 8 would render colorpicker/filepicker icons incorrectly.
+ Fixed bug where trailing slashes for directories in URLs would be removed.
+ Fixed bug where autostart and other boolean values in the media dialog wouldn't be stored/parsed correctly.
+ Fixed bug where the repaint call for the media plugin wouldn't be executed due to a typo in the source.
+ Fixed bug where id attribute of object elements wasn't kept intact by the media plugin.
+ Fixed bug where preview of embeded elements when the media_use_script option was used would fail.
+ Fixed bug where inlinepopups could be rendered at an incorrect location on IE 6 while dragging.
+ Fixed bug where the blocker shim could be placed at an incorrect location on IE 6.
+ Fixed bug where the multiple and size attributes of select elements would produce incorrect values while running in IE.
+ Fixed bug where IE would loose the caret position is you selected a color from the color drop down.
+ Fixed bug where remove format wouldn't work on IE since it couldn't remove span elements that had style information.
+ Fixed bug where Opera was removing links when removing formatting from selected contents.
+ Fixed bug where paragraphs could be produced inside non positional elements styled with the CSS position value of static.
+ Fixed bug where removeformat wouldn't work if you selected part of a span in IE.
+ Fixed bug where media plugin didn't retain the style attribute on embed/object elements.
+ Fixed bug where auto focus on empty editor instances could produce strange results if you inserted an image into it.
+ Fixed bug where characters would be removed in FF when inserted with the mceInsertContent or selection.setContent methods.
+ Fixed bug where warning message of missing paste support wasn't displayed on WebKit browsers.
+ Fixed bug where anchor links could include other links. The selected range is now unlinked before adding news links to it.
+ Fixed memory leak when TinyMCE was used with prototype. Patch contributed by James Ots.
+ Fixed so the non documented fullpage_hide_in_source_view option for the fullpage plugin works again in the 3.x branch.
+ Fixed so tables doesn't get inserted into paragraphs by default since it's not W3C valid. Can be disabled by using the fix_table_elements option.
+ Fixed so the source view dialog sets a source_view state to the event object. Enables plugins to intercept the source view mode.
+ Fixed various validation issues with the html dialogs and pages.
+ Removed ask mode option since there is way better ways of doing this now. Use the add/remove control methods instead.
+ Removed logic for compatibility with Safari 2.x, this browser is no longer supported since no one is using it.
+ Removed the auto domain relaxing feature. If loading scripts cross sub domains it's better to specify the document.domain by hand.
+Version 3.2.1.1 (2008-11-27)
+ Added new theme_advanced_default_background_color/theme_advanced_default_foreground_color options. Patch contributed by David Bildström (ChronoZ).
+ Fixed font style formatting compatibility issue with Adobe Air.
+ Fixed so legacy font elements get converted into spans even if cleanup_on_startup isn't enabled.
+ Fixed bug where pre elements could be incorrectly modified by an IE bug workaround. Patch contributed by hu vime.
+ Fixed bug where input elements inside inlinepopups wasn't editable in Firefox 2.
+ Fixed bug where the xhtmlxtras plugin wasn't replacing attribute values correctly.
+ Fixed bug where menu buttons in skin variants would look strange due to IE 8 fixes.
+ Fixed bug where WebKit browsers would on backspace take you back to the previous page if the editor was empty.
+ Fixed bug where DOMUtils decode method wouldn't handle strings larger than 4096kb due to node chunking.
+ Fixed bug where meta key wasn't handled as ctrl key on Mac OS X for custom keyboard short cuts.
+ Fixed bug where init event would get fired twice on WebKit on Mac OS X.
+Version 3.2.1 (2008-11-04)
+ Added support for custom icon image for drop menus. Use icon_src to set a custom image directly.
+ Added new media_strict option to media plugin. Enables you to control if the flash embed is strict or not. Enabled by default.
+ Fixed so the editors script files gets dynamically loaded without using XHR or eval.
+ Fixed so the media plugin outputs valid XHTML object elements for Flash movies. Can be disabled with the media_strict option.
+ Fixed so dynamic loading doesn't require eval calls on non IE browsers for better Air support.
+ Fixed bug where the editor wasn't treated as empty if the remaining paragraph had attributes.
+ Fixed bug where id's of elements was removed ones they got wrapped in paragraphs. Patch contributed by ChronoZ.
+ Fixed bug where WebKit browsers where placing list elements inside paragraph elements.
+ Fixed bug where inserting images or links would produce absolute urls on WebKit browsers.
+ Fixed bug where values for checked, readonly, disabled and selected attributes was incorrect on IE.
+ Fixed bug where positive values for checked, readonly, disabled and selected attributes wasn't forced to valid values.
+ Fixed bug where selecting the first option in a native select box would produce an undefined error.
+ Fixed bug where tabindex 32768 could be outputted on IE if element attributes where cloned.
+ Fixed bug where the media dialogs preview window would display incorrect contents due to duplicate clsid prefixes.
+ Fixed bug where non pixel or percent heights for textarea elements would produce errors on IE.
+ Fixed bug where cdata sections in script elements wasn't handled correctly.
+ Fixed bug where nowrap of table cells would produce a 65535 value output.
+ Fixed bug where media plugin would produce an error if you selected the first item in the items list.
+ Fixed bug where media plugin would modify links with the item _value in them.
+ Fixed so table width/height is better forced if inline_styles is enabled. Patch contributed by daKmoR.
+ Fixed css for IE 8 such as opacity and other rendering quirks.
+Version 3.2.0.2 (2008-10-02)
+ Fixed bug where the SelectBox and NativeSelectBox wasn't updated correctly if undefined was passed to them.
+ Fixed bug where the style dropdown wasn't correctly changed back to it's original state when element had no class.
+ Fixed bug where multiple pending font styles wasn't handled correctly.
+ Fixed so you can disable all auto css loading for dialogs by setting the popups_css option to false.
+Version 3.2.0.1 (2008-09-17)
+ Fixed bug where font sizes and faces wouldn't be changed correctly when there was a parent with a different style.
+ Fixed bug where adding fonts to the same selection would produce redundant spans.
+Version 3.2 (2008-09-11)
+ Added new text style support, it will now use span elements internally instead of font elements.
+ Added new improved support for the theme_advanced_font_sizes option, check the Wiki for details.
+ Added new keep_style setting that maintains the text style on return/enter on non IE browsers, enabled by default.
+ Added new onBeforeSetContent/onBeforeGetContent/onSetContent/onGetContent events to the Selection class.
+ Added new selectByIndex method to ListBox class. This enables you to select list items by an index instead of a value.
+ Added new possibility to the select method of the ListBox class. This can now have a selector function as it's value argument.
+ Added new possibility to skip the loading of popups css by setting the feature popup_css to the value false.
+ Added new possibility to skip translation of popups by setting the translate_i18n feature to false.
+ Added new element_format option enables you to produce HTML element endings instead of XHTML. But we are still in the XHTML is better camp.
+ Added missing allowfullscreen and quality options for flash elements, this will now get correctly stored.
+ Fixed bug where table cell dialog didn't close properly unless the accessibility_warnings option was set to false.
+ Fixed bug where the modal dialog blocker element for inlinepopups wasn't placed at a correct location if the page had scroll.
+ Fixed bug where non inline dialogs didn't close correctly if the inlinepopups plugin was used.
+ Fixed bug where non inline dialogs could make the modal dialog blocker to work incorrectly.
+ Fixed bug where style select wasn't populated correctly if you pressed the arrow. Patch by Hari Karam Singh.
+ Fixed bug where toggling the fullscreen mode didn't restore scrollbars on IE when the editor was inside a frame. Patch by Jacob Barrett.
+ Fixed bug where inserting flash contents using the template plugin didn't work correctly.
+ Fixed bug where inserting flash contents using the selection.setContent or mceInsertContent command didn't work correctly.
+ Fixed bug where IE would produce an exception if a comment started with -.
+ Fixed bug where the blockquote button would wrap lists incorrectly on non IE browsers.
+ Fixed bug where Opera would display BR elements in the element path.
+ Fixed bug where xhtmlxtras didn't insert elements correctly on IE.
+ Fixed bug where the buttons wasn't activated correctly in the xhtmlxtras plugin.
+ Fixed bug where adding an object as the style attribute for the dom setAttribs method wouldn't work.
+ Fixed bug where the background color would bleed out to parent container element in Gecko.
+ Fixed bug where the insert column actions for tables would fail if you did it in a thead or tfoot. Patch contributed by T Andersen (tan73).
+ Fixed bug where event blocker element wasn't positioned correctly for the inlinepopups plugin.
+ Fixed bug where pasting from Office 2007 would produce an odd comment in the contents.
+ Fixed bug where the paste as plain text could remove an extra character. Patch contributed by Speednet.
+ Fixed bug where some characters where missing for the paste_replace_list option. Patch contributed by Speednet.
+ Fixed bug where removing non existing editor instances by the mceRemoveControl command would produce an error.
+ Fixed bug where meta elements with the name description would produce errors in IE.
+ Fixed bug where color and background colors wouldn't be updated properly.
+ Fixed bug where the createMenuButton of tinymce.ControlManager didn't implement the last class argument.
+ Fixed bug where the editor_css option was relative from the TinyMCE installation directory not the current page.
+ Fixed bug where elements wouldn't be padded if the element contained bogus br elements. For example TD elements.
+ Fixed bug where parsing of <body > in fullpage plugin would produce an error.
+ Fixed bug where relative urls with just ./ would become an empty string.
+ Fixed bug where outdent button would be disabled if inline_styles where set to false.
+ Fixed bug where replace with an empty search string would produce an error on IE.
+ Fixed bug where restoring the overflow state of the body in fullscreen plugin running on IE would produce vertical scrollbars.
+ Fixed bug where pressing return/enter in list items would sometimes move the caret the to top of the content area in FF.
+ Fixed bug where the style listbox wouldn't be updated correctly if you used the use_native_selects option.
+ Fixed bug where WebKit browsers would produce a div element when ending list elements using return.
+ Fixed so translation of popup contents only occurs if it's needed.
+ Optimized the URI object in regards or converting absolute URIs to relative URIs.
+Version 3.1.1 (2008-08-18)
+ Added new getSize method to DOMUtils it will return the dimensions only of an element.
+ Added new alert/confirm methods to the tinyMCEPopup class to prevent focus problems and also to shorten method calls.
+ Added new plugin_preview_inline option to preview plugin to enable/disable native/inline dialogs.
+ Added new readonly option. If this is set the editor will only display the contents for the user.
+ Added missing tabindex and accesskey to input elements in the default valid_elements setup.
+ Updated firebug lite to 1.2, to enable it use the tiny_mce_dev.js?debug=1 on the development package.
+ Fixed so the preview dialog in the preview plugin uses inline dialogs/popups.
+ Fixed so CDATA sections remains intact through the serialization process of the DOM tree.
+ Fixed various issues with the getAttrib command. It will now return more correct values.
+ Fixed bug where the embed element wasn't properly parsed in the media plugin it now supports 3 formats.
+ Fixed bug where the noshade attribute was serialized incorrectly on IE.
+ Fixed bug where editing an existing link element didn't force it relative.
+ Fixed bug where image link creation fails on Safari if the image is aligned.
+ Fixed bug where it was possible to scroll the fullscreen mode in Opera 9.50.
+ Fixed bug where removal of center image alignment would fail. Patch contributed by Andrew Ozz.
+ Fixed bug where inlinedialogs didn't work properly if the doctype was incorrect in IE.
+ Fixed bug where cross domain loading didn't work correctly in Opera 9.50.
+ Fixed bug where breaking huge text blocks with return/enter key would scroll to end of block.
+ Fixed bug where replace button kept inserting the replacement text even if there is no more matches.
+ Fixed bug with fullpage plugin where value wasn't set correctly. Patch contributed by Pascal Chantelois.
+ Fixed bug where the dom utils setAttrib method call could produce an exception if the input was null/false.
+ Fixed bug where pressing backspace would sometimes remove one extra character in Gecko browsers.
+ Fixed bug where the native confirm/alert boxes would move focus to parent document if fired in dialogs.
+ Fixed bug where Opera 9.50 was telling you that the selection is collapsed even when it isn't.
+ Fixed bug where mceInsertContent would break up existing elements in Opera and Gecko.
+ Fixed bug where TinyMCE fails to detect some keyboard combos on Mac, contributed by MattyRob.
+ Fixed bug where replace all didn't move the caret to beginning of text before searching.
+ Fixed bug where the oninit callback wasn't executed correctly when the strict_loading_mode option was used, thanks goes to Nicholas Oxhoej.
+ Fixed bug where a access denied exception was thrown if some other script specified document.domain before loading TinyMCE.
+ Fixed so setting language to empty string will skip language loading if translations are made by some backend.
+ Fixed so dialog_type is automatically modal if you use the inlinepopups plugin use dialog_type : "window" to re-enable the old behavior.
+Version 3.1.0.1 (2008-06-18)
+ Fixed bug where the Opera line break fix didn't work correctly on Mac OS X and Unix.
+ Fixed bug where IE was producing the default value the maxlength attribute of input elements.
+Version 3.1.0 (2008-06-17)
+ Fixed bug where the paste as text didn't work correctly it encoded produced paragraphs and br elements.
+ Fixed bug where embed element in XHTML style didn't work correctly in the media plugin.
+ Fixed bug where style elements was forced empty in IE. The will now be wrapped in a comment just like script elements.
+ Fixed bug where some script elements wrapped in CDATA could fail to be serialized correctly.
+ Fixed bug where FF 3 produced -moz- internal styles in some style attributes.
+ Fixed bug where query strings and external URLs didn't work correctly in style attributes.
+ Fixed bug where shape attribute of area elements got serialized as rect regardless of it's initial value in IE 6.
+ Fixed bug where selection of elements inside layers would fail in IE since focus was moved to the document body.
+ Fixed bug where pressing enter/return in an editable select box would produce an __mce_add_custom__ class value.
+ Fixed bug where changing font size of text placed inside a colored text chunk would remove the parent node.
+ Fixed bug where Opera 9.5 final produced a strange line break behavior due to a workaround for previous Opera versions.
+ Fixed bug where text/background color would produce a strange focus problem when you tried to click on the body in IE.
+ Fixed issue where selecting the title of an listbox equals the old 2.x behavior of changing the value to an empty string.
+ Fixed issue where it was common for the media plugin to break if the _value attribute wasn't added for the param element.
+ Fixed issue where the wrong parent editor instance might be updated if you use fullscreen mode in an incorrect way.
+ Fixed issue where Safari was producing a warning about the base element not being closed correctly.
+ Removed redundant form element name matching from regexp in the DOMUtils class.
+Version 3.0.9 (2008-06-02)
+ Added new contextmenu_offset_x/contextmenu_offset_y options for the contextmenu plugin.
+ Added cite attribute to the default rule for the blockquote element.
+ Added support for using arrow keys for selection of items in listboxes.
+ Added support for using arrow keys for selection of items in dropmenus.
+ Fixed bug where blockformat change on elements with BR inside them didn't change correctly on Firefox.
+ Fixed bug where removing table rows inside thead or tfoot would remove the whole table if it was the last one.
+ Fixed bug where XHR synchronous mode didn't execute the callback handlers synchronously.
+ Fixed bug where setting border to 0 didn't add border: 0 to the style attribute when using the advimage dialog.
+ Fixed bug where the selection of images and table cells didn't work correctly when the editor is placed in a frame and running on IE.
+ Fixed bug where the store/restore of a selection didn't work correctly in non IE browsers.
+ Fixed bug where only the first element would be invalid for the invalid_elements option.
+ Fixed bug where paste as plain text didn't encode the characters correctly when they where inserted.
+ Fixed bug where HTML source window couldn't be maximized on Gecko when the maximizable feature was enabled.
+ Fixed bug where color selection using the color picker could produce exception in IE.
+ Fixed bug where font size changes could produce produce extra redundant elements.
+ Fixed bug where IE could produce unknown runtime error if you replaced a image with another image from a separate frame.
+ Fixed bug where the domLoaded state for the Event class wasn't set correctly if the editor was loaded dynamically using the gzip compressor.
+ Fixed bug where handling of the base element for a page would produce incorrect urls. Based on a patch contributed by John LeSueur.
+ Fixed bug where table constraint alert boxes was presented with an empty value and wasn't the skinned inline ones.
+ Fixed bug where the onChange event wasn't fired when the form was submitted. It's now also triggered when the save method is called.
+ Fixed bug where encoding set to xml didn't work as expected. It now encodes the contents into XML entities.
+ Fixed bug where numrows didn't work correctly for the merge cells dialog of the table plugin.
+ Fixed bug where the onGetContent event was fired even when the no_events flag was set.
+ Fixed bug where the preview panels for the advimage and the media plugin could overflow on Safari and FF 3.
+ Fixed bug where the editing and removal of abbr elements using the xhtmlxtras plugin working correctly on IE.
+ Fixed bug where save button in the save plugin didn't work correctly on IE.
+ Fixed bug where dragging layers didn't work as expected since it would snap back to it's original location if you saved.
+ Fixed bug where the description of the template plugin dialog wasn't updated correctly.
+ Fixed bug where the values for frame and rules in the table dialogs where swapped.
+ Fixed bug where the elements like ins, del, cite, acronym and abbr didn't have the default editing style as the old 2.x branch.
+ Fixed bug where ask mode would lock the focused textarea if you pressed cancel in the confirm dialog on FF 3.
+ Fixed bug where ask mode would produce contents for empty textareas if you reloaded the page.
+ Fixed so the onGetContent event gets the full pass through object just like the other events.
+ Fixed so attributes for block elements remains the same when you change format of a element.
+Version 3.0.8 (2008-04-30)
+ Fixed bug where IE would produce an error if textareas without names where converted.
+ Fixed bug where editor wasn't forced empty when there was only a single br or empty paragraph left.
+ Fixed bug where IE would produce an warning message if object elements where produced in the media plugins preview running on https.
+ Fixed bug where new addVer function didn't handle hash items correctly. Patch contributed by Mirek Burkon.
+ Fixed bug where font_size_style_values option wasn't applied correctly to fonts inside the editor.
+ Fixed bug where image selection could be lost if a image was edited using context menu on IE.
+ Fixed bug where style values wasn't updated properly due to an invalid regexp.
+ Fixed bug where IE 6 where displaying warning message about insecure items when inserting an image while using https. Patch contributed by Norifumi Sunaoka.
+ Fixed bug where IE was producing an auto save message if you selected a color from the color split button.
+ Fixed bug where backspace sometimes would move the caret to the end of the previous block in Gecko.
+ Fixed bug where the rowlayout manager didn't work as described in the documentation.
+ Fixed bug where the default options for the fullpage plugin wasn't applied correctly.
+ Fixed bug where selection would jump one character if you applied a styles to a words in non IE browsers.
+ Fixed bug where undo levels wasn't added correctly if you went back in undo history and added a new event.
+ Fixed bug where font size dropdown didn't mark the selected size in IE.
+ Fixed bug where the size of the editor was determined using clientWidth instead of offsetWidth.
+ Fixed so the onchange event doesn't fire on the initial undo level, it will also fire when the editor is blurred.
+ Fixed so the advhr plugin produces XHTML valid output instead of non standard attributes.
+ Fixed so blockquote gets converted into [quote] in when the bbcode plugin is enabled.
+ Fixed so theme_advanced_font_sizes can be named for example Font 1=1, Font 2=2 etc.
+ Fixed so editor_selector/editor_deselector can be regexps. By default only strings are allowed not part regexps like before.
+ Fixed so that the version suffix is optional. It still requires the build process so you need to export it manually.
+ Fixed so it's possible to tab to table cells in non Gecko browsers and also produce new rows if you tab at the end of a table. Contributed by Josh Peek.
+Version 3.0.7 (2008-04-14)
+ Added new version suffix to all internal GET requests to make sure that the users cache gets cleared correctly.
+ Fixed issue with isDirty returning true event if it wasn't dirty on IE due to changes in tables during initialization.
+ Fixed memory leak in IE where if a page was unloaded before all images on the page was loaded it would leak.
+ Fixed bug in IE where underline and strikethrough could produce an exception error message.
+ Fixed bug where inserting paragraphs in totally empty table cells would produce odd effects.
+ Fixed bug where layer style data wasn't updated correctly due to some performance enhancements with the DOM serializer.
+ Fixed bug where it would convert the wrong element if there was two elements with the same name and id on the page.
+ Fixed bug where it was possible to add style information to the body element using the style plugin.
+ Fixed bug where Gecko would add an extra undo level some times due to the blur event.
+ Fixed bug where the underline icon would get active if the caret was inside a link element.
+ Fixed bug where merging th cells not working correctly. Patch contributed by André R.
+ Fixed bug where forecolorpicker and backcolorpicker buttons where rendered incorrectly when the o2k7 skin was used.
+ Fixed bug where comment couldn't contain -- since it's invalid markup. It will now at least not break on those invalid comments.
+ Fixed bug where apos wasn't handled correctly in IE. It will now convert apos to ' on IE since that browser doesn't support that entity.
+ Fixed bug where entities wasn't encoded correctly inside pre elements since they where protected from whitespace removal.
+ Fixed bug where color split buttons where rendered incorrectly on IE6 when using the non default theme.
+ Fixed so caret is placed after links ones they are created, to improve usability of the editor.
+ Fixed so you can select tables by clicking on it's borders in non IE browsers to normalize the behavior.
+ Fixed so the menus can be toggled by clicking once more on the icon in listboxes, menubuttons and splitbuttons based on code contributed by Josh Peek.
+ Fixed so buttons can be labeled, currently only works with the default skin, so it's kind of experimental. Patch contributed by Daniel Insley.
+ Fixed so forecolorpicker and backcolorpicker remembers the last selected color. Patch contributed by Shane Tomlinson.
+ Fixed so that you can only execute the mceAddEditor command once for the same instance name.
+ Fixed so command functions added with addCommand can pass though the call to default handles if it returns true.
+Version 3.0.6.2 (2008-04-07)
+ Fixed bug where empty tables couldn't be edited correctly on non IE browsers if they where loaded into the editor.
+ Fixed bug where it was impossible to resize layers correctly in IE since it thought it was an image.
+ Fixed bug where an editor instance was stealing focus in IE resulting in a scroll to the editor on page reloads.
+ Fixed bug where Safari was crashing on Mac OS X if you closed dialogs using the Esc key.
+Version 3.0.6.1 (2008-04-04)
+ Added support for the missing mceAddFrameControl command. The input for this command has changed so consult the Wiki.
+ Fixed bug where sub menus for the drop menus would leave an empty element behind.
+ Fixed memory leak in IE if the editor was placed in a frame or iframe.
+Version 3.0.6 (2008-04-03)
+ Added elements to the default value of valid_elements option. It now contains all XHTML strict elements and a few transitional.
+ Added more accessibility fixes, it's now possible to navigate and close list boxes and split button menus with the keyboard.
+ Added missing getInfo method to the contextmenu and safari plugin, this caused problems for the Drupal module.
+ Added new inlinepopups_zindex option to the inlinepopups plugin so that you can configure the default start z-index.
+ Added new setControlType method to the tinymce.ControlManager class. This method enables you to override the default classes.
+ Added ability to specific an optional control class to use instead of the default one for the ControlManager methods. Based on concept by Josh Peek.
+ Fixed bug where attribute rules for the DOM Serializer couldn't contain - or _ characters in their names.
+ Fixed bug where inlinepopups event blocker and modal dialog blocker elements produced vertical scrollbars.
+ Fixed bug where there was a rendering issue with quirks mode in Safari moving the resize handle to an incorrect position.
+ Fixed bug with forecolor/backcolor controls on IE. Sometimes elements positioned relative will generate display errors.
+ Fixed bug where a p2 was leaking out in the global name space when you selected a color from the forecolor/backcolor controls.
+ Fixed bug where empty paragraphs didn't work as expected in browsers other than IE.
+ Fixed bug where the load method of the tinymce.dom.ScriptLoader didn't check if the file was already loaded.
+ Fixed bug where the load method for the PluginManager and ThemeManager didn't check if a plugin/theme by a specific name was all ready loaded.
+ Fixed bug where the theme_advanced_link_targets option didn't work correctly with the advanced themes link dialog. Patch contributed by Arnold B.
+ Fixed bug where the style command would merge classes into empty span elements.
+ Fixed bug where the style command would remove empty span elements outside the current selection.
+ Fixed bug where the fix for the Safari backspace bug removed all editor contents if it was filled with empty paragraphs.
+ Fixed bug where alert and confirm boxes opened by the inlinepopups plugin would produce an exception if domain relaxing was used.
+ Fixed bug where Safari was adding style attributes to all elements when you paste them into the editor.
+ Fixed bug where the spellchecker menus was visually incorrect since the space for the non existing icon was still there.
+ Fixed bug where remove_linebreaks option didn't remove line breaks inside the text contents of a element.
+ Fixed bug where Safari 3.1 was introducing _mc_tmp into paragraphs due to the new querySelectorAll and a TinyMCE specific workaround.
+ Fixed bug where getParam method in the Editor class was returning incorrect objects and would mess up the font drop down. Patch contributed by speednet.
+ Fixed bug where the table dialog would produce an exception in IE when you edited tables since it tried to place focus in a disabled field.
+ Fixed bug where class attribute on some span elements was removed on cleanup.
+ Fixed bug where resizing the editor in IE could produce an exception if the editor width/height got to be a negative value.
+ Fixed bug where wmv files wouldn't play since the src param was used instead of the url param.
+ Fixed bug where br elements would be added here and there in Gecko. Geckos internal _moz_dirty br elements where serialized as well.
+ Fixed bug where editing named anchors would produce two anchors instead of one updated one.
+ Fixed bug where arrow and function keys didn't work when an noneditable element was focused within the editor.
+ Fixed bug where the dispatcher could produce an exception if the listener list was altered inside an event callback.
+ Fixed bug where it was impossible to totally empty the editor contents on Safari due to an mistreatment of nbsp as whitespace. Patch contributed by Andrew Ozz.
+ Fixed bug where TinyMCE would not convert textareas with the same name attribute value. It will now generate an unique id for those textareas.
+ Fixed bug where backspace/delete key was deleting td elements inside tables while running on Gecko.
+ Fixed bug where Firefox 3.0b4 and Opera 9.26 where scrolling to the top of document when pressing return/enter.
+ Fixed bug where the template plugin wasn't just inserting the mceTmpl tagged element.
+ Fixed bug where the alert method of the default WindowManager implementation didn't translate input language strings like the inlinepopups dialog does.
+ Fixed bugs with the backspace behavior in Gecko. The caret was placed on incorrect locations in the DOM sometimes.
+ Fixed so advimage dialog and table dialogs has support for editable select boxes for the class value.
+ Fixed so the media, pagebreak and spellchecker doesn't load it's default content.css file if the content_css option is set to false.
+ Fixed so the paste_use_dialog option works again it's enabled by default but can be disabled on IE. Patch contributed by Speednet.
+ Fixed so that the fullscreen editor is focused when switching fullscreen editing on.
+ Fixed so it's possible to edit images and links inside tables using the context menu.
+ Fixed so table dialogs and the advanced image dialog doesn't loose selection in IE if the dialogs where navigated/submitted with the keyboard.
+ Fixed so the theme_advanced_blockformats options can have named items for example title 1=h1;title 2=h2.
+ Fixed so it's possible to add a custom editor_css for the simple theme.
+ Fixed quirks with directionality rtl, patch contributed by Andrew Ozz.
+ Fixed so the inlinepopups default start zIndex is 300000.
+ Fixed typo in media plugin Shockware is now replaced with Shockwave.
+ Fixed psuedo memory leak in IE with the replaceChild method inside the DOMUtils.replace method.
+ Fixed so memory is released when an editor instance is removed from page.
+ Optimized the color split button menus so that they use less event handlers.
+ Removed the util/mclayer.js file since it's no longer used by any of the TinyMCE dialogs and is considered deprecated.
+Version 3.0.5 (2008-03-12)
+ Added new black skin variant to the o2k7 skin contributed by Stefan Moonen.
+ Added new explode method to the tinymce core class. This does a split but removed whitespace it also defaults to a , delimiter.
+ Added new detection logic for IE 8 standards mode into the DOMUtils class strMode can now be checked to see if that mode is on/off.
+ Added new noscale option value for the scale select box for Flash in the media plugin.
+ Fixed bug where the menu for the ColorSplitButton wasn't removed when the editor was removed.
+ Fixed bug where font colors couldn't be edited correctly since the style of the element didn't get updated correctly.
+ Fixed bug where class of elements would get lost when TinyMCE was fixing incorrect HTML markup.
+ Fixed bug where table editing would produce double height values.
+ Fixed bug where width style value wouldn't be removed if you switched width unit from cm/em to pixels or percent.
+ Fixed bug where the search/replace input box wasn't auto focused like the other dialogs.
+ Fixed bug where the old mceAddControl command would use the fullscreen settings next time it created an instance.
+ Fixed bug where multiple lines where added to the target cell if you merged multiple empty cells.
+ Fixed bug where drop down menus would be incorrectly positioned inside scrollable divs.
+ Fixed bug where the separators of the silver skin variant didn't display correctly in IE 6.
+ Fixed bug where createStyleSheet seems to load scripts at opposite order in some IE versions.
+ Fixed bug where directionality could produce odd results for the UI and the dialogs.
+ Fixed bug where the DOM serializer wouldn't serialize custom namespaced attributes in IE 6 using the *[*] valid elements rule.
+ Fixed bug where table caption would be inserted after the thead element if you swapped a tr to be inside the thead.
+ Fixed bug where the youtube detection logic for the media plugin was to generic.
+ Fixed so the deprecated and undocumented theme_advanced_path_location set to none won't hide the whole statusbar.
+ Fixed so most input lists can have whitespace in them they are now split using the new tinymce.explode method.
+ Fixed so the popup_css and popup_css_add URLs are relative to where the current document is located.
+ Fixed various bugs and quirks with the store/restore selection logic.
+ Fixed so the editor starts in IE 8 standards mode but still that browser is very very buggy.
+ Fixed so dialog_type set to modal will block the background and other inline windows and only give access to the front most window.
+Version 3.0.4.1 (2008-03-08)
+ Fixed critical bug where it was impossible to edit images when inlinepopups where used due to lost selection in IE.
+Version 3.0.4 (2008-03-07)
+ Added new option constrain_menus, this enables you to force view port constraints on all menus. Contributed by Shane Tomlinson.
+ Fixed bug where table background wasn't visible inside the editor due to a default CSS rule overriding the style attribute.
+ Fixed bug where links would get a null class added if no styles was used in IE.
+ Fixed bug where spellchecker was auto focusing the editor in IE.
+ Fixed bug where document.domain would produce invalid argument if the editor was loaded in IE6 over a network UNC path.
+ Fixed bug where table height attribute was used, this is deprecated in XHTML so it now adds it as an style.
+ Fixed bug where textareas with style values would produce error in IE.
+ Fixed so the first element in each dialog is focused by default to enhance keyboard usage.
+ Fixed so you can add a mceFocus class to elements to make it auto focused.
+ Fixed so you can close dialogs using the esc key.
+ Fixed so you can press return/enter to submit the action of each dialog.
+ Fixed so tabbing inside an inline popups wont focus the resize anchor elements.
+ Fixed so you can press ok in inline alert messages using the return/enter key.
+ Fixed so textareas can be set to non px or % sizes for example em, cm, pt etc.
+ Fixed so non pixel values can be used in width/height properties for tables.
+ Fixed so the custom context menu can be disabled by holding down ctrl key while clicking.
+ Fixed so the layout for the o2k7 skin looks better if you don't have separators before and after list boxes.
+ Fixed so the sub classes get a copy of the super class constructor function to ease up type checking.
+ Fixed so font sizes for the format block previews are normalized according to http://www.w3.org/TR/CSS21/sample.html (it can be overridden).
+ Fixed so font sizes for h1-h6 in the default content.css is normalized according to http://www.w3.org/TR/CSS21/sample.html (it can be overridden).
+Version 3.0.3 (2008-03-03)
+ Fixed bug where an error about document.domain would be thrown if TinyMCE was loaded using a different port.
+ Fixed bug where mode exact would convert textareas without id or name if the elements option was omitted.
+ Fixed bug where the caret could be placed at an incorrect location when backspace was used in Gecko.
+ Fixed bug where local file:// URLs where converted into absolute domain URLs.
+ Fixed bug where an error was produced if a editor was removed inside an editor command.
+ Fixed bug where force_p_newlines didn't effect the paste plugin correctly.
+ Fixed bug where the paste plugin was producing an exception on IE if you pasted contents with middots.
+ Fixed bug where delete key could produce exceptions in Gecko sometimes due to the fix for the table cell bug.
+ Fixed bug where the layer plugin would produce an visual add class called mceVisualAid this one is now renamed to mceItemVisualAid to mark it internal.
+ Fixed bug where TinyMCE wouldn't initialize properly if ActiveX controls was disabled in IE.
+ Fixed bug where tables and other elements that had visual aids on them would produce an extra space after any custom class names.
+ Fixed bug where search with an empty string would produce some odd "invalid pointer" error in IE.
+ Fixed bug where elements like menus where placed at incorrect positions in Opera 9.26.
+ Fixed bug where IE was loosing focus of the editor when you clicked some dropmenu and if it was placed in a frame or iframe.
+ Fixed bug where focus of images could be lost in IE if you focused the accessibility confirm dialog in the advimage plugin.
+ Fixed bug where nestled font elements would produce odd output like missing font elements.
+ Fixed bug where text colors and styles got removed if invalid_elements included the font element.
+ Fixed bug where text-decoration set to underline or line-through would remove other styles from span elements.
+ Fixed bug where editor contents like \n\n would be incorrectly handled and processed as real line feeds.
+ Fixed bug where incorrectly encoded urls with ampersands in them would be decoded incorrectly.
+ Optimized the DOMUtils decode method to be a lot faster if the string doesn't have any entities to decode.
+Version 3.0.2.1 (2008-02-26)
+ Fixed alert/confirm dialogs so they display correctly.
+Version 3.0.2 (2008-02-26)
+ Added new body_id option that enables you to specify the id of the body inside the editor iframe based on ideas by David Bildström (ChronoZ).
+ Added new body_class option that enables you to set the class for the body of the editor iframe based on ideas by David Bildström (ChronoZ).
+ Added new CSS class to the default content.css files mceForceColors that forces white background and black text can be used with the body_class option.
+ Added new type parameter to the Editor.getParam function to reduce redundant logic for parsing hash tables.
+ Added new isDone method to the ScriptLoaded class, this enables you to check if a script has been loaded or not.
+ Added new resizeTo and resizeBy methods for the advanced theme. Can be called using tinyMCE.activeEditor.theme.resizeTo(w, h);
+ Added new skin_variant option this can be used to extend existing skins with slight modifications like color.
+ Added new variant of the o2k7 skin called "silver" based on a contribution made by Stefan Moonen.
+ Fixed bug where the template plugin might produce errors if the template_mdate_classes wasn't configured.
+ Fixed bug where the media plugin didn't convert the URLs for movies once they where inserted.
+ Fixed bug where the style field for the advlink dialog didn't work correctly if you edited an existing link.
+ Fixed bug where alignment of toolbars would fail in editor was uses in a quirks mode on IE, fix contributed by Peter Wood & Art Lawry.
+ Fixed bug where initialization of multiple editors at the same time using the mceAddControl method would produce errors.
+ Fixed bug where initialization of editors using mceAddControl command or new tinymce.Editor calls would fail during page load.
+ Fixed bug where the check for domain relaxing could fail if the document.domain property was changed by another script.
+ Fixed bug where textareas couldn't be named description or any other name that matches the meta elements in IE and Opera.
+ Fixed bug where the element path would fail sometimes in IE due to "unknown runtime error" on innerHTML.
+ Fixed bug where Safari would crash if you was hiding the editor before serializing the contents.
+ Fixed bug where the editor wasn't scaled propertly in fullscreen mode using the old fullscreen_new_window option.
+ Fixed bug where render method didn't load language packs in IE and Opera if you rendered an editor during page load.
+ Fixed bug where resizing the browser window in fullscreen didn't resize the editor.
+ Fixed bug where the blockquote command didn't move the caret inside the new empty blockquote if you used it on an empty document.
+ Fixed bug where auto in a style width/height for the textarea would produce an editor with the size value of 100. Fix contributed by Shane Tomlinson.
+ Fixed bug where restoration of selection at the beginning of an element could fail in Gecko.
+ Fixed bug where caret restoration after a cleanup could place the it at an incorrect location.
+ Fixed bug where delete key inside td elements would delete the cell in Gecko.
+ Fixed so the blockquote button toggles individual lines. This behavior is a bit more like the old indentation behavior in the 2.x branch.
+ Fixed so the dialog language packs only gets loaded the first time you open a dialog.
+ Fixed so all classes in the whole UI is prefixed with "mce" to avoid collisions, use the skin converter to update your existing skins.
+ Fixed so all classes in the inlinepopups logic is prefixed with "mce" to avoid collisions, use the skin converter to update your existing skins.
+ Fixed so that the window in fullscreen mode can be resized when fullscreen_new_window option is enabled.
+ Fixed so blockquote elements are formatted in the source output with an linefeed before and after it.
+ Optimized the editor initialization by reducing the number of calls to getBookmark/moveToBookmark.
+Version 3.0.1 (2008-02-21)
+ Added spellchecker plugin into the main package, but without any backend can be specified with the spellchecker_rpc_url option.
+ Added src attribute for script elements to the default valid_elements option value.
+ Added extra parameter to the class_filter callback it can now also filter out classes based on the whole CSS rule.
+ Added support for domain relaxing, TinyMCE can now be loaded from an remote domain as long as they are on the same root domain.
+ Added support for custom elements the new custom_elements option enables you to add non HTML elements to the editor.
+ Added support for the W3C Selectors API that was added to latest nightly build of WebKit.
+ Fixed bug where some object param element wasn't stored correctly using the media plugin.
+ Fixed bug where Opera was scrolling to top of page is drop menus on list boxes where displayed.
+ Fixed bug where IE6 was crashing if a format block was used on a container with anchor elements.
+ Fixed bug where spans with font sizes wasn't handled correctly when editor was loading contents.
+ Fixed bug where mode exact couldn't convert editors with name only. Id is no longer required but recommended.
+ Fixed bug where the mceInsertRawHTML command produced an extra undo level.
+ Fixed bug where the specific_textareas mode didn't work correctly this is the same thing as textareas now.
+ Fixed bug where the values of input elements in the HTML page of dialogs pages where changed in IE.
+ Fixed bug where fullscreen and fullpage plugins didn't work well together.
+ Fixed bug where embed elements wasn't handled properly in the media plugin.
+ Fixed bug where style information on span elements gets munged when fonts are converted to spans.
+ Fixed bug where some entities in element attributes where encoded incorrectly in the latest WebKit build.
+ Fixed bug where initialization would fail in IE if there where two input elements with the name submit in the form.
+ Fixed bug where fullscreen mode didn't work correctly in IE when the fullscreen_new_window option was used.
+ Fixed bug where invalid contents like an ul inside a p element would produce odd results in IE.
+ Fixed bug where Opera 9.2x was placing the drop menus at incorrect locations if the editor was placed in a table.
+ Fixed bug where Opera was producing odd results if enter/return was pressed while having forced_root_blocks disabled.
+ Fixed bug where layer plugin was stealing focus in IE on initialization.
+ Fixed bug where body attributes wasn't set properly in the fullpage plugin, fix contributed by Hiroaki Kawai.
+ Fixed bug where insert image and insert link dialogs where producing an extra level in the undo history.
+ Fixed bug where Gecko would produce an error if empty elements like <div></div> where inserted using mceInsertContent.
+ Fixed bug where center alignment of images produced odd results inside table cells.
+ Fixed bug where center alignment of images couldn't be toggled correctly.
+ Fixed bug where alignment of images inside tables would produce double float style items in IE if the fix_table_elements option was enabled.
+ Fixed bug where a variable called 'v' was polluting the global namespace. Objects tinymce and tinyMCE are the only ones allowed to be global.
+ Fixed bug where insert table from context menu couldn't insert new tables inside existing tables.
+ Fixed bug where Safari wouldn't produce br elements on enter when the force_br_newlines option was enabled.
+ Fixed bug where switching cell type in table cell dialog would produce odd attributes in IE.
+ Fixed bug where Gecko was outputting internal attributes if valid_elements where set to "*[*]".
+ Fixed bug where the style plugin would produce non hex colors inside the dialog when running on Gecko.
+ Fixed bug where an empty src value for insert image would remove the currently selected image if it wasn't and image element.
+ Fixed bug where hidden input elements would break the logic for the tab_focus option.
+ Fixed bug where save button wasn't working correctly in fullscreen mode.
+ Fixed bug where the editor was forced to be placed in a form element if the save_onsavecallback option was used.
+ Fixed bug where upper case param attributes wasn't parsed correctly in the media plugin.
+ Fixed bug where render method of tinymce.Editor class would produce an exception if the strict_loading_mode option was omitted.
+ Fixed bug where nodeChanged event could be fired while the editor was loading and there for produce an exception in FF.
+ Fixed bug where no undo levels where added if the user created new table rows using the tab key on Gecko.
+ Fixed bug where tables would be broken if you selected a different block format for contents withing an table cell.
+ Fixed bug where the render method of the tinymce.Editor class didn't setup the tinymce.EditorManager.settings object correctly.
+ Fixed bug where the advanced image dialog would go to the first tab if the alternative image was changed using the file browser link.
+ Fixed bug where the forced_root_block option would produce BR elements inside empty blocks if the block wasn't a paragraph.
+ Fixed bug where the forced_root_block doesn't work correctly on IE if the specified element was something else than paragraphs.
+ Fixed bug where selection of images would get lost if user selected something from the context menu in IE.
+ Fixed bug where the context menu plugin would pollute the global namespace with two variables p1 and p2.
+ Fixed compatibility issue with Mootools, it is destroying document.getElementById on unload in IE. (Mantra: You don't own the internal objects).
+ Fixed bugs where dialogs/tabs and other UI elements where rendered incorrectly in Firefox 3.
+ Fixed so the auto CSS class importer is compatible with 2.x.
+ Fixed so the editor UI and inlinedialogs works correctly with the YUI CSS reset package.
+ Fixed so header and footer elements are forced to lower case when the fullpage plugin is used.
+ Fixed so load prefixes "-" for plugins and themes isn't required if the plugin/theme was loaded by the ThemeManager/PluginManager.
+ Fixed so the JSONRequest uses application/json content type to make Ruby on rails happy.
+ Fixed so the CSS rule is more exact for the body in the default content.css files. Body is now defined as "body.mceContentBody" instead of just "body".
+ Fixed so the tiny_mce_dev.js uses XHR instead of document.write to load scripts to resolve an issue with Opera 9.50.
+ Fixed so language pack loading can be disabled by setting the language option to false. Can be useful for systems with their own language pack management.
+Version 3.0 (2008-01-30)
+ Added map and area elements to the default valid_elements list and also some indentation rules.
+ Fixed bug where empty paragraphs wasn't padded when loading contents.
+ Fixed bug where the RowLayout manager didn't work at all.
+ Fixed bug where style attribute data would get messed up in advimage dialog.
+ Fixed bug where the table dialogs class select wasn't updated correctly.
+ Fixed bug where elements would get extra whitespace around on insert when body was present in valid_elements.
+ Fixed bug where coords attribute of the area element wasn't handled properly in IE.
+ Fixed bug where Safari didn't produce BR elements on shift+return.
+ Fixed bug where force blocks would cast odd invalid attribute exception in IE.
+ Fixed bug where media plugin would produce extra whitespace before and after objects.
+ Fixed bug where cleanup_callback could break the contents of the editor. But use the new event system instead of this option.
+ Fixed bug where the tab_focus option didn't work between editor instanced. You can now tab between editors.
+ Fixed bug where the load function of the ScriptLoader class didn't load single files without the load que as it was supposed to.
+ Fixed bug where the execcommand_callback parameter order was incorrect. Recommendation use the new addCommand method.
+ Fixed bug where range.select calls sometimes failed on some IE versions.
+ Fixed bug where Safari was scrolling to top of document when enter/returned was pressed.
+ Fixed bug where fullscreen_new_window option didn't work correctly.
+ Fixed bug where the nonbreaking plugin inserted an space instead of an non breaking space the first time.
+ Fixed bug where the visualization of non breaking spaces where visual in element path.
+ Fixed so the focus is restored to the editor after inserting an custom character.
+ Fixed so the isNotDirty state is set to false if a new undo level is added.
+ Fixed so pointless style information for borders gets removed in IE.
+ Fixed so the resize button has a se-resize cursor css value.
+Version 3.0rc2 (2008-01-18)
+ Added new fix_nesting option to fix bug #1867292, this is disabled by default.
+ Added new indentation option enables you to specify how much each indent/outdent call will add/remove.
+ Added easier support for enabling/disabling icon columns on drop menues.
+ Added new menu button control class. This control is very similar to the splitbutton but without any onclick action.
+ Added support for previous tab focus (shift+tab). The tab_focus setting now takes two items next and previous element.
+ Fixed bug where iframes inside the editor got removed in Firefox on initial load.
+ Fixed bug where the CSS for abbr elements wasn't applied correctly in IE.
+ Fixed bug where mceAddControl on element inside a hidden container produced errors.
+ Fixed bug where closed anchors like <a /> produced strange results.
+ Fixed bug where caret would jump to the top of the editor if enter was pressed a the end of a list.
+ Fixed bug where remove editor failed if the editor wasn't properly initialized.
+ Fixed bug where render call on for a non existing element produced exception.
+ Fixed bug where parent window was hidden when the color picker was used in a non inlinepopups setup.
+ Fixed bug where onchange event wasn't fired correctly on IE when color picker was used in dialogs.
+ Fixed bug where save plugin could not save contents if the converted element wasn't an textarea.
+ Fixed bug where events might be fired even after an editor instance was removed such as blur events.
+ Fixed bug where an exception about undefined undo levels could be throwed sometimes.
+ Fixed bug where the plugin_preview_pageurl option didn't work.
+ Fixed bug where adding/removing an editor instance very fast could produce problems.
+ Fixed bug where the link button was highlighted when an anchor element was selected.
+ Fixed bug where the selected contents where removed if a new anchor element was added.
+ Fixed bug where splitbuttons where rendered one pixel down in the default theme.
+ Fixed bug where some buttons where placed at incorrect positions in the o2k7 theme.
+ Fixed bug that made it impossible to visually disable a custom button that used an image instead of CSS sprites.
+ Fixed bug where it wasn't possible to press delete/backspace if the editor was added+removed and re-added due to a FF bug.
+ Fixed bug where an entities option with only 38,amp,60,lt,62,gt would fail in IE.
+ Fixed bug where innerHTML sometimes generated unknown runtime error on IE.
+ Fixed bug where content_css files wasn't loaded in the template preview iframe.
+ Fixed bug where scroll position was incorrect when toggling fullscreen mode.
+ Fixed bug where restoration of overflow didn't work correctly when disabling fullscreen mode in Opera.
+ Fixed bug where drop menus where places at incorrect locations if the editor was placed in a scrollable container element.
+ Fixed bug where hideMenu didn't hide sub menus correctly. It will now hide all menus recursively.
+ Fixed so theme_advanced_path_location can be used in init options for compatibility reasons.
+ Fixed so the drop menu colors matches the rest of o2k7 theme.
+ Fixed so the preview example.html file is updated to the new 3.x API.
+ Fixed so the margins are the same by default inside the editable area between IE and other browsers.
+ Fixed so editor contents gets stored before it the onSubmit event is fired.
+Version 3.0rc1 (2008-01-08)
+ Added new classes for toolbar rows in advanced theme mceToolbarRow1..n enabled you to change appearance of individual rows.
+ Added auto detection for the strict_loading_mode option when running in application/xhtml+xml mode on Gecko.
+ Optimized the HTML serializer by bundling some post process methods together.
+ Fixed so that the toolbars have unique IDs, enables you to alter the toolbars using the ControlManager and the DOM.
+ Fixed bug where delta values for dialog sizes in language packs didn't work correctly due to missing string to number casting.
+ Fixed bug where paragraph generation logic didn't handle hr or table elements correctly if they where the only element.
+ Fixed bug where some elements got extra linebreaks added after or before it in HTML output.
+ Fixed bug where it was hard to modify existing style data on table rows and table cells.
+ Fixed bug where the dom.getRect method didn't handle non pixel values correctly.
+ Fixed bug where strikethrough and underline couldn't be toggled on existing span elements.
+ Fixed bug where the postprocessor searched for nsbp instead of nbsp entities.
+ Fixed bug where it was impossible to edit links that had child elements within them.
+ Fixed bug where it was possible to click on the parent item of a submenu.
+ Fixed bug where mouseover/mouseout images couldn't be removed in advimage dialog.
+ Fixed bug where drop menus didn't work when running in application/xhtml+xml mode.
+ Fixed bug where Opera added doctype to output in application/xhtml+xml mode.
+ Fixed bug where some DOM methods didn't work correctly in the application/xhtml+xml mode.
+ Fixed bug where the inlinepopups didn't work correctly in the application/xhtml+xml mode.
+ Fixed bug where the ColorSplitButton didn't display correctly in the application/xhtml+xml mode.
+ Fixed bug where the UI layout was incorrect on Gecko browsers when running in application/xhtml+xml mode.
+ Fixed bug where the word paste plugin produced exception while running in application/xhtml+xml mode.
+ Fixed bug where there wasn't any hidden input element generated for divs while running in application/xhtml+xml mode.
+ Fixed bug where indentation of script/style/pre elements where incorrect.
+ Fixed bug where script element contents was removed in IE.
+ Fixed bug where script element contents got entity encoded.
+ Fixed bug where you couldn't edit existing element styles using the styles plugin.
+ Fixed bug where styles wasn't updated properly sometimes due to an performance enhancement.
+ Fixed bug where font sizes couldn't be changed using the style plugin.
+ Fixed bug where an error was produced in Gecko browsers when switching back from fullscreen mode.
+ Fixed bug where Opera was producing br elements after elements like h3.
+ Fixed bug where TinyMCE couldn't be loaded on a page using - characters in it's URL.
+ Fixed bug where the editor container element was forced to have a specific name.
+ Fixed bug with force_br_newlines option on Firefox, even though it should never be used (Read FAQ).
+ Fixed bug where onclick event had an return true; prefix added when creating an popup.
+ Fixed bug where the theme_advanced_statusbar_location option couldn't handle the value "none".
+ Fixed issue with URLs with multiple at characters for example an Zope URI.
+ Fixed so simple and advanced themes doesn't collide.
+ Fixed so a elements gets removed when the href field is left empty, the href attribute is required in a link after all.
+ Fixed so img elements gets removed when the src field is left empty, the src attribute is required for all images after all.
+ Removed the indent and encode methods from the tinymce.dom.Serializer class due to performance enhancement and reduction of the API size.
+Version 3.0b3 (2007-12-14)
+ Added new getElement method to Editor class, returns the element that was replaced with the editor instance.
+ Added new unavailable prefix for disabled controls for accessibility reasons.
+ Fixed bug where regexp patterns couldn't be used for the editor_selector/editor_deselector options.
+ Fixed bug where the DOM wasn't properly initialized before the onInit event was executed in popups.
+ Fixed bug where font sizes where reduced by font size actions on previous spans in Safari.
+ Fixed bug where HR elements got places at the wrong location in IE.
+ Fixed bug where align/justify didn't work correctly on multiple paragraphs.
+ Fixed bug with missing translation for cell scope settings.
+ Fixed bug where selection/caret position was lost on some table actions.
+ Fixed bug where editor instances couldn't be added to hidden div elements.
+ Fixed bug where list elements in Safari would get an odd ID attribute.
+ Fixed bug where IE would return <html/> when the editor was completely empty.
+ Fixed bug where accessibility title attribute for access keys wasn't setup properly.
+ Fixed bug where forecolorpicker and backcolorpicker control names wasn't working.
+ Fixed bug where inserting template content didn't work in Safari due to selection exception.
+ Fixed bug where absolute URLs to remote hosts couldn't be used for background images.
+ Fixed bug where mysterious span elements where produced in Safari when injecting HTML contents.
+ Fixed bug where the media plugin didn't work correctly on the latest Opera 9.24.
+ Fixed bug where indentation of HTML output wasn't applied to all block elements.
+ Fixed bug where Safari was production DOM exception if you pressed enter in an empty editor.
+ Fixed bug where media plugin didn't parse script tags correctly patch contributed by Mathieu Campagna.
+ Fixed bug where the drop menus of list boxes like blockformat could produce scrolling of the page.
+ Fixed bug where the drop menus where placed at an incorrect location if TinyMCE was placed in a scrollable div.
+ Fixed bug where submit buttons couldn't be named submit, it's not recommended to name submit buttons submit anyway.
+ Fixed bug where the stylelistbox produced an exception if there was only one class in the list box.
+ Fixed bug where the stylelistbox wasn't updated correctly when the current class was removed.
+ Fixed bug where the formatblock command sometimes removed the body element.
+ Fixed bug where fullscreen switching in IE sometimes produced an exception when the spellchecker plugin was enabled.
+ Fixed issue where FF produced an empty paragraph when the editor was completely empty.
+ Fixed issue with size of image dialog in the advanced theme.
+ Fixed issues with the bbcode plugin it now also handles spans and the [font] rule.
+ Fixed so the style compression feature is a bit smarter to resolve issues with Opera.
+ Reintroduced the remove_linebreaks option, this is enabled by default.
+Version 3.0b2 (2007-11-29)
+ Added type and compact attributes to the default valid_elements list for the ul and ol elements.
+ Added missing accessibility support to native list boxes in both the toolbar and dialogs.
+ Added missing access key for the element path for accessibility reasons.
+ Fixed support for loading themes from external URLs.
+ Fixed bug where setOuterHTML didn't work correctly when multiple elements where passed to it.
+ Fixed bug with visualchars plugin was moving elements around in the DOM.
+ Fixed bug with DIV elements that got converted into editors on IE.
+ Fixed bug with paste plugin using the old event API.
+ Fixed bug where the spellchecker was removing the word when it was ignored.
+ Fixed bug where fullscreen wasn't working properly.
+ Fixed bug where the base href element and attribute was ignored.
+ Fixed bug where redo function didn't work in IE.
+ Fixed bug where content_css didn't work as previous 2.x branch.
+ Fixed bug where preview dialog was throwing errors if the content_css wasn't defined.
+ Fixed bug where the theme_advanced_path option didn't work like the 2.x branch.
+ Fixed bug where the theme_advanced_statusbar_location was called theme_advanced_status_location.
+ Fixed bug where the strict_loading_mode option didn't work if you created editors dynamically without using the EditorManager.
+ Fixed bug where some language values wasn't translated such as insert and update in dialogs.
+ Fixed bug where some image attributes wasn't stored correctly when inserting an image.
+ Fixed bug where fullscreen mode didn't restore scrollbars when disabled.
+ Fixed bug where there was no visual representation for tab focus in toolbars on IE.
+ Fixed bug where HR elements wasn't treated as block elements so forced_root_block would fail on these.
+ Fixed bug where autosave presented warning message even when the form was submitted normally.
+ Fixed typo of openBrower it's now openBrowser in form_utils.js.
+ Fixed various HTML problems like missing TD elements and duplicated doctypes.
+ Fixed default values for theme_advanced_resize_horizontal, theme_advanced_resizing_use_cookie to be 2.x compatible.
+ Moved spellchecker JS files into the development package.
+ Removed support for theme_advanced_path_location since the theme_advanced_statusbar_location is the correct option name.
+Version 3.0b1 (2007-11-21)
+ Added new tab_focus option, that enables you to specify a element id or that the next element to be focused on tab key down.
+ Added new addQueryValueHandler method to the tinymce.Editor class.
+ Added new class_filter option, this enables you to specify a function that can filter out CSS classes for the styles list box.
+ Added support form [url=url]title[/url] to the bbcode plugin.
+ Renamed the addCommandQueryState method in the tinymce.Editor class to addQueryStateHandler.
+ Renamed loadQue to loadQueue, to correct spelling.
+ Removed the createDOM method from the window manager and replace it with a createInstance method.
+ Removed the add to beginning of class attribute parameter of the DOMUtils.addClass method.
+ Fixed bug with the forced_root_block option, didn't work correctly with multiple inline elements.
+ Fixed bug where image dialogs replaced the current image element with a new one even when it was updated.
+ Fixed bug where the submit trigger wasn't executed when divs where converted into editor instances.
+ Fixed bug where div elements that got converted into editors didn't get a hidden input element generated for them.
+ Fixed bug where the the media_use_script option for the media plugin wasn't working correctly.
+ Fixed bug where the font size and font family listboxes wasn't updated correctly on Safari.
+ Fixed bug where the height of the fieldset in default image dialog for the advanced theme was to small.
+ Fixed bug where the font sizes behaved incorrectly after a cleanup on Safari.
+ Fixed bug where formatblock didn't work correctly in Safari on some elements.
+ Fixed bug where template plugin didn't insert content correctly unless some options where specified.
+ Fixed bug where charmap on Safari produced scrollbars.
+ Fixed bug where there was white artifacts in some dialogs due to missing background color.
+ Fixed bug where port was added to all external URLs if the editor was loaded from a custom port.
+ Fixed bug where the context menus got duplicated on Safari 3.0.4 on Mac OS X.
+ Fixed bug where dialogs like paste from word was huge on Firefox.
+ Fixed bug with media plugin not working with windows media objects.
+ Fixed bug where a forever loop was created if multiple instances where submitted using form.submit.
+ Fixed bug with editing a table produce error in IE when inlinepopups where used.
+ Fixed bug where the style plugin generated ugly looking style information in IE.
+ Fixed bug where the inline dialogs that got opened while in fullscreen mode wasn't visible.
+ Fixed bug where it was difficult to place the caret inside the word paste dialog.
+ Fixed bug where Opera produced strange border in the word paste dialog.
+ Fixed bug where viewport constraints could move a inlinepopup to a negative x, y position if the viewport was to small.
+ Fixed bug where template plugin was producing an error due to a deprecated API call.
+ Fixed bug where drag drop of images failed in Gecko if a document_base_url was specified.
+ Fixed bug where Firefox 3 failed to apply block formats like H1-H6 it still breaks on DIVs this has been reported to bugzilla.
+ Fixed bug where IE was producing a warning dialog about non secure items when running TinyMCE over HTTPS.
+ Fixed bug where the onbeforeunload event was triggered when menus or dialogs where opened.
+ Fixed bug where the fullscreen mode of the HTML view source box threw an error.
+ Fixed bug where the mceFocus command didn't work correctly.
+ Fixed bug where the selection could get lost in IE using inlinepopups.
+ Fixed so the body of the editor area has the mceContentBody class just like the 2.x branch.
+ Fixed so the media icon gets active when a media element is selected.
+Version 3.0a3 (2007-11-13)
+ Added new experimental jQuery and Prototype framework adapters to the development package.
+ Added new translation.html file for the development package. Helps with the internationalization of TinyMCE.
+ Added new setup callback option, use this callback to add events to TinyMCE. This method is recommended over the old callbacks.
+ Added new API documetation to all classes, functions, events, properties to the Wiki with examples etc.
+ Added new init method to all plugins and themes, since it's shorter to write and it mimics interface capable languages better.
+ Fixed various CSS issues in the default skin such as alignment of split buttons and separators.
+ Fixed issues with mod_security. It didn't like that a content type of text/javascript was forced in a XHR.
+ Fixed all events so that they now pass the sender object as it's first argument.
+ Fixed some DOM methods so they now can take an array as input.
+ Fixed so addButton and the methods of the ControlManager uses less arguments and it now uses a settings object instead.
+ Fixed various issues with the tinymce.util.URI class.
+ Fixed bug in IE and Safari and the on demand gzip loading feature.
+ Fixed bug with moving inline windows sometimes failed in IE6.
+ Fixed bug where save_callback function wasn't executed at all.
+ Fixed bug where inlinepopups produces scrollbars if windows where moved to the corners of the browser.
+ Fixed bug where view HTML source failed when inserting a embedded media object.
+ Fixed bug where the listbox menus didn't display correctly on IE6.
+ Fixed bug where undo level wasn't added when editor was blurred.
+ Fixed bug where spellchecker wasn't disabled when fullscreen mode was enabled.
+ Fixed bug where Firefox could crash some times when the user switched to fullscreen mode.
+ Fixed bug where tinymce.ui.DropMenu didn't remove all item data when an item was removed from the menu.
+ Fixed bug where anchor list in advlink dialog wasn't populated correctly in Safari.
+ Fixed bug where it wasn't possible to edit tables in IE when inlinepopups was enabled.
+ Fixed bug where it wasn't possible to change the table width of an existing table.
+ Fixed bug where xhtmlxtras like abbr didn't work correctly on IE.
+ Fixed bug where IE6 had some graphics rendering issues with the inlinepopups.
+ Fixed bug where inlinepopup windows where moved incorrectly when they were boundary checked for min width.
+ Fixed bug where textareas without id or name couldn't be converted into editor instances.
+ Fixed bug where TinyMCE was stealing element focus on IE.
+ Fixed bug where the getParam method didn't handle false values correctly.
+ Fixed bug where inlinepopups was clipped by other TinyMCE instances or relative elements in IE.
+ Fixed bug where the contextmenu was clipped by other TinyMCE instances or relative elements in IE.
+ Fixed bug where listbox menus was clipped by other TinyMCE instances or relative elements in IE.
+ Fixed bug where listboxes wasn't updated correctly when the a value wasn't found by select.
+ Fixed various CSS issues that produced odd rendering bugs in IE.
+ Fixed issues with tinymce.ui.DropMenu class, it required some optional settings to be specified.
+ Fixed so multiple blockquotes can be removed with a easier method than before.
+ Optimized some of the core API to boost performance.
+ Removed some functions from the core API that wasn't needed.
+Version 3.0a2 (2007-11-02)
+ Fixed critical bug where IE generaded an error on a hasAttribute call in the serialization engine.
+ Fixed critical bug where some dialogs didn't open in the non dev package.
+ Fixed bug when using the theme_advanced_styles option. Error was thrown in some dialogs.
+ Fixed bug where the close buttons produced an error when native windows where used.
+ Fixed bug in default skin so that split buttons gets activated correctly.
+ Fixed so plugins can be loaded from external urls outsite the plugins directory.
+Version 3.0a1 (2007-11-01)
+ Rewrote the core and most of the plugins and themes from scratch.
+ Added new and improved serialization engine, faster and more powerful.
+ Added new internal event system, things like editor.onClick.add(func).
+ Added new inlinepopups plugin, the dialogs are now skinnable and uses clearlooks2 as default.
+ Added new contextmenu plugin, context menus can now have submenus and plugins can add items on the fly.
+ Added new skin support for the simple and advanced themes you can alter the whole UI using CSS.
+ Added new o2k7 skin for the simple and advanced themes.
+ Added new custom list boxes for font size/format/style etc with preview support.
+ Added new UI management, enabled plugins to create controls like splitbuttons or menus easier.
+ Added new JSON parser/serializer and JSON-RPC class to the core API.
+ Added new cookie utility class to the core API.
+ Added new Unit testing class to the core API only available in dev mode.
+ Added new firebug lite integration when loading the dev version of TinyMCE.
+ Added new Safari plugin, fixes lots compatibility of issues with Safari 3.x.
+ Added new URI/URL parsing it now handles the hole RFC and even some exceptions.
+ Added new pagebreak plugin, enables you to insert pagebreak comments like <!-- pagebreak -->
+ Added new on demand loading of plugins and themes. Enables you to load and init TinyMCE at any time.
+ Added new throbber/progress visualization a plugin can show/hide this when it's needed.
+ Added new blockquote button. Enables you to wrap paragraphs in blockquotes.
+ Added new compat2x plugin. Will provide a TinyMCE 2.x API for older plugins.
+ Added new theme_advanced_resizing_min_width, theme_advanced_resizing_min_height options.
+ Added new theme_advanced_resizing_max_height, theme_advanced_resizing_max_height options.
+ Added new use_native_selects option. Enables you to toggle native listboxes on and off.
+ Added new docs_url option enables you to specify where the TinyMCE user documentation is located.
+ Added new frame and rules options for the table dialog.
+ Added new global rule for valid_elements/extended_valid_elements enables you to specify global attributes for all elements.
+ Added new deny attribute rule characher so it's possible to deny global attribute rules on specific elements.
+ Added new unit tests in the dev package of TinyMCE. Runs tests on the core API, commands and settings of the editor.
+ Readded the inline_styles option and enabled it by default so deprecated attributes are no longer used.
+ Removed all button images and replaced them with CSS sprite images. Reduces the number of requests needed.
+ Removed lots of language files and merged them into the base language files. Reduces the number of requests needed.
+ Removed lots of unnecessary files and merged many of them together to reduce requests and improve loading speed.
+ Reduced the over all script size by 33% and the number of files/requests by 75% so it loads a lot faster.
+ Fixed so convert_fonts_to_spans are enabled by default. So no more font tags.
+ Fixed so underline and strikethrough uses spans instread of deprecated U and STRIKE elements.
+ Fixed so indent/outdent adds/removed margin-left instead of blockquotes.
+ Fixed so alignment of paragraphs results in a text-align style value instead of the deprecated align attribute.
+ Fixed so alignment of images uses float or vertical-align style values instead of the deprecated align attribute.
+ Fixed so all classes from @import stylesheets gets imported into the editor.
+ Fixed so the directionality can toggle the dir attribute on and off.
+ Fixed so the fullscreen_settings can be used for all types of fullscreen modes.
+ Fixed so the advanced HR dialog gets displayed when inserting a HR not only on edit.
+ Fixed bug where word wrap didn't work in the source editor on Safari.
+ Fixed so non HTML elements can be used within the editor such as <myns:tag>
+ Fixed various memory leaks in IE and reduced the unload cleanups needed.
+ Fixed so the preformatted option adds an invisible container pre tag inside the editor.
+ Renamed the _template plugin to example and updated it to use the new 3.x API.
-(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;if(tinyMCE.isIE){return}a.onKeyDown.add(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng().cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f-2);a.setEnd(n,f-1);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])){h[1]="mailto:"+h[1]}}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})();
\ No newline at end of file
+(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;a.onKeyDown.addToTop(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});if(tinyMCE.isIE){return}a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng(true).cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f-2);a.setEnd(n,f-1);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}var m=a.toString();if(m.charAt(m.length-1)=="."){a.setEnd(n,c-1)}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])){h[1]="mailto:"+h[1]}}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})();
\ No newline at end of file
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2011, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- tinymce.create('tinymce.plugins.AutolinkPlugin', {\r
- /**\r
- * Initializes the plugin, this will be executed after the plugin has been created.\r
- * This call is done before the editor instance has finished it's initialization so use the onInit event\r
- * of the editor instance to intercept that event.\r
- *\r
- * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.\r
- * @param {string} url Absolute URL to where the plugin is located.\r
- */\r
-\r
- init : function(ed, url) {\r
- var t = this;\r
-\r
- // Internet Explorer has built-in automatic linking\r
- if (tinyMCE.isIE)\r
- return;\r
-\r
- // Add a key down handler\r
- ed.onKeyDown.add(function(ed, e) {\r
- if (e.keyCode == 13)\r
- return t.handleEnter(ed);\r
- });\r
-\r
- ed.onKeyPress.add(function(ed, e) {\r
- if (e.which == 41)\r
- return t.handleEclipse(ed);\r
- });\r
-\r
- // Add a key up handler\r
- ed.onKeyUp.add(function(ed, e) {\r
- if (e.keyCode == 32)\r
- return t.handleSpacebar(ed);\r
- });\r
- },\r
-\r
- handleEclipse : function(ed) {\r
- this.parseCurrentLine(ed, -1, '(', true);\r
- },\r
-\r
- handleSpacebar : function(ed) {\r
- this.parseCurrentLine(ed, 0, '', true);\r
- },\r
-\r
- handleEnter : function(ed) {\r
- this.parseCurrentLine(ed, -1, '', false);\r
- },\r
-\r
- parseCurrentLine : function(ed, end_offset, delimiter, goback) {\r
- var r, end, start, endContainer, bookmark, text, matches, prev, len;\r
-\r
- // We need at least five characters to form a URL,\r
- // hence, at minimum, five characters from the beginning of the line.\r
- r = ed.selection.getRng().cloneRange();\r
- if (r.startOffset < 5) {\r
- // During testing, the caret is placed inbetween two text nodes. \r
- // The previous text node contains the URL.\r
- prev = r.endContainer.previousSibling;\r
- if (prev == null) {\r
- if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null)\r
- return;\r
-\r
- prev = r.endContainer.firstChild.nextSibling;\r
- }\r
- len = prev.length;\r
- r.setStart(prev, len);\r
- r.setEnd(prev, len);\r
-\r
- if (r.endOffset < 5)\r
- return;\r
-\r
- end = r.endOffset;\r
- endContainer = prev;\r
- } else {\r
- endContainer = r.endContainer;\r
-\r
- // Get a text node\r
- if (endContainer.nodeType != 3 && endContainer.firstChild) {\r
- while (endContainer.nodeType != 3 && endContainer.firstChild)\r
- endContainer = endContainer.firstChild;\r
-\r
- r.setStart(endContainer, 0);\r
- r.setEnd(endContainer, endContainer.nodeValue.length);\r
- }\r
-\r
- if (r.endOffset == 1)\r
- end = 2;\r
- else\r
- end = r.endOffset - 1 - end_offset;\r
- }\r
-\r
- start = end;\r
-\r
- do\r
- {\r
- // Move the selection one character backwards.\r
- r.setStart(endContainer, end - 2);\r
- r.setEnd(endContainer, end - 1);\r
- end -= 1;\r
-\r
- // Loop until one of the following is found: a blank space, , delimeter, (end-2) >= 0\r
- } while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter);\r
-\r
- if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) {\r
- r.setStart(endContainer, end);\r
- r.setEnd(endContainer, start);\r
- end += 1;\r
- } else if (r.startOffset == 0) {\r
- r.setStart(endContainer, 0);\r
- r.setEnd(endContainer, start);\r
- }\r
- else {\r
- r.setStart(endContainer, end);\r
- r.setEnd(endContainer, start);\r
- }\r
-\r
- text = r.toString();\r
- matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|[A-Z0-9._%+-]+@)(.+)$/i);\r
-\r
- if (matches) {\r
- if (matches[1] == 'www.') {\r
- matches[1] = 'http://www.';\r
- } else if (/@$/.test(matches[1])) {\r
- matches[1] = 'mailto:' + matches[1];\r
- }\r
-\r
- bookmark = ed.selection.getBookmark();\r
-\r
- ed.selection.setRng(r);\r
- tinyMCE.execCommand('createlink',false, matches[1] + matches[2]);\r
- ed.selection.moveToBookmark(bookmark);\r
-\r
- // TODO: Determine if this is still needed.\r
- if (tinyMCE.isWebKit) {\r
- // move the caret to its original position\r
- ed.selection.collapse(false);\r
- var max = Math.min(endContainer.length, start + 1);\r
- r.setStart(endContainer, max);\r
- r.setEnd(endContainer, max);\r
- ed.selection.setRng(r);\r
- }\r
- }\r
- },\r
-\r
- /**\r
- * Returns information about the plugin as a name/value array.\r
- * The current keys are longname, author, authorurl, infourl and version.\r
- *\r
- * @return {Object} Name/value array containing information about the plugin.\r
- */\r
- getInfo : function() {\r
- return {\r
- longname : 'Autolink',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
-\r
- // Register plugin\r
- tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin);\r
-})();\r
+/**
+ * editor_plugin_src.js
+ *
+ * Copyright 2011, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+(function() {
+ tinymce.create('tinymce.plugins.AutolinkPlugin', {
+ /**
+ * Initializes the plugin, this will be executed after the plugin has been created.
+ * This call is done before the editor instance has finished it's initialization so use the onInit event
+ * of the editor instance to intercept that event.
+ *
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
+ * @param {string} url Absolute URL to where the plugin is located.
+ */
+
+ init : function(ed, url) {
+ var t = this;
+
+ // Add a key down handler
+ ed.onKeyDown.addToTop(function(ed, e) {
+ if (e.keyCode == 13)
+ return t.handleEnter(ed);
+ });
+
+ // Internet Explorer has built-in automatic linking for most cases
+ if (tinyMCE.isIE)
+ return;
+
+ ed.onKeyPress.add(function(ed, e) {
+ if (e.which == 41)
+ return t.handleEclipse(ed);
+ });
+
+ // Add a key up handler
+ ed.onKeyUp.add(function(ed, e) {
+ if (e.keyCode == 32)
+ return t.handleSpacebar(ed);
+ });
+ },
+
+ handleEclipse : function(ed) {
+ this.parseCurrentLine(ed, -1, '(', true);
+ },
+
+ handleSpacebar : function(ed) {
+ this.parseCurrentLine(ed, 0, '', true);
+ },
+
+ handleEnter : function(ed) {
+ this.parseCurrentLine(ed, -1, '', false);
+ },
+
+ parseCurrentLine : function(ed, end_offset, delimiter, goback) {
+ var r, end, start, endContainer, bookmark, text, matches, prev, len;
+
+ // We need at least five characters to form a URL,
+ // hence, at minimum, five characters from the beginning of the line.
+ r = ed.selection.getRng(true).cloneRange();
+ if (r.startOffset < 5) {
+ // During testing, the caret is placed inbetween two text nodes.
+ // The previous text node contains the URL.
+ prev = r.endContainer.previousSibling;
+ if (prev == null) {
+ if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null)
+ return;
+
+ prev = r.endContainer.firstChild.nextSibling;
+ }
+ len = prev.length;
+ r.setStart(prev, len);
+ r.setEnd(prev, len);
+
+ if (r.endOffset < 5)
+ return;
+
+ end = r.endOffset;
+ endContainer = prev;
+ } else {
+ endContainer = r.endContainer;
+
+ // Get a text node
+ if (endContainer.nodeType != 3 && endContainer.firstChild) {
+ while (endContainer.nodeType != 3 && endContainer.firstChild)
+ endContainer = endContainer.firstChild;
+
+ r.setStart(endContainer, 0);
+ r.setEnd(endContainer, endContainer.nodeValue.length);
+ }
+
+ if (r.endOffset == 1)
+ end = 2;
+ else
+ end = r.endOffset - 1 - end_offset;
+ }
+
+ start = end;
+
+ do
+ {
+ // Move the selection one character backwards.
+ r.setStart(endContainer, end - 2);
+ r.setEnd(endContainer, end - 1);
+ end -= 1;
+
+ // Loop until one of the following is found: a blank space, , delimeter, (end-2) >= 0
+ } while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter);
+
+ if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) {
+ r.setStart(endContainer, end);
+ r.setEnd(endContainer, start);
+ end += 1;
+ } else if (r.startOffset == 0) {
+ r.setStart(endContainer, 0);
+ r.setEnd(endContainer, start);
+ }
+ else {
+ r.setStart(endContainer, end);
+ r.setEnd(endContainer, start);
+ }
+
+ // Exclude last . from word like "www.site.com."
+ var text = r.toString();
+ if (text.charAt(text.length - 1) == '.') {
+ r.setEnd(endContainer, start - 1);
+ }
+
+ text = r.toString();
+ matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|[A-Z0-9._%+-]+@)(.+)$/i);
+
+ if (matches) {
+ if (matches[1] == 'www.') {
+ matches[1] = 'http://www.';
+ } else if (/@$/.test(matches[1])) {
+ matches[1] = 'mailto:' + matches[1];
+ }
+
+ bookmark = ed.selection.getBookmark();
+
+ ed.selection.setRng(r);
+ tinyMCE.execCommand('createlink',false, matches[1] + matches[2]);
+ ed.selection.moveToBookmark(bookmark);
+
+ // TODO: Determine if this is still needed.
+ if (tinyMCE.isWebKit) {
+ // move the caret to its original position
+ ed.selection.collapse(false);
+ var max = Math.min(endContainer.length, start + 1);
+ r.setStart(endContainer, max);
+ r.setEnd(endContainer, max);
+ ed.selection.setRng(r);
+ }
+ }
+ },
+
+ /**
+ * Returns information about the plugin as a name/value array.
+ * The current keys are longname, author, authorurl, infourl and version.
+ *
+ * @return {Object} Name/value array containing information about the plugin.
+ */
+ getInfo : function() {
+ return {
+ longname : 'Autolink',
+ author : 'Moxiecode Systems AB',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink',
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
+ };
+ }
+ });
+
+ // Register plugin
+ tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin);
+})();
-(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent());tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent());d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().firstChild);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();
\ No newline at end of file
+(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent());tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6||document.compatMode=="BackCompat"){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent());d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().firstChild);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();
\ No newline at end of file
vp.h -= 1;\r
\r
// Use fixed position if it exists\r
- if (tinymce.isIE6)\r
+ if (tinymce.isIE6 || document.compatMode == 'BackCompat')\r
posCss = 'absolute;top:' + vp.y;\r
else\r
posCss = 'fixed;top:0';\r
-/**\r
- * editor_plugin_src.js\r
- *\r
- * Copyright 2011, Moxiecode Systems AB\r
- * Released under LGPL License.\r
- *\r
- * License: http://tinymce.moxiecode.com/license\r
- * Contributing: http://tinymce.moxiecode.com/contributing\r
- */\r
-\r
-(function() {\r
- var each = tinymce.each, Event = tinymce.dom.Event, bookmark;\r
-\r
- // Skips text nodes that only contain whitespace since they aren't semantically important.\r
- function skipWhitespaceNodes(e, next) {\r
- while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) {\r
- e = next(e);\r
- }\r
- return e;\r
- }\r
-\r
- function skipWhitespaceNodesBackwards(e) {\r
- return skipWhitespaceNodes(e, function(e) {\r
- return e.previousSibling;\r
- });\r
- }\r
-\r
- function skipWhitespaceNodesForwards(e) {\r
- return skipWhitespaceNodes(e, function(e) {\r
- return e.nextSibling;\r
- });\r
- }\r
-\r
- function hasParentInList(ed, e, list) {\r
- return ed.dom.getParent(e, function(p) {\r
- return tinymce.inArray(list, p) !== -1;\r
- });\r
- }\r
-\r
- function isList(e) {\r
- return e && (e.tagName === 'OL' || e.tagName === 'UL');\r
- }\r
-\r
- function splitNestedLists(element, dom) {\r
- var tmp, nested, wrapItem;\r
- tmp = skipWhitespaceNodesBackwards(element.lastChild);\r
- while (isList(tmp)) {\r
- nested = tmp;\r
- tmp = skipWhitespaceNodesBackwards(nested.previousSibling);\r
- }\r
- if (nested) {\r
- wrapItem = dom.create('li', { style: 'list-style-type: none;'});\r
- dom.split(element, nested);\r
- dom.insertAfter(wrapItem, nested);\r
- wrapItem.appendChild(nested);\r
- wrapItem.appendChild(nested);\r
- element = wrapItem.previousSibling;\r
- }\r
- return element;\r
- }\r
-\r
- function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) {\r
- e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs);\r
- return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs);\r
- }\r
-\r
- function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) {\r
- var prev = skipWhitespaceNodesBackwards(e.previousSibling);\r
- if (prev) {\r
- return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs);\r
- } else {\r
- return e;\r
- }\r
- }\r
-\r
- function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) {\r
- var next = skipWhitespaceNodesForwards(e.nextSibling);\r
- if (next) {\r
- return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs);\r
- } else {\r
- return e;\r
- }\r
- }\r
-\r
- function attemptMerge(e1, e2, differentStylesMasterElement, mergeParagraphs) {\r
- if (canMerge(e1, e2, !!differentStylesMasterElement, mergeParagraphs)) {\r
- return merge(e1, e2, differentStylesMasterElement);\r
- } else if (e1 && e1.tagName === 'LI' && isList(e2)) {\r
- // Fix invalidly nested lists.\r
- e1.appendChild(e2);\r
- }\r
- return e2;\r
- }\r
-\r
- function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) {\r
- if (!e1 || !e2) {\r
- return false;\r
- } else if (e1.tagName === 'LI' && e2.tagName === 'LI') {\r
- return e2.style.listStyleType === 'none' || containsOnlyAList(e2);\r
- } else if (isList(e1)) {\r
- return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2);\r
- } else return mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P';\r
- }\r
-\r
- function isListForIndent(e) {\r
- var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild);\r
- return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI));\r
- }\r
-\r
- function containsOnlyAList(e) {\r
- var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild);\r
- return firstChild && lastChild && firstChild === lastChild && isList(firstChild);\r
- }\r
-\r
- function merge(e1, e2, masterElement) {\r
- var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild);\r
- if (e1.tagName === 'P') {\r
- e1.appendChild(e1.ownerDocument.createElement('br'));\r
- }\r
- while (e2.firstChild) {\r
- e1.appendChild(e2.firstChild);\r
- }\r
- if (masterElement) {\r
- e1.style.listStyleType = masterElement.style.listStyleType;\r
- }\r
- e2.parentNode.removeChild(e2);\r
- attemptMerge(lastOriginal, firstNew, false);\r
- return e1;\r
- }\r
-\r
- function findItemToOperateOn(e, dom) {\r
- var item;\r
- if (!dom.is(e, 'li,ol,ul')) {\r
- item = dom.getParent(e, 'li');\r
- if (item) {\r
- e = item;\r
- }\r
- }\r
- return e;\r
- }\r
-\r
- tinymce.create('tinymce.plugins.Lists', {\r
- init: function(ed) {\r
- var LIST_TABBING = 'TABBING';\r
- var LIST_EMPTY_ITEM = 'EMPTY';\r
- var LIST_ESCAPE = 'ESCAPE';\r
- var LIST_PARAGRAPH = 'PARAGRAPH';\r
- var LIST_UNKNOWN = 'UNKNOWN';\r
- var state = LIST_UNKNOWN;\r
-\r
- function isTabInList(e) {\r
- // Don't indent on Ctrl+Tab or Alt+Tab\r
- return e.keyCode === tinymce.VK.TAB && !(e.altKey || e.ctrlKey) &&\r
- (ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList'));\r
- }\r
-\r
- function isOnLastListItem() {\r
- var li = getLi();\r
- var grandParent = li.parentNode.parentNode;\r
- var isLastItem = li.parentNode.lastChild === li;\r
- return isLastItem && !isNestedList(grandParent) && isEmptyListItem(li);\r
- }\r
-\r
- function isNestedList(grandParent) {\r
- if (isList(grandParent)) {\r
- return grandParent.parentNode && grandParent.parentNode.tagName === 'LI';\r
- } else {\r
- return grandParent.tagName === 'LI';\r
- }\r
- }\r
-\r
- function isInEmptyListItem() {\r
- return ed.selection.isCollapsed() && isEmptyListItem(getLi());\r
- }\r
-\r
- function getLi() {\r
- var n = ed.selection.getStart();\r
- // Get start will return BR if the LI only contains a BR or an empty element as we use these to fix caret position\r
- return ((n.tagName == 'BR' || n.tagName == '') && n.parentNode.tagName == 'LI') ? n.parentNode : n;\r
- }\r
-\r
- function isEmptyListItem(li) {\r
- var numChildren = li.childNodes.length;\r
- if (li.tagName === 'LI') {\r
- return numChildren == 0 ? true : numChildren == 1 && (li.firstChild.tagName == '' || li.firstChild.tagName == 'BR' || isEmptyIE9Li(li));\r
- }\r
- return false;\r
- }\r
-\r
- function isEmptyIE9Li(li) {\r
- // only consider this to be last item if there is no list item content or that content is nbsp or space since IE9 creates these\r
- var lis = tinymce.grep(li.parentNode.childNodes, function(n) {return n.tagName == 'LI'});\r
- var isLastLi = li == lis[lis.length - 1];\r
- var child = li.firstChild;\r
- return tinymce.isIE9 && isLastLi && (child.nodeValue == String.fromCharCode(160) || child.nodeValue == String.fromCharCode(32));\r
- }\r
-\r
- function isEnter(e) {\r
- return e.keyCode === tinymce.VK.ENTER;\r
- }\r
-\r
- function isEnterWithoutShift(e) {\r
- return isEnter(e) && !e.shiftKey;\r
- }\r
-\r
- function getListKeyState(e) {\r
- if (isTabInList(e)) {\r
- return LIST_TABBING;\r
- } else if (isEnterWithoutShift(e) && isOnLastListItem()) {\r
- // Returns LIST_UNKNOWN since breaking out of lists is handled by the EnterKey.js logic now\r
- //return LIST_ESCAPE;\r
- return LIST_UNKNOWN;\r
- } else if (isEnterWithoutShift(e) && isInEmptyListItem()) {\r
- return LIST_EMPTY_ITEM;\r
- } else {\r
- return LIST_UNKNOWN;\r
- }\r
- }\r
-\r
- function cancelDefaultEvents(ed, e) {\r
- // list escape is done manually using outdent as it does not create paragraphs correctly in td's\r
- if (state == LIST_TABBING || state == LIST_EMPTY_ITEM || tinymce.isGecko && state == LIST_ESCAPE) {\r
- Event.cancel(e);\r
- }\r
- }\r
-\r
- function isCursorAtEndOfContainer() {\r
- var range = ed.selection.getRng(true);\r
- var startContainer = range.startContainer;\r
- if (startContainer.nodeType == 3) {\r
- var value = startContainer.nodeValue;\r
- if (tinymce.isIE9 && value.length > 1 && value.charCodeAt(value.length-1) == 32) {\r
- // IE9 places a space on the end of the text in some cases so ignore last char\r
- return (range.endOffset == value.length-1);\r
- } else {\r
- return (range.endOffset == value.length);\r
- }\r
- } else if (startContainer.nodeType == 1) {\r
- return range.endOffset == startContainer.childNodes.length;\r
- }\r
- return false;\r
- }\r
-\r
- /*\r
- If we are at the end of a list item surrounded with an element, pressing enter should create a\r
- new list item instead without splitting the element e.g. don't want to create new P or H1 tag\r
- */\r
- function isEndOfListItem() {\r
- var node = ed.selection.getNode();\r
- var validElements = 'h1,h2,h3,h4,h5,h6,p,div';\r
- var isLastParagraphOfLi = ed.dom.is(node, validElements) && node.parentNode.tagName === 'LI' && node.parentNode.lastChild === node;\r
- return ed.selection.isCollapsed() && isLastParagraphOfLi && isCursorAtEndOfContainer();\r
- }\r
-\r
- // Creates a new list item after the current selection's list item parent\r
- function createNewLi(ed, e) {\r
- if (isEnterWithoutShift(e) && isEndOfListItem()) {\r
- var node = ed.selection.getNode();\r
- var li = ed.dom.create("li");\r
- var parentLi = ed.dom.getParent(node, 'li');\r
- ed.dom.insertAfter(li, parentLi);\r
-\r
- // Move caret to new list element.\r
- if (tinymce.isIE6 || tinymce.isIE7 || tinyMCE.isIE8) {\r
- // Removed this line since it would create an odd < > tag and placing the caret inside an empty LI is handled and should be handled by the selection logic\r
- //li.appendChild(ed.dom.create(" ")); // IE needs an element within the bullet point\r
- ed.selection.setCursorLocation(li, 1);\r
- } else {\r
- ed.selection.setCursorLocation(li, 0);\r
- }\r
- e.preventDefault();\r
- }\r
- }\r
-\r
- function imageJoiningListItem(ed, e) {\r
- var prevSibling;\r
-\r
- if (!tinymce.isGecko)\r
- return;\r
-\r
- var n = ed.selection.getStart();\r
- if (e.keyCode != tinymce.VK.BACKSPACE || n.tagName !== 'IMG')\r
- return;\r
-\r
- function lastLI(node) {\r
- var child = node.firstChild;\r
- var li = null;\r
- do {\r
- if (!child)\r
- break;\r
-\r
- if (child.tagName === 'LI')\r
- li = child;\r
- } while (child = child.nextSibling);\r
-\r
- return li;\r
- }\r
-\r
- function addChildren(parentNode, destination) {\r
- while (parentNode.childNodes.length > 0)\r
- destination.appendChild(parentNode.childNodes[0]);\r
- }\r
-\r
- // Check if there is a previous sibling\r
- prevSibling = n.parentNode.previousSibling;\r
- if (!prevSibling)\r
- return;\r
-\r
- var ul;\r
- if (prevSibling.tagName === 'UL' || prevSibling.tagName === 'OL')\r
- ul = prevSibling;\r
- else if (prevSibling.previousSibling && (prevSibling.previousSibling.tagName === 'UL' || prevSibling.previousSibling.tagName === 'OL'))\r
- ul = prevSibling.previousSibling;\r
- else\r
- return;\r
-\r
- var li = lastLI(ul);\r
-\r
- // move the caret to the end of the list item\r
- var rng = ed.dom.createRng();\r
- rng.setStart(li, 1);\r
- rng.setEnd(li, 1);\r
- ed.selection.setRng(rng);\r
- ed.selection.collapse(true);\r
-\r
- // save a bookmark at the end of the list item\r
- var bookmark = ed.selection.getBookmark();\r
-\r
- // copy the image an its text to the list item\r
- var clone = n.parentNode.cloneNode(true);\r
- if (clone.tagName === 'P' || clone.tagName === 'DIV')\r
- addChildren(clone, li);\r
- else\r
- li.appendChild(clone);\r
-\r
- // remove the old copy of the image\r
- n.parentNode.parentNode.removeChild(n.parentNode);\r
-\r
- // move the caret where we saved the bookmark\r
- ed.selection.moveToBookmark(bookmark);\r
- }\r
-\r
- // fix the cursor position to ensure it is correct in IE\r
- function setCursorPositionToOriginalLi(li) {\r
- var list = ed.dom.getParent(li, 'ol,ul');\r
- if (list != null) {\r
- var lastLi = list.lastChild;\r
- // Removed this line since IE9 would report an DOM character error and placing the caret inside an empty LI is handled and should be handled by the selection logic\r
- //lastLi.appendChild(ed.getDoc().createElement(''));\r
- ed.selection.setCursorLocation(lastLi, 0);\r
- }\r
- }\r
-\r
- this.ed = ed;\r
- ed.addCommand('Indent', this.indent, this);\r
- ed.addCommand('Outdent', this.outdent, this);\r
- ed.addCommand('InsertUnorderedList', function() {\r
- this.applyList('UL', 'OL');\r
- }, this);\r
- ed.addCommand('InsertOrderedList', function() {\r
- this.applyList('OL', 'UL');\r
- }, this);\r
-\r
- ed.onInit.add(function() {\r
- ed.editorCommands.addCommands({\r
- 'outdent': function() {\r
- var sel = ed.selection, dom = ed.dom;\r
-\r
- function hasStyleIndent(n) {\r
- n = dom.getParent(n, dom.isBlock);\r
- return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0;\r
- }\r
-\r
- return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList');\r
- }\r
- }, 'state');\r
- });\r
-\r
- ed.onKeyUp.add(function(ed, e) {\r
- if (state == LIST_TABBING) {\r
- ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null);\r
- state = LIST_UNKNOWN;\r
- return Event.cancel(e);\r
- } else if (state == LIST_EMPTY_ITEM) {\r
- var li = getLi();\r
- var shouldOutdent = ed.settings.list_outdent_on_enter === true || e.shiftKey;\r
- ed.execCommand(shouldOutdent ? 'Outdent' : 'Indent', true, null);\r
- if (tinymce.isIE) {\r
- setCursorPositionToOriginalLi(li);\r
- }\r
-\r
- return Event.cancel(e);\r
- } else if (state == LIST_ESCAPE) {\r
- if (tinymce.isIE6 || tinymce.isIE7 || tinymce.isIE8) {\r
- // append a zero sized nbsp so that caret is positioned correctly in IE after escaping and applying formatting.\r
- // if there is no text then applying formatting for e.g a H1 to the P tag immediately following list after\r
- // escaping from it will cause the caret to be positioned on the last li instead of staying the in P tag.\r
- var n = ed.getDoc().createTextNode('\uFEFF');\r
- ed.selection.getNode().appendChild(n);\r
- } else if (tinymce.isIE9 || tinymce.isGecko) {\r
- // IE9 does not escape the list so we use outdent to do this and cancel the default behaviour\r
- // Gecko does not create a paragraph outdenting inside a TD so default behaviour is cancelled and we outdent ourselves\r
- ed.execCommand('Outdent');\r
- return Event.cancel(e);\r
- }\r
- }\r
- });\r
-\r
- function fixListItem(parent, reference) {\r
- // a zero-sized non-breaking space is placed in the empty list item so that the nested list is\r
- // displayed on the below line instead of next to it\r
- var n = ed.getDoc().createTextNode('\uFEFF');\r
- parent.insertBefore(n, reference);\r
- ed.selection.setCursorLocation(n, 0);\r
- // repaint to remove rendering artifact. only visible when creating new list\r
- ed.execCommand('mceRepaint');\r
- }\r
-\r
- function fixIndentedListItemForGecko(ed, e) {\r
- if (isEnter(e)) {\r
- var li = getLi();\r
- if (li) {\r
- var parent = li.parentNode;\r
- var grandParent = parent && parent.parentNode;\r
- if (grandParent && grandParent.nodeName == 'LI' && grandParent.firstChild == parent && li == parent.firstChild) {\r
- fixListItem(grandParent, parent);\r
- }\r
- }\r
- }\r
- }\r
-\r
- function fixIndentedListItemForIE8(ed, e) {\r
- if (isEnter(e)) {\r
- var li = getLi();\r
- if (ed.dom.select('ul li', li).length === 1) {\r
- var list = li.firstChild;\r
- fixListItem(li, list);\r
- }\r
- }\r
- }\r
-\r
- function fixDeletingFirstCharOfList(ed, e) {\r
- function listElements(list, li) {\r
- var elements = [];\r
- var walker = new tinymce.dom.TreeWalker(li, list);\r
- for (var node = walker.current(); node; node = walker.next()) {\r
- if (ed.dom.is(node, 'ol,ul,li')) {\r
- elements.push(node);\r
- }\r
- }\r
- return elements;\r
- }\r
-\r
- if (e.keyCode == tinymce.VK.BACKSPACE) {\r
- var li = getLi();\r
- if (li) {\r
- var list = ed.dom.getParent(li, 'ol,ul');\r
- if (list && list.firstChild === li) {\r
- var elements = listElements(list, li);\r
- ed.execCommand("Outdent", false, elements);\r
- ed.undoManager.add();\r
- return Event.cancel(e);\r
- }\r
- }\r
- }\r
- }\r
-\r
- function fixDeletingEmptyLiInWebkit(ed, e) {\r
- var li = getLi();\r
- if (e.keyCode === tinymce.VK.BACKSPACE && ed.dom.is(li, 'li') && li.parentNode.firstChild!==li) {\r
- if (ed.dom.select('ul,ol', li).length === 1) {\r
- var prevLi = li.previousSibling;\r
- ed.dom.remove(ed.dom.select('br', li));\r
- ed.dom.remove(li, true);\r
- var textNodes = tinymce.grep(prevLi.childNodes, function(n){ return n.nodeType === 3 });\r
- if (textNodes.length === 1) {\r
- var textNode = textNodes[0]\r
- ed.selection.setCursorLocation(textNode, textNode.length);\r
- }\r
- ed.undoManager.add();\r
- return Event.cancel(e);\r
- }\r
- }\r
- }\r
-\r
- ed.onKeyDown.add(function(_, e) { state = getListKeyState(e); });\r
- ed.onKeyDown.add(cancelDefaultEvents);\r
- ed.onKeyDown.add(imageJoiningListItem);\r
- ed.onKeyDown.add(createNewLi);\r
-\r
- if (tinymce.isGecko) {\r
- ed.onKeyUp.add(fixIndentedListItemForGecko);\r
- }\r
- if (tinymce.isIE8) {\r
- ed.onKeyUp.add(fixIndentedListItemForIE8);\r
- }\r
- if (tinymce.isGecko || tinymce.isWebKit) {\r
- ed.onKeyDown.add(fixDeletingFirstCharOfList);\r
- }\r
- if (tinymce.isWebKit) {\r
- ed.onKeyDown.add(fixDeletingEmptyLiInWebkit);\r
- }\r
- },\r
-\r
- applyList: function(targetListType, oppositeListType) {\r
- var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions,\r
- selectedBlocks = ed.selection.getSelectedBlocks();\r
-\r
- function cleanupBr(e) {\r
- if (e && e.tagName === 'BR') {\r
- dom.remove(e);\r
- }\r
- }\r
-\r
- function makeList(element) {\r
- var list = dom.create(targetListType), li;\r
-\r
- function adjustIndentForNewList(element) {\r
- // If there's a margin-left, outdent one level to account for the extra list margin.\r
- if (element.style.marginLeft || element.style.paddingLeft) {\r
- t.adjustPaddingFunction(false)(element);\r
- }\r
- }\r
-\r
- if (element.tagName === 'LI') {\r
- // No change required.\r
- } else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') {\r
- processBrs(element, function(startSection, br) {\r
- doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode);\r
- li = startSection.parentNode;\r
- adjustIndentForNewList(li);\r
- cleanupBr(br);\r
- });\r
- if (li) {\r
- if (li.tagName === 'LI' && (element.tagName === 'P' || selectedBlocks.length > 1)) {\r
- dom.split(li.parentNode.parentNode, li.parentNode);\r
- }\r
- attemptMergeWithAdjacent(li.parentNode, true);\r
- }\r
- return;\r
- } else {\r
- // Put the list around the element.\r
- li = dom.create('li');\r
- dom.insertAfter(li, element);\r
- li.appendChild(element);\r
- adjustIndentForNewList(element);\r
- element = li;\r
- }\r
- dom.insertAfter(list, element);\r
- list.appendChild(element);\r
- attemptMergeWithAdjacent(list, true);\r
- applied.push(element);\r
- }\r
-\r
- function doWrapList(start, end, template) {\r
- var li, n = start, tmp;\r
- while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) {\r
- start = dom.split(start.parentNode, start.previousSibling);\r
- start = start.nextSibling;\r
- n = start;\r
- }\r
- if (template) {\r
- li = template.cloneNode(true);\r
- start.parentNode.insertBefore(li, start);\r
- while (li.firstChild) dom.remove(li.firstChild);\r
- li = dom.rename(li, 'li');\r
- } else {\r
- li = dom.create('li');\r
- start.parentNode.insertBefore(li, start);\r
- }\r
- while (n && n != end) {\r
- tmp = n.nextSibling;\r
- li.appendChild(n);\r
- n = tmp;\r
- }\r
- if (li.childNodes.length === 0) {\r
- li.innerHTML = '<br _mce_bogus="1" />';\r
- }\r
- makeList(li);\r
- }\r
-\r
- function processBrs(element, callback) {\r
- var startSection, previousBR, END_TO_START = 3, START_TO_END = 1,\r
- breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl';\r
-\r
- function isAnyPartSelected(start, end) {\r
- var r = dom.createRng(), sel;\r
- bookmark.keep = true;\r
- ed.selection.moveToBookmark(bookmark);\r
- bookmark.keep = false;\r
- sel = ed.selection.getRng(true);\r
- if (!end) {\r
- end = start.parentNode.lastChild;\r
- }\r
- r.setStartBefore(start);\r
- r.setEndAfter(end);\r
- return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0);\r
- }\r
-\r
- function nextLeaf(br) {\r
- if (br.nextSibling)\r
- return br.nextSibling;\r
- if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot())\r
- return nextLeaf(br.parentNode);\r
- }\r
-\r
- // Split on BRs within the range and process those.\r
- startSection = element.firstChild;\r
- // First mark the BRs that have any part of the previous section selected.\r
- var trailingContentSelected = false;\r
- each(dom.select(breakElements, element), function(br) {\r
- if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {\r
- return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.\r
- }\r
- if (isAnyPartSelected(startSection, br)) {\r
- dom.addClass(br, '_mce_tagged_br');\r
- startSection = nextLeaf(br);\r
- }\r
- });\r
- trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined));\r
- startSection = element.firstChild;\r
- each(dom.select(breakElements, element), function(br) {\r
- // Got a section from start to br.\r
- var tmp = nextLeaf(br);\r
- if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {\r
- return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.\r
- }\r
- if (dom.hasClass(br, '_mce_tagged_br')) {\r
- callback(startSection, br, previousBR);\r
- previousBR = null;\r
- } else {\r
- previousBR = br;\r
- }\r
- startSection = tmp;\r
- });\r
- if (trailingContentSelected) {\r
- callback(startSection, undefined, previousBR);\r
- }\r
- }\r
-\r
- function wrapList(element) {\r
- processBrs(element, function(startSection, br, previousBR) {\r
- // Need to indent this part\r
- doWrapList(startSection, br);\r
- cleanupBr(br);\r
- cleanupBr(previousBR);\r
- });\r
- }\r
-\r
- function changeList(element) {\r
- if (tinymce.inArray(applied, element) !== -1) {\r
- return;\r
- }\r
- if (element.parentNode.tagName === oppositeListType) {\r
- dom.split(element.parentNode, element);\r
- makeList(element);\r
- attemptMergeWithNext(element.parentNode, false);\r
- }\r
- applied.push(element);\r
- }\r
-\r
- function convertListItemToParagraph(element) {\r
- var child, nextChild, mergedElement, splitLast;\r
- if (tinymce.inArray(applied, element) !== -1) {\r
- return;\r
- }\r
- element = splitNestedLists(element, dom);\r
- while (dom.is(element.parentNode, 'ol,ul,li')) {\r
- dom.split(element.parentNode, element);\r
- }\r
- // Push the original element we have from the selection, not the renamed one.\r
- applied.push(element);\r
- element = dom.rename(element, 'p');\r
- mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines);\r
- if (mergedElement === element) {\r
- // Now split out any block elements that can't be contained within a P.\r
- // Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each)\r
- child = element.firstChild;\r
- while (child) {\r
- if (dom.isBlock(child)) {\r
- child = dom.split(child.parentNode, child);\r
- splitLast = true;\r
- nextChild = child.nextSibling && child.nextSibling.firstChild;\r
- } else {\r
- nextChild = child.nextSibling;\r
- if (splitLast && child.tagName === 'BR') {\r
- dom.remove(child);\r
- }\r
- splitLast = false;\r
- }\r
- child = nextChild;\r
- }\r
- }\r
- }\r
-\r
- each(selectedBlocks, function(e) {\r
- e = findItemToOperateOn(e, dom);\r
- if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) {\r
- hasOppositeType = true;\r
- } else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) {\r
- hasSameType = true;\r
- } else {\r
- hasNonList = true;\r
- }\r
- });\r
-\r
- if (hasNonList &&!hasSameType || hasOppositeType || selectedBlocks.length === 0) {\r
- actions = {\r
- 'LI': changeList,\r
- 'H1': makeList,\r
- 'H2': makeList,\r
- 'H3': makeList,\r
- 'H4': makeList,\r
- 'H5': makeList,\r
- 'H6': makeList,\r
- 'P': makeList,\r
- 'BODY': makeList,\r
- 'DIV': selectedBlocks.length > 1 ? makeList : wrapList,\r
- defaultAction: wrapList,\r
- elements: this.selectedBlocks()\r
- };\r
- } else {\r
- actions = {\r
- defaultAction: convertListItemToParagraph,\r
- elements: this.selectedBlocks()\r
- };\r
- }\r
- this.process(actions);\r
- },\r
-\r
- indent: function() {\r
- var ed = this.ed, dom = ed.dom, indented = [];\r
-\r
- function createWrapItem(element) {\r
- var wrapItem = dom.create('li', { style: 'list-style-type: none;'});\r
- dom.insertAfter(wrapItem, element);\r
- return wrapItem;\r
- }\r
-\r
- function createWrapList(element) {\r
- var wrapItem = createWrapItem(element),\r
- list = dom.getParent(element, 'ol,ul'),\r
- listType = list.tagName,\r
- listStyle = dom.getStyle(list, 'list-style-type'),\r
- attrs = {},\r
- wrapList;\r
- if (listStyle !== '') {\r
- attrs.style = 'list-style-type: ' + listStyle + ';';\r
- }\r
- wrapList = dom.create(listType, attrs);\r
- wrapItem.appendChild(wrapList);\r
- return wrapList;\r
- }\r
-\r
- function indentLI(element) {\r
- if (!hasParentInList(ed, element, indented)) {\r
- element = splitNestedLists(element, dom);\r
- var wrapList = createWrapList(element);\r
- wrapList.appendChild(element);\r
- attemptMergeWithAdjacent(wrapList.parentNode, false);\r
- attemptMergeWithAdjacent(wrapList, false);\r
- indented.push(element);\r
- }\r
- }\r
-\r
- this.process({\r
- 'LI': indentLI,\r
- defaultAction: this.adjustPaddingFunction(true),\r
- elements: this.selectedBlocks()\r
- });\r
-\r
- },\r
-\r
- outdent: function(ui, elements) {\r
- var t = this, ed = t.ed, dom = ed.dom, outdented = [];\r
-\r
- function outdentLI(element) {\r
- var listElement, targetParent, align;\r
- if (!hasParentInList(ed, element, outdented)) {\r
- if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') {\r
- return t.adjustPaddingFunction(false)(element);\r
- }\r
- align = dom.getStyle(element, 'text-align', true);\r
- if (align === 'center' || align === 'right') {\r
- dom.setStyle(element, 'text-align', 'left');\r
- return;\r
- }\r
- element = splitNestedLists(element, dom);\r
- listElement = element.parentNode;\r
- targetParent = element.parentNode.parentNode;\r
- if (targetParent.tagName === 'P') {\r
- dom.split(targetParent, element.parentNode);\r
- } else {\r
- dom.split(listElement, element);\r
- if (targetParent.tagName === 'LI') {\r
- // Nested list, need to split the LI and go back out to the OL/UL element.\r
- dom.split(targetParent, element);\r
- } else if (!dom.is(targetParent, 'ol,ul')) {\r
- dom.rename(element, 'p');\r
- }\r
- }\r
- outdented.push(element);\r
- }\r
- }\r
-\r
- var listElements = elements && tinymce.is(elements, 'array') ? elements : this.selectedBlocks();\r
- this.process({\r
- 'LI': outdentLI,\r
- defaultAction: this.adjustPaddingFunction(false),\r
- elements: listElements\r
- });\r
-\r
- each(outdented, attemptMergeWithAdjacent);\r
- },\r
-\r
- process: function(actions) {\r
- var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r;\r
-\r
- function isEmptyElement(element) {\r
- var excludeBrsAndBookmarks = tinymce.grep(element.childNodes, function(n) {\r
- return !(n.nodeName === 'BR' || n.nodeName === 'SPAN' && dom.getAttrib(n, 'data-mce-type') == 'bookmark'\r
- || n.nodeType == 3 && (n.nodeValue == String.fromCharCode(160) || n.nodeValue == ''));\r
- });\r
- return excludeBrsAndBookmarks.length === 0;\r
- }\r
-\r
- function processElement(element) {\r
- dom.removeClass(element, '_mce_act_on');\r
- if (!element || element.nodeType !== 1 || selectedBlocks.length > 1 && isEmptyElement(element)) {\r
- return;\r
- }\r
- element = findItemToOperateOn(element, dom);\r
- var action = actions[element.tagName];\r
- if (!action) {\r
- action = actions.defaultAction;\r
- }\r
- action(element);\r
- }\r
-\r
- function recurse(element) {\r
- t.splitSafeEach(element.childNodes, processElement);\r
- }\r
-\r
- function brAtEdgeOfSelection(container, offset) {\r
- return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length &&\r
- container.childNodes[offset].tagName === 'BR';\r
- }\r
-\r
- function isInTable() {\r
- var n = sel.getNode();\r
- var p = dom.getParent(n, 'td');\r
- return p !== null;\r
- }\r
-\r
- selectedBlocks = actions.elements;\r
-\r
- r = sel.getRng(true);\r
- if (!r.collapsed) {\r
- if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) {\r
- r.setEnd(r.endContainer, r.endOffset - 1);\r
- sel.setRng(r);\r
- }\r
- if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) {\r
- r.setStart(r.startContainer, r.startOffset + 1);\r
- sel.setRng(r);\r
- }\r
- }\r
-\r
-\r
- if (tinymce.isIE8) {\r
- // append a zero sized nbsp so that caret is restored correctly using bookmark\r
- var s = t.ed.selection.getNode();\r
- if (s.tagName === 'LI' && !(s.parentNode.lastChild === s)) {\r
- var i = t.ed.getDoc().createTextNode('\uFEFF');\r
- s.appendChild(i);\r
- }\r
- }\r
-\r
- bookmark = sel.getBookmark();\r
- actions.OL = actions.UL = recurse;\r
- t.splitSafeEach(selectedBlocks, processElement);\r
- sel.moveToBookmark(bookmark);\r
- bookmark = null;\r
-\r
- // we avoid doing repaint in a table as this will move the caret out of the table in Firefox 3.6\r
- if (!isInTable()) {\r
- // Avoids table or image handles being left behind in Firefox.\r
- t.ed.execCommand('mceRepaint');\r
- }\r
- },\r
-\r
- splitSafeEach: function(elements, f) {\r
- if (tinymce.isGecko && (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) ||\r
- /Firefox\/3\.[0-4]/.test(navigator.userAgent))) {\r
- this.classBasedEach(elements, f);\r
- } else {\r
- each(elements, f);\r
- }\r
- },\r
-\r
- classBasedEach: function(elements, f) {\r
- var dom = this.ed.dom, nodes, element;\r
- // Mark nodes\r
- each(elements, function(element) {\r
- dom.addClass(element, '_mce_act_on');\r
- });\r
- nodes = dom.select('._mce_act_on');\r
- while (nodes.length > 0) {\r
- element = nodes.shift();\r
- dom.removeClass(element, '_mce_act_on');\r
- f(element);\r
- nodes = dom.select('._mce_act_on');\r
- }\r
- },\r
-\r
- adjustPaddingFunction: function(isIndent) {\r
- var indentAmount, indentUnits, ed = this.ed;\r
- indentAmount = ed.settings.indentation;\r
- indentUnits = /[a-z%]+/i.exec(indentAmount);\r
- indentAmount = parseInt(indentAmount, 10);\r
- return function(element) {\r
- var currentIndent, newIndentAmount;\r
- currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10);\r
- if (isIndent) {\r
- newIndentAmount = currentIndent + indentAmount;\r
- } else {\r
- newIndentAmount = currentIndent - indentAmount;\r
- }\r
- ed.dom.setStyle(element, 'padding-left', '');\r
- ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : '');\r
- };\r
- },\r
-\r
- selectedBlocks: function() {\r
- var ed = this.ed\r
- var selectedBlocks = ed.selection.getSelectedBlocks();\r
- return selectedBlocks.length == 0 ? [ ed.dom.getRoot() ] : selectedBlocks;\r
- },\r
-\r
- getInfo: function() {\r
- return {\r
- longname : 'Lists',\r
- author : 'Moxiecode Systems AB',\r
- authorurl : 'http://tinymce.moxiecode.com',\r
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists',\r
- version : tinymce.majorVersion + "." + tinymce.minorVersion\r
- };\r
- }\r
- });\r
- tinymce.PluginManager.add("lists", tinymce.plugins.Lists);\r
-}());\r
+/**
+ * editor_plugin_src.js
+ *
+ * Copyright 2011, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+(function() {
+ var each = tinymce.each, Event = tinymce.dom.Event, bookmark;
+
+ // Skips text nodes that only contain whitespace since they aren't semantically important.
+ function skipWhitespaceNodes(e, next) {
+ while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) {
+ e = next(e);
+ }
+ return e;
+ }
+
+ function skipWhitespaceNodesBackwards(e) {
+ return skipWhitespaceNodes(e, function(e) {
+ return e.previousSibling;
+ });
+ }
+
+ function skipWhitespaceNodesForwards(e) {
+ return skipWhitespaceNodes(e, function(e) {
+ return e.nextSibling;
+ });
+ }
+
+ function hasParentInList(ed, e, list) {
+ return ed.dom.getParent(e, function(p) {
+ return tinymce.inArray(list, p) !== -1;
+ });
+ }
+
+ function isList(e) {
+ return e && (e.tagName === 'OL' || e.tagName === 'UL');
+ }
+
+ function splitNestedLists(element, dom) {
+ var tmp, nested, wrapItem;
+ tmp = skipWhitespaceNodesBackwards(element.lastChild);
+ while (isList(tmp)) {
+ nested = tmp;
+ tmp = skipWhitespaceNodesBackwards(nested.previousSibling);
+ }
+ if (nested) {
+ wrapItem = dom.create('li', { style: 'list-style-type: none;'});
+ dom.split(element, nested);
+ dom.insertAfter(wrapItem, nested);
+ wrapItem.appendChild(nested);
+ wrapItem.appendChild(nested);
+ element = wrapItem.previousSibling;
+ }
+ return element;
+ }
+
+ function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) {
+ e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs);
+ return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs);
+ }
+
+ function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) {
+ var prev = skipWhitespaceNodesBackwards(e.previousSibling);
+ if (prev) {
+ return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs);
+ } else {
+ return e;
+ }
+ }
+
+ function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) {
+ var next = skipWhitespaceNodesForwards(e.nextSibling);
+ if (next) {
+ return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs);
+ } else {
+ return e;
+ }
+ }
+
+ function attemptMerge(e1, e2, differentStylesMasterElement, mergeParagraphs) {
+ if (canMerge(e1, e2, !!differentStylesMasterElement, mergeParagraphs)) {
+ return merge(e1, e2, differentStylesMasterElement);
+ } else if (e1 && e1.tagName === 'LI' && isList(e2)) {
+ // Fix invalidly nested lists.
+ e1.appendChild(e2);
+ }
+ return e2;
+ }
+
+ function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) {
+ if (!e1 || !e2) {
+ return false;
+ } else if (e1.tagName === 'LI' && e2.tagName === 'LI') {
+ return e2.style.listStyleType === 'none' || containsOnlyAList(e2);
+ } else if (isList(e1)) {
+ return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2);
+ } else return mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P';
+ }
+
+ function isListForIndent(e) {
+ var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild);
+ return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI));
+ }
+
+ function containsOnlyAList(e) {
+ var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild);
+ return firstChild && lastChild && firstChild === lastChild && isList(firstChild);
+ }
+
+ function merge(e1, e2, masterElement) {
+ var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild);
+ if (e1.tagName === 'P') {
+ e1.appendChild(e1.ownerDocument.createElement('br'));
+ }
+ while (e2.firstChild) {
+ e1.appendChild(e2.firstChild);
+ }
+ if (masterElement) {
+ e1.style.listStyleType = masterElement.style.listStyleType;
+ }
+ e2.parentNode.removeChild(e2);
+ attemptMerge(lastOriginal, firstNew, false);
+ return e1;
+ }
+
+ function findItemToOperateOn(e, dom) {
+ var item;
+ if (!dom.is(e, 'li,ol,ul')) {
+ item = dom.getParent(e, 'li');
+ if (item) {
+ e = item;
+ }
+ }
+ return e;
+ }
+
+ tinymce.create('tinymce.plugins.Lists', {
+ init: function(ed) {
+ var LIST_TABBING = 'TABBING';
+ var LIST_EMPTY_ITEM = 'EMPTY';
+ var LIST_ESCAPE = 'ESCAPE';
+ var LIST_PARAGRAPH = 'PARAGRAPH';
+ var LIST_UNKNOWN = 'UNKNOWN';
+ var state = LIST_UNKNOWN;
+
+ function isTabInList(e) {
+ // Don't indent on Ctrl+Tab or Alt+Tab
+ return e.keyCode === tinymce.VK.TAB && !(e.altKey || e.ctrlKey) &&
+ (ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList'));
+ }
+
+ function isOnLastListItem() {
+ var li = getLi();
+ var grandParent = li.parentNode.parentNode;
+ var isLastItem = li.parentNode.lastChild === li;
+ return isLastItem && !isNestedList(grandParent) && isEmptyListItem(li);
+ }
+
+ function isNestedList(grandParent) {
+ if (isList(grandParent)) {
+ return grandParent.parentNode && grandParent.parentNode.tagName === 'LI';
+ } else {
+ return grandParent.tagName === 'LI';
+ }
+ }
+
+ function isInEmptyListItem() {
+ return ed.selection.isCollapsed() && isEmptyListItem(getLi());
+ }
+
+ function getLi() {
+ var n = ed.selection.getStart();
+ // Get start will return BR if the LI only contains a BR or an empty element as we use these to fix caret position
+ return ((n.tagName == 'BR' || n.tagName == '') && n.parentNode.tagName == 'LI') ? n.parentNode : n;
+ }
+
+ function isEmptyListItem(li) {
+ var numChildren = li.childNodes.length;
+ if (li.tagName === 'LI') {
+ return numChildren == 0 ? true : numChildren == 1 && (li.firstChild.tagName == '' || li.firstChild.tagName == 'BR' || isEmptyIE9Li(li));
+ }
+ return false;
+ }
+
+ function isEmptyIE9Li(li) {
+ // only consider this to be last item if there is no list item content or that content is nbsp or space since IE9 creates these
+ var lis = tinymce.grep(li.parentNode.childNodes, function(n) {return n.tagName == 'LI'});
+ var isLastLi = li == lis[lis.length - 1];
+ var child = li.firstChild;
+ return tinymce.isIE9 && isLastLi && (child.nodeValue == String.fromCharCode(160) || child.nodeValue == String.fromCharCode(32));
+ }
+
+ function isEnter(e) {
+ return e.keyCode === tinymce.VK.ENTER;
+ }
+
+ function isEnterWithoutShift(e) {
+ return isEnter(e) && !e.shiftKey;
+ }
+
+ function getListKeyState(e) {
+ if (isTabInList(e)) {
+ return LIST_TABBING;
+ } else if (isEnterWithoutShift(e) && isOnLastListItem()) {
+ // Returns LIST_UNKNOWN since breaking out of lists is handled by the EnterKey.js logic now
+ //return LIST_ESCAPE;
+ return LIST_UNKNOWN;
+ } else if (isEnterWithoutShift(e) && isInEmptyListItem()) {
+ return LIST_EMPTY_ITEM;
+ } else {
+ return LIST_UNKNOWN;
+ }
+ }
+
+ function cancelDefaultEvents(ed, e) {
+ // list escape is done manually using outdent as it does not create paragraphs correctly in td's
+ if (state == LIST_TABBING || state == LIST_EMPTY_ITEM || tinymce.isGecko && state == LIST_ESCAPE) {
+ Event.cancel(e);
+ }
+ }
+
+ function isCursorAtEndOfContainer() {
+ var range = ed.selection.getRng(true);
+ var startContainer = range.startContainer;
+ if (startContainer.nodeType == 3) {
+ var value = startContainer.nodeValue;
+ if (tinymce.isIE9 && value.length > 1 && value.charCodeAt(value.length-1) == 32) {
+ // IE9 places a space on the end of the text in some cases so ignore last char
+ return (range.endOffset == value.length-1);
+ } else {
+ return (range.endOffset == value.length);
+ }
+ } else if (startContainer.nodeType == 1) {
+ return range.endOffset == startContainer.childNodes.length;
+ }
+ return false;
+ }
+
+ /*
+ If we are at the end of a list item surrounded with an element, pressing enter should create a
+ new list item instead without splitting the element e.g. don't want to create new P or H1 tag
+ */
+ function isEndOfListItem() {
+ var node = ed.selection.getNode();
+ var validElements = 'h1,h2,h3,h4,h5,h6,p,div';
+ var isLastParagraphOfLi = ed.dom.is(node, validElements) && node.parentNode.tagName === 'LI' && node.parentNode.lastChild === node;
+ return ed.selection.isCollapsed() && isLastParagraphOfLi && isCursorAtEndOfContainer();
+ }
+
+ // Creates a new list item after the current selection's list item parent
+ function createNewLi(ed, e) {
+ if (isEnterWithoutShift(e) && isEndOfListItem()) {
+ var node = ed.selection.getNode();
+ var li = ed.dom.create("li");
+ var parentLi = ed.dom.getParent(node, 'li');
+ ed.dom.insertAfter(li, parentLi);
+
+ // Move caret to new list element.
+ if (tinymce.isIE6 || tinymce.isIE7 || tinyMCE.isIE8) {
+ // Removed this line since it would create an odd < > tag and placing the caret inside an empty LI is handled and should be handled by the selection logic
+ //li.appendChild(ed.dom.create(" ")); // IE needs an element within the bullet point
+ ed.selection.setCursorLocation(li, 1);
+ } else {
+ ed.selection.setCursorLocation(li, 0);
+ }
+ e.preventDefault();
+ }
+ }
+
+ function imageJoiningListItem(ed, e) {
+ var prevSibling;
+
+ if (!tinymce.isGecko)
+ return;
+
+ var n = ed.selection.getStart();
+ if (e.keyCode != tinymce.VK.BACKSPACE || n.tagName !== 'IMG')
+ return;
+
+ function lastLI(node) {
+ var child = node.firstChild;
+ var li = null;
+ do {
+ if (!child)
+ break;
+
+ if (child.tagName === 'LI')
+ li = child;
+ } while (child = child.nextSibling);
+
+ return li;
+ }
+
+ function addChildren(parentNode, destination) {
+ while (parentNode.childNodes.length > 0)
+ destination.appendChild(parentNode.childNodes[0]);
+ }
+
+ // Check if there is a previous sibling
+ prevSibling = n.parentNode.previousSibling;
+ if (!prevSibling)
+ return;
+
+ var ul;
+ if (prevSibling.tagName === 'UL' || prevSibling.tagName === 'OL')
+ ul = prevSibling;
+ else if (prevSibling.previousSibling && (prevSibling.previousSibling.tagName === 'UL' || prevSibling.previousSibling.tagName === 'OL'))
+ ul = prevSibling.previousSibling;
+ else
+ return;
+
+ var li = lastLI(ul);
+
+ // move the caret to the end of the list item
+ var rng = ed.dom.createRng();
+ rng.setStart(li, 1);
+ rng.setEnd(li, 1);
+ ed.selection.setRng(rng);
+ ed.selection.collapse(true);
+
+ // save a bookmark at the end of the list item
+ var bookmark = ed.selection.getBookmark();
+
+ // copy the image an its text to the list item
+ var clone = n.parentNode.cloneNode(true);
+ if (clone.tagName === 'P' || clone.tagName === 'DIV')
+ addChildren(clone, li);
+ else
+ li.appendChild(clone);
+
+ // remove the old copy of the image
+ n.parentNode.parentNode.removeChild(n.parentNode);
+
+ // move the caret where we saved the bookmark
+ ed.selection.moveToBookmark(bookmark);
+ }
+
+ // fix the cursor position to ensure it is correct in IE
+ function setCursorPositionToOriginalLi(li) {
+ var list = ed.dom.getParent(li, 'ol,ul');
+ if (list != null) {
+ var lastLi = list.lastChild;
+ // Removed this line since IE9 would report an DOM character error and placing the caret inside an empty LI is handled and should be handled by the selection logic
+ //lastLi.appendChild(ed.getDoc().createElement(''));
+ ed.selection.setCursorLocation(lastLi, 0);
+ }
+ }
+
+ this.ed = ed;
+ ed.addCommand('Indent', this.indent, this);
+ ed.addCommand('Outdent', this.outdent, this);
+ ed.addCommand('InsertUnorderedList', function() {
+ this.applyList('UL', 'OL');
+ }, this);
+ ed.addCommand('InsertOrderedList', function() {
+ this.applyList('OL', 'UL');
+ }, this);
+
+ ed.onInit.add(function() {
+ ed.editorCommands.addCommands({
+ 'outdent': function() {
+ var sel = ed.selection, dom = ed.dom;
+
+ function hasStyleIndent(n) {
+ n = dom.getParent(n, dom.isBlock);
+ return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0;
+ }
+
+ return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList');
+ }
+ }, 'state');
+ });
+
+ ed.onKeyUp.add(function(ed, e) {
+ if (state == LIST_TABBING) {
+ ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null);
+ state = LIST_UNKNOWN;
+ return Event.cancel(e);
+ } else if (state == LIST_EMPTY_ITEM) {
+ var li = getLi();
+ var shouldOutdent = ed.settings.list_outdent_on_enter === true || e.shiftKey;
+ ed.execCommand(shouldOutdent ? 'Outdent' : 'Indent', true, null);
+ if (tinymce.isIE) {
+ setCursorPositionToOriginalLi(li);
+ }
+
+ return Event.cancel(e);
+ } else if (state == LIST_ESCAPE) {
+ if (tinymce.isIE6 || tinymce.isIE7 || tinymce.isIE8) {
+ // append a zero sized nbsp so that caret is positioned correctly in IE after escaping and applying formatting.
+ // if there is no text then applying formatting for e.g a H1 to the P tag immediately following list after
+ // escaping from it will cause the caret to be positioned on the last li instead of staying the in P tag.
+ var n = ed.getDoc().createTextNode('\uFEFF');
+ ed.selection.getNode().appendChild(n);
+ } else if (tinymce.isIE9 || tinymce.isGecko) {
+ // IE9 does not escape the list so we use outdent to do this and cancel the default behaviour
+ // Gecko does not create a paragraph outdenting inside a TD so default behaviour is cancelled and we outdent ourselves
+ ed.execCommand('Outdent');
+ return Event.cancel(e);
+ }
+ }
+ });
+
+ function fixListItem(parent, reference) {
+ // a zero-sized non-breaking space is placed in the empty list item so that the nested list is
+ // displayed on the below line instead of next to it
+ var n = ed.getDoc().createTextNode('\uFEFF');
+ parent.insertBefore(n, reference);
+ ed.selection.setCursorLocation(n, 0);
+ // repaint to remove rendering artifact. only visible when creating new list
+ ed.execCommand('mceRepaint');
+ }
+
+ function fixIndentedListItemForGecko(ed, e) {
+ if (isEnter(e)) {
+ var li = getLi();
+ if (li) {
+ var parent = li.parentNode;
+ var grandParent = parent && parent.parentNode;
+ if (grandParent && grandParent.nodeName == 'LI' && grandParent.firstChild == parent && li == parent.firstChild) {
+ fixListItem(grandParent, parent);
+ }
+ }
+ }
+ }
+
+ function fixIndentedListItemForIE8(ed, e) {
+ if (isEnter(e)) {
+ var li = getLi();
+ if (ed.dom.select('ul li', li).length === 1) {
+ var list = li.firstChild;
+ fixListItem(li, list);
+ }
+ }
+ }
+
+ function fixDeletingFirstCharOfList(ed, e) {
+ function listElements(list, li) {
+ var elements = [];
+ var walker = new tinymce.dom.TreeWalker(li, list);
+ for (var node = walker.current(); node; node = walker.next()) {
+ if (ed.dom.is(node, 'ol,ul,li')) {
+ elements.push(node);
+ }
+ }
+ return elements;
+ }
+
+ if (e.keyCode == tinymce.VK.BACKSPACE) {
+ var li = getLi();
+ if (li) {
+ var list = ed.dom.getParent(li, 'ol,ul');
+ if (list && list.firstChild === li) {
+ var elements = listElements(list, li);
+ ed.execCommand("Outdent", false, elements);
+ ed.undoManager.add();
+ return Event.cancel(e);
+ }
+ }
+ }
+ }
+
+ function fixDeletingEmptyLiInWebkit(ed, e) {
+ var li = getLi();
+ if (e.keyCode === tinymce.VK.BACKSPACE && ed.dom.is(li, 'li') && li.parentNode.firstChild!==li) {
+ if (ed.dom.select('ul,ol', li).length === 1) {
+ var prevLi = li.previousSibling;
+ ed.dom.remove(ed.dom.select('br', li));
+ ed.dom.remove(li, true);
+ var textNodes = tinymce.grep(prevLi.childNodes, function(n){ return n.nodeType === 3 });
+ if (textNodes.length === 1) {
+ var textNode = textNodes[0]
+ ed.selection.setCursorLocation(textNode, textNode.length);
+ }
+ ed.undoManager.add();
+ return Event.cancel(e);
+ }
+ }
+ }
+
+ ed.onKeyDown.add(function(_, e) { state = getListKeyState(e); });
+ ed.onKeyDown.add(cancelDefaultEvents);
+ ed.onKeyDown.add(imageJoiningListItem);
+ ed.onKeyDown.add(createNewLi);
+
+ if (tinymce.isGecko) {
+ ed.onKeyUp.add(fixIndentedListItemForGecko);
+ }
+ if (tinymce.isIE8) {
+ ed.onKeyUp.add(fixIndentedListItemForIE8);
+ }
+ if (tinymce.isGecko || tinymce.isWebKit) {
+ ed.onKeyDown.add(fixDeletingFirstCharOfList);
+ }
+ if (tinymce.isWebKit) {
+ ed.onKeyDown.add(fixDeletingEmptyLiInWebkit);
+ }
+ },
+
+ applyList: function(targetListType, oppositeListType) {
+ var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions,
+ selectedBlocks = ed.selection.getSelectedBlocks();
+
+ function cleanupBr(e) {
+ if (e && e.tagName === 'BR') {
+ dom.remove(e);
+ }
+ }
+
+ function makeList(element) {
+ var list = dom.create(targetListType), li;
+
+ function adjustIndentForNewList(element) {
+ // If there's a margin-left, outdent one level to account for the extra list margin.
+ if (element.style.marginLeft || element.style.paddingLeft) {
+ t.adjustPaddingFunction(false)(element);
+ }
+ }
+
+ if (element.tagName === 'LI') {
+ // No change required.
+ } else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') {
+ processBrs(element, function(startSection, br) {
+ doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode);
+ li = startSection.parentNode;
+ adjustIndentForNewList(li);
+ cleanupBr(br);
+ });
+ if (li) {
+ if (li.tagName === 'LI' && (element.tagName === 'P' || selectedBlocks.length > 1)) {
+ dom.split(li.parentNode.parentNode, li.parentNode);
+ }
+ attemptMergeWithAdjacent(li.parentNode, true);
+ }
+ return;
+ } else {
+ // Put the list around the element.
+ li = dom.create('li');
+ dom.insertAfter(li, element);
+ li.appendChild(element);
+ adjustIndentForNewList(element);
+ element = li;
+ }
+ dom.insertAfter(list, element);
+ list.appendChild(element);
+ attemptMergeWithAdjacent(list, true);
+ applied.push(element);
+ }
+
+ function doWrapList(start, end, template) {
+ var li, n = start, tmp;
+ while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) {
+ start = dom.split(start.parentNode, start.previousSibling);
+ start = start.nextSibling;
+ n = start;
+ }
+ if (template) {
+ li = template.cloneNode(true);
+ start.parentNode.insertBefore(li, start);
+ while (li.firstChild) dom.remove(li.firstChild);
+ li = dom.rename(li, 'li');
+ } else {
+ li = dom.create('li');
+ start.parentNode.insertBefore(li, start);
+ }
+ while (n && n != end) {
+ tmp = n.nextSibling;
+ li.appendChild(n);
+ n = tmp;
+ }
+ if (li.childNodes.length === 0) {
+ li.innerHTML = '<br _mce_bogus="1" />';
+ }
+ makeList(li);
+ }
+
+ function processBrs(element, callback) {
+ var startSection, previousBR, END_TO_START = 3, START_TO_END = 1,
+ breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl';
+
+ function isAnyPartSelected(start, end) {
+ var r = dom.createRng(), sel;
+ bookmark.keep = true;
+ ed.selection.moveToBookmark(bookmark);
+ bookmark.keep = false;
+ sel = ed.selection.getRng(true);
+ if (!end) {
+ end = start.parentNode.lastChild;
+ }
+ r.setStartBefore(start);
+ r.setEndAfter(end);
+ return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0);
+ }
+
+ function nextLeaf(br) {
+ if (br.nextSibling)
+ return br.nextSibling;
+ if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot())
+ return nextLeaf(br.parentNode);
+ }
+
+ // Split on BRs within the range and process those.
+ startSection = element.firstChild;
+ // First mark the BRs that have any part of the previous section selected.
+ var trailingContentSelected = false;
+ each(dom.select(breakElements, element), function(br) {
+ if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
+ return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
+ }
+ if (isAnyPartSelected(startSection, br)) {
+ dom.addClass(br, '_mce_tagged_br');
+ startSection = nextLeaf(br);
+ }
+ });
+ trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined));
+ startSection = element.firstChild;
+ each(dom.select(breakElements, element), function(br) {
+ // Got a section from start to br.
+ var tmp = nextLeaf(br);
+ if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
+ return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
+ }
+ if (dom.hasClass(br, '_mce_tagged_br')) {
+ callback(startSection, br, previousBR);
+ previousBR = null;
+ } else {
+ previousBR = br;
+ }
+ startSection = tmp;
+ });
+ if (trailingContentSelected) {
+ callback(startSection, undefined, previousBR);
+ }
+ }
+
+ function wrapList(element) {
+ processBrs(element, function(startSection, br, previousBR) {
+ // Need to indent this part
+ doWrapList(startSection, br);
+ cleanupBr(br);
+ cleanupBr(previousBR);
+ });
+ }
+
+ function changeList(element) {
+ if (tinymce.inArray(applied, element) !== -1) {
+ return;
+ }
+ if (element.parentNode.tagName === oppositeListType) {
+ dom.split(element.parentNode, element);
+ makeList(element);
+ attemptMergeWithNext(element.parentNode, false);
+ }
+ applied.push(element);
+ }
+
+ function convertListItemToParagraph(element) {
+ var child, nextChild, mergedElement, splitLast;
+ if (tinymce.inArray(applied, element) !== -1) {
+ return;
+ }
+ element = splitNestedLists(element, dom);
+ while (dom.is(element.parentNode, 'ol,ul,li')) {
+ dom.split(element.parentNode, element);
+ }
+ // Push the original element we have from the selection, not the renamed one.
+ applied.push(element);
+ element = dom.rename(element, 'p');
+ mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines);
+ if (mergedElement === element) {
+ // Now split out any block elements that can't be contained within a P.
+ // Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each)
+ child = element.firstChild;
+ while (child) {
+ if (dom.isBlock(child)) {
+ child = dom.split(child.parentNode, child);
+ splitLast = true;
+ nextChild = child.nextSibling && child.nextSibling.firstChild;
+ } else {
+ nextChild = child.nextSibling;
+ if (splitLast && child.tagName === 'BR') {
+ dom.remove(child);
+ }
+ splitLast = false;
+ }
+ child = nextChild;
+ }
+ }
+ }
+
+ each(selectedBlocks, function(e) {
+ e = findItemToOperateOn(e, dom);
+ if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) {
+ hasOppositeType = true;
+ } else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) {
+ hasSameType = true;
+ } else {
+ hasNonList = true;
+ }
+ });
+
+ if (hasNonList &&!hasSameType || hasOppositeType || selectedBlocks.length === 0) {
+ actions = {
+ 'LI': changeList,
+ 'H1': makeList,
+ 'H2': makeList,
+ 'H3': makeList,
+ 'H4': makeList,
+ 'H5': makeList,
+ 'H6': makeList,
+ 'P': makeList,
+ 'BODY': makeList,
+ 'DIV': selectedBlocks.length > 1 ? makeList : wrapList,
+ defaultAction: wrapList,
+ elements: this.selectedBlocks()
+ };
+ } else {
+ actions = {
+ defaultAction: convertListItemToParagraph,
+ elements: this.selectedBlocks()
+ };
+ }
+ this.process(actions);
+ },
+
+ indent: function() {
+ var ed = this.ed, dom = ed.dom, indented = [];
+
+ function createWrapItem(element) {
+ var wrapItem = dom.create('li', { style: 'list-style-type: none;'});
+ dom.insertAfter(wrapItem, element);
+ return wrapItem;
+ }
+
+ function createWrapList(element) {
+ var wrapItem = createWrapItem(element),
+ list = dom.getParent(element, 'ol,ul'),
+ listType = list.tagName,
+ listStyle = dom.getStyle(list, 'list-style-type'),
+ attrs = {},
+ wrapList;
+ if (listStyle !== '') {
+ attrs.style = 'list-style-type: ' + listStyle + ';';
+ }
+ wrapList = dom.create(listType, attrs);
+ wrapItem.appendChild(wrapList);
+ return wrapList;
+ }
+
+ function indentLI(element) {
+ if (!hasParentInList(ed, element, indented)) {
+ element = splitNestedLists(element, dom);
+ var wrapList = createWrapList(element);
+ wrapList.appendChild(element);
+ attemptMergeWithAdjacent(wrapList.parentNode, false);
+ attemptMergeWithAdjacent(wrapList, false);
+ indented.push(element);
+ }
+ }
+
+ this.process({
+ 'LI': indentLI,
+ defaultAction: this.adjustPaddingFunction(true),
+ elements: this.selectedBlocks()
+ });
+
+ },
+
+ outdent: function(ui, elements) {
+ var t = this, ed = t.ed, dom = ed.dom, outdented = [];
+
+ function outdentLI(element) {
+ var listElement, targetParent, align;
+ if (!hasParentInList(ed, element, outdented)) {
+ if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') {
+ return t.adjustPaddingFunction(false)(element);
+ }
+ align = dom.getStyle(element, 'text-align', true);
+ if (align === 'center' || align === 'right') {
+ dom.setStyle(element, 'text-align', 'left');
+ return;
+ }
+ element = splitNestedLists(element, dom);
+ listElement = element.parentNode;
+ targetParent = element.parentNode.parentNode;
+ if (targetParent.tagName === 'P') {
+ dom.split(targetParent, element.parentNode);
+ } else {
+ dom.split(listElement, element);
+ if (targetParent.tagName === 'LI') {
+ // Nested list, need to split the LI and go back out to the OL/UL element.
+ dom.split(targetParent, element);
+ } else if (!dom.is(targetParent, 'ol,ul')) {
+ dom.rename(element, 'p');
+ }
+ }
+ outdented.push(element);
+ }
+ }
+
+ var listElements = elements && tinymce.is(elements, 'array') ? elements : this.selectedBlocks();
+ this.process({
+ 'LI': outdentLI,
+ defaultAction: this.adjustPaddingFunction(false),
+ elements: listElements
+ });
+
+ each(outdented, attemptMergeWithAdjacent);
+ },
+
+ process: function(actions) {
+ var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r;
+
+ function isEmptyElement(element) {
+ var excludeBrsAndBookmarks = tinymce.grep(element.childNodes, function(n) {
+ return !(n.nodeName === 'BR' || n.nodeName === 'SPAN' && dom.getAttrib(n, 'data-mce-type') == 'bookmark'
+ || n.nodeType == 3 && (n.nodeValue == String.fromCharCode(160) || n.nodeValue == ''));
+ });
+ return excludeBrsAndBookmarks.length === 0;
+ }
+
+ function processElement(element) {
+ dom.removeClass(element, '_mce_act_on');
+ if (!element || element.nodeType !== 1 || selectedBlocks.length > 1 && isEmptyElement(element)) {
+ return;
+ }
+ element = findItemToOperateOn(element, dom);
+ var action = actions[element.tagName];
+ if (!action) {
+ action = actions.defaultAction;
+ }
+ action(element);
+ }
+
+ function recurse(element) {
+ t.splitSafeEach(element.childNodes, processElement);
+ }
+
+ function brAtEdgeOfSelection(container, offset) {
+ return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length &&
+ container.childNodes[offset].tagName === 'BR';
+ }
+
+ function isInTable() {
+ var n = sel.getNode();
+ var p = dom.getParent(n, 'td');
+ return p !== null;
+ }
+
+ selectedBlocks = actions.elements;
+
+ r = sel.getRng(true);
+ if (!r.collapsed) {
+ if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) {
+ r.setEnd(r.endContainer, r.endOffset - 1);
+ sel.setRng(r);
+ }
+ if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) {
+ r.setStart(r.startContainer, r.startOffset + 1);
+ sel.setRng(r);
+ }
+ }
+
+
+ if (tinymce.isIE8) {
+ // append a zero sized nbsp so that caret is restored correctly using bookmark
+ var s = t.ed.selection.getNode();
+ if (s.tagName === 'LI' && !(s.parentNode.lastChild === s)) {
+ var i = t.ed.getDoc().createTextNode('\uFEFF');
+ s.appendChild(i);
+ }
+ }
+
+ bookmark = sel.getBookmark();
+ actions.OL = actions.UL = recurse;
+ t.splitSafeEach(selectedBlocks, processElement);
+ sel.moveToBookmark(bookmark);
+ bookmark = null;
+
+ // we avoid doing repaint in a table as this will move the caret out of the table in Firefox 3.6
+ if (!isInTable()) {
+ // Avoids table or image handles being left behind in Firefox.
+ t.ed.execCommand('mceRepaint');
+ }
+ },
+
+ splitSafeEach: function(elements, f) {
+ if (tinymce.isGecko && (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) ||
+ /Firefox\/3\.[0-4]/.test(navigator.userAgent))) {
+ this.classBasedEach(elements, f);
+ } else {
+ each(elements, f);
+ }
+ },
+
+ classBasedEach: function(elements, f) {
+ var dom = this.ed.dom, nodes, element;
+ // Mark nodes
+ each(elements, function(element) {
+ dom.addClass(element, '_mce_act_on');
+ });
+ nodes = dom.select('._mce_act_on');
+ while (nodes.length > 0) {
+ element = nodes.shift();
+ dom.removeClass(element, '_mce_act_on');
+ f(element);
+ nodes = dom.select('._mce_act_on');
+ }
+ },
+
+ adjustPaddingFunction: function(isIndent) {
+ var indentAmount, indentUnits, ed = this.ed;
+ indentAmount = ed.settings.indentation;
+ indentUnits = /[a-z%]+/i.exec(indentAmount);
+ indentAmount = parseInt(indentAmount, 10);
+ return function(element) {
+ var currentIndent, newIndentAmount;
+ currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10);
+ if (isIndent) {
+ newIndentAmount = currentIndent + indentAmount;
+ } else {
+ newIndentAmount = currentIndent - indentAmount;
+ }
+ ed.dom.setStyle(element, 'padding-left', '');
+ ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : '');
+ };
+ },
+
+ selectedBlocks: function() {
+ var ed = this.ed
+ var selectedBlocks = ed.selection.getSelectedBlocks();
+ return selectedBlocks.length == 0 ? [ ed.dom.getRoot() ] : selectedBlocks;
+ },
+
+ getInfo: function() {
+ return {
+ longname : 'Lists',
+ author : 'Moxiecode Systems AB',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists',
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
+ };
+ }
+ });
+ tinymce.PluginManager.add("lists", tinymce.plugins.Lists);
+}());
-(function(){var c=tinymce.dom.TreeWalker;var a="contenteditable",d="data-mce-"+a;var e=tinymce.VK;function b(n){var j=n.dom,p=n.selection,r,o="mce_noneditablecaret";r=tinymce.isGecko?"\u200B":"\uFEFF";function m(t){var s;if(t.nodeType===1){s=t.getAttribute(d);if(s&&s!=="inherit"){return s}s=t.contentEditable;if(s!=="inherit"){return s}}return null}function g(s){var t;while(s){t=m(s);if(t){return t==="false"?s:null}s=s.parentNode}}function l(s){while(s){if(s.id===o){return s}s=s.parentNode}}function k(s){var t;if(s){t=new c(s,s);for(s=t.current();s;s=t.next()){if(s.nodeType===3){return s}}}}function f(v,u){var s,t;if(m(v)==="false"){if(j.isBlock(v)){p.select(v);return}}t=j.createRng();if(m(v)==="true"){if(!v.firstChild){v.appendChild(n.getDoc().createTextNode("\u00a0"))}v=v.firstChild;u=true}s=j.create("span",{id:o,"data-mce-bogus":true},r);if(u){v.parentNode.insertBefore(s,v)}else{j.insertAfter(s,v)}t.setStart(s.firstChild,1);t.collapse(true);p.setRng(t);return s}function i(s){var v,t,u;if(s){rng=p.getRng(true);rng.setStartBefore(s);rng.setEndBefore(s);v=k(s);if(v&&v.nodeValue.charAt(0)==r){v=v.deleteData(0,1)}j.remove(s,true);p.setRng(rng)}else{t=l(p.getStart());while((s=j.get(o))&&s!==u){if(t!==s){v=k(s);if(v&&v.nodeValue.charAt(0)==r){v=v.deleteData(0,1)}j.remove(s,true)}u=s}}}function q(){var s,w,u,t,v;function x(B,D){var A,F,E,C,z;A=t.startContainer;F=t.startOffset;if(A.nodeType==3){z=A.nodeValue.length;if((F>0&&F<z)||(D?F==z:F==0)){return}}else{if(F<A.childNodes.length){var G=!D&&F>0?F-1:F;A=A.childNodes[G];if(A.hasChildNodes()){A=A.firstChild}}else{return !D?B:null}}E=new c(A,B);while(C=E[D?"prev":"next"]()){if(C.nodeType===3&&C.nodeValue.length>0){return}else{if(m(C)==="true"){return C}}}return B}i();u=p.isCollapsed();s=g(p.getStart());w=g(p.getEnd());if(s||w){t=p.getRng(true);if(u){s=s||w;var y=p.getStart();if(v=x(s,true)){f(v,true)}else{if(v=x(s,false)){f(v,false)}else{p.select(s)}}}else{t=p.getRng(true);if(s){t.setStartBefore(s)}if(w){t.setEndAfter(w)}p.setRng(t)}}}function h(y,A){var E=A.keyCode,w,B,C,u;function t(G,F){while(G=G[F?"previousSibling":"nextSibling"]){if(G.nodeType!==3||G.nodeValue.length>0){return G}}}function x(F,G){p.select(F);p.collapse(G)}C=p.getStart();u=p.getEnd();w=g(C)||g(u);if(w&&(E<112||E>124)&&E!=e.DELETE&&E!=e.BACKSPACE){A.preventDefault();if(E==e.LEFT||E==e.RIGHT){var v=E==e.LEFT;if(y.dom.isBlock(w)){var z=v?w.previousSibling:w.nextSibling;var s=new c(z,z);var D=v?s.prev():s.next();x(D,!v)}else{x(w,v)}}}else{if(E==e.LEFT||E==e.RIGHT||E==e.BACKSPACE||E==e.DELETE){B=l(C);if(B){if(E==e.LEFT||E==e.BACKSPACE){w=t(B,true);if(w&&m(w)==="false"){A.preventDefault();if(E==e.LEFT){x(w,true)}else{j.remove(w)}}else{i(B)}}if(E==e.RIGHT||E==e.DELETE){w=t(B);if(w&&m(w)==="false"){A.preventDefault();if(E==e.RIGHT){x(w,false)}else{j.remove(w)}}else{i(B)}}}}}}n.onMouseDown.addToTop(function(s,u){var t=s.selection.getNode();if(m(t)==="false"&&t==u.target){u.preventDefault()}});n.onMouseUp.addToTop(q);n.onKeyDown.addToTop(h);n.onKeyUp.addToTop(q)}tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(h,j){var g,f,i;g=" "+tinymce.trim(h.getParam("noneditable_editable_class","mceEditable"))+" ";f=" "+tinymce.trim(h.getParam("noneditable_noneditable_class","mceNonEditable"))+" ";i=h.getParam("noneditable_regexp");if(i&&!i.length){i=[i]}h.onPreInit.add(function(){b(h);if(i){h.onBeforeSetContent.add(function(l,m){var n=i.length,o=m.content,k=tinymce.trim(f);if(m.format=="raw"){return}while(n--){o=o.replace(i[n],function(){var p=arguments;return'<span class="'+k+'" data-mce-content="'+l.dom.encode(p[0])+'">'+l.dom.encode(typeof(p[1])==="string"?p[1]:p[0])+"</span>"})}m.content=o})}h.parser.addAttributeFilter("class",function(k){var l=k.length,m,n;while(l--){n=k[l];m=" "+n.attr("class")+" ";if(m.indexOf(g)!==-1){n.attr(d,"true")}else{if(m.indexOf(f)!==-1){n.attr(d,"false")}}}});h.serializer.addAttributeFilter(d,function(k,l){var m=k.length,n;while(m--){n=k[m];if(i&&n.attr("data-mce-content")){n.name="#text";n.type=3;n.raw=true;n.value=n.attr("data-mce-content")}else{n.attr(a,null);n.attr(d,null)}}});h.parser.addAttributeFilter(a,function(k,l){var m=k.length,n;while(m--){n=k[m];n.attr(d,n.attr(a));n.attr(a,null)}})})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})();
\ No newline at end of file
+(function(){var c=tinymce.dom.TreeWalker;var a="contenteditable",d="data-mce-"+a;var e=tinymce.VK;function b(n){var j=n.dom,p=n.selection,r,o="mce_noneditablecaret";r=tinymce.isGecko?"\u200B":"\uFEFF";function m(t){var s;if(t.nodeType===1){s=t.getAttribute(d);if(s&&s!=="inherit"){return s}s=t.contentEditable;if(s!=="inherit"){return s}}return null}function g(s){var t;while(s){t=m(s);if(t){return t==="false"?s:null}s=s.parentNode}}function l(s){while(s){if(s.id===o){return s}s=s.parentNode}}function k(s){var t;if(s){t=new c(s,s);for(s=t.current();s;s=t.next()){if(s.nodeType===3){return s}}}}function f(v,u){var s,t;if(m(v)==="false"){if(j.isBlock(v)){p.select(v);return}}t=j.createRng();if(m(v)==="true"){if(!v.firstChild){v.appendChild(n.getDoc().createTextNode("\u00a0"))}v=v.firstChild;u=true}s=j.create("span",{id:o,"data-mce-bogus":true},r);if(u){v.parentNode.insertBefore(s,v)}else{j.insertAfter(s,v)}t.setStart(s.firstChild,1);t.collapse(true);p.setRng(t);return s}function i(s){var v,t,u;if(s){rng=p.getRng(true);rng.setStartBefore(s);rng.setEndBefore(s);v=k(s);if(v&&v.nodeValue.charAt(0)==r){v=v.deleteData(0,1)}j.remove(s,true);p.setRng(rng)}else{t=l(p.getStart());while((s=j.get(o))&&s!==u){if(t!==s){v=k(s);if(v&&v.nodeValue.charAt(0)==r){v=v.deleteData(0,1)}j.remove(s,true)}u=s}}}function q(){var s,w,u,t,v;function x(B,D){var A,F,E,C,z;A=t.startContainer;F=t.startOffset;if(A.nodeType==3){z=A.nodeValue.length;if((F>0&&F<z)||(D?F==z:F==0)){return}}else{if(F<A.childNodes.length){var G=!D&&F>0?F-1:F;A=A.childNodes[G];if(A.hasChildNodes()){A=A.firstChild}}else{return !D?B:null}}E=new c(A,B);while(C=E[D?"prev":"next"]()){if(C.nodeType===3&&C.nodeValue.length>0){return}else{if(m(C)==="true"){return C}}}return B}i();u=p.isCollapsed();s=g(p.getStart());w=g(p.getEnd());if(s||w){t=p.getRng(true);if(u){s=s||w;var y=p.getStart();if(v=x(s,true)){f(v,true)}else{if(v=x(s,false)){f(v,false)}else{p.select(s)}}}else{t=p.getRng(true);if(s){t.setStartBefore(s)}if(w){t.setEndAfter(w)}p.setRng(t)}}}function h(z,B){var F=B.keyCode,x,C,D,v;function u(H,G){while(H=H[G?"previousSibling":"nextSibling"]){if(H.nodeType!==3||H.nodeValue.length>0){return H}}}function y(G,H){p.select(G);p.collapse(H)}function t(K){var J,I,M,H;function G(O){var N=I;while(N){if(N===O){return}N=N.parentNode}j.remove(O);q()}function L(){var O,P,N=z.schema.getNonEmptyElements();P=new tinymce.dom.TreeWalker(I,z.getBody());while(O=(K?P.prev():P.next())){if(N[O.nodeName.toLowerCase()]){break}if(O.nodeType===3&&tinymce.trim(O.nodeValue).length>0){break}if(m(O)==="false"){G(O);return true}}if(g(O)){return true}return false}if(p.isCollapsed()){J=p.getRng(true);I=J.startContainer;M=J.startOffset;I=l(I)||I;if(H=g(I)){G(H);return false}if(I.nodeType==3&&(K?M>0:M<I.nodeValue.length)){return true}if(I.nodeType==1){I=I.childNodes[M]||I}if(L()){return false}}return true}D=p.getStart();v=p.getEnd();x=g(D)||g(v);if(x&&(F<112||F>124)&&F!=e.DELETE&&F!=e.BACKSPACE){if((tinymce.isMac?B.metaKey:B.ctrlKey)&&(F==67||F==88||F==86)){return}B.preventDefault();if(F==e.LEFT||F==e.RIGHT){var w=F==e.LEFT;if(z.dom.isBlock(x)){var A=w?x.previousSibling:x.nextSibling;var s=new c(A,A);var E=w?s.prev():s.next();y(E,!w)}else{y(x,w)}}}else{if(F==e.LEFT||F==e.RIGHT||F==e.BACKSPACE||F==e.DELETE){C=l(D);if(C){if(F==e.LEFT||F==e.BACKSPACE){x=u(C,true);if(x&&m(x)==="false"){B.preventDefault();if(F==e.LEFT){y(x,true)}else{j.remove(x);return}}else{i(C)}}if(F==e.RIGHT||F==e.DELETE){x=u(C);if(x&&m(x)==="false"){B.preventDefault();if(F==e.RIGHT){y(x,false)}else{j.remove(x);return}}else{i(C)}}}if((F==e.BACKSPACE||F==e.DELETE)&&!t(F==e.BACKSPACE)){B.preventDefault();return false}}}}n.onMouseDown.addToTop(function(s,u){var t=s.selection.getNode();if(m(t)==="false"&&t==u.target){q()}});n.onMouseUp.addToTop(q);n.onKeyDown.addToTop(h);n.onKeyUp.addToTop(q)}tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(i,k){var h,g,j;function f(m,n){var o=j.length,p=n.content,l=tinymce.trim(g);if(n.format=="raw"){return}while(o--){p=p.replace(j[o],function(s){var r=arguments,q=r[r.length-2];if(q>0&&p.charAt(q-1)=='"'){return s}return'<span class="'+l+'" data-mce-content="'+m.dom.encode(r[0])+'">'+m.dom.encode(typeof(r[1])==="string"?r[1]:r[0])+"</span>"})}n.content=p}h=" "+tinymce.trim(i.getParam("noneditable_editable_class","mceEditable"))+" ";g=" "+tinymce.trim(i.getParam("noneditable_noneditable_class","mceNonEditable"))+" ";j=i.getParam("noneditable_regexp");if(j&&!j.length){j=[j]}i.onPreInit.add(function(){b(i);if(j){i.selection.onBeforeSetContent.add(f);i.onBeforeSetContent.add(f)}i.parser.addAttributeFilter("class",function(l){var m=l.length,n,o;while(m--){o=l[m];n=" "+o.attr("class")+" ";if(n.indexOf(h)!==-1){o.attr(d,"true")}else{if(n.indexOf(g)!==-1){o.attr(d,"false")}}}});i.serializer.addAttributeFilter(d,function(l,m){var n=l.length,o;while(n--){o=l[n];if(j&&o.attr("data-mce-content")){o.name="#text";o.type=3;o.raw=true;o.value=o.attr("data-mce-content")}else{o.attr(a,null);o.attr(d,null)}}});i.parser.addAttributeFilter(a,function(l,m){var n=l.length,o;while(n--){o=l[n];o.attr(d,o.attr(a));o.attr(a,null)}})})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})();
\ No newline at end of file
selection.collapse(start);\r
}\r
\r
+ function canDelete(backspace) {\r
+ var rng, container, offset, nonEditableParent;\r
+\r
+ function removeNodeIfNotParent(node) {\r
+ var parent = container;\r
+\r
+ while (parent) {\r
+ if (parent === node) {\r
+ return;\r
+ }\r
+\r
+ parent = parent.parentNode;\r
+ }\r
+\r
+ dom.remove(node);\r
+ moveSelection();\r
+ }\r
+\r
+ function isNextPrevTreeNodeNonEditable() {\r
+ var node, walker, nonEmptyElements = ed.schema.getNonEmptyElements();\r
+\r
+ walker = new tinymce.dom.TreeWalker(container, ed.getBody());\r
+ while (node = (backspace ? walker.prev() : walker.next())) {\r
+ // Found IMG/INPUT etc\r
+ if (nonEmptyElements[node.nodeName.toLowerCase()]) {\r
+ break;\r
+ }\r
+\r
+ // Found text node with contents\r
+ if (node.nodeType === 3 && tinymce.trim(node.nodeValue).length > 0) {\r
+ break;\r
+ }\r
+\r
+ // Found non editable node\r
+ if (getContentEditable(node) === "false") {\r
+ removeNodeIfNotParent(node);\r
+ return true;\r
+ }\r
+ }\r
+\r
+ // Check if the content node is within a non editable parent\r
+ if (getNonEditableParent(node)) {\r
+ return true;\r
+ }\r
+\r
+ return false;\r
+ }\r
+\r
+ if (selection.isCollapsed()) {\r
+ rng = selection.getRng(true);\r
+ container = rng.startContainer;\r
+ offset = rng.startOffset;\r
+ container = getParentCaretContainer(container) || container;\r
+\r
+ // Is in noneditable parent\r
+ if (nonEditableParent = getNonEditableParent(container)) {\r
+ removeNodeIfNotParent(nonEditableParent);\r
+ return false;\r
+ }\r
+\r
+ // Check if the caret is in the middle of a text node\r
+ if (container.nodeType == 3 && (backspace ? offset > 0 : offset < container.nodeValue.length)) {\r
+ return true;\r
+ }\r
+\r
+ // Resolve container index\r
+ if (container.nodeType == 1) {\r
+ container = container.childNodes[offset] || container;\r
+ }\r
+\r
+ // Check if previous or next tree node is non editable then block the event\r
+ if (isNextPrevTreeNodeNonEditable()) {\r
+ return false;\r
+ }\r
+ }\r
+\r
+ return true;\r
+ }\r
+\r
startElement = selection.getStart()\r
endElement = selection.getEnd();\r
\r
// Disable all key presses in contentEditable=false except delete or backspace\r
nonEditableParent = getNonEditableParent(startElement) || getNonEditableParent(endElement);\r
if (nonEditableParent && (keyCode < 112 || keyCode > 124) && keyCode != VK.DELETE && keyCode != VK.BACKSPACE) {\r
+ // Is Ctrl+c, Ctrl+v or Ctrl+x then use default browser behavior\r
+ if ((tinymce.isMac ? e.metaKey : e.ctrlKey) && (keyCode == 67 || keyCode == 88 || keyCode == 86)) {\r
+ return;\r
+ }\r
+\r
e.preventDefault();\r
\r
// Arrow left/right select the element and collapse left/right\r
positionCaretOnElement(nonEditableParent, true);\r
} else {\r
dom.remove(nonEditableParent);\r
+ return;\r
}\r
} else {\r
removeCaretContainer(caretContainer);\r
positionCaretOnElement(nonEditableParent, false);\r
} else {\r
dom.remove(nonEditableParent);\r
+ return;\r
}\r
} else {\r
removeCaretContainer(caretContainer);\r
}\r
}\r
}\r
+\r
+ if ((keyCode == VK.BACKSPACE || keyCode == VK.DELETE) && !canDelete(keyCode == VK.BACKSPACE)) {\r
+ e.preventDefault();\r
+ return false;\r
+ }\r
}\r
}\r
};\r
\r
- ed.onMouseDown.addToTop(function(ed, e){\r
- // prevent collapsing selection to caret when clicking in a non-editable section\r
+ ed.onMouseDown.addToTop(function(ed, e) {\r
var node = ed.selection.getNode();\r
+\r
if (getContentEditable(node) === "false" && node == e.target) {\r
- e.preventDefault();\r
+ // Expand selection on mouse down we can't block the default event since it's used for drag/drop\r
+ moveSelection();\r
}\r
});\r
+\r
ed.onMouseUp.addToTop(moveSelection);\r
ed.onKeyDown.addToTop(handleKey);\r
ed.onKeyUp.addToTop(moveSelection);\r
init : function(ed, url) {\r
var editClass, nonEditClass, nonEditableRegExps;\r
\r
+ // Converts configured regexps to noneditable span items\r
+ function convertRegExpsToNonEditable(ed, args) {\r
+ var i = nonEditableRegExps.length, content = args.content, cls = tinymce.trim(nonEditClass);\r
+\r
+ // Don't replace the variables when raw is used for example on undo/redo\r
+ if (args.format == "raw") {\r
+ return;\r
+ }\r
+\r
+ while (i--) {\r
+ content = content.replace(nonEditableRegExps[i], function(match) {\r
+ var args = arguments, index = args[args.length - 2];\r
+\r
+ // Is value inside an attribute then don't replace\r
+ if (index > 0 && content.charAt(index - 1) == '"') {\r
+ return match;\r
+ }\r
+\r
+ return '<span class="' + cls + '" data-mce-content="' + ed.dom.encode(args[0]) + '">' + ed.dom.encode(typeof(args[1]) === "string" ? args[1] : args[0]) + '</span>';\r
+ });\r
+ }\r
+\r
+ args.content = content;\r
+ };\r
+ \r
editClass = " " + tinymce.trim(ed.getParam("noneditable_editable_class", "mceEditable")) + " ";\r
nonEditClass = " " + tinymce.trim(ed.getParam("noneditable_noneditable_class", "mceNonEditable")) + " ";\r
\r
handleContentEditableSelection(ed);\r
\r
if (nonEditableRegExps) {\r
- ed.onBeforeSetContent.add(function(ed, args) {\r
- var i = nonEditableRegExps.length, content = args.content, cls = tinymce.trim(nonEditClass);\r
-\r
- // Don't replace the variables when raw is used for example on undo/redo\r
- if (args.format == "raw") {\r
- return;\r
- }\r
-\r
- while (i--) {\r
- content = content.replace(nonEditableRegExps[i], function() {\r
- var args = arguments;\r
-\r
- return '<span class="' + cls + '" data-mce-content="' + ed.dom.encode(args[0]) + '">' + ed.dom.encode(typeof(args[1]) === "string" ? args[1] : args[0]) + '</span>';\r
- });\r
- }\r
-\r
- args.content = content;\r
- });\r
+ ed.selection.onBeforeSetContent.add(convertRegExpsToNonEditable);\r
+ ed.onBeforeSetContent.add(convertRegExpsToNonEditable);\r
}\r
- \r
+\r
// Apply contentEditable true/false on elements with the noneditable/editable classes\r
ed.parser.addAttributeFilter('class', function(nodes) {\r
var i = nodes.length, className, node;\r
-(function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"combined",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(l,j){var k=d.dom,i;f.onPreProcess.dispatch(f,l);l.node=k.create("div",0,l.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){if(l.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(l.node.firstChild.nodeName)&&l.content.indexOf("__MCE_ITEM__")===-1){k.remove(l.node.firstChild,true)}}}f.onPostProcess.dispatch(f,l);l.content=d.serializer.serialize(l.node,{getInner:1,forced_root_block:""});if((!j)&&(d.pasteAsPlainText)){f._insertPlainText(l.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(l.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:o.encode(r).replace(/\r?\n/g,"<br />")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="<p>"+o.encode(r).replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br />")+"</p>"}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9){d([[/(?:<br> [\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br> [\s\r\n]+|<br>)*/g,"$1"]]);d([[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*( )+/gi,/( |<br[^>]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>")}if(b(k,"paste_convert_middot_lists")){d([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/"/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/<h[1-6][^>]*>/gi,"<p><strong>"],[/<\/h[1-6][^>]*>/gi,"</strong></p>"]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l<d.length;l++){o=d[l];j=h.getStyle(m,o);if(j){n[o]=j;k++}}}h.setAttrib(m,"style","");if(d&&k>0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f<d){n=tinymce.inArray(m,f);o=i.getParents(h.parentNode,s);h=o[o.length-1-n]||h}}}c(i.select("span",t),function(v){var p=v.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(g){var d=this.editor,e=b(d,"paste_text_linebreaktype"),i=b(d,"paste_text_replacements"),f=tinymce.is;function h(j){c(j,function(k){if(k.constructor==RegExp){g=g.replace(k,"")}else{g=g.replace(k[0],k[1])}})}if((typeof(g)==="string")&&(g.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(g)){h([/[\n\r]+/g])}else{h([/\r+/g])}h([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/<br[^>]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*<t[dh][^>]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"]]);g=d.dom.decode(tinymce.html.Entities.encodeRaw(g));if(f(i,"array")){h(i)}else{if(f(i,"string")){h(new RegExp(i,"gi"))}}if(e=="none"){h([[/\n+/g," "]])}else{if(e=="br"){h([[/\n/g,"<br />"]])}else{if(e=="p"){h([[/\n+/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"]])}else{h([[/\n\n/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"],[/\n/g,"<br />"]])}}}d.execCommand("mceInsertContent",false,g)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})();
\ No newline at end of file
+(function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"combined",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(l,j){var k=d.dom,i;f.onPreProcess.dispatch(f,l);l.node=k.create("div",0,l.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){if(l.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(l.node.firstChild.nodeName)&&l.content.indexOf("__MCE_ITEM__")===-1){k.remove(l.node.firstChild,true)}}}f.onPostProcess.dispatch(f,l);l.content=d.serializer.serialize(l.node,{getInner:1,forced_root_block:""});if((!j)&&(d.pasteAsPlainText)){f._insertPlainText(l.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(l.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:o.encode(r).replace(/\r?\n/g,"<br />")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="<p>"+o.encode(r).replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br />")+"</p>"}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9&&/<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(e.content)){d([[/(?:<br> [\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br> [\s\r\n]+|<br>)*/g,"$1"]]);d([[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*( )+/gi,/( |<br[^>]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>")}if(b(k,"paste_convert_middot_lists")){d([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/"/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/<h[1-6][^>]*>/gi,"<p><strong>"],[/<\/h[1-6][^>]*>/gi,"</strong></p>"]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l<d.length;l++){o=d[l];j=h.getStyle(m,o);if(j){n[o]=j;k++}}}h.setAttrib(m,"style","");if(d&&k>0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f<d){n=tinymce.inArray(m,f);o=i.getParents(h.parentNode,s);h=o[o.length-1-n]||h}}}c(i.select("span",t),function(v){var p=v.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(g){var d=this.editor,e=b(d,"paste_text_linebreaktype"),i=b(d,"paste_text_replacements"),f=tinymce.is;function h(j){c(j,function(k){if(k.constructor==RegExp){g=g.replace(k,"")}else{g=g.replace(k[0],k[1])}})}if((typeof(g)==="string")&&(g.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(g)){h([/[\n\r]+/g])}else{h([/\r+/g])}h([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/<br[^>]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*<t[dh][^>]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"]]);g=d.dom.decode(tinymce.html.Entities.encodeRaw(g));if(f(i,"array")){h(i)}else{if(f(i,"string")){h(new RegExp(i,"gi"))}}if(e=="none"){h([[/\n+/g," "]])}else{if(e=="br"){h([[/\n/g,"<br />"]])}else{if(e=="p"){h([[/\n+/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"]])}else{h([[/\n\n/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"],[/\n/g,"<br />"]])}}}d.execCommand("mceInsertContent",false,g)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})();
\ No newline at end of file
}\r
\r
// IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser\r
- if (tinymce.isIE && document.documentMode >= 9) {\r
+ if (tinymce.isIE && document.documentMode >= 9 && /<(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)/.test(o.content)) {\r
// IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser\r
process([[/(?:<br> [\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br> [\s\r\n]+|<br>)*/g, '$1']]);\r
\r
-(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(t){n=c.select(":input:enabled,*[tabindex]");function s(v){return v.nodeName==="BODY"||(v.type!="hidden"&&!(v.style.display=="none")&&!(v.style.visibility=="hidden")&&s(v.parentNode))}function i(v){return v.attributes.tabIndex.specified||v.nodeName=="INPUT"||v.nodeName=="TEXTAREA"}function u(){return tinymce.isIE6||tinymce.isIE7}function r(v){return((!u()||i(v)))&&v.getAttribute("tabindex")!="-1"&&s(v)}d(n,function(w,v){if(w.id==l.id){j=v;return false}});if(t>0){for(m=j+1;m<n.length;m++){if(r(n[m])){return n[m]}}}else{for(m=j-1;m>=0;m--){if(r(n[m])){return n[m]}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(n.id&&(l=tinymce.get(n.id||n.name))){l.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})();
\ No newline at end of file
+(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(t){n=c.select(":input:enabled,*[tabindex]:not(iframe)");function s(v){return v.nodeName==="BODY"||(v.type!="hidden"&&!(v.style.display=="none")&&!(v.style.visibility=="hidden")&&s(v.parentNode))}function i(v){return v.attributes.tabIndex.specified||v.nodeName=="INPUT"||v.nodeName=="TEXTAREA"}function u(){return tinymce.isIE6||tinymce.isIE7}function r(v){return((!u()||i(v)))&&v.getAttribute("tabindex")!="-1"&&s(v)}d(n,function(w,v){if(w.id==l.id){j=v;return false}});if(t>0){for(m=j+1;m<n.length;m++){if(r(n[m])){return n[m]}}}else{for(m=j-1;m>=0;m--){if(r(n[m])){return n[m]}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(n.id&&(l=tinymce.get(n.id||n.name))){l.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})();
\ No newline at end of file
var x, i, f, el, v;
function find(d) {
- el = DOM.select(':input:enabled,*[tabindex]');
+ el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
function canSelectRecursive(e) {
return e.nodeName==="BODY" || (e.type != 'hidden' &&
do {\r
if (cell == tdElm)\r
break;\r
- col += cell.getAttribute("colspan");\r
+ col += cell.getAttribute("colspan")?cell.getAttribute("colspan"):1;\r
} while ((cell = nextCell(cell)) != null);\r
\r
for (var i=0; i<rows.length; i++) {\r
cell = updateCell(cell, true);\r
break;\r
}\r
- curr += cell.getAttribute("colspan");\r
+ curr += cell.getAttribute("colspan")?cell.getAttribute("colspan"):1;\r
} while ((cell = nextCell(cell)) != null);\r
}\r
\r
-p, h1, h2, h3, h4, h5, h6, hgroup, aside, div, section, article, blockquote, address, pre {display: block; padding-top: 10px; border: 1px dashed #BBB; background: transparent no-repeat}\r
-p, h1, h2, h3, h4, h5, h6, hgroup, aside, div, section, article, address, pre {margin-left: 3px}\r
-section, article, address, hgroup, aside {margin: 1em 0 0 3px}\r
+p, h1, h2, h3, h4, h5, h6, hgroup, aside, div, section, article, blockquote, address, pre, figure {display: block; padding-top: 10px; border: 1px dashed #BBB; background: transparent no-repeat}\r
+p, h1, h2, h3, h4, h5, h6, hgroup, aside, div, section, article, address, pre, figure {margin-left: 3px}\r
+section, article, address, hgroup, aside, figure {margin: 0 0 1em 3px}\r
\r
p {background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)}\r
h1 {background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)}\r
pre {background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)}\r
hgroup {background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)}\r
aside {background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)}\r
+figure {background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7)}\r
+figcaption {border: 1px dashed #BBB}\r
-(function(){tinymce.create("tinymce.plugins.VisualBlocks",{init:function(a,b){var c;if(!window.NodeList){return}a.addCommand("mceVisualBlocks",function(){var e=a.dom,d;if(!c){c=e.uniqueId();d=e.create("link",{id:c,rel:"stylesheet",href:b+"/css/visualblocks.css"});a.getDoc().getElementsByTagName("head")[0].appendChild(d)}else{d=e.get(c);d.disabled=!d.disabled}a.controlManager.setActive("visualblocks",!d.disabled)});a.addButton("visualblocks",{title:"visualblocks.desc",cmd:"mceVisualBlocks"});a.onInit.add(function(){if(a.settings.visualblocks_default_state){a.execCommand("mceVisualBlocks")}})},getInfo:function(){return{longname:"Visual blocks",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualblocks",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("visualblocks",tinymce.plugins.VisualBlocks)})();
\ No newline at end of file
+(function(){tinymce.create("tinymce.plugins.VisualBlocks",{init:function(a,b){var c;if(!window.NodeList){return}a.addCommand("mceVisualBlocks",function(){var e=a.dom,d;if(!c){c=e.uniqueId();d=e.create("link",{id:c,rel:"stylesheet",href:b+"/css/visualblocks.css"});a.getDoc().getElementsByTagName("head")[0].appendChild(d)}else{d=e.get(c);d.disabled=!d.disabled}a.controlManager.setActive("visualblocks",!d.disabled)});a.addButton("visualblocks",{title:"visualblocks.desc",cmd:"mceVisualBlocks"});a.onInit.add(function(){if(a.settings.visualblocks_default_state){a.execCommand("mceVisualBlocks",false,null,{skip_focus:true})}})},getInfo:function(){return{longname:"Visual blocks",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualblocks",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("visualblocks",tinymce.plugins.VisualBlocks)})();
\ No newline at end of file
\r
ed.onInit.add(function() {\r
if (ed.settings.visualblocks_default_state) {\r
- ed.execCommand('mceVisualBlocks');\r
+ ed.execCommand('mceVisualBlocks', false, null, {skip_focus : true});\r
}\r
});\r
},\r
\r
<div class="mceActionPanel">\r
<input type="submit" id="insert" name="insert" value="{#apply}" />\r
-\r
- <div id="preview"></div>\r
-\r
- <div id="previewblock">\r
- <label for="color">{#advanced_dlg.colorpicker_color}</label> <input id="color" type="text" size="8" class="text mceFocus" aria-required="true" />\r
- </div>\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();"/>\r
+ <div id="preview_wrapper"><div id="previewblock"><label for="color">{#advanced_dlg.colorpicker_color}</label> <input id="color" type="text" size="8" class="text mceFocus" aria-required="true" /></div><span id="preview"></span></div>\r
</div>\r
</form>\r
</body>\r
-(function(h){var i=h.DOM,g=h.dom.Event,c=h.extend,f=h.each,a=h.util.Cookie,e,d=h.explode;function b(m,k){var q,p=m.dom,n="",o,l;previewStyles=m.settings.preview_styles;if(previewStyles===false){return""}if(!previewStyles){previewStyles="font-family font-size font-weight text-decoration text-transform color background-color"}function j(r){return r.replace(/%(\w+)/g,"")}name=k.block||k.inline||"span";q=p.create(name);f(k.styles,function(s,r){s=j(s);if(s){p.setStyle(q,r,s)}});f(k.attributes,function(s,r){s=j(s);if(s){p.setAttrib(q,r,s)}});f(k.classes,function(r){r=j(r);if(!p.hasClass(q,r)){p.addClass(q,r)}});p.setStyles(q,{position:"absolute",left:-65535});m.getBody().appendChild(q);o=p.getStyle(m.getBody(),"fontSize",true);o=/px$/.test(o)?parseInt(o,10):0;f(previewStyles.split(" "),function(r){var s=p.getStyle(q,r,true);if(r=="font-size"){if(/em|%$/.test(s)){if(o===0){return}s=parseFloat(s,10)/(/%$/.test(s)?100:1);s=(s*o)+"px"}}n+=r+":"+s+";"});p.remove(q);return n}h.ThemeManager.requireLangPack("advanced");h.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(k,l){var m=this,n,j,p;m.editor=k;m.url=l;m.onResolveName=new h.util.Dispatcher(this);k.forcedHighContrastMode=k.settings.detect_highcontrast&&m._isHighContrast();k.settings.skin=k.forcedHighContrastMode?"highcontrast":k.settings.skin;m.settings=n=c({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"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",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_font_selector:"span",theme_advanced_show_current_color:0,readonly:k.settings.readonly},k.settings);if(!n.font_size_style_values){n.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(h.is(n.theme_advanced_font_sizes,"string")){n.font_size_style_values=h.explode(n.font_size_style_values);n.font_size_classes=h.explode(n.font_size_classes||"");p={};k.settings.theme_advanced_font_sizes=n.theme_advanced_font_sizes;f(k.getParam("theme_advanced_font_sizes","","hash"),function(r,q){var o;if(q==r&&r>=1&&r<=7){q=r+" ("+m.sizes[r-1]+"pt)";o=n.font_size_classes[r-1];r=n.font_size_style_values[r-1]||(m.sizes[r-1]+"pt")}if(/^\s*\./.test(r)){o=r.replace(/\./g,"")}p[q]=o?{"class":o}:{fontSize:r}});n.theme_advanced_font_sizes=p}if((j=n.theme_advanced_path_location)&&j!="none"){n.theme_advanced_statusbar_location=n.theme_advanced_path_location}if(n.theme_advanced_statusbar_location=="none"){n.theme_advanced_statusbar_location=0}if(k.settings.content_css!==false){k.contentCSS.push(k.baseURI.toAbsolute(l+"/skins/"+k.settings.skin+"/content.css"))}k.onInit.add(function(){if(!k.settings.readonly){k.onNodeChange.add(m._nodeChanged,m);k.onKeyUp.add(m._updateUndoStatus,m);k.onMouseUp.add(m._updateUndoStatus,m);k.dom.bind(k.dom.getRoot(),"dragend",function(){m._updateUndoStatus(k)})}});k.onSetProgressState.add(function(r,o,s){var t,u=r.id,q;if(o){m.progressTimer=setTimeout(function(){t=r.getContainer();t=t.insertBefore(i.create("DIV",{style:"position:relative"}),t.firstChild);q=i.get(r.id+"_tbl");i.add(t,"div",{id:u+"_blocker","class":"mceBlocker",style:{width:q.clientWidth+2,height:q.clientHeight+2}});i.add(t,"div",{id:u+"_progress","class":"mceProgress",style:{left:q.clientWidth/2,top:q.clientHeight/2}})},s||0)}else{i.remove(u+"_blocker");i.remove(u+"_progress");clearTimeout(m.progressTimer)}});i.loadCSS(n.editor_css?k.documentBaseURI.toAbsolute(n.editor_css):l+"/skins/"+k.settings.skin+"/ui.css");if(n.skin_variant){i.loadCSS(l+"/skins/"+k.settings.skin+"/ui_"+n.skin_variant+".css")}},_isHighContrast:function(){var j,k=i.add(i.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});j=(i.getStyle(k,"background-color",true)+"").toLowerCase().replace(/ /g,"");i.remove(k);return j!="rgb(171,239,86)"&&j!="#abef56"},createControl:function(m,j){var k,l;if(l=j.createControl(m)){return l}switch(m){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((k=this.controls[m])){return j.createButton(m,{title:"advanced."+k[0],cmd:k[1],ui:k[2],value:k[3]})}},execCommand:function(l,k,m){var j=this["_"+l];if(j){j.call(this,k,m);return true}return false},_importClasses:function(l){var j=this.editor,k=j.controlManager.get("styleselect");if(k.getLength()==0){f(j.dom.getClasses(),function(q,m){var p="style_"+m,n;n={inline:"span",attributes:{"class":q["class"]},selector:"*"};j.formatter.register(p,n);k.add(q["class"],p,{style:function(){return b(j,n)}})})}},_createStyleSelect:function(o){var l=this,j=l.editor,k=j.controlManager,m;m=k.createListBox("styleselect",{title:"advanced.style_select",onselect:function(q){var r,n=[],p;f(m.items,function(s){n.push(s.value)});j.focus();j.undoManager.add();r=j.formatter.matchAll(n);h.each(r,function(s){if(!q||s==q){if(s){j.formatter.remove(s)}p=true}});if(!p){j.formatter.apply(q)}j.undoManager.add();j.nodeChanged();return false}});j.onPreInit.add(function(){var p=0,n=j.getParam("style_formats");if(n){f(n,function(q){var r,s=0;f(q,function(){s++});if(s>1){r=q.name=q.name||"style_"+(p++);j.formatter.register(r,q);m.add(q.title,r,{style:function(){return b(j,q)}})}else{m.add(q.title)}})}else{f(j.getParam("theme_advanced_styles","","hash"),function(t,s){var r,q;if(t){r="style_"+(p++);q={inline:"span",classes:t,selector:"*"};j.formatter.register(r,q);m.add(l.editor.translate(s),r,{style:function(){return b(j,q)}})}})}});if(m.getLength()==0){m.onPostRender.add(function(p,q){if(!m.NativeListBox){g.add(q.id+"_text","focus",l._importClasses,l);g.add(q.id+"_text","mousedown",l._importClasses,l);g.add(q.id+"_open","focus",l._importClasses,l);g.add(q.id+"_open","mousedown",l._importClasses,l)}else{g.add(q.id,"focus",l._importClasses,l)}})}return m},_createFontSelect:function(){var l,k=this,j=k.editor;l=j.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(m){var n=l.items[l.selectedIndex];if(!m&&n){j.execCommand("FontName",false,n.value);return}j.execCommand("FontName",false,m);l.select(function(o){return m==o});if(n&&n.value==m){l.select(null)}return false}});if(l){f(j.getParam("theme_advanced_fonts",k.settings.theme_advanced_fonts,"hash"),function(n,m){l.add(j.translate(m),n,{style:n.indexOf("dings")==-1?"font-family:"+n:""})})}return l},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(o){var p=n.items[n.selectedIndex];if(!o&&p){p=p.value;if(p["class"]){k.formatter.toggle("fontsize_class",{value:p["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,p.fontSize)}return}if(o["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}n.select(function(q){return o==q});if(p&&(p.value.fontSize==o.fontSize||p.value["class"]&&p.value["class"]==o["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(p,o){var q=p.fontSize;if(q>=1&&q<=7){q=m.sizes[parseInt(q)-1]+"pt"}n.add(o,p,{style:"font-size:"+q,"class":"mceFontSize"+(l++)+(" "+(p["class"]||""))})})}return n},_createBlockFormats:function(){var l,j={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},k=this;l=k.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(m){k.editor.execCommand("FormatBlock",false,m);return false}});if(l){f(k.editor.getParam("theme_advanced_blockformats",k.settings.theme_advanced_blockformats,"hash"),function(n,m){l.add(k.editor.translate(m!=n?m:j[n]),n,{"class":"mce_formatPreview mce_"+n,style:function(){return b(k.editor,{block:n})}})})}return l},_createForeColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_text_colors){m.colors=j}if(l.theme_advanced_default_foreground_color){m.default_color=l.theme_advanced_default_foreground_color}m.title="advanced.forecolor_desc";m.cmd="ForeColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("forecolor",m);return n},_createBackColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_background_colors){m.colors=j}if(l.theme_advanced_default_background_color){m.default_color=l.theme_advanced_default_background_color}m.title="advanced.backcolor_desc";m.cmd="HiliteColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("backcolor",m);return n},renderUI:function(l){var q,m,r,w=this,u=w.editor,x=w.settings,v,k,j;if(u.settings){u.settings.aria_label=x.aria_label+u.getLang("advanced.help_shortcut")}q=k=i.create("span",{role:"application","aria-labelledby":u.id+"_voice",id:u.id+"_parent","class":"mceEditor "+u.settings.skin+"Skin"+(x.skin_variant?" "+u.settings.skin+"Skin"+w._ufirst(x.skin_variant):"")});i.add(q,"span",{"class":"mceVoiceLabel",style:"display:none;",id:u.id+"_voice"},x.aria_label);if(!i.boxModel){q=i.add(q,"div",{"class":"mceOldBoxModel"})}q=v=i.add(q,"table",{role:"presentation",id:u.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});q=r=i.add(q,"tbody");switch((x.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":m=w._rowLayout(x,r,l);break;case"customlayout":m=u.execCallback("theme_advanced_custom_layout",x,r,l,k);break;default:m=w._simpleLayout(x,r,l,k)}q=l.targetNode;j=v.rows;i.addClass(j[0],"mceFirst");i.addClass(j[j.length-1],"mceLast");f(i.select("tr",r),function(o){i.addClass(o.firstChild,"mceFirst");i.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(i.get(x.theme_advanced_toolbar_container)){i.get(x.theme_advanced_toolbar_container).appendChild(k)}else{i.insertAfter(k,q)}g.add(u.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){w._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return false}});if(!u.getParam("accessibility_focus")){g.add(i.add(k,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(u.id).focus()})}if(x.theme_advanced_toolbar_location=="external"){l.deltaHeight=0}w.deltaHeight=l.deltaHeight;l.targetNode=null;u.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){if(h.isWebKit){window.focus()}w.toolbarGroup.focus();return g.cancel(n)}else{if(n.keyCode===o){i.get(p.id+"_path_row").focus();return g.cancel(n)}}}});u.addShortcut("alt+0","","mceShortcuts",w);return{iframeContainer:m,editorContainer:u.id+"_parent",sizeContainer:v,deltaHeight:l.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:h.majorVersion+"."+h.minorVersion}},resizeBy:function(j,k){var l=i.get(this.editor.id+"_ifr");this.resizeTo(l.clientWidth+j,l.clientHeight+k)},resizeTo:function(j,n,l){var k=this.editor,m=this.settings,o=i.get(k.id+"_tbl"),p=i.get(k.id+"_ifr");j=Math.max(m.theme_advanced_resizing_min_width||100,j);n=Math.max(m.theme_advanced_resizing_min_height||100,n);j=Math.min(m.theme_advanced_resizing_max_width||65535,j);n=Math.min(m.theme_advanced_resizing_max_height||65535,n);i.setStyle(o,"height","");i.setStyle(p,"height",n);if(m.theme_advanced_resize_horizontal){i.setStyle(o,"width","");i.setStyle(p,"width",j);if(j<o.clientWidth){j=o.clientWidth;i.setStyle(p,"width",o.clientWidth)}}if(l&&m.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+k.id+"_size",{cw:j,ch:n})}},destroy:function(){var j=this.editor.id;g.clear(j+"_resize");g.clear(j+"_path_row");g.clear(j+"_external_close")},_simpleLayout:function(z,u,l,j){var y=this,v=y.editor,w=z.theme_advanced_toolbar_location,q=z.theme_advanced_statusbar_location,m,k,r,x;if(z.readonly){m=i.add(u,"tr");m=k=i.add(m,"td",{"class":"mceIframeContainer"});return k}if(w=="top"){y._addToolbars(u,l)}if(w=="external"){m=x=i.create("div",{style:"position:relative"});m=i.add(m,"div",{id:v.id+"_external","class":"mceExternalToolbar"});i.add(m,"a",{id:v.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});m=i.add(m,"table",{id:v.id+"_tblext",cellSpacing:0,cellPadding:0});r=i.add(m,"tbody");if(j.firstChild.className=="mceOldBoxModel"){j.firstChild.appendChild(x)}else{j.insertBefore(x,j.firstChild)}y._addToolbars(r,l);v.onMouseUp.add(function(){var o=i.get(v.id+"_external");i.show(o);i.hide(e);var n=g.add(v.id+"_external_close","click",function(){i.hide(v.id+"_external");g.remove(v.id+"_external_close","click",n)});i.show(o);i.setStyle(o,"top",0-i.getRect(v.id+"_tblext").h-1);i.hide(o);i.show(o);o.style.filter="";e=v.id+"_external";o=null})}if(q=="top"){y._addStatusBar(u,l)}if(!z.theme_advanced_toolbar_container){m=i.add(u,"tr");m=k=i.add(m,"td",{"class":"mceIframeContainer"})}if(w=="bottom"){y._addToolbars(u,l)}if(q=="bottom"){y._addStatusBar(u,l)}return k},_rowLayout:function(x,p,l){var w=this,q=w.editor,v,y,j=q.controlManager,m,k,u,r;v=x.theme_advanced_containers_default_class||"";y=x.theme_advanced_containers_default_align||"center";f(d(x.theme_advanced_containers||""),function(s,o){var n=x["theme_advanced_container_"+s]||"";switch(s.toLowerCase()){case"mceeditor":m=i.add(p,"tr");m=k=i.add(m,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":w._addStatusBar(p,l);break;default:r=(x["theme_advanced_container_"+s+"_align"]||y).toLowerCase();r="mce"+w._ufirst(r);m=i.add(i.add(p,"tr"),"td",{"class":"mceToolbar "+(x["theme_advanced_container_"+s+"_class"]||v)+" "+r||y});u=j.createToolbar("toolbar"+o);w._addControls(n,u);i.setHTML(m,u.renderHTML());l.deltaHeight-=x.theme_advanced_row_height}});return k},_addControls:function(k,j){var l=this,m=l.settings,n,o=l.editor.controlManager;if(m.theme_advanced_disable&&!l._disabled){n={};f(d(m.theme_advanced_disable),function(p){n[p]=1});l._disabled=n}else{n=l._disabled}f(d(k),function(q){var p;if(n&&n[q]){return}if(q=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(r){r=l.createControl(r,o);if(r){j.add(r)}});return}p=l.createControl(q,o);if(p){j.add(p)}})},_addToolbars:function(x,k){var A=this,p,m,r=A.editor,B=A.settings,z,j=r.controlManager,u,l,q=[],y,w;w=j.createToolbarGroup("toolbargroup",{name:r.getLang("advanced.toolbar"),tab_focus_toolbar:r.getParam("theme_advanced_tab_focus_toolbar")});A.toolbarGroup=w;y=B.theme_advanced_toolbar_align.toLowerCase();y="mce"+A._ufirst(y);l=i.add(i.add(x,"tr",{role:"presentation"}),"td",{"class":"mceToolbar "+y,role:"presentation"});for(p=1;(z=B["theme_advanced_buttons"+p]);p++){m=j.createToolbar("toolbar"+p,{"class":"mceToolbarRow"+p});if(B["theme_advanced_buttons"+p+"_add"]){z+=","+B["theme_advanced_buttons"+p+"_add"]}if(B["theme_advanced_buttons"+p+"_add_before"]){z=B["theme_advanced_buttons"+p+"_add_before"]+","+z}A._addControls(z,m);w.add(m);k.deltaHeight-=B.theme_advanced_row_height}q.push(w.renderHTML());q.push(i.createHTML("a",{href:"#",accesskey:"z",title:r.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+r.id+"').focus();"},"<!-- IE -->"));i.setHTML(l,q.join(""))},_addStatusBar:function(p,k){var l,w=this,q=w.editor,x=w.settings,j,u,v,m;l=i.add(p,"tr");l=m=i.add(l,"td",{"class":"mceStatusbar"});l=i.add(l,"div",{id:q.id+"_path_row",role:"group","aria-labelledby":q.id+"_path_voice"});if(x.theme_advanced_path){i.add(l,"span",{id:q.id+"_path_voice"},q.translate("advanced.path"));i.add(l,"span",{},": ")}else{i.add(l,"span",{}," ")}if(x.theme_advanced_resizing){i.add(m,"a",{id:q.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize",tabIndex:"-1"});if(x.theme_advanced_resizing_use_cookie){q.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+q.id+"_size"),r=i.get(q.id+"_tbl");if(!n){return}w.resizeTo(n.cw,n.ch)})}q.onPostRender.add(function(){g.add(q.id+"_resize","click",function(n){n.preventDefault()});g.add(q.id+"_resize","mousedown",function(E){var t,r,s,o,D,A,B,G,n,F,y;function z(H){H.preventDefault();n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F)}function C(H){g.remove(i.doc,"mousemove",t);g.remove(q.getDoc(),"mousemove",r);g.remove(i.doc,"mouseup",s);g.remove(q.getDoc(),"mouseup",o);n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F,true)}E.preventDefault();D=E.screenX;A=E.screenY;y=i.get(w.editor.id+"_ifr");B=n=y.clientWidth;G=F=y.clientHeight;t=g.add(i.doc,"mousemove",z);r=g.add(q.getDoc(),"mousemove",z);s=g.add(i.doc,"mouseup",C);o=g.add(q.getDoc(),"mouseup",C)})})}k.deltaHeight-=21;l=p=null},_updateUndoStatus:function(k){var j=k.controlManager,l=k.undoManager;j.setDisabled("undo",!l.hasUndo()&&!l.typing);j.setDisabled("redo",!l.hasRedo())},_nodeChanged:function(o,u,E,r,F){var z=this,D,G=0,y,H,A=z.settings,x,l,w,C,m,k,j;h.each(z.stateControls,function(n){u.setActive(n,o.queryCommandState(z.controls[n][1]))});function q(p){var s,n=F.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s<n.length;s++){if(t(n[s])){return n[s]}}}u.setActive("visualaid",o.hasVisual);z._updateUndoStatus(o);u.setDisabled("outdent",!o.queryCommandState("Outdent"));D=q("A");if(H=u.get("link")){if(!D||!D.name){H.setDisabled(!D&&r);H.setActive(!!D)}}if(H=u.get("unlink")){H.setDisabled(!D&&r);H.setActive(!!D&&!D.name)}if(H=u.get("anchor")){H.setActive(!r&&!!D&&D.name)}D=q("IMG");if(H=u.get("image")){H.setActive(!r&&!!D&&E.className.indexOf("mceItem")==-1)}if(H=u.get("styleselect")){z._importClasses();k=[];f(H.items,function(n){k.push(n.value)});j=o.formatter.matchAll(k);H.select(j[0]);h.each(j,function(p,n){if(n>0){H.mark(p)}})}if(H=u.get("formatselect")){D=q(i.isBlock);if(D){H.select(D.nodeName.toLowerCase())}}q(function(p){if(p.nodeName==="SPAN"){if(!x&&p.className){x=p.className}}if(o.dom.is(p,A.theme_advanced_font_selector)){if(!l&&p.style.fontSize){l=p.style.fontSize}if(!w&&p.style.fontFamily){w=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}if(!C&&p.style.color){C=p.style.color}if(!m&&p.style.backgroundColor){m=p.style.backgroundColor}}return false});if(H=u.get("fontselect")){H.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==w})}if(H=u.get("fontsizeselect")){if(A.theme_advanced_runtime_fontsize&&!l&&!x){l=o.dom.getStyle(E,"fontSize",true)}H.select(function(n){if(n.fontSize&&n.fontSize===l){return true}if(n["class"]&&n["class"]===x){return true}})}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_path&&A.theme_advanced_statusbar_location){D=i.get(o.id+"_path")||i.add(o.id+"_path_row","span",{id:o.id+"_path"});if(z.statusKeyboardNavigation){z.statusKeyboardNavigation.destroy();z.statusKeyboardNavigation=null}i.setHTML(D,"");q(function(I){var p=I.nodeName.toLowerCase(),s,v,t="";if(I.nodeType!=1||p==="br"||I.getAttribute("data-mce-bogus")||i.hasClass(I,"mceItemHidden")||i.hasClass(I,"mceItemRemoved")){return}if(h.isIE&&I.scopeName!=="HTML"){p=I.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(y=i.getAttrib(I,"src")){t+="src: "+y+" "}break;case"a":if(y=i.getAttrib(I,"name")){t+="name: "+y+" ";p+="#"+y}if(y=i.getAttrib(I,"href")){t+="href: "+y+" "}break;case"font":if(y=i.getAttrib(I,"face")){t+="font: "+y+" "}if(y=i.getAttrib(I,"size")){t+="size: "+y+" "}if(y=i.getAttrib(I,"color")){t+="color: "+y+" "}break;case"span":if(y=i.getAttrib(I,"style")){t+="style: "+y+" "}break}if(y=i.getAttrib(I,"id")){t+="id: "+y+" "}if(y=I.className){y=y.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(y){t+="class: "+y+" ";if(i.isBlock(I)||p=="img"||p=="span"){p+="."+y}}}p=p.replace(/(html:)/g,"");p={name:p,node:I,title:t};z.onResolveName.dispatch(z,p);t=p.title;p=p.name;v=i.create("a",{href:"javascript:;",role:"button",onmousedown:"return false;",title:t,"class":"mcePath_"+(G++)},p);if(D.hasChildNodes()){D.insertBefore(i.create("span",{"aria-hidden":"true"},"\u00a0\u00bb "),D.firstChild);D.insertBefore(v,D.firstChild)}else{D.appendChild(v)}},o.getBody());if(i.select("a",D).length>0){z.statusKeyboardNavigation=new h.ui.KeyboardNavigation({root:o.id+"_path_row",items:i.select("a",D),excludeFromTabOrder:true,onCancel:function(){o.focus()}},i)}}},_sel:function(j){this.editor.execCommand("mceSelectNodeDepth",false,j)},_mceInsertAnchor:function(l,k){var j=this.editor;j.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(j.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(j.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var j=this.editor;j.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(j.getLang("advanced.charmap_delta_width",0)),height:265+parseInt(j.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var j=this.editor;j.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var j=this.editor;j.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(l,k){var j=this.editor;k=k||{};j.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(j.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(j.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:k.color,func:k.func,theme_url:this.url})},_mceCodeEditor:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(j.getParam("theme_advanced_source_editor_width",720)),height:parseInt(j.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(k,l){var j=this.editor;if(j.dom.getAttrib(j.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}j.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(j.getLang("advanced.image_delta_width",0)),height:275+parseInt(j.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(j.getLang("advanced.link_delta_width",0)),height:200+parseInt(j.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var j=this.editor;j.windowManager.confirm("advanced.newdocument",function(k){if(k){j.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var j=this;this._mceColorPicker(0,{color:j.fgColor,func:function(k){j.fgColor=k;j.editor.execCommand("ForeColor",false,k)}})},_mceBackColor:function(){var j=this;this._mceColorPicker(0,{color:j.bgColor,func:function(k){j.bgColor=k;j.editor.execCommand("HiliteColor",false,k)}})},_ufirst:function(j){return j.substring(0,1).toUpperCase()+j.substring(1)}});h.ThemeManager.add("advanced",h.themes.AdvancedTheme)}(tinymce));
\ No newline at end of file
+(function(h){var i=h.DOM,g=h.dom.Event,c=h.extend,f=h.each,a=h.util.Cookie,e,d=h.explode;function b(m,k){var q,p=m.dom,n="",o,l;previewStyles=m.settings.preview_styles;if(previewStyles===false){return""}if(!previewStyles){previewStyles="font-family font-size font-weight text-decoration text-transform color background-color"}function j(r){return r.replace(/%(\w+)/g,"")}name=k.block||k.inline||"span";q=p.create(name);f(k.styles,function(s,r){s=j(s);if(s){p.setStyle(q,r,s)}});f(k.attributes,function(s,r){s=j(s);if(s){p.setAttrib(q,r,s)}});f(k.classes,function(r){r=j(r);if(!p.hasClass(q,r)){p.addClass(q,r)}});p.setStyles(q,{position:"absolute",left:-65535});m.getBody().appendChild(q);o=p.getStyle(m.getBody(),"fontSize",true);o=/px$/.test(o)?parseInt(o,10):0;f(previewStyles.split(" "),function(r){var s=p.getStyle(q,r,true);if(r=="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(s)){s=p.getStyle(m.getBody(),r,true);if(p.toHex(s).toLowerCase()=="#ffffff"){return}}if(r=="font-size"){if(/em|%$/.test(s)){if(o===0){return}s=parseFloat(s,10)/(/%$/.test(s)?100:1);s=(s*o)+"px"}}n+=r+":"+s+";"});p.remove(q);return n}h.ThemeManager.requireLangPack("advanced");h.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(k,l){var m=this,n,j,p;m.editor=k;m.url=l;m.onResolveName=new h.util.Dispatcher(this);k.forcedHighContrastMode=k.settings.detect_highcontrast&&m._isHighContrast();k.settings.skin=k.forcedHighContrastMode?"highcontrast":k.settings.skin;m.settings=n=c({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"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",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_font_selector:"span",theme_advanced_show_current_color:0,readonly:k.settings.readonly},k.settings);if(!n.font_size_style_values){n.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(h.is(n.theme_advanced_font_sizes,"string")){n.font_size_style_values=h.explode(n.font_size_style_values);n.font_size_classes=h.explode(n.font_size_classes||"");p={};k.settings.theme_advanced_font_sizes=n.theme_advanced_font_sizes;f(k.getParam("theme_advanced_font_sizes","","hash"),function(r,q){var o;if(q==r&&r>=1&&r<=7){q=r+" ("+m.sizes[r-1]+"pt)";o=n.font_size_classes[r-1];r=n.font_size_style_values[r-1]||(m.sizes[r-1]+"pt")}if(/^\s*\./.test(r)){o=r.replace(/\./g,"")}p[q]=o?{"class":o}:{fontSize:r}});n.theme_advanced_font_sizes=p}if((j=n.theme_advanced_path_location)&&j!="none"){n.theme_advanced_statusbar_location=n.theme_advanced_path_location}if(n.theme_advanced_statusbar_location=="none"){n.theme_advanced_statusbar_location=0}if(k.settings.content_css!==false){k.contentCSS.push(k.baseURI.toAbsolute(l+"/skins/"+k.settings.skin+"/content.css"))}k.onInit.add(function(){if(!k.settings.readonly){k.onNodeChange.add(m._nodeChanged,m);k.onKeyUp.add(m._updateUndoStatus,m);k.onMouseUp.add(m._updateUndoStatus,m);k.dom.bind(k.dom.getRoot(),"dragend",function(){m._updateUndoStatus(k)})}});k.onSetProgressState.add(function(r,o,s){var t,u=r.id,q;if(o){m.progressTimer=setTimeout(function(){t=r.getContainer();t=t.insertBefore(i.create("DIV",{style:"position:relative"}),t.firstChild);q=i.get(r.id+"_tbl");i.add(t,"div",{id:u+"_blocker","class":"mceBlocker",style:{width:q.clientWidth+2,height:q.clientHeight+2}});i.add(t,"div",{id:u+"_progress","class":"mceProgress",style:{left:q.clientWidth/2,top:q.clientHeight/2}})},s||0)}else{i.remove(u+"_blocker");i.remove(u+"_progress");clearTimeout(m.progressTimer)}});i.loadCSS(n.editor_css?k.documentBaseURI.toAbsolute(n.editor_css):l+"/skins/"+k.settings.skin+"/ui.css");if(n.skin_variant){i.loadCSS(l+"/skins/"+k.settings.skin+"/ui_"+n.skin_variant+".css")}},_isHighContrast:function(){var j,k=i.add(i.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});j=(i.getStyle(k,"background-color",true)+"").toLowerCase().replace(/ /g,"");i.remove(k);return j!="rgb(171,239,86)"&&j!="#abef56"},createControl:function(m,j){var k,l;if(l=j.createControl(m)){return l}switch(m){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((k=this.controls[m])){return j.createButton(m,{title:"advanced."+k[0],cmd:k[1],ui:k[2],value:k[3]})}},execCommand:function(l,k,m){var j=this["_"+l];if(j){j.call(this,k,m);return true}return false},_importClasses:function(l){var j=this.editor,k=j.controlManager.get("styleselect");if(k.getLength()==0){f(j.dom.getClasses(),function(q,m){var p="style_"+m,n;n={inline:"span",attributes:{"class":q["class"]},selector:"*"};j.formatter.register(p,n);k.add(q["class"],p,{style:function(){return b(j,n)}})})}},_createStyleSelect:function(o){var l=this,j=l.editor,k=j.controlManager,m;m=k.createListBox("styleselect",{title:"advanced.style_select",onselect:function(q){var r,n=[],p;f(m.items,function(s){n.push(s.value)});j.focus();j.undoManager.add();r=j.formatter.matchAll(n);h.each(r,function(s){if(!q||s==q){if(s){j.formatter.remove(s)}p=true}});if(!p){j.formatter.apply(q)}j.undoManager.add();j.nodeChanged();return false}});j.onPreInit.add(function(){var p=0,n=j.getParam("style_formats");if(n){f(n,function(q){var r,s=0;f(q,function(){s++});if(s>1){r=q.name=q.name||"style_"+(p++);j.formatter.register(r,q);m.add(q.title,r,{style:function(){return b(j,q)}})}else{m.add(q.title)}})}else{f(j.getParam("theme_advanced_styles","","hash"),function(t,s){var r,q;if(t){r="style_"+(p++);q={inline:"span",classes:t,selector:"*"};j.formatter.register(r,q);m.add(l.editor.translate(s),r,{style:function(){return b(j,q)}})}})}});if(m.getLength()==0){m.onPostRender.add(function(p,q){if(!m.NativeListBox){g.add(q.id+"_text","focus",l._importClasses,l);g.add(q.id+"_text","mousedown",l._importClasses,l);g.add(q.id+"_open","focus",l._importClasses,l);g.add(q.id+"_open","mousedown",l._importClasses,l)}else{g.add(q.id,"focus",l._importClasses,l)}})}return m},_createFontSelect:function(){var l,k=this,j=k.editor;l=j.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(m){var n=l.items[l.selectedIndex];if(!m&&n){j.execCommand("FontName",false,n.value);return}j.execCommand("FontName",false,m);l.select(function(o){return m==o});if(n&&n.value==m){l.select(null)}return false}});if(l){f(j.getParam("theme_advanced_fonts",k.settings.theme_advanced_fonts,"hash"),function(n,m){l.add(j.translate(m),n,{style:n.indexOf("dings")==-1?"font-family:"+n:""})})}return l},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(o){var p=n.items[n.selectedIndex];if(!o&&p){p=p.value;if(p["class"]){k.formatter.toggle("fontsize_class",{value:p["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,p.fontSize)}return}if(o["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}n.select(function(q){return o==q});if(p&&(p.value.fontSize==o.fontSize||p.value["class"]&&p.value["class"]==o["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(p,o){var q=p.fontSize;if(q>=1&&q<=7){q=m.sizes[parseInt(q)-1]+"pt"}n.add(o,p,{style:"font-size:"+q,"class":"mceFontSize"+(l++)+(" "+(p["class"]||""))})})}return n},_createBlockFormats:function(){var l,j={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},k=this;l=k.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(m){k.editor.execCommand("FormatBlock",false,m);return false}});if(l){f(k.editor.getParam("theme_advanced_blockformats",k.settings.theme_advanced_blockformats,"hash"),function(n,m){l.add(k.editor.translate(m!=n?m:j[n]),n,{"class":"mce_formatPreview mce_"+n,style:function(){return b(k.editor,{block:n})}})})}return l},_createForeColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_text_colors){m.colors=j}if(l.theme_advanced_default_foreground_color){m.default_color=l.theme_advanced_default_foreground_color}m.title="advanced.forecolor_desc";m.cmd="ForeColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("forecolor",m);return n},_createBackColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_background_colors){m.colors=j}if(l.theme_advanced_default_background_color){m.default_color=l.theme_advanced_default_background_color}m.title="advanced.backcolor_desc";m.cmd="HiliteColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("backcolor",m);return n},renderUI:function(l){var q,m,r,w=this,u=w.editor,x=w.settings,v,k,j;if(u.settings){u.settings.aria_label=x.aria_label+u.getLang("advanced.help_shortcut")}q=k=i.create("span",{role:"application","aria-labelledby":u.id+"_voice",id:u.id+"_parent","class":"mceEditor "+u.settings.skin+"Skin"+(x.skin_variant?" "+u.settings.skin+"Skin"+w._ufirst(x.skin_variant):"")+(u.settings.directionality=="rtl"?" mceRtl":"")});i.add(q,"span",{"class":"mceVoiceLabel",style:"display:none;",id:u.id+"_voice"},x.aria_label);if(!i.boxModel){q=i.add(q,"div",{"class":"mceOldBoxModel"})}q=v=i.add(q,"table",{role:"presentation",id:u.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});q=r=i.add(q,"tbody");switch((x.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":m=w._rowLayout(x,r,l);break;case"customlayout":m=u.execCallback("theme_advanced_custom_layout",x,r,l,k);break;default:m=w._simpleLayout(x,r,l,k)}q=l.targetNode;j=v.rows;i.addClass(j[0],"mceFirst");i.addClass(j[j.length-1],"mceLast");f(i.select("tr",r),function(o){i.addClass(o.firstChild,"mceFirst");i.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(i.get(x.theme_advanced_toolbar_container)){i.get(x.theme_advanced_toolbar_container).appendChild(k)}else{i.insertAfter(k,q)}g.add(u.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){w._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return false}});if(!u.getParam("accessibility_focus")){g.add(i.add(k,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(u.id).focus()})}if(x.theme_advanced_toolbar_location=="external"){l.deltaHeight=0}w.deltaHeight=l.deltaHeight;l.targetNode=null;u.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){if(h.isWebKit){window.focus()}w.toolbarGroup.focus();return g.cancel(n)}else{if(n.keyCode===o){i.get(p.id+"_path_row").focus();return g.cancel(n)}}}});u.addShortcut("alt+0","","mceShortcuts",w);return{iframeContainer:m,editorContainer:u.id+"_parent",sizeContainer:v,deltaHeight:l.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:h.majorVersion+"."+h.minorVersion}},resizeBy:function(j,k){var l=i.get(this.editor.id+"_ifr");this.resizeTo(l.clientWidth+j,l.clientHeight+k)},resizeTo:function(j,n,l){var k=this.editor,m=this.settings,o=i.get(k.id+"_tbl"),p=i.get(k.id+"_ifr");j=Math.max(m.theme_advanced_resizing_min_width||100,j);n=Math.max(m.theme_advanced_resizing_min_height||100,n);j=Math.min(m.theme_advanced_resizing_max_width||65535,j);n=Math.min(m.theme_advanced_resizing_max_height||65535,n);i.setStyle(o,"height","");i.setStyle(p,"height",n);if(m.theme_advanced_resize_horizontal){i.setStyle(o,"width","");i.setStyle(p,"width",j);if(j<o.clientWidth){j=o.clientWidth;i.setStyle(p,"width",o.clientWidth)}}if(l&&m.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+k.id+"_size",{cw:j,ch:n})}},destroy:function(){var j=this.editor.id;g.clear(j+"_resize");g.clear(j+"_path_row");g.clear(j+"_external_close")},_simpleLayout:function(z,u,l,j){var y=this,v=y.editor,w=z.theme_advanced_toolbar_location,q=z.theme_advanced_statusbar_location,m,k,r,x;if(z.readonly){m=i.add(u,"tr");m=k=i.add(m,"td",{"class":"mceIframeContainer"});return k}if(w=="top"){y._addToolbars(u,l)}if(w=="external"){m=x=i.create("div",{style:"position:relative"});m=i.add(m,"div",{id:v.id+"_external","class":"mceExternalToolbar"});i.add(m,"a",{id:v.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});m=i.add(m,"table",{id:v.id+"_tblext",cellSpacing:0,cellPadding:0});r=i.add(m,"tbody");if(j.firstChild.className=="mceOldBoxModel"){j.firstChild.appendChild(x)}else{j.insertBefore(x,j.firstChild)}y._addToolbars(r,l);v.onMouseUp.add(function(){var o=i.get(v.id+"_external");i.show(o);i.hide(e);var n=g.add(v.id+"_external_close","click",function(){i.hide(v.id+"_external");g.remove(v.id+"_external_close","click",n)});i.show(o);i.setStyle(o,"top",0-i.getRect(v.id+"_tblext").h-1);i.hide(o);i.show(o);o.style.filter="";e=v.id+"_external";o=null})}if(q=="top"){y._addStatusBar(u,l)}if(!z.theme_advanced_toolbar_container){m=i.add(u,"tr");m=k=i.add(m,"td",{"class":"mceIframeContainer"})}if(w=="bottom"){y._addToolbars(u,l)}if(q=="bottom"){y._addStatusBar(u,l)}return k},_rowLayout:function(x,p,l){var w=this,q=w.editor,v,y,j=q.controlManager,m,k,u,r;v=x.theme_advanced_containers_default_class||"";y=x.theme_advanced_containers_default_align||"center";f(d(x.theme_advanced_containers||""),function(s,o){var n=x["theme_advanced_container_"+s]||"";switch(s.toLowerCase()){case"mceeditor":m=i.add(p,"tr");m=k=i.add(m,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":w._addStatusBar(p,l);break;default:r=(x["theme_advanced_container_"+s+"_align"]||y).toLowerCase();r="mce"+w._ufirst(r);m=i.add(i.add(p,"tr"),"td",{"class":"mceToolbar "+(x["theme_advanced_container_"+s+"_class"]||v)+" "+r||y});u=j.createToolbar("toolbar"+o);w._addControls(n,u);i.setHTML(m,u.renderHTML());l.deltaHeight-=x.theme_advanced_row_height}});return k},_addControls:function(k,j){var l=this,m=l.settings,n,o=l.editor.controlManager;if(m.theme_advanced_disable&&!l._disabled){n={};f(d(m.theme_advanced_disable),function(p){n[p]=1});l._disabled=n}else{n=l._disabled}f(d(k),function(q){var p;if(n&&n[q]){return}if(q=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(r){r=l.createControl(r,o);if(r){j.add(r)}});return}p=l.createControl(q,o);if(p){j.add(p)}})},_addToolbars:function(y,k){var B=this,q,p,u=B.editor,C=B.settings,A,j=u.controlManager,w,l,r=[],z,x,m=false;x=j.createToolbarGroup("toolbargroup",{name:u.getLang("advanced.toolbar"),tab_focus_toolbar:u.getParam("theme_advanced_tab_focus_toolbar")});B.toolbarGroup=x;z=C.theme_advanced_toolbar_align.toLowerCase();z="mce"+B._ufirst(z);l=i.add(i.add(y,"tr",{role:"presentation"}),"td",{"class":"mceToolbar "+z,role:"presentation"});for(q=1;(A=C["theme_advanced_buttons"+q]);q++){m=true;p=j.createToolbar("toolbar"+q,{"class":"mceToolbarRow"+q});if(C["theme_advanced_buttons"+q+"_add"]){A+=","+C["theme_advanced_buttons"+q+"_add"]}if(C["theme_advanced_buttons"+q+"_add_before"]){A=C["theme_advanced_buttons"+q+"_add_before"]+","+A}B._addControls(A,p);x.add(p);k.deltaHeight-=C.theme_advanced_row_height}if(!m){k.deltaHeight-=C.theme_advanced_row_height}r.push(x.renderHTML());r.push(i.createHTML("a",{href:"#",accesskey:"z",title:u.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+u.id+"').focus();"},"<!-- IE -->"));i.setHTML(l,r.join(""))},_addStatusBar:function(p,k){var l,w=this,q=w.editor,x=w.settings,j,u,v,m;l=i.add(p,"tr");l=m=i.add(l,"td",{"class":"mceStatusbar"});l=i.add(l,"div",{id:q.id+"_path_row",role:"group","aria-labelledby":q.id+"_path_voice"});if(x.theme_advanced_path){i.add(l,"span",{id:q.id+"_path_voice"},q.translate("advanced.path"));i.add(l,"span",{},": ")}else{i.add(l,"span",{}," ")}if(x.theme_advanced_resizing){i.add(m,"a",{id:q.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize",tabIndex:"-1"});if(x.theme_advanced_resizing_use_cookie){q.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+q.id+"_size"),r=i.get(q.id+"_tbl");if(!n){return}w.resizeTo(n.cw,n.ch)})}q.onPostRender.add(function(){g.add(q.id+"_resize","click",function(n){n.preventDefault()});g.add(q.id+"_resize","mousedown",function(E){var t,r,s,o,D,A,B,G,n,F,y;function z(H){H.preventDefault();n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F)}function C(H){g.remove(i.doc,"mousemove",t);g.remove(q.getDoc(),"mousemove",r);g.remove(i.doc,"mouseup",s);g.remove(q.getDoc(),"mouseup",o);n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F,true)}E.preventDefault();D=E.screenX;A=E.screenY;y=i.get(w.editor.id+"_ifr");B=n=y.clientWidth;G=F=y.clientHeight;t=g.add(i.doc,"mousemove",z);r=g.add(q.getDoc(),"mousemove",z);s=g.add(i.doc,"mouseup",C);o=g.add(q.getDoc(),"mouseup",C)})})}k.deltaHeight-=21;l=p=null},_updateUndoStatus:function(k){var j=k.controlManager,l=k.undoManager;j.setDisabled("undo",!l.hasUndo()&&!l.typing);j.setDisabled("redo",!l.hasRedo())},_nodeChanged:function(o,u,E,r,F){var z=this,D,G=0,y,H,A=z.settings,x,l,w,C,m,k,j;h.each(z.stateControls,function(n){u.setActive(n,o.queryCommandState(z.controls[n][1]))});function q(p){var s,n=F.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s<n.length;s++){if(t(n[s])){return n[s]}}}u.setActive("visualaid",o.hasVisual);z._updateUndoStatus(o);u.setDisabled("outdent",!o.queryCommandState("Outdent"));D=q("A");if(H=u.get("link")){if(!D||!D.name){H.setDisabled(!D&&r);H.setActive(!!D)}}if(H=u.get("unlink")){H.setDisabled(!D&&r);H.setActive(!!D&&!D.name)}if(H=u.get("anchor")){H.setActive(!r&&!!D&&D.name)}D=q("IMG");if(H=u.get("image")){H.setActive(!r&&!!D&&E.className.indexOf("mceItem")==-1)}if(H=u.get("styleselect")){z._importClasses();k=[];f(H.items,function(n){k.push(n.value)});j=o.formatter.matchAll(k);H.select(j[0]);h.each(j,function(p,n){if(n>0){H.mark(p)}})}if(H=u.get("formatselect")){D=q(o.dom.isBlock);if(D){H.select(D.nodeName.toLowerCase())}}q(function(p){if(p.nodeName==="SPAN"){if(!x&&p.className){x=p.className}}if(o.dom.is(p,A.theme_advanced_font_selector)){if(!l&&p.style.fontSize){l=p.style.fontSize}if(!w&&p.style.fontFamily){w=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}if(!C&&p.style.color){C=p.style.color}if(!m&&p.style.backgroundColor){m=p.style.backgroundColor}}return false});if(H=u.get("fontselect")){H.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==w})}if(H=u.get("fontsizeselect")){if(A.theme_advanced_runtime_fontsize&&!l&&!x){l=o.dom.getStyle(E,"fontSize",true)}H.select(function(n){if(n.fontSize&&n.fontSize===l){return true}if(n["class"]&&n["class"]===x){return true}})}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_path&&A.theme_advanced_statusbar_location){D=i.get(o.id+"_path")||i.add(o.id+"_path_row","span",{id:o.id+"_path"});if(z.statusKeyboardNavigation){z.statusKeyboardNavigation.destroy();z.statusKeyboardNavigation=null}i.setHTML(D,"");q(function(I){var p=I.nodeName.toLowerCase(),s,v,t="";if(I.nodeType!=1||p==="br"||I.getAttribute("data-mce-bogus")||i.hasClass(I,"mceItemHidden")||i.hasClass(I,"mceItemRemoved")){return}if(h.isIE&&I.scopeName!=="HTML"&&I.scopeName){p=I.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(y=i.getAttrib(I,"src")){t+="src: "+y+" "}break;case"a":if(y=i.getAttrib(I,"name")){t+="name: "+y+" ";p+="#"+y}if(y=i.getAttrib(I,"href")){t+="href: "+y+" "}break;case"font":if(y=i.getAttrib(I,"face")){t+="font: "+y+" "}if(y=i.getAttrib(I,"size")){t+="size: "+y+" "}if(y=i.getAttrib(I,"color")){t+="color: "+y+" "}break;case"span":if(y=i.getAttrib(I,"style")){t+="style: "+y+" "}break}if(y=i.getAttrib(I,"id")){t+="id: "+y+" "}if(y=I.className){y=y.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(y){t+="class: "+y+" ";if(o.dom.isBlock(I)||p=="img"||p=="span"){p+="."+y}}}p=p.replace(/(html:)/g,"");p={name:p,node:I,title:t};z.onResolveName.dispatch(z,p);t=p.title;p=p.name;v=i.create("a",{href:"javascript:;",role:"button",onmousedown:"return false;",title:t,"class":"mcePath_"+(G++)},p);if(D.hasChildNodes()){D.insertBefore(i.create("span",{"aria-hidden":"true"},"\u00a0\u00bb "),D.firstChild);D.insertBefore(v,D.firstChild)}else{D.appendChild(v)}},o.getBody());if(i.select("a",D).length>0){z.statusKeyboardNavigation=new h.ui.KeyboardNavigation({root:o.id+"_path_row",items:i.select("a",D),excludeFromTabOrder:true,onCancel:function(){o.focus()}},i)}}},_sel:function(j){this.editor.execCommand("mceSelectNodeDepth",false,j)},_mceInsertAnchor:function(l,k){var j=this.editor;j.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(j.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(j.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var j=this.editor;j.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(j.getLang("advanced.charmap_delta_width",0)),height:265+parseInt(j.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var j=this.editor;j.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var j=this.editor;j.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(l,k){var j=this.editor;k=k||{};j.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(j.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(j.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:k.color,func:k.func,theme_url:this.url})},_mceCodeEditor:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(j.getParam("theme_advanced_source_editor_width",720)),height:parseInt(j.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(k,l){var j=this.editor;if(j.dom.getAttrib(j.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}j.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(j.getLang("advanced.image_delta_width",0)),height:275+parseInt(j.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(j.getLang("advanced.link_delta_width",0)),height:200+parseInt(j.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var j=this.editor;j.windowManager.confirm("advanced.newdocument",function(k){if(k){j.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var j=this;this._mceColorPicker(0,{color:j.fgColor,func:function(k){j.fgColor=k;j.editor.execCommand("ForeColor",false,k)}})},_mceBackColor:function(){var j=this;this._mceColorPicker(0,{color:j.bgColor,func:function(k){j.bgColor=k;j.editor.execCommand("HiliteColor",false,k)}})},_ufirst:function(j){return j.substring(0,1).toUpperCase()+j.substring(1)}});h.ThemeManager.add("advanced",h.themes.AdvancedTheme)}(tinymce));
\ No newline at end of file
each(previewStyles.split(' '), function(name) {\r
var value = dom.getStyle(previewElm, name, true);\r
\r
+ // If background is transparent then check if the body has a background color we can use\r
+ if (name == 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) {\r
+ value = dom.getStyle(ed.getBody(), name, true);\r
+\r
+ // Ignore white since it's the default color, not the nicest fix\r
+ if (dom.toHex(value).toLowerCase() == '#ffffff') {\r
+ return;\r
+ }\r
+ }\r
+\r
// Old IE won't calculate the font size so we need to do that manually\r
if (name == 'font-size') {\r
if (/em|%$/.test(value)) {\r
\r
// TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for.\r
// Maybe actually inherit it from the original textara?\r
- n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')});\r
+ n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '') + (ed.settings.directionality == "rtl" ? ' mceRtl' : '')});\r
DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label);\r
\r
if (!DOM.boxModel)\r
},\r
\r
_addToolbars : function(c, o) {\r
- var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup;\r
+ var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup, toolbarsExist = false;\r
\r
toolbarGroup = cf.createToolbarGroup('toolbargroup', {\r
'name': ed.getLang('advanced.toolbar'),\r
\r
// Create toolbar and add the controls\r
for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {\r
+ toolbarsExist = true;\r
tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i});\r
\r
if (s['theme_advanced_buttons' + i + '_add'])\r
\r
o.deltaHeight -= s.theme_advanced_row_height;\r
}\r
+ // Handle case when there are no toolbar buttons and ensure editor height is adjusted accordingly\r
+ if (!toolbarsExist)\r
+ o.deltaHeight -= s.theme_advanced_row_height;\r
h.push(toolbarGroup.renderHTML());\r
h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));\r
DOM.setHTML(n, h.join(''));\r
}\r
\r
if (c = cm.get('formatselect')) {\r
- p = getParent(DOM.isBlock);\r
+ p = getParent(ed.dom.isBlock);\r
\r
if (p)\r
c.select(p.nodeName.toLowerCase());\r
return;\r
\r
// Handle prefix\r
- if (tinymce.isIE && n.scopeName !== 'HTML')\r
+ if (tinymce.isIE && n.scopeName !== 'HTML' && n.scopeName)\r
na = n.scopeName + ':' + na;\r
\r
// Remove internal prefix\r
if (v) {\r
ti += 'class: ' + v + ' ';\r
\r
- if (DOM.isBlock(n) || na == 'img' || na == 'span')\r
+ if (ed.dom.isBlock(n) || na == 'img' || na == 'span')\r
na += '.' + v;\r
}\r
}\r
},\r
\r
updateStyle : function() {\r
- var dom = tinyMCEPopup.dom, st, v, f = document.forms[0];\r
+ var dom = tinyMCEPopup.dom, st = {}, v, f = document.forms[0];\r
\r
if (tinyMCEPopup.editor.settings.inline_styles) {\r
- st = tinyMCEPopup.dom.parseStyle(this.styleVal);\r
+ tinymce.each(tinyMCEPopup.dom.parseStyle(this.styleVal), function(value, key) {\r
+ st[key] = value;\r
+ });\r
\r
// Handle align\r
v = getSelectValue(f, 'align');\r
/* Generic */\r
body {\r
font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;\r
-background:#F0F0EE;
+background:#F0F0EE;\r
color: black;\r
padding:0;\r
margin:8px 8px 0 8px;\r
#plugintable, #about #plugintable td {border:1px solid #919B9C;}\r
#plugintable {width:96%; margin-top:10px;}\r
#pluginscontainer {height:290px; overflow:auto;}\r
-#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}\r
+#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px}\r
+#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline}\r
+#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap}\r
#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}\r
#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}\r
#colorpicker #light div {overflow:hidden;}\r
-#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}\r
#colorpicker .panel_wrapper div.current {height:175px;}\r
#colorpicker #namedcolors {width:150px;}\r
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}\r
\r
/* Menu */\r
.highcontrastSkin .mceNoIcons span.mceIcon {width:0;}\r
-.highcontrastSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid; }\r
+.highcontrastSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid; direction:ltr}\r
.highcontrastSkin .mceMenu table {background:white; color: black}\r
.highcontrastSkin .mceNoIcons a .mceText {padding-left:10px}\r
.highcontrastSkin .mceMenu a, .highcontrastSkin .mceMenu span, .highcontrastSkin .mceMenu {display:block;background:white; color: black}\r
.highcontrastSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF}\r
.highcontrastSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}\r
\r
+/* Rtl */\r
+.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0}\r
+.mceRtl .mceMenuItem .mceText {text-align: right}\r
+\r
/* Formats */\r
.highcontrastSkin .mce_p span.mceText {}\r
.highcontrastSkin .mce_address span.mceText {font-style:italic}\r
#plugintable, #about #plugintable td {border:1px solid #919B9C;}\r
#plugintable {width:96%; margin-top:10px;}\r
#pluginscontainer {height:290px; overflow:auto;}\r
-#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}\r
+#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px}\r
+#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline}\r
+#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap}\r
#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}\r
#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}\r
#colorpicker #light div {overflow:hidden;}\r
-#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}\r
#colorpicker .panel_wrapper div.current {height:175px;}\r
#colorpicker #namedcolors {width:150px;}\r
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}\r
.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden}\r
\r
/* Menu */\r
-.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD}\r
+.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD; direction:ltr}\r
.o2k7Skin .mceNoIcons span.mceIcon {width:0;}\r
.o2k7Skin .mceNoIcons a .mceText {padding-left:10px}\r
.o2k7Skin .mceMenu table {background:#FFF}\r
.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF}\r
.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}\r
\r
+/* Rtl */\r
+.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0}\r
+.mceRtl .mceMenuItem .mceText {text-align: right}\r
+\r
/* Formats */\r
.o2k7Skin .mce_formatPreview a {font-size:10px}\r
.o2k7Skin .mce_p span.mceText {}\r
-(function(d){var a=/^\s*|\s*$/g,e,c="B".replace(/A(.)|B/,"$1")==="$1";var b={majorVersion:"3",minorVersion:"5b2",releaseDate:"2012-03-15",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=d.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(d.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m<f.length;m++){if(r=f[m].href){if(/^https?:\/\/[^\/]+$/.test(r)){r+="/"}k=r?r.match(/.*\//)[0]:""}}function h(i){if(i.src&&/tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(i.src)){if(/_(src|dev)\.js/g.test(i.src)){s.suffix="_src"}if((j=i.src.indexOf("?"))!=-1){s.query=i.src.substring(j+1)}s.baseURL=i.src.substring(0,i.src.lastIndexOf("/"));if(k&&s.baseURL.indexOf("://")==-1&&s.baseURL.indexOf("/")!==0){s.baseURL=k+s.baseURL}return s.baseURL}return null}f=q.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}l=q.getElementsByTagName("head")[0];if(l){f=l.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}}return},is:function(g,f){if(!f){return g!==e}if(f=="array"&&(g.hasOwnProperty&&g instanceof Array)){return true}return typeof(g)==f},makeMap:function(f,j,h){var g;f=f||[];j=j||",";if(typeof(f)=="string"){f=f.split(j)}h=h||{};g=f.length;while(g--){h[f[g]]={}}return h},each:function(i,f,h){var j,g;if(!i){return 0}h=h||i;if(i.length!==e){for(j=0,g=i.length;j<g;j++){if(f.call(h,i[j],j,i)===false){return 0}}}else{for(j in i){if(i.hasOwnProperty(j)){if(f.call(h,i[j],j,i)===false){return 0}}}}return 1},map:function(g,h){var i=[];b.each(g,function(f){i.push(h(f))});return i},grep:function(g,h){var i=[];b.each(g,function(f){if(!h||h(f)){i.push(f)}});return i},inArray:function(g,h){var j,f;if(g){for(j=0,f=g.length;j<f;j++){if(g[j]===h){return j}}}return -1},extend:function(k,j){var h,g,f=arguments;for(h=1,g=f.length;h<g;h++){j=f[h];b.each(j,function(i,l){if(i!==e){k[l]=i}})}return k},trim:function(f){return(f?""+f:"").replace(a,"")},create:function(o,f,j){var n=this,g,i,k,l,h,m=0;o=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(o);k=o[3].match(/(^|\.)(\w+)$/i)[2];i=n.createNS(o[3].replace(/\.\w+$/,""),j);if(i[k]){return}if(o[2]=="static"){i[k]=f;if(this.onCreate){this.onCreate(o[2],o[3],i[k])}return}if(!f[k]){f[k]=function(){};m=1}i[k]=f[k];n.extend(i[k].prototype,f);if(o[5]){g=n.resolve(o[5]).prototype;l=o[5].match(/\.(\w+)$/i)[1];h=i[k];if(m){i[k]=function(){return g[l].apply(this,arguments)}}else{i[k]=function(){this.parent=g[l];return h.apply(this,arguments)}}i[k].prototype[k]=i[k];n.each(g,function(p,q){i[k].prototype[q]=g[q]});n.each(f,function(p,q){if(g[q]){i[k].prototype[q]=function(){this.parent=g[q];return p.apply(this,arguments)}}else{if(q!=k){i[k].prototype[q]=p}}})}n.each(f["static"],function(p,q){i[k][q]=p});if(this.onCreate){this.onCreate(o[2],o[3],i[k].prototype)}},walk:function(i,h,j,g){g=g||this;if(i){if(j){i=i[j]}b.each(i,function(k,f){if(h.call(g,k,f,j)===false){return false}b.walk(k,h,j,g)})}},createNS:function(j,h){var g,f;h=h||d;j=j.split(".");for(g=0;g<j.length;g++){f=j[g];if(!h[f]){h[f]={}}h=h[f]}return h},resolve:function(j,h){var g,f;h=h||d;j=j.split(".");for(g=0,f=j.length;g<f;g++){h=h[j[g]];if(!h){break}}return h},addUnload:function(j,i){var h=this;j={func:j,scope:i||this};if(!h.unloads){function g(){var f=h.unloads,l,m;if(f){for(m in f){l=f[m];if(l&&l.func){l.func.call(l.scope,1)}}if(d.detachEvent){d.detachEvent("onbeforeunload",k);d.detachEvent("onunload",g)}else{if(d.removeEventListener){d.removeEventListener("unload",g,false)}}h.unloads=l=f=w=g=0;if(d.CollectGarbage){CollectGarbage()}}}function k(){var l=document;if(l.readyState=="interactive"){function f(){l.detachEvent("onstop",f);if(g){g()}l=0}if(l){l.attachEvent("onstop",f)}d.setTimeout(function(){if(l){l.detachEvent("onstop",f)}},0)}}if(d.attachEvent){d.attachEvent("onunload",g);d.attachEvent("onbeforeunload",k)}else{if(d.addEventListener){d.addEventListener("unload",g,false)}}h.unloads=[j]}else{h.unloads.push(j)}return j},removeUnload:function(i){var g=this.unloads,h=null;b.each(g,function(j,f){if(j&&j.func==i){g.splice(f,1);h=i;return false}});return h},explode:function(f,g){return f?b.map(f.split(g||","),b.trim):f},_addVer:function(g){var f;if(!this.query){return g}f=(g.indexOf("?")==-1?"?":"&")+this.query;if(g.indexOf("#")==-1){return g+f}return g.replace("#",f+"#")},_replace:function(h,f,g){if(c){return g.replace(h,function(){var l=f,j=arguments,k;for(k=0;k<j.length-2;k++){if(j[k]===e){l=l.replace(new RegExp("\\$"+k,"g"),"")}else{l=l.replace(new RegExp("\\$"+k,"g"),j[k])}}return l})}return g.replace(h,f)}};b._init();d.tinymce=d.tinyMCE=b})(window);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d.length>0?d:[g.scope]);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,i,d,c,h;e=tinymce.trim(e);g=f.settings=g||{};if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w-]*:?\/\//.test(e)){h=g.base_uri?g.base_uri.path:new tinymce.util.URI(location.href).directory;e=((g.base_uri&&g.base_uri.protocol)||"http")+"://mce_host"+f.toAbsPath(h,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();(function(){function serialize(o,quote){var i,v,t;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){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&&o instanceof Array){for(i=0,v="[";i<o.length;i++){v+=(i>0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(i in o){if(o.hasOwnProperty(i)){v+=typeof o[i]!="function"?(v.length>1?","+quote:quote)+i+quote+":"+serialize(o[i],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(b){return b.shiftKey||b.ctrlKey||b.altKey}}})(tinymce);(function(n){var l=n.VK,m=l.BACKSPACE,j=l.DELETE;function p(r,t,s){try{r.getDoc().execCommand(t,false,s)}catch(q){}}function d(q){var s=q.dom,r=q.selection;q.onKeyDown.add(function(u,z){var t,A,x,y,v;if(z.isDefaultPrevented()){return}v=z.keyCode==j;if((v||z.keyCode==m)&&!l.modifierPressed(z)){z.preventDefault();t=r.getRng();A=s.getParent(t.startContainer,s.isBlock);if(v){A=s.getNext(A,s.isBlock)}if(A){x=A.firstChild;while(x&&x.nodeType==3&&x.nodeValue.length==0){x=x.nextSibling}if(x&&x.nodeName==="SPAN"){y=x.cloneNode(false)}}u.getDoc().execCommand(v?"ForwardDelete":"Delete",false,null);A=s.getParent(t.startContainer,s.isBlock);n.each(s.select("span.Apple-style-span,font.Apple-style-span",A),function(B){var C=r.getBookmark();if(y){s.replace(y.cloneNode(false),B,true)}else{s.remove(B,true)}r.moveToBookmark(C)})}})}function e(q){function r(u){var t=q.dom.create("body");var v=u.cloneContents();t.appendChild(v);return q.selection.serializer.serialize(t,{format:"html"})}function s(t){var v=r(t);var x=q.dom.createRng();x.selectNode(q.getBody());var u=r(x);return v===u}q.onKeyDown.addToTop(function(u,x){var v=x.keyCode;if(v==j||v==m){var t=u.selection.getRng(true);if(!t.collapsed&&s(t)){u.setContent("",{format:"raw"});u.nodeChanged();x.preventDefault()}}})}function c(q){q.dom.bind(q.getDoc(),"focusin",function(){q.selection.setRng(q.selection.getRng())})}function g(q){q.onKeyDown.add(function(r,u){if(u.keyCode===m){if(r.selection.isCollapsed()&&r.selection.getRng(true).startOffset===0){var t=r.selection.getNode();var s=t.previousSibling;if(s&&s.nodeName&&s.nodeName.toLowerCase()==="hr"){r.dom.remove(s);n.dom.Event.cancel(u)}}}})}function i(q){if(!Range.prototype.getClientRects){q.onMouseDown.add(function(s,t){if(t.target.nodeName==="HTML"){var r=s.getBody();r.blur();setTimeout(function(){r.focus()},0)}})}}function h(q){q.onClick.add(function(r,s){s=s.target;if(/^(IMG|HR)$/.test(s.nodeName)){r.selection.getSel().setBaseAndExtent(s,0,s,1)}if(s.nodeName=="A"&&r.dom.hasClass(s,"mceItemAnchor")){r.selection.select(s)}r.nodeChanged()})}function b(q){var s=q.selection,v=q.dom;function t(){var x=v.getAttribs(s.getStart().cloneNode(false));return function(){var y=s.getStart();if(y!==q.getBody()){v.setAttrib(y,"style",null);n.each(x,function(z){y.setAttributeNode(z.cloneNode(true))})}}}function r(){return !s.isCollapsed()&&s.getStart()!=s.getEnd()}function u(x,y){y.preventDefault();return false}q.onKeyPress.add(function(x,z){var y;if((z.keyCode==8||z.keyCode==46)&&r()){y=t();x.getDoc().execCommand("delete",false,null);y();z.preventDefault();return false}});v.bind(q.getDoc(),"cut",function(y){var x;if(r()){x=t();q.onKeyUp.addToTop(u);setTimeout(function(){x();q.onKeyUp.remove(u)},0)}})}function o(q){var s,r;q.dom.bind(q.getDoc(),"selectionchange",function(){if(r){clearTimeout(r);r=0}r=window.setTimeout(function(){var t=q.selection.getRng();if(!s||!n.dom.RangeUtils.compareRanges(t,s)){q.nodeChanged();s=t}},50)})}function a(q){document.body.setAttribute("role","application")}function f(q){q.onKeyDown.add(function(r,t){if(t.keyCode===m){if(r.selection.isCollapsed()&&r.selection.getRng(true).startOffset===0){var s=r.selection.getNode().previousSibling;if(s&&s.nodeName&&s.nodeName.toLowerCase()==="table"){return n.dom.Event.cancel(t)}}}})}function k(r){var q=r.getDoc().documentMode;if(q&&q>7){return}p(r,"RespectVisibilityInDesign",true);r.dom.addClass(r.getBody(),"mceHideBrInPre");r.parser.addNodeFilter("pre",function(s,u){var v=s.length,y,t,z,x;while(v--){y=s[v].getAll("br");t=y.length;while(t--){z=y[t];x=z.prev;if(x&&x.type===3&&x.value.charAt(x.value-1)!="\n"){x.value+="\n"}else{z.parent.insert(new n.html.Node("#text",3),z,true).value="\n"}}}});r.serializer.addNodeFilter("pre",function(s,u){var v=s.length,y,t,z,x;while(v--){y=s[v].getAll("br");t=y.length;while(t--){z=y[t];x=z.prev;if(x&&x.type==3){x.value=x.value.replace(/\r?\n$/,"")}}}})}n.create("tinymce.util.Quirks",{Quirks:function(q){f(q);if(n.isWebKit){d(q);e(q);c(q);h(q);if(n.isIDevice){o(q)}}if(n.isIE){g(q);e(q);a(q);k(q)}if(n.isGecko){g(q);i(q);b(q)}}})})(tinymce);(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={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"};g={'"':""","'":"'","<":"<",">":">","&":"&"};d={"<":"<",">":">","&":"&",""":'"',"'":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n<m.length;n+=2){o=String.fromCharCode(parseInt(m[n],p));if(!g[o]){l="&"+m[n+1]+";";q[o]=l;q[l]=o}}return q}}a=e("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);j.html=j.html||{};j.html.Entities={encodeRaw:function(m,l){return m.replace(l?k:b,function(n){return g[n]||n})},encodeAllRaw:function(l){return(""+l).replace(f,function(m){return g[m]||m})},encodeNumeric:function(m,l){return m.replace(l?k:b,function(n){if(n.length>1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g<j.length;g++){a[j[g]]="\uFEFF"+g;a["\uFEFF"+g]=j[g]}function c(n,q,p,i){function o(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(r){var y={},p,n,v,q,u=d.url_converter,x=d.url_converter_scope||this;function o(C,F){var E,B,A,D;E=y[C+"-top"+F];if(!E){return}B=y[C+"-right"+F];if(E!=B){return}A=y[C+"-bottom"+F];if(B!=A){return}D=y[C+"-left"+F];if(A!=D){return}y[C+F]=D;delete y[C+"-top"+F];delete y[C+"-right"+F];delete y[C+"-bottom"+F];delete y[C+"-left"+F]}function t(B){var C=y[B],A;if(!C||C.indexOf(" ")<0){return}C=C.split(" ");A=C.length;while(A--){if(C[A]!==C[0]){return false}}y[B]=C[0];return true}function z(C,B,A,D){if(!t(B)){return}if(!t(A)){return}if(!t(D)){return}y[C]=y[B]+" "+y[A]+" "+y[D];delete y[B];delete y[A];delete y[D]}function s(A){q=true;return a[A]}function i(B,A){if(q){B=B.replace(/\uFEFF[0-9]/g,function(C){return a[C]})}if(!A){B=B.replace(/\\([\'\";:])/g,"$1")}return B}if(r){r=r.replace(/\\[\"\';:\uFEFF]/g,s).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(A){return A.replace(/[;:]/g,s)});while(p=b.exec(r)){n=p[1].replace(l,"").toLowerCase();v=p[2].replace(l,"");if(n&&v.length>0){if(n==="font-weight"&&v==="700"){v="bold"}else{if(n==="color"||n==="background-color"){v=v.toLowerCase()}}v=v.replace(k,c);v=v.replace(h,function(B,A,E,D,F,C){F=F||C;if(F){F=i(F);return"'"+F.replace(/\'/g,"\\'")+"'"}A=i(A||E||D);if(u){A=u.call(x,A,"style")}return"url('"+A.replace(/\'/g,"\\'")+"')"});y[n]=q?i(v,true):v}b.lastIndex=p.index+p[0].length}o("border","");o("border","-width");o("border","-color");o("border","-style");o("padding","");o("margin","");z("border","border-width","border-style","border-color");if(y.border==="medium none"){delete y.border}}return y},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u<s;u++){t=x[u];v=p[t];if(v!==e&&v.length>0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(f){var a={},e=f.makeMap,g=f.each;function d(j,i){return j.split(i||",")}function h(m,l){var j,k={};function i(n){return n.replace(/[A-Z]+/g,function(o){return i(m[o])})}for(j in m){if(m.hasOwnProperty(j)){m[j]=i(m[j])}}i(l).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(q,o,n,p){n=d(n,"|");k[o]={attributes:e(n),attributesOrder:n,children:e(p,"|",{"#comment":{}})}});return k}function b(){var i=a.html5;if(!i){i=a.html5=h({A:"id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title",B:"#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video",C:"#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video"},"html[A|manifest][body|head]head[A][base|command|link|meta|noscript|script|style|title]title[A][#]base[A|href|target][]link[A|href|rel|media|type|sizes][]meta[A|http-equiv|name|content|charset][]style[A|type|media|scoped][#]script[A|charset|type|src|defer|async][#]noscript[A][C]body[A][C]section[A][C]nav[A][C]article[A][C]aside[A][C]h1[A][B]h2[A][B]h3[A][B]h4[A][B]h5[A][B]h6[A][B]hgroup[A][h1|h2|h3|h4|h5|h6]header[A][C]footer[A][C]address[A][C]p[A][B]br[A][]pre[A][B]dialog[A][dd|dt]blockquote[A|cite][C]ol[A|start|reversed][li]ul[A][li]li[A|value][C]dl[A][dd|dt]dt[A][B]dd[A][C]a[A|href|target|ping|rel|media|type][C]em[A][B]strong[A][B]small[A][B]cite[A][B]q[A|cite][B]dfn[A][B]abbr[A][B]code[A][B]var[A][B]samp[A][B]kbd[A][B]sub[A][B]sup[A][B]i[A][B]b[A][B]mark[A][B]progress[A|value|max][B]meter[A|value|min|max|low|high|optimum][B]time[A|datetime][B]ruby[A][B|rt|rp]rt[A][B]rp[A][B]bdo[A][B]span[A][B]ins[A|cite|datetime][B]del[A|cite|datetime][B]figure[A][C|legend]img[A|alt|src|height|width|usemap|ismap][]iframe[A|name|src|height|width|sandbox|seamless][]embed[A|src|height|width|type][]object[A|data|type|height|width|usemap|name|form|classid][param]param[A|name|value][]details[A|open][C|legend]command[A|type|label|icon|disabled|checked|radiogroup][]menu[A|type|label][C|li]legend[A][C|B]div[A][C]source[A|src|type|media][]audio[A|src|autobuffer|autoplay|loop|controls][source]video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]hr[A][]form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]fieldset[A|disabled|form|name][C|legend]label[A|form|for][B]input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value][]button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]datalist[A][B|option]optgroup[A|disabled|label][option]option[A|disabled|selected|label|value][]textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]keygen[A|autofocus|challenge|disabled|form|keytype|name][]output[A|for|form|name][B]canvas[A|width|height][]map[A|name][B|C]area[A|shape|coords|href|alt|target|media|rel|ping|type][]mathml[A][]svg[A][]table[A|summary][caption|colgroup|thead|tfoot|tbody|tr]caption[A][C]colgroup[A|span][col]col[A|span][]thead[A][tr]tfoot[A][tr]tbody[A][tr]tr[A][th|td]th[A|headers|rowspan|colspan|scope][B]td[A|headers|rowspan|colspan][C]")}return i}function c(){var i=a.html4;if(!i){i=a.html4=h({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]")}return i}f.html.Schema=function(A){var u=this,s={},k={},j=[],D,y;var o,q,z,r,v,n,p={};function m(F,E,H){var G=A[F];if(!G){G=a[F];if(!G){G=e(E," ",e(E.toUpperCase()," "));G=f.extend(G,H);a[F]=G}}else{G=e(G,",",e(G.toUpperCase()," "))}return G}A=A||{};y=A.schema=="html5"?b():c();if(A.verify_html===false){A.valid_elements="*[*]"}if(A.valid_styles){D={};g(A.valid_styles,function(F,E){D[E]=f.explode(F)})}o=m("whitespace_elements","pre script style textarea");q=m("self_closing_elements","colgroup dd dt li options p td tfoot th thead tr");z=m("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source");r=m("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");n=m("non_empty_elements","td th iframe video audio object",z);v=m("block_elements","h1 h2 h3 h4 h5 h6 hr p div address pre form table tbody thead tfoot th tr td li ol ul caption blockquote center dl dt dd dir fieldset noscript menu isindex samp header footer article section hgroup aside nav");function i(E){return new RegExp("^"+E.replace(/([?+*])/g,".$1")+"$")}function C(L){var K,G,Z,V,aa,F,I,U,X,Q,Y,ac,O,J,W,E,S,H,ab,ad,P,T,N=/^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,R=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,M=/[*?+]/;if(L){L=d(L);if(s["@"]){S=s["@"].attributes;H=s["@"].attributesOrder}for(K=0,G=L.length;K<G;K++){F=N.exec(L[K]);if(F){W=F[1];Q=F[2];E=F[3];X=F[4];O={};J=[];I={attributes:O,attributesOrder:J};if(W==="#"){I.paddEmpty=true}if(W==="-"){I.removeEmpty=true}if(S){for(ad in S){O[ad]=S[ad]}J.push.apply(J,H)}if(X){X=d(X,"|");for(Z=0,V=X.length;Z<V;Z++){F=R.exec(X[Z]);if(F){U={};ac=F[1];Y=F[2].replace(/::/g,":");W=F[3];T=F[4];if(ac==="!"){I.attributesRequired=I.attributesRequired||[];I.attributesRequired.push(Y);U.required=true}if(ac==="-"){delete O[Y];J.splice(f.inArray(J,Y),1);continue}if(W){if(W==="="){I.attributesDefault=I.attributesDefault||[];I.attributesDefault.push({name:Y,value:T});U.defaultValue=T}if(W===":"){I.attributesForced=I.attributesForced||[];I.attributesForced.push({name:Y,value:T});U.forcedValue=T}if(W==="<"){U.validValues=e(T,"?")}}if(M.test(Y)){I.attributePatterns=I.attributePatterns||[];U.pattern=i(Y);I.attributePatterns.push(U)}else{if(!O[Y]){J.push(Y)}O[Y]=U}}}}if(!S&&Q=="@"){S=O;H=J}if(E){I.outputName=Q;s[E]=I}if(M.test(Q)){I.pattern=i(Q);j.push(I)}else{s[Q]=I}}}}}function t(E){s={};j=[];C(E);g(y,function(G,F){k[F]=G.children})}function l(F){var E=/^(~)?(.+)$/;if(F){g(d(F),function(J){var H=E.exec(J),I=H[1]==="~",K=I?"span":"div",G=H[2];k[G]=k[K];p[G]=K;if(!I){v[G]={}}g(k,function(L,M){if(L[K]){L[G]=L[K]}})})}}function x(F){var E=/^([+\-]?)(\w+)\[([^\]]+)\]$/;if(F){g(d(F),function(J){var I=E.exec(J),G,H;if(I){H=I[1];if(H){G=k[I[2]]}else{G=k[I[2]]={"#comment":{}}}G=k[I[2]];g(d(I[3],"|"),function(K){if(H==="-"){delete G[K]}else{G[K]={}}})}})}}function B(E){var G=s[E],F;if(G){return G}F=j.length;while(F--){G=j[F];if(G.pattern.test(E)){return G}}}if(!A.valid_elements){g(y,function(F,E){s[E]={attributes:F.attributes,attributesOrder:F.attributesOrder};k[E]=F.children});if(A.schema!="html5"){g(d("strong/b,em/i"),function(E){E=d(E,"/");s[E[1]].outputName=E[0]})}s.img.attributesDefault=[{name:"alt",value:""}];g(d("ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr,strong,em,b,i"),function(E){if(s[E]){s[E].removeEmpty=true}});g(d("p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption"),function(E){s[E].paddEmpty=true})}else{t(A.valid_elements)}l(A.custom_elements);x(A.valid_children);C(A.extended_valid_elements);x("+ol[ul|ol],+ul[ul|ol]");if(A.invalid_elements){f.each(f.explode(A.invalid_elements),function(E){if(s[E]){delete s[E]}})}if(!B("span")){C("span[!data-mce-type|*]")}u.children=k;u.styles=D;u.getBoolAttrs=function(){return r};u.getBlockElements=function(){return v};u.getShortEndedElements=function(){return z};u.getSelfClosingElements=function(){return q};u.getNonEmptyElements=function(){return n};u.getWhiteSpaceElements=function(){return o};u.isValidChild=function(E,G){var F=k[E];return !!(F&&F[G])};u.getElementRule=B;u.getCustomElements=function(){return p};u.addValidElements=C;u.setValidElements=t;u.addCustomElements=l;u.addValidChildren=x}})(tinymce);(function(a){a.html.SaxParser=function(c,e){var b=this,d=function(){};c=c||{};b.schema=e=e||new a.html.Schema();if(c.fix_self_closing!==false){c.fix_self_closing=true}a.each("comment cdata text start end pi doctype".split(" "),function(f){if(f){b[f]=c[f]||d}});b.parse=function(D){var n=this,g,F=0,H,A,z=[],M,P,B,q,y,r,L,G,N,u,m,k,s,Q,o,O,E,R,K,f,I,l,C,J,h,v=0,j=a.html.Entities.decode,x,p;function t(S){var U,T;U=z.length;while(U--){if(z[U].name===S){break}}if(U>=0){for(T=z.length-1;T>=U;T--){S=z[T];if(S.valid){n.end(S.name)}}z.length=U}}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9-:]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");C=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;J={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};L=e.getShortEndedElements();I=e.getSelfClosingElements();G=e.getBoolAttrs();u=c.validate;r=c.remove_internals;x=c.fix_self_closing;p=a.isIE;o=/^:/;while(g=l.exec(D)){if(F<g.index){n.text(j(D.substr(F,g.index-F)))}if(H=g[6]){H=H.toLowerCase();if(p&&o.test(H)){H=H.substr(1)}t(H)}else{if(H=g[7]){H=H.toLowerCase();if(p&&o.test(H)){H=H.substr(1)}N=H in L;if(x&&I[H]&&z.length>0&&z[z.length-1].name===H){t(H)}if(!u||(m=e.getElementRule(H))){k=true;if(u){O=m.attributes;E=m.attributePatterns}if(Q=g[8]){y=Q.indexOf("data-mce-type")!==-1;if(y&&r){k=false}M=[];M.map={};Q.replace(C,function(T,S,X,W,V){var Y,U;S=S.toLowerCase();X=S in G?S:j(X||W||V||"");if(u&&!y&&S.indexOf("data-")!==0){Y=O[S];if(!Y&&E){U=E.length;while(U--){Y=E[U];if(Y.pattern.test(S)){break}}if(U===-1){Y=null}}if(!Y){return}if(Y.validValues&&!(X in Y.validValues)){return}}M.map[S]=X;M.push({name:S,value:X})})}else{M=[];M.map={}}if(u&&!y){R=m.attributesRequired;K=m.attributesDefault;f=m.attributesForced;if(f){P=f.length;while(P--){s=f[P];q=s.name;h=s.value;if(h==="{$uid}"){h="mce_"+v++}M.map[q]=h;M.push({name:q,value:h})}}if(K){P=K.length;while(P--){s=K[P];q=s.name;if(!(q in M.map)){h=s.value;if(h==="{$uid}"){h="mce_"+v++}M.map[q]=h;M.push({name:q,value:h})}}}if(R){P=R.length;while(P--){if(R[P] in M.map){break}}if(P===-1){k=false}}if(M.map["data-mce-bogus"]){k=false}}if(k){n.start(H,M,N)}}else{k=false}if(A=J[H]){A.lastIndex=F=g.index+g[0].length;if(g=A.exec(D)){if(k){B=D.substr(F,g.index-F)}F=g.index+g[0].length}else{B=D.substr(F);F=D.length}if(k&&B.length>0){n.text(B,true)}if(k){n.end(H)}l.lastIndex=F;continue}if(!N){if(!Q||Q.indexOf("/")!=Q.length-1){z.push({name:H,valid:k})}else{if(k){n.end(H)}}}}else{if(H=g[1]){n.comment(H)}else{if(H=g[2]){n.cdata(H)}else{if(H=g[3]){n.doctype(H)}else{if(H=g[4]){n.pi(H,g[5])}}}}}}F=g.index+g[0].length}if(F<D.length){n.text(j(D.substr(F)))}for(P=z.length-1;P>=0;P--){H=z[P];if(H.valid){n.end(H.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h<f;h++){j=m[h];if(j.name!=="id"){k[k.length]={name:j.name,value:j.value};k.map[j.name]=j.value}}n.attributes=k}n.value=g.value;n.shortEnded=g.shortEnded;return n},wrap:function(g){var f=this;f.parent.insert(g,f);g.append(f);return f},unwrap:function(){var f=this,h,g;for(h=f.firstChild;h;){g=h.next;f.insert(h,f,true);h=g}f.remove()},remove:function(){var f=this,h=f.parent,g=f.next,i=f.prev;if(h){if(h.firstChild===f){h.firstChild=g;if(g){g.prev=null}}else{i.next=g}if(h.lastChild===f){h.lastChild=i;if(i){i.next=null}}else{g.prev=i}f.parent=f.next=f.prev=null}return f},append:function(h){var f=this,g;if(h.parent){h.remove()}g=f.lastChild;if(g){g.next=h;h.prev=g;f.lastChild=h}else{f.lastChild=f.firstChild=h}h.parent=f;return h},insert:function(h,f,i){var g;if(h.parent){h.remove()}g=f.parent||this;if(i){if(f===g.firstChild){g.firstChild=h}else{f.prev.next=h}h.prev=f.prev;h.next=f;f.prev=h}else{if(f===g.lastChild){g.lastChild=h}else{f.next.prev=h}h.next=f.next;h.prev=f;f.next=h}h.parent=g;return h},getAll:function(g){var f=this,h,i=[];for(h=f.firstChild;h;h=a(h,f)){if(h.name===g){i.push(h)}}return i},empty:function(){var g=this,f,h,j;if(g.firstChild){f=[];for(j=g.firstChild;j;j=a(j,g)){f.push(j)}h=f.length;while(h--){j=f[h];j.parent=j.firstChild=j.lastChild=j.next=j.prev=null}}g.firstChild=g.lastChild=null;return g},isEmpty:function(k){var f=this,j=f.firstChild,h,g;if(j){do{if(j.type===1){if(j.attributes.map["data-mce-bogus"]){continue}if(k[j.name]){return false}h=j.attributes.length;while(h--){g=j.attributes[h].name;if(g==="name"||g.indexOf("data-")===0){return false}}}if(j.type===8){return false}if((j.type===3&&!c.test(j.value))){return false}}while(j=a(j,f))}return true},walk:function(f){return a(this,null,f)}});d.extend(b,{create:function(g,f){var i,h;i=new b(g,e[g]||1);if(f){for(h in f){i.attr(h,f[h])}}return i}});d.html.Node=b})(tinymce);(function(b){var a=b.html.Node;b.html.DomParser=function(g,h){var f=this,e={},d=[],i={},c={};g=g||{};g.validate="validate" in g?g.validate:true;g.root_name=g.root_name||"body";f.schema=h=h||new b.html.Schema();function j(m){var o,p,x,v,z,n,q,l,t,u,k,s,y,r;s=b.makeMap("tr,td,th,tbody,thead,tfoot,table");k=h.getNonEmptyElements();for(o=0;o<m.length;o++){p=m[o];if(!p.parent){continue}v=[p];for(x=p.parent;x&&!h.isValidChild(x.name,p.name)&&!s[x.name];x=x.parent){v.push(x)}if(x&&v.length>1){v.reverse();z=n=f.filterNode(v[0].clone());for(t=0;t<v.length-1;t++){if(h.isValidChild(n.name,v[t].name)){q=f.filterNode(v[t].clone());n.append(q)}else{q=n}for(l=v[t].firstChild;l&&l!=v[t+1];){r=l.next;q.append(l);l=r}n=q}if(!z.isEmpty(k)){x.insert(z,v[0],true);x.insert(p,z)}else{x.insert(p,v[0],true)}x=v[0];if(x.isEmpty(k)||x.firstChild===x.lastChild&&x.firstChild.name==="br"){x.empty().remove()}}else{if(p.parent){if(p.name==="li"){y=p.prev;if(y&&(y.name==="ul"||y.name==="ul")){y.append(p);continue}y=p.next;if(y&&(y.name==="ul"||y.name==="ul")){y.insert(p,y.firstChild,true);continue}p.wrap(f.filterNode(new a("ul",1)));continue}if(h.isValidChild(p.parent.name,"div")&&h.isValidChild("div",p.name)){p.wrap(f.filterNode(new a("div",1)))}else{if(p.name==="style"||p.name==="script"){p.empty().remove()}else{p.unwrap()}}}}}}f.filterNode=function(m){var l,k,n;if(k in e){n=i[k];if(n){n.push(m)}else{i[k]=[m]}}l=d.length;while(l--){k=d[l].name;if(k in m.attributes.map){n=c[k];if(n){n.push(m)}else{c[k]=[m]}}}return m};f.addNodeFilter=function(k,l){b.each(b.explode(k),function(m){var n=e[m];if(!n){e[m]=n=[]}n.push(l)})};f.addAttributeFilter=function(k,l){b.each(b.explode(k),function(m){var n;for(n=0;n<d.length;n++){if(d[n].name===m){d[n].callbacks.push(l);return}}d.push({name:m,callbacks:[l]})})};f.parse=function(v,m){var n,H,A,z,C,B,x,r,E,L,y,o,D,K=[],J,t,k,s,p,u,q;m=m||{};i={};c={};o=b.extend(b.makeMap("script,style,head,html,body,title,meta,param"),h.getBlockElements());u=h.getNonEmptyElements();p=h.children;y=g.validate;q="forced_root_block" in m?m.forced_root_block:g.forced_root_block;s=h.getWhiteSpaceElements();D=/^[ \t\r\n]+/;t=/[ \t\r\n]+$/;k=/[ \t\r\n]+/g;function F(){var M=H.firstChild,l,N;while(M){l=M.next;if(M.type==3||(M.type==1&&M.name!=="p"&&!o[M.name]&&!M.attr("data-mce-type"))){if(!N){N=I(q,1);H.insert(N,M);N.append(M)}else{N.append(M)}}else{N=null}M=l}}function I(l,M){var N=new a(l,M),O;if(l in e){O=i[l];if(O){O.push(N)}else{i[l]=[N]}}return N}function G(N){var O,l,M;for(O=N.prev;O&&O.type===3;){l=O.value.replace(t,"");if(l.length>0){O.value=l;O=O.prev}else{M=O.prev;O.remove();O=M}}}n=new b.html.SaxParser({validate:y,fix_self_closing:!y,cdata:function(l){A.append(I("#cdata",4)).value=l},text:function(N,l){var M;if(!J){N=N.replace(k," ");if(A.lastChild&&o[A.lastChild.name]){N=N.replace(D,"")}}if(N.length!==0){M=I("#text",3);M.raw=!!l;A.append(M).value=N}},comment:function(l){A.append(I("#comment",8)).value=l},pi:function(l,M){A.append(I(l,7)).value=M;G(A)},doctype:function(M){var l;l=A.append(I("#doctype",10));l.value=M;G(A)},start:function(l,U,N){var S,P,O,M,Q,V,T,R;O=y?h.getElementRule(l):{};if(O){S=I(O.outputName||l,1);S.attributes=U;S.shortEnded=N;A.append(S);R=p[A.name];if(R&&p[S.name]&&!R[S.name]){K.push(S)}P=d.length;while(P--){Q=d[P].name;if(Q in U.map){E=c[Q];if(E){E.push(S)}else{c[Q]=[S]}}}if(o[l]){G(S)}if(!N){A=S}if(!J&&s[l]){J=true}}},end:function(l){var Q,N,P,M,O;N=y?h.getElementRule(l):{};if(N){if(o[l]){if(!J){for(Q=A.firstChild;Q&&Q.type===3;){P=Q.value.replace(D,"");if(P.length>0){Q.value=P;Q=Q.next}else{M=Q.next;Q.remove();Q=M}}for(Q=A.lastChild;Q&&Q.type===3;){P=Q.value.replace(t,"");if(P.length>0){Q.value=P;Q=Q.prev}else{M=Q.prev;Q.remove();Q=M}}}Q=A.prev;if(Q&&Q.type===3){P=Q.value.replace(D,"");if(P.length>0){Q.value=P}else{Q.remove()}}}if(J&&s[l]){J=false}if(N.removeEmpty||N.paddEmpty){if(A.isEmpty(u)){if(N.paddEmpty){A.empty().append(new a("#text","3")).value="\u00a0"}else{if(!A.attributes.map.name){O=A.parent;A.empty().remove();A=O;return}}}}A=A.parent}}},h);H=A=new a(m.context||g.root_name,11);n.parse(v);if(y&&K.length){if(!m.context){j(K)}else{m.invalid=true}}if(q&&H.name=="body"){F()}if(!m.invalid){for(L in i){E=e[L];z=i[L];x=z.length;while(x--){if(!z[x].parent){z.splice(x,1)}}for(C=0,B=E.length;C<B;C++){E[C](z,L,m)}}for(C=0,B=d.length;C<B;C++){E=d[C];if(E.name in c){z=c[E.name];x=z.length;while(x--){if(!z[x].parent){z.splice(x,1)}}for(x=0,r=E.callbacks.length;x<r;x++){E.callbacks[x](z,E.name,m)}}}}return H};if(g.remove_trailing_brs){f.addNodeFilter("br",function(n,m){var r,q=n.length,o,u=h.getBlockElements(),k=h.getNonEmptyElements(),s,p,t;u.body=1;for(r=0;r<q;r++){o=n[r];s=o.parent;if(u[o.parent.name]&&o===s.lastChild){p=o.prev;while(p){t=p.name;if(t!=="span"||p.attr("data-mce-type")!=="bookmark"){if(t!=="br"){break}if(t==="br"){o=null;break}}p=p.prev}if(o){o.remove();if(s.isEmpty(k)){elementRule=h.getElementRule(s.name);if(elementRule){if(elementRule.removeEmpty){s.remove()}else{if(elementRule.paddEmpty){s.empty().append(new b.html.Node("#text",3)).value="\u00a0"}}}}}}}})}}})(tinymce);tinymce.html.Writer=function(e){var c=[],a,b,d,f,g;e=e||{};a=e.indent;b=tinymce.makeMap(e.indent_before||"");d=tinymce.makeMap(e.indent_after||"");f=tinymce.html.Entities.getEncodeFunc(e.entity_encoding||"raw",e.entities);g=e.element_format=="html";return{start:function(m,k,p){var n,j,h,o;if(a&&b[m]&&c.length>0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n<j;n++){h=k[n];c.push(" ",h.name,'="',f(h.value,true),'"')}}if(!p||g){c[c.length]=">"}else{c[c.length]=" />"}if(p&&a&&d[m]&&c.length>0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("</",h,">");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("<![CDATA[",h,"]]>")},comment:function(h){c.push("<!--",h,"-->")},pi:function(h,i){if(i){c.push("<?",h," ",i,"?>")}else{c.push("<?",h,"?>")}if(a){c.push("\n")}},doctype:function(h){c.push("<!DOCTYPE",h,">",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n<m;n++){r=q.attributesOrder[n];if(r in s.map){p=s.map[r];u.map[r]=p;u.push({name:r,value:p})}}for(n=0,m=s.length;n<m;n++){r=s[n].name;if(!(r in u.map)){p=s.map[r];u.map[r]=p;u.push({name:r,value:p})}}s=u}e.start(k.name,s,o);if(!o){if((k=k.firstChild)){do{f(k)}while(k=k.next)}e.end(j)}}else{t(k)}}if(h.type==1&&!c.inner){f(h)}else{g[11](h)}return e.getContent()}}})(tinymce);tinymce.dom={};(function(b,h){var g=!!document.addEventListener;function c(k,j,l,i){if(k.addEventListener){k.addEventListener(j,l,i||false)}else{if(k.attachEvent){k.attachEvent("on"+j,l)}}}function e(k,j,l,i){if(k.removeEventListener){k.removeEventListener(j,l,i||false)}else{if(k.detachEvent){k.detachEvent("on"+j,l)}}}function a(n,l){var i,k=l||{};function j(){return false}function m(){return true}for(i in n){if(i!=="layerX"&&i!=="layerY"){k[i]=n[i]}}if(!k.target){k.target=k.srcElement||document}k.preventDefault=function(){k.isDefaultPrevented=m;if(n){if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}}};k.stopPropagation=function(){k.isPropagationStopped=m;if(n){if(n.stopPropagation){n.stopPropagation()}else{n.cancelBubble=true}}};k.stopImmediatePropagation=function(){k.isImmediatePropagationStopped=m;k.stopPropagation()};if(!k.isDefaultPrevented){k.isDefaultPrevented=j;k.isPropagationStopped=j;k.isImmediatePropagationStopped=j}return k}function d(m,n,l){var k=m.document,j={type:"ready"};function i(){if(!l.domLoaded){l.domLoaded=true;n(j)}}if(g){c(m,"DOMContentLoaded",i)}else{c(k,"readystatechange",function(){if(k.readyState==="complete"){e(k,"readystatechange",arguments.callee);i()}});if(k.documentElement.doScroll&&m===m.top){(function(){try{k.documentElement.doScroll("left")}catch(o){setTimeout(arguments.callee,0);return}i()})()}}c(m,"load",i)}function f(k){var q=this,p={},i,o,n,m,l;m="onmouseenter" in document.documentElement;n="onfocusin" in document.documentElement;l={mouseenter:"mouseover",mouseleave:"mouseout"};i=1;q.domLoaded=false;q.events=p;function j(t,x){var s,u,r,v;s=p[x][t.type];if(s){for(u=0,r=s.length;u<r;u++){v=s[u];if(v&&v.func.call(v.scope,t)===false){t.preventDefault()}if(t.isImmediatePropagationStopped()){return}}}}q.bind=function(x,A,D,E){var s,t,u,r,B,z,C,v=window;function y(F){j(a(F||v.event),s)}if(!x||x.nodeType===3||x.nodeType===8){return}if(!x[h]){s=i++;x[h]=s;p[s]={}}else{s=x[h];if(!p[s]){p[s]={}}}E=E||x;A=A.split(" ");u=A.length;while(u--){r=A[u];z=y;B=C=false;if(r==="DOMContentLoaded"){r="ready"}if((q.domLoaded||x.readyState=="complete")&&r==="ready"){q.domLoaded=true;D.call(E,a({type:r}));continue}if(!m){B=l[r];if(B){z=function(F){var H,G;H=F.currentTarget;G=F.relatedTarget;if(G&&H.contains){G=H.contains(G)}else{while(G&&G!==H){G=G.parentNode}}if(!G){F=a(F||v.event);F.type=F.type==="mouseout"?"mouseleave":"mouseenter";F.target=H;j(F,s)}}}}if(!n&&(r==="focusin"||r==="focusout")){C=true;B=r==="focusin"?"focus":"blur";z=function(F){F=a(F||v.event);F.type=F.type==="focus"?"focusin":"focusout";j(F,s)}}t=p[s][r];if(!t){p[s][r]=t=[{func:D,scope:E}];t.fakeName=B;t.capture=C;t.nativeHandler=z;if(!g){t.proxyHandler=k(s)}if(r==="ready"){d(x,z,q)}else{c(x,B||r,g?z:t.proxyHandler,C)}}else{t.push({func:D,scope:E})}}x=t=0;return D};q.unbind=function(x,z,A){var s,u,v,B,r,t;if(!x||x.nodeType===3||x.nodeType===8){return q}s=x[h];if(s){t=p[s];if(z){z=z.split(" ");v=z.length;while(v--){r=z[v];u=t[r];if(u){if(A){B=u.length;while(B--){if(u[B].func===A){u.splice(B,1)}}}if(!A||u.length===0){delete t[r];e(x,u.fakeName||r,g?u.nativeHandler:u.proxyHandler,u.capture)}}}}else{for(r in t){u=t[r];e(x,u.fakeName||r,g?u.nativeHandler:u.proxyHandler,u.capture)}t={}}for(r in t){return q}delete p[s];try{delete x[h]}catch(y){x[h]=null}}return q};q.fire=function(u,s,r){var v,t;if(!u||u.nodeType===3||u.nodeType===8){return q}t=a(null,r);t.type=s;do{v=u[h];if(v){j(t,v)}u=u.parentNode||u.ownerDocument||u.defaultView||u.parentWindow}while(u&&!t.isPropagationStopped());return q};q.clean=function(u){var s,r,t=q.unbind;if(!u||u.nodeType===3||u.nodeType===8){return q}if(u[h]){t(u)}if(!u.getElementsByTagName){u=u.document}if(u&&u.getElementsByTagName){t(u);r=u.getElementsByTagName("*");s=r.length;while(s--){u=r[s];if(u[h]){t(u)}}}return q};q.callNativeHandler=function(s,r){if(p){p[s][r.type].nativeHandler(r)}};q.destory=function(){p={}};q.add=function(v,s,u,t){if(typeof(v)==="string"){v=document.getElementById(v)}if(v&&v instanceof Array){var r=v;while(r--){q.add(v[r],s,u,t)}return}if(s==="init"){s="ready"}return q.bind(v,s instanceof Array?s.join(" "):s,u,t)};q.remove=function(u,s,t){if(typeof(u)==="string"){u=document.getElementById(u)}if(u instanceof Array){var r=u;while(r--){q.remove(u[r],s,t,scope)}return q}return q.unbind(u,s instanceof Array?s.join(" "):s,t)};q.clear=function(r){if(typeof(r)==="string"){r=document.getElementById(r)}return q.clean(r)};q.cancel=function(r){if(r){q.prevent(r);q.stop(r)}return false};q.prevent=function(r){r.preventDefault();return false};q.stop=function(r){r.stopPropagation();return false}}b.EventUtils=f;b.Event=new f(function(i){return function(j){tinymce.dom.Event.callNativeHandler(i,j)}});b.Event.bind(window,"ready",function(){});b=0})(tinymce.dom,"data-mce-expando");(function(e){var g=e.each,d=e.is,f=e.isWebKit,b=e.isIE,h=e.html.Entities,c=/^([a-z0-9],?)+$/i,a=/^[ \t\r\n]*$/;e.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,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"},DOMUtils:function(o,l){var k=this,i,j,n;k.doc=o;k.win=window;k.files={};k.cssFlicker=false;k.counter=0;k.stdMode=!e.isIE||o.documentMode>=8;k.boxModel=!e.isIE||o.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in o.createElement("a");k.settings=l=e.extend({keep_values:false,hex_colors:1},l);k.schema=l.schema;k.styles=new e.html.Styles({url_converter:l.url_converter,url_converter_scope:l.url_converter_scope},l.schema);if(e.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}k.fixDoc(o);k.events=l.ownEvents?new e.dom.EventUtils(l.proxy):e.dom.Event;e.addUnload(k.destroy,k);n=l.schema?l.schema.getBlockElements():{};k.isBlock=function(q){var p=q.nodeType;if(p){return !!(p===1&&n[q.nodeName])}return !!n[q]}},fixDoc:function(k){var j=this.settings,i;if(b&&j.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(l){k.createElement(l)});for(i in j.schema.getCustomElements()){k.createElement(i)}}},clone:function(k,i){var j=this,m,l;if(!b||k.nodeType!==1||i){return k.cloneNode(i)}l=j.doc;if(!i){m=l.createElement(k.nodeName);g(j.getAttribs(k),function(n){j.setAttrib(m,n.nodeName,j.getAttrib(k,n.nodeName))});return m}return m.firstChild},getRoot:function(){var i=this,j=i.settings;return(j&&i.get(j.root_element))||i.doc.body},getViewPort:function(j){var k,i;j=!j?this.win:j;k=j.document;i=this.boxModel?k.documentElement:k.body;return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop,w:j.innerWidth||i.clientWidth,h:j.innerHeight||i.clientHeight}},getRect:function(l){var k,i=this,j;l=i.get(l);k=i.getPos(l);j=i.getSize(l);return{x:k.x,y:k.y,w:j.w,h:j.h}},getSize:function(l){var j=this,i,k;l=j.get(l);i=j.getStyle(l,"width");k=j.getStyle(l,"height");if(i.indexOf("px")===-1){i=0}if(k.indexOf("px")===-1){k=0}return{w:parseInt(i)||l.offsetWidth||l.clientWidth,h:parseInt(k)||l.offsetHeight||l.clientHeight}},getParent:function(k,j,i){return this.getParents(k,j,i,false)},getParents:function(s,m,k,q){var j=this,i,l=j.settings,p=[];s=j.get(s);q=q===undefined;if(l.strict_root){k=k||j.getRoot()}if(d(m,"string")){i=m;if(m==="*"){m=function(o){return o.nodeType==1}}else{m=function(o){return j.is(o,i)}}}while(s){if(s==k||!s.nodeType||s.nodeType===9){break}if(!m||m(s)){if(q){p.push(s)}else{return s}}s=s.parentNode}return q?p:null},get:function(i){var j;if(i&&this.doc&&typeof(i)=="string"){j=i;i=this.doc.getElementById(i);if(i&&i.id!==j){return this.doc.getElementsByName(j)[1]}}return i},getNext:function(j,i){return this._findSib(j,i,"nextSibling")},getPrev:function(j,i){return this._findSib(j,i,"previousSibling")},select:function(k,j){var i=this;return e.dom.Sizzle(k,i.get(j)||i.get(i.settings.root_element)||i.doc,[])},is:function(l,j){var k;if(l.length===undefined){if(j==="*"){return l.nodeType==1}if(c.test(j)){j=j.toLowerCase().split(/,/);l=l.nodeName.toLowerCase();for(k=j.length-1;k>=0;k--){if(j[k]==l){return true}}return false}}return e.dom.Sizzle.matches(j,l.nodeType?[l]:l).length>0},add:function(l,o,i,k,m){var j=this;return this.run(l,function(r){var q,n;q=d(o,"string")?j.doc.createElement(o):o;j.setAttribs(q,i);if(k){if(k.nodeType){q.appendChild(k)}else{j.setHTML(q,k)}}return !m?r.appendChild(q):q})},create:function(k,i,j){return this.add(this.doc.createElement(k),k,i,j,1)},createHTML:function(q,i,m){var p="",l=this,j;p+="<"+q;for(j in i){if(i.hasOwnProperty(j)){p+=" "+j+'="'+l.encode(i[j])+'"'}}if(typeof(m)!="undefined"){return p+">"+m+"</"+q+">"}return p+" />"},remove:function(i,j){return this.run(i,function(l){var m,k=l.parentNode;if(!k){return null}if(j){while(m=l.firstChild){if(!e.isIE||m.nodeType!==3||m.nodeValue){k.insertBefore(m,l)}else{l.removeChild(m)}}}return k.removeChild(l)})},setStyle:function(l,i,j){var k=this;return k.run(l,function(o){var n,m;n=o.style;i=i.replace(/-(\D)/g,function(q,p){return p.toUpperCase()});if(k.pixelStyles.test(i)&&(e.is(j,"number")||/^[\-0-9\.]+$/.test(j))){j+="px"}switch(i){case"opacity":if(b){n.filter=j===""?"":"alpha(opacity="+(j*100)+")";if(!l.currentStyle||!l.currentStyle.hasLayout){n.display="inline-block"}}n[i]=n["-moz-opacity"]=n["-khtml-opacity"]=j||"";break;case"float":b?n.styleFloat=j:n.cssFloat=j;break;default:n[i]=j||""}if(k.settings.update_styles){k.setAttrib(o,"data-mce-style")}})},getStyle:function(l,i,k){l=this.get(l);if(!l){return}if(this.doc.defaultView&&k){i=i.replace(/[A-Z]/g,function(m){return"-"+m});try{return this.doc.defaultView.getComputedStyle(l,null).getPropertyValue(i)}catch(j){return null}}i=i.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(i=="float"){i=b?"styleFloat":"cssFloat"}if(l.currentStyle&&k){return l.currentStyle[i]}return l.style?l.style[i]:undefined},setStyles:function(l,m){var j=this,k=j.settings,i;i=k.update_styles;k.update_styles=0;g(m,function(o,p){j.setStyle(l,p,o)});k.update_styles=i;if(k.update_styles){j.setAttrib(l,k.cssText)}},removeAllAttribs:function(i){return this.run(i,function(l){var k,j=l.attributes;for(k=j.length-1;k>=0;k--){l.removeAttributeNode(j.item(k))}})},setAttrib:function(k,l,i){var j=this;if(!k||!l){return}if(j.settings.strict){l=l.toLowerCase()}return this.run(k,function(p){var o=j.settings;var m=p.getAttribute(l);if(i!==null){switch(l){case"style":if(!d(i,"string")){g(i,function(q,r){j.setStyle(p,r,q)});return}if(o.keep_values){if(i&&!j._isRes(i)){p.setAttribute("data-mce-style",i,2)}else{p.removeAttribute("data-mce-style",2)}}p.style.cssText=i;break;case"class":p.className=i||"";break;case"src":case"href":if(o.keep_values){if(o.url_converter){i=o.url_converter.call(o.url_converter_scope||j,i,l,p)}j.setAttrib(p,"data-mce-"+l,i,2)}break;case"shape":p.setAttribute("data-mce-style",i);break}}if(d(i)&&i!==null&&i.length!==0){p.setAttribute(l,""+i,2)}else{p.removeAttribute(l,2)}if(tinyMCE.activeEditor&&m!=i){var n=tinyMCE.activeEditor;n.onSetAttrib.dispatch(n,p,l,i)}})},setAttribs:function(j,k){var i=this;return this.run(j,function(l){g(k,function(m,o){i.setAttrib(l,o,m)})})},getAttrib:function(m,o,k){var i,j=this,l;m=j.get(m);if(!m||m.nodeType!==1){return k===l?false:k}if(!d(k)){k=""}if(/^(src|href|style|coords|shape)$/.test(o)){i=m.getAttribute("data-mce-"+o);if(i){return i}}if(b&&j.props[o]){i=m[j.props[o]];i=i&&i.nodeValue?i.nodeValue:i}if(!i){i=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[j.props[o]]===true&&i===""){return o}return i?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){i=i||m.style.cssText;if(i){i=j.serializeStyle(j.parseStyle(i),m.nodeName);if(j.settings.keep_values&&!j._isRes(i)){m.setAttribute("data-mce-style",i)}}}if(f&&o==="class"&&i){i=i.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(o){case"rowspan":case"colspan":if(i===1){i=""}break;case"size":if(i==="+0"||i===20||i===0){i=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(i===0){i=""}break;case"hspace":if(i===-1){i=""}break;case"maxlength":case"tabindex":if(i===32768||i===2147483647||i==="32768"){i=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(i===65535){return o}return k;case"shape":i=i.toLowerCase();break;default:if(o.indexOf("on")===0&&i){i=e._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+i)}}}return(i!==l&&i!==null&&i!=="")?""+i:k},getPos:function(q,l){var j=this,i=0,p=0,m,o=j.doc,k;q=j.get(q);l=l||o.body;if(q){if(q.getBoundingClientRect){q=q.getBoundingClientRect();m=j.boxModel?o.documentElement:o.body;i=q.left+(o.documentElement.scrollLeft||o.body.scrollLeft)-m.clientTop;p=q.top+(o.documentElement.scrollTop||o.body.scrollTop)-m.clientLeft;return{x:i,y:p}}k=q;while(k&&k!=l&&k.nodeType){i+=k.offsetLeft||0;p+=k.offsetTop||0;k=k.offsetParent}k=q.parentNode;while(k&&k!=l&&k.nodeType){i-=k.scrollLeft||0;p-=k.scrollTop||0;k=k.parentNode}}return{x:i,y:p}},parseStyle:function(i){return this.styles.parse(i)},serializeStyle:function(j,i){return this.styles.serialize(j,i)},loadCSS:function(i){var k=this,l=k.doc,j;if(!i){i=""}j=k.select("head")[0];g(i.split(","),function(m){var n;if(k.files[m]){return}k.files[m]=true;n=k.create("link",{rel:"stylesheet",href:e._addVer(m)});if(b&&l.documentMode&&l.recalc){n.onload=function(){if(l.recalc){l.recalc()}n.onload=null}}j.appendChild(n)})},addClass:function(i,j){return this.run(i,function(k){var l;if(!j){return 0}if(this.hasClass(k,j)){return k.className}l=this.removeClass(k,j);return k.className=(l!=""?(l+" "):"")+j})},removeClass:function(k,l){var i=this,j;return i.run(k,function(n){var m;if(i.hasClass(n,l)){if(!j){j=new RegExp("(^|\\s+)"+l+"(\\s+|$)","g")}m=n.className.replace(j," ");m=e.trim(m!=" "?m:"");n.className=m;if(!m){n.removeAttribute("class");n.removeAttribute("className")}return m}return n.className})},hasClass:function(j,i){j=this.get(j);if(!j||!i){return false}return(" "+j.className+" ").indexOf(" "+i+" ")!==-1},show:function(i){return this.setStyle(i,"display","block")},hide:function(i){return this.setStyle(i,"display","none")},isHidden:function(i){i=this.get(i);return !i||i.style.display=="none"||this.getStyle(i,"display")=="none"},uniqueId:function(i){return(!i?"mce_":i)+(this.counter++)},setHTML:function(k,j){var i=this;return i.run(k,function(m){if(b){while(m.firstChild){m.removeChild(m.firstChild)}try{m.innerHTML="<br />"+j;m.removeChild(m.firstChild)}catch(l){m=i.create("div");m.innerHTML="<br />"+j;g(m.childNodes,function(o,n){if(n){m.appendChild(o)}})}}else{m.innerHTML=j}return j})},getOuterHTML:function(k){var j,i=this;k=i.get(k);if(!k){return null}if(k.nodeType===1&&i.hasOuterHTML){return k.outerHTML}j=(k.ownerDocument||i.doc).createElement("body");j.appendChild(k.cloneNode(true));return j.innerHTML},setOuterHTML:function(l,j,m){var i=this;function k(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){i.insertAfter(s.cloneNode(true),p);s=s.previousSibling}i.remove(p)}return this.run(l,function(o){o=i.get(o);if(o.nodeType==1){m=m||o.ownerDocument||i.doc;if(b){try{if(b&&o.nodeType==1){o.outerHTML=j}else{k(o,j,m)}}catch(n){k(o,j,m)}}else{k(o,j,m)}}})},decode:h.decode,encode:h.encodeAllRaw,insertAfter:function(i,j){j=this.get(j);return this.run(i,function(l){var k,m;k=j.parentNode;m=j.nextSibling;if(m){k.insertBefore(l,m)}else{k.appendChild(l)}return l})},replace:function(m,l,i){var j=this;if(d(l,"array")){m=m.cloneNode(true)}return j.run(l,function(k){if(i){g(e.grep(k.childNodes),function(n){m.appendChild(n)})}return k.parentNode.replaceChild(m,k)})},rename:function(l,i){var k=this,j;if(l.nodeName!=i.toUpperCase()){j=k.create(i);g(k.getAttribs(l),function(m){k.setAttrib(j,m.nodeName,k.getAttrib(l,m.nodeName))});k.replace(j,l,1)}return j||l},findCommonAncestor:function(k,i){var l=k,j;while(l){j=i;while(j&&l!=j){j=j.parentNode}if(l==j){break}l=l.parentNode}if(!l&&k.ownerDocument){return k.ownerDocument.documentElement}return l},toHex:function(i){var k=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i);function j(l){l=parseInt(l).toString(16);return l.length>1?l:"0"+l}if(k){i="#"+j(k[1])+j(k[2])+j(k[3]);return i}return i},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(i){g(i.imports,function(s){q(s)});g(i.cssRules||i.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){g(s.selectorText.split(","),function(r){r=r.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(r)||!/\.[\w\-]+$/.test(r)){return}l=r;r=e._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",r);if(p&&!(r=p(r,l))){return}if(!o[r]){j.push({"class":r});o[r]=1}})}break;case 3:q(s.styleSheet);break}})}try{g(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(l,k,j){var i=this,m;if(i.doc&&typeof(l)==="string"){l=i.get(l)}if(!l){return false}j=j||this;if(!l.nodeType&&(l.length||l.length===0)){m=[];g(l,function(o,n){if(o){if(typeof(o)=="string"){o=i.doc.getElementById(o)}m.push(k.call(j,o,n))}});return m}return k.call(j,l)},getAttribs:function(j){var i;j=this.get(j);if(!j){return[]}if(b){i=[];if(j.nodeName=="OBJECT"){return j.attributes}if(j.nodeName==="OPTION"&&this.getAttrib(j,"selected")){i.push({specified:1,nodeName:"selected"})}j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(k){i.push({specified:1,nodeName:k})});return i}return j.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p=0;m=m.firstChild;if(m){j=new e.dom.TreeWalker(m,m.parentNode);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){if(l==="br"){p++;continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if(q==8){return false}if((q===3&&!a.test(m.nodeValue))){return false}}while(m=j.next())}return p<=1},destroy:function(j){var i=this;i.win=i.doc=i.root=i.events=i.frag=null;if(!j){e.removeUnload(i.destroy)}},createRng:function(){var i=this.doc;return i.createRange?i.createRange():new e.dom.Range(this)},nodeIndex:function(m,n){var i=0,k,l,j;if(m){for(k=m.nodeType,m=m.previousSibling,l=m;m;m=m.previousSibling){j=m.nodeType;if(n&&j==3){if(j==k||!m.nodeValue.length){continue}}i++;k=j}}return i},split:function(m,l,p){var q=this,i=q.createRng(),n,k,o;function j(v){var t,s=v.childNodes,u=v.nodeType;function x(A){var z=A.previousSibling&&A.previousSibling.nodeName=="SPAN";var y=A.nextSibling&&A.nextSibling.nodeName=="SPAN";return z&&y}if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=s.length-1;t>=0;t--){j(s[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){var r=e.trim(v.nodeValue).length;if(!q.isBlock(v.parentNode)||r>0||r==0&&x(v)){return}}else{if(u==1){s=v.childNodes;if(s.length==1&&s[0]&&s[0].nodeType==1&&s[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(s[0],v)}if(s.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}q.remove(v)}return v}if(m&&l){i.setStart(m.parentNode,q.nodeIndex(m));i.setEnd(l.parentNode,q.nodeIndex(l));n=i.extractContents();i=q.createRng();i.setStart(l.parentNode,q.nodeIndex(l)+1);i.setEnd(m.parentNode,q.nodeIndex(m)+1);k=i.extractContents();o=m.parentNode;o.insertBefore(j(n),m);if(p){o.replaceChild(p,l)}else{o.insertBefore(l,m)}o.insertBefore(j(k),m);q.remove(m);return p||l}},bind:function(l,i,k,j){return this.events.add(l,i,k,j||this)},unbind:function(k,i,j){return this.events.remove(k,i,j)},fire:function(k,j,i){return this.events.fire(k,j,i)},_findSib:function(l,i,j){var k=this,m=i;if(l){if(d(m,"string")){m=function(n){return k.is(n,i)}}for(l=l[j];l;l=l[j]){if(m(l)){return l}}}return null},_isRes:function(i){return/^(top|left|bottom|right|width|height)/i.test(i)||/;\s*(top|left|bottom|right|width|height)/i.test(i)}});e.DOM=new e.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var O=this,e=c.doc,T=0,F=1,j=2,E=true,S=false,V="startOffset",h="startContainer",Q="endContainer",A="endOffset",k=tinymce.extend,n=c.nodeIndex;k(O,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:E,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:J,setEndBefore:K,setEndAfter:u,collapse:B,selectNode:y,selectNodeContents:G,compareBoundaryPoints:v,deleteContents:p,extractContents:I,cloneContents:d,insertNode:D,surroundContents:N,cloneRange:L});function x(){return e.createDocumentFragment()}function q(W,t){C(E,W,t)}function s(W,t){C(S,W,t)}function g(t){q(t.parentNode,n(t))}function J(t){q(t.parentNode,n(t)+1)}function K(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function B(t){if(t){O[Q]=O[h];O[A]=O[V]}else{O[h]=O[Q];O[V]=O[A]}O.collapsed=E}function y(t){g(t);u(t)}function G(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(Z,t){var ac=O[h],X=O[V],ab=O[Q],W=O[A],aa=t.startContainer,ae=t.startOffset,Y=t.endContainer,ad=t.endOffset;if(Z===0){return H(ac,X,aa,ae)}if(Z===1){return H(ab,W,aa,ae)}if(Z===2){return H(ab,W,Y,ad)}if(Z===3){return H(ac,X,Y,ad)}}function p(){l(j)}function I(){return l(T)}function d(){return l(F)}function D(Z){var W=this[h],t=this[V],Y,X;if((W.nodeType===3||W.nodeType===4)&&W.nodeValue){if(!t){W.parentNode.insertBefore(Z,W)}else{if(t>=W.nodeValue.length){c.insertAfter(Z,W)}else{Y=W.splitText(t);W.parentNode.insertBefore(Z,Y)}}}else{if(W.childNodes.length>0){X=W.childNodes[t]}if(X){W.insertBefore(Z,X)}else{W.appendChild(Z)}}}function N(W){var t=O.extractContents();O.insertNode(W);W.appendChild(t);O.selectNode(W)}function L(){return k(new b(c),{startContainer:O[h],startOffset:O[V],endContainer:O[Q],endOffset:O[A],collapsed:O.collapsed,commonAncestorContainer:O.commonAncestorContainer})}function P(t,W){var X;if(t.nodeType==3){return t}if(W<0){return t}X=t.firstChild;while(X&&W>0){--W;X=X.nextSibling}if(X){return X}return t}function m(){return(O[h]==O[Q]&&O[V]==O[A])}function H(Y,aa,W,Z){var ab,X,t,ac,ae,ad;if(Y==W){if(aa==Z){return 0}if(aa<Z){return -1}return 1}ab=W;while(ab&&ab.parentNode!=Y){ab=ab.parentNode}if(ab){X=0;t=Y.firstChild;while(t!=ab&&X<aa){X++;t=t.nextSibling}if(aa<=X){return -1}return 1}ab=Y;while(ab&&ab.parentNode!=W){ab=ab.parentNode}if(ab){X=0;t=W.firstChild;while(t!=ab&&X<Z){X++;t=t.nextSibling}if(X<Z){return -1}return 1}ac=c.findCommonAncestor(Y,W);ae=Y;while(ae&&ae.parentNode!=ac){ae=ae.parentNode}if(!ae){ae=ac}ad=W;while(ad&&ad.parentNode!=ac){ad=ad.parentNode}if(!ad){ad=ac}if(ae==ad){return 0}t=ac.firstChild;while(t){if(t==ae){return -1}if(t==ad){return 1}t=t.nextSibling}}function C(W,Z,Y){var t,X;if(W){O[h]=Z;O[V]=Y}else{O[Q]=Z;O[A]=Y}t=O[Q];while(t.parentNode){t=t.parentNode}X=O[h];while(X.parentNode){X=X.parentNode}if(X==t){if(H(O[h],O[V],O[Q],O[A])>0){O.collapse(W)}}else{O.collapse(W)}O.collapsed=m();O.commonAncestorContainer=c.findCommonAncestor(O[h],O[Q])}function l(ac){var ab,Y=0,ae=0,W,aa,X,Z,t,ad;if(O[h]==O[Q]){return f(ac)}for(ab=O[Q],W=ab.parentNode;W;ab=W,W=W.parentNode){if(W==O[h]){return r(ab,ac)}++Y}for(ab=O[h],W=ab.parentNode;W;ab=W,W=W.parentNode){if(W==O[Q]){return U(ab,ac)}++ae}aa=ae-Y;X=O[h];while(aa>0){X=X.parentNode;aa--}Z=O[Q];while(aa<0){Z=Z.parentNode;aa++}for(t=X.parentNode,ad=Z.parentNode;t!=ad;t=t.parentNode,ad=ad.parentNode){X=t;Z=ad}return o(X,Z,ac)}function f(ab){var ad,ae,t,X,Y,ac,Z,W,aa;if(ab!=j){ad=x()}if(O[V]==O[A]){return ad}if(O[h].nodeType==3){ae=O[h].nodeValue;t=ae.substring(O[V],O[A]);if(ab!=F){X=O[h];W=O[V];aa=O[A]-O[V];if(W===0&&aa>=X.nodeValue.length-1){X.parentNode.removeChild(X)}else{X.deleteData(W,aa)}O.collapse(E)}if(ab==j){return}if(t.length>0){ad.appendChild(e.createTextNode(t))}return ad}X=P(O[h],O[V]);Y=O[A]-O[V];while(X&&Y>0){ac=X.nextSibling;Z=z(X,ab);if(ad){ad.appendChild(Z)}--Y;X=ac}if(ab!=F){O.collapse(E)}return ad}function r(ac,Z){var ab,aa,W,t,Y,X;if(Z!=j){ab=x()}aa=i(ac,Z);if(ab){ab.appendChild(aa)}W=n(ac);t=W-O[V];if(t<=0){if(Z!=F){O.setEndBefore(ac);O.collapse(S)}return ab}aa=ac.previousSibling;while(t>0){Y=aa.previousSibling;X=z(aa,Z);if(ab){ab.insertBefore(X,ab.firstChild)}--t;aa=Y}if(Z!=F){O.setEndBefore(ac);O.collapse(S)}return ab}function U(aa,Z){var ac,W,ab,t,Y,X;if(Z!=j){ac=x()}ab=R(aa,Z);if(ac){ac.appendChild(ab)}W=n(aa);++W;t=O[A]-W;ab=aa.nextSibling;while(ab&&t>0){Y=ab.nextSibling;X=z(ab,Z);if(ac){ac.appendChild(X)}--t;ab=Y}if(Z!=F){O.setStartAfter(aa);O.collapse(E)}return ac}function o(aa,t,ad){var X,af,Z,ab,ac,W,ae,Y;if(ad!=j){af=x()}X=R(aa,ad);if(af){af.appendChild(X)}Z=aa.parentNode;ab=n(aa);ac=n(t);++ab;W=ac-ab;ae=aa.nextSibling;while(W>0){Y=ae.nextSibling;X=z(ae,ad);if(af){af.appendChild(X)}ae=Y;--W}X=i(t,ad);if(af){af.appendChild(X)}if(ad!=F){O.setStartAfter(aa);O.collapse(E)}return af}function i(ab,ac){var X=P(O[Q],O[A]-1),ad,aa,Z,t,W,Y=X!=O[Q];if(X==ab){return M(X,Y,S,ac)}ad=X.parentNode;aa=M(ad,S,S,ac);while(ad){while(X){Z=X.previousSibling;t=M(X,Y,S,ac);if(ac!=j){aa.insertBefore(t,aa.firstChild)}Y=E;X=Z}if(ad==ab){return aa}X=ad.previousSibling;ad=ad.parentNode;W=M(ad,S,S,ac);if(ac!=j){W.appendChild(aa)}aa=W}}function R(ab,ac){var Y=P(O[h],O[V]),Z=Y!=O[h],ad,aa,X,t,W;if(Y==ab){return M(Y,Z,E,ac)}ad=Y.parentNode;aa=M(ad,S,E,ac);while(ad){while(Y){X=Y.nextSibling;t=M(Y,Z,E,ac);if(ac!=j){aa.appendChild(t)}Z=E;Y=X}if(ad==ab){return aa}Y=ad.nextSibling;ad=ad.parentNode;W=M(ad,S,E,ac);if(ac!=j){W.appendChild(aa)}aa=W}}function M(t,Z,ac,ad){var Y,X,aa,W,ab;if(Z){return z(t,ad)}if(t.nodeType==3){Y=t.nodeValue;if(ac){W=O[V];X=Y.substring(W);aa=Y.substring(0,W)}else{W=O[A];X=Y.substring(0,W);aa=Y.substring(W)}if(ad!=F){t.nodeValue=aa}if(ad==j){return}ab=c.clone(t,S);ab.nodeValue=X;return ab}if(ad==j){return}return c.clone(t,S)}function z(W,t){if(t!=j){return t==F?c.clone(W,E):W}W.parentNode.removeChild(W)}}a.Range=b})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",1)==0||s!=k.parentElement()){break}o++}}else{k.collapse(true);o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",-1)==0||s!=k.parentElement()){break}o++}}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var u,t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,s,q,r=d.dom.doc,m=r.body;function j(z){var u,y,t,x,v;t=h.create("a");u=z?k:s;y=z?p:q;x=n.duplicate();if(u==r||u==r.documentElement){u=m;y=0}if(u.nodeType==3){u.parentNode.insertBefore(t,u);x.moveToElementText(t);x.moveStart("character",y);h.remove(t);n.setEndPoint(z?"StartToStart":"EndToEnd",x)}else{v=u.childNodes;if(v.length){if(y>=v.length){h.insertAfter(t,v[v.length-1])}else{u.insertBefore(t,v[y])}x.moveToElementText(t)}else{if(u.canHaveHTML){u.innerHTML="<span>\uFEFF</span>";t=u.firstChild;x.moveToElementText(t);x.collapse(f)}}n.setEndPoint(z?"StartToStart":"EndToEnd",x);h.remove(t)}}k=i.startContainer;p=i.startOffset;s=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==s&&k.nodeType==1){if(!k.hasChildNodes()){k.innerHTML="<span>\uFEFF</span><span>\uFEFF</span>";n.moveToElementText(k.lastChild);n.select();h.doc.selection.clear();k.innerHTML="";return}if(p==q-1){try{l=m.createControlRange();l.addElement(k.childNodes[p]);l.select();return}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,j=0,d=Object.prototype.toString,o=false,i=true;[0,0].sort(function(){i=false;return 0});var b=function(v,e,z,A){z=z||[];e=e||document;var C=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!v||typeof v!=="string"){return z}var x=[],s,E,H,r,u=true,t=b.isXML(e),B=v,D,G,F,y;do{p.exec("");s=p.exec(B);if(s){B=s[3];x.push(s[1]);if(s[2]){r=s[3];break}}}while(s);if(x.length>1&&k.exec(v)){if(x.length===2&&f.relative[x[0]]){E=h(x[0]+x[1],e)}else{E=f.relative[x[0]]?[e]:b(x.shift(),e);while(x.length){v=x.shift();if(f.relative[v]){v+=x.shift()}E=h(v,E)}}}else{if(!A&&x.length>1&&e.nodeType===9&&!t&&f.match.ID.test(x[0])&&!f.match.ID.test(x[x.length-1])){D=b.find(x.shift(),e,t);e=D.expr?b.filter(D.expr,D.set)[0]:D.set[0]}if(e){D=A?{expr:x.pop(),set:a(A)}:b.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&e.parentNode?e.parentNode:e,t);E=D.expr?b.filter(D.expr,D.set):D.set;if(x.length>0){H=a(E)}else{u=false}while(x.length){G=x.pop();F=G;if(!f.relative[G]){G=""}else{F=x.pop()}if(F==null){F=e}f.relative[G](H,F,t)}}else{H=x=[]}}if(!H){H=E}if(!H){b.error(G||v)}if(d.call(H)==="[object Array]"){if(!u){z.push.apply(z,H)}else{if(e&&e.nodeType===1){for(y=0;H[y]!=null;y++){if(H[y]&&(H[y]===true||H[y].nodeType===1&&b.contains(e,H[y]))){z.push(E[y])}}}else{for(y=0;H[y]!=null;y++){if(H[y]&&H[y].nodeType===1){z.push(E[y])}}}}}else{a(H,z)}if(r){b(r,C,z,A);b.uniqueSort(z)}return z};b.uniqueSort=function(r){if(c){o=i;r.sort(c);if(o){for(var e=1;e<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}return r};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(y,e,z){var x;if(!y){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.leftMatch[v].exec(y))){var r=u[1];u.splice(1,1);if(r.substr(r.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");x=f.find[v](u,e,z);if(x!=null){y=y.replace(f.match[v],"");break}}}}if(!x){x=e.getElementsByTagName("*")}return{set:x,expr:y}};b.filter=function(C,B,F,u){var s=C,H=[],z=B,x,e,y=B&&B[0]&&b.isXML(B[0]);while(C&&B.length){for(var A in f.filter){if((x=f.leftMatch[A].exec(C))!=null&&x[2]){var r=f.filter[A],G,E,t=x[1];e=false;x.splice(1,1);if(t.substr(t.length-1)==="\\"){continue}if(z===H){H=[]}if(f.preFilter[A]){x=f.preFilter[A](x,z,F,H,u,y);if(!x){e=G=true}else{if(x===true){continue}}}if(x){for(var v=0;(E=z[v])!=null;v++){if(E){G=r(E,x,v,z);var D=u^!!G;if(F&&G!=null){if(D){e=true}else{z[v]=false}}else{if(D){H.push(E);e=true}}}}}if(G!==undefined){if(!F){z=H}C=C.replace(f.match[A],"");if(!e){return[]}break}}}if(C===s){if(e==null){b.error(C)}else{break}}s=C}return z};b.error=function(e){throw"Syntax error, unrecognized expression: "+e};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(x,r){var t=typeof r==="string",v=t&&!/\W/.test(r),y=t&&!v;if(v){r=r.toLowerCase()}for(var s=0,e=x.length,u;s<e;s++){if((u=x[s])){while((u=u.previousSibling)&&u.nodeType!==1){}x[s]=y||u&&u.nodeName.toLowerCase()===r?u||false:u===r}}if(y){b.filter(r,x,true)}},">":function(x,r){var u=typeof r==="string",v,s=0,e=x.length;if(u&&!/\W/.test(r)){r=r.toLowerCase();for(;s<e;s++){v=x[s];if(v){var t=v.parentNode;x[s]=t.nodeName.toLowerCase()===r?t:false}}}else{for(;s<e;s++){v=x[s];if(v){x[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,x,true)}}},"":function(t,r,v){var s=j++,e=q,u;if(typeof r==="string"&&!/\W/.test(r)){r=r.toLowerCase();u=r;e=n}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=j++,e=q,u;if(typeof r==="string"&&!/\W/.test(r)){r=r.toLowerCase();u=r;e=n}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,x,y){t=" "+t[1].replace(/\\/g,"")+" ";if(y){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(x^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(t)>=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){return r[1].toLowerCase()},CHILD:function(e){if(e[1]==="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=j++;return e},ATTR:function(u,r,s,e,v,x){var t=u[1].replace(/\\/g,"");if(!x&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if((p.exec(u[3])||"").length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toLowerCase()==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return r<e[3]-0},gt:function(s,r,e){return r>e[3]-0},nth:function(s,r,e){return e[3]-0===r},eq:function(s,r,e){return e[3]-0===r}},filter:{PSEUDO:function(s,y,x,z){var e=y[1],r=f.filters[e];if(r){return r(s,x,y,z)}else{if(e==="contains"){return(s.textContent||s.innerText||b.getText([s])||"").indexOf(y[3])>=0}else{if(e==="not"){var t=y[3];for(var v=0,u=t.length;v<u;v++){if(t[v]===s){return false}}return true}else{b.error("Syntax error, unrecognized expression: "+e)}}}},CHILD:function(e,t){var x=t[1],r=e;switch(x){case"only":case"first":while((r=r.previousSibling)){if(r.nodeType===1){return false}}if(x==="first"){return true}r=e;case"last":while((r=r.nextSibling)){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],A=t[3];if(s===1&&A===0){return true}var v=t[0],z=e.parentNode;if(z&&(z.sizcache!==v||!e.nodeIndex)){var u=0;for(r=z.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}z.sizcache=v}var y=e.nodeIndex-A;if(s===0){return y===0}else{return(y%s===0&&y/s>=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName.toLowerCase()===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),x=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?x===r:u==="*="?x.indexOf(r)>=0:u==="~="?(" "+x+" ").indexOf(r)>=0:!r?x&&e!==false:u==="!="?x!==r:u==="^="?x.indexOf(r)===0:u==="$="?x.substr(x.length-r.length)===r:u==="|="?x===r||x.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var k=f.match.POS,g=function(r,e){return"\\"+(e-0+1)};for(var m in f.match){f.match[m]=new RegExp(f.match[m].source+(/(?![^\[]*\])(?![^\(]*\))/.source));f.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+f.match[m].source.replace(/\\(\d+)/g,g))}var a=function(r,e){r=Array.prototype.slice.call(r,0);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(l){a=function(u,t){var r=t||[],s=0;if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var e=u.length;s<e;s++){r.push(u[s])}}else{for(;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){if(!r.compareDocumentPosition||!e.compareDocumentPosition){if(r==e){o=true}return r.compareDocumentPosition?-1:1}var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){o=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){if(!r.sourceIndex||!e.sourceIndex){if(r==e){o=true}return r.sourceIndex?-1:1}var s=r.sourceIndex-e.sourceIndex;if(s===0){o=true}return s}}else{if(document.createRange){c=function(t,r){if(!t.ownerDocument||!r.ownerDocument){if(t==r){o=true}return t.ownerDocument?-1:1}var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.setStart(t,0);s.setEnd(t,0);e.setStart(r,0);e.setEnd(r,0);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){o=true}return u}}}}b.getText=function(e){var r="",t;for(var s=0;e[s];s++){t=e[s];if(t.nodeType===3||t.nodeType===4){r+=t.nodeValue}else{if(t.nodeType!==8){r+=b.getText(t.childNodes)}}}return r};(function(){var r=document.createElement("div"),s="script"+(new Date()).getTime();r.innerHTML="<a name='"+s+"'/>";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(document.getElementById(s)){f.find.ID=function(u,v,x){if(typeof v.getElementById!=="undefined"&&!x){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r);e=r=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(x,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!b.isXML(v)){try{return a(v.querySelectorAll(x),t)}catch(y){}}return e(x,v,t,u)};for(var r in e){b[r]=e[r]}s=null})()}(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}};e=null})();function n(r,x,v,A,y,z){for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1&&!z){e.sizcache=v;e.sizset=t}if(e.nodeName.toLowerCase()===x){u=e;break}e=e[r]}A[t]=u}}}function q(r,x,v,A,y,z){for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1){if(!z){e.sizcache=v;e.sizset=t}if(typeof x!=="string"){if(e===x){u=true;break}}else{if(b.filter(x,[e]).length>0){u=e;break}}}e=e[r]}A[t]=u}}}b.contains=document.compareDocumentPosition?function(r,e){return !!(r.compareDocumentPosition(e)&16)}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};b.isXML=function(e){var r=(e?e.ownerDocument||e:0).documentElement;return r?r.nodeName!=="HTML":false};var h=function(e,y){var t=[],u="",v,s=y.nodeType?[y]:y;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var x=0,r=s.length;x<r;x++){b(e,s[x],t)}return b.filter(u,t)};window.tinymce.dom.Sizzle=b})();(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j<arguments.length;j++){h.push(arguments[j])}h=e[g].apply(e,h);b.update(g);return h}});a.extend(b,{on:function(i,h,g){return a.dom.Event.add(b.id,i,h,g)},getXY:function(){return{x:parseInt(b.getStyle("left")),y:parseInt(b.getStyle("top"))}},getSize:function(){var g=e.get(b.id);return{w:parseInt(b.getStyle("width")||g.clientWidth),h:parseInt(b.getStyle("height")||g.clientHeight)}},moveTo:function(g,h){b.setStyles({left:g,top:h})},moveBy:function(g,i){var h=b.getXY();b.moveTo(h.x+g,h.y+i)},resizeTo:function(g,i){b.setStyles({width:g,height:i})},resizeBy:function(g,j){var i=b.getSize();b.resizeTo(i.w+g,i.h+j)},update:function(h){var g;if(a.isIE6&&d.blocker){h=h||"";if(h.indexOf("get")===0||h.indexOf("has")===0||h.indexOf("is")===0){return}if(h=="remove"){e.remove(b.blocker);return}if(!b.blocker){b.blocker=e.uniqueId();g=e.add(d.container||e.getRoot(),"iframe",{id:b.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});e.setStyle(g,"opacity",0)}else{g=e.get(b.blocker)}e.setStyles(g,{left:b.getStyle("left",1),top:b.getStyle("top",1),width:b.getStyle("width",1),height:b.getStyle("height",1),display:b.getStyle("display",1),zIndex:parseInt(b.getStyle("zIndex",1)||0)-1})}}})}})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}if(c.isIE&&i.boxModel){this._fixIESelection()}c.addUnload(f.destroy,f)},setCursorLocation:function(h,i){var f=this;var g=f.dom.createRng();g.setStart(h,i);g.setEnd(h,i);f.setRng(g);f.collapse(false)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";g.forced_root_block="";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML="<br>"+(h.item?h.item(0).outerHTML:h.htmlText);l.removeChild(l.firstChild)}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(g,i){var n=this,f=n.getRng(),j,k=n.win.document,m,l;i=i||{format:"html"};i.set=true;g=i.content=g;if(!i.no_events){n.onBeforeSetContent.dispatch(n,i)}g=i.content;if(f.insertNode){g+='<span id="__caret">_</span>';if(f.startContainer==k&&f.endContainer==k){k.body.innerHTML=g}else{f.deleteContents();if(k.body.childNodes.length==0){k.body.innerHTML=g}else{if(f.createContextualFragment){f.insertNode(f.createContextualFragment(g))}else{m=k.createDocumentFragment();l=k.createElement("div");m.appendChild(l);l.outerHTML=g;f.insertNode(m)}}}j=n.dom.get("__caret");f=k.createRange();f.setStartBefore(j);f.setEndBefore(j);n.setRng(f);n.dom.remove("__caret");try{n.setRng(f)}catch(h){}}else{if(f.item){k.execCommand("Delete",false,null);f=n.getRng()}if(/^\s+/.test(g)){f.pasteHTML('<span id="__mce_tmp">_</span>'+g);n.dom.remove("__mce_tmp")}else{f.pasteHTML(g)}}if(!i.no_events){n.onSetContent.dispatch(n,i)}},getStart:function(){var g=this.getRng(),h,f,j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}j=g.duplicate();j.collapse(1);h=j.parentElement();f=i=g.parentElement();while(i=i.parentNode){if(i==h){h=f;break}}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(h.duplicate||h.item){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(r,s){var v=this,m=v.dom,g,j,i,n,h,o,p,l="\uFEFF",u;function f(x,y){var t=0;d(m.select(x),function(A,z){if(A==y){t=z}});return t}if(r==2){function k(){var x=v.getRng(true),t=m.getRoot(),y={};function z(C,H){var B=C[H?"startContainer":"endContainer"],G=C[H?"startOffset":"endOffset"],A=[],D,F,E=0;if(B.nodeType==3){if(s){for(D=B.previousSibling;D&&D.nodeType==3;D=D.previousSibling){G+=D.nodeValue.length}}A.push(G)}else{F=B.childNodes;if(G>=F.length&&F.length){E=1;G=Math.max(0,F.length-1)}A.push(v.dom.nodeIndex(F[G],s)+E)}for(;B&&B!=t;B=B.parentNode){A.push(v.dom.nodeIndex(B,s))}return A}y.start=z(x,true);if(!v.isCollapsed()){y.end=z(x)}return y}if(v.tridentSel){return v.tridentSel.getBookmark(r)}return k()}if(r){return{rng:v.getRng()}}g=v.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();u="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();try{g.collapse();g.pasteHTML('<span data-mce-type="bookmark" id="'+i+'_start" style="'+u+'">'+l+"</span>");if(!n){j.collapse(false);g.moveToElementText(j.parentElement());if(g.compareEndPoints("StartToEnd",j)==0){j.move("character",-1)}j.pasteHTML('<span data-mce-type="bookmark" id="'+i+'_end" style="'+u+'">'+l+"</span>")}}catch(q){return null}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=v.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}if(g.startContainer.nodeType==9){return}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{"data-mce-type":"bookmark",id:i+"_end",style:u},l))}g.collapse(true);g.insertNode(m.create("span",{"data-mce-type":"bookmark",id:i+"_start",style:u},l))}v.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(n){var r=this,l=r.dom,i,h,f,q,j,s,o,p;if(n){if(n.start){f=l.createRng();q=l.getRoot();function g(z){var t=n[z?"start":"end"],v,x,y,u;if(t){y=t[0];for(x=q,v=t.length-1;v>=1;v--){u=x.childNodes;if(t[v]>u.length-1){return}x=u[t[v]]}if(x.nodeType===3){y=Math.min(t[0],x.nodeValue.length)}if(x.nodeType===1){y=Math.min(t[0],x.childNodes.length)}if(z){f.setStart(x,y)}else{f.setEnd(x,y)}}return true}if(r.tridentSel){return r.tridentSel.moveToBookmark(n)}if(g(true)&&g()){r.setRng(f)}}else{if(n.id){function k(A){var u=l.get(n.id+"_"+A),z,t,x,y,v=n.keep;if(u){z=u.parentNode;if(A=="start"){if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}j=s=z;o=p=t}else{if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}s=z;p=t}if(!v){y=u.previousSibling;x=u.nextSibling;d(c.grep(u.childNodes),function(B){if(B.nodeType==3){B.nodeValue=B.nodeValue.replace(/\uFEFF/g,"")}});while(u=l.get(n.id+"_"+A)){l.remove(u,1)}if(y&&x&&y.nodeType==x.nodeType&&y.nodeType==3&&!c.isOpera){t=y.nodeValue.length;y.appendData(x.nodeValue);l.remove(x);if(A=="start"){j=s=y;o=p=t}else{s=y;p=t}}}}}function m(t){if(l.isBlock(t)&&!t.innerHTML){t.innerHTML=!a?'<br data-mce-bogus="1" />':" "}return t}k("start");k("end");if(j){f=l.createRng();f.setStart(m(j),o);f.setEnd(m(s),p);r.setRng(f)}}else{if(n.name){r.select(l.select(n.name)[n.index])}else{if(n.rng){r.setRng(n.rng)}}}}}},select:function(k,j){var i=this,l=i.dom,g=l.createRng(),f;if(k){f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g)}return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var h=this,g=h.getRng(),i;if(g.item){i=g.item(0);g=h.win.document.body.createTextRange();g.moveToElementText(i)}g.collapse(!!f);h.setRng(g)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(l){var g=this,h,i,k,j=g.win.document;if(l&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():j.createRange())}}catch(f){}if(c.isIE&&i&&i.setStart&&j.selection.createRange().item){k=j.selection.createRange().item(0);i=j.createRange();i.setStartBefore(k);i.setEndAfter(k)}if(!i){i=j.createRange?j.createRange():j.body.createTextRange()}if(g.selectedRange&&g.explicitRange){if(i.compareBoundaryPoints(i.START_TO_START,g.selectedRange)===0&&i.compareBoundaryPoints(i.END_TO_END,g.selectedRange)===0){i=g.explicitRange}else{g.selectedRange=null;g.explicitRange=null}}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){g.explicitRange=i;try{h.removeAllRanges()}catch(f){}h.addRange(i);g.selectedRange=h.rangeCount>0?h.getRangeAt(0):null}}else{if(i.cloneRange){try{g.tridentSel.addRange(i);return}catch(f){}}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var h=this,g=h.getRng(),i=h.getSel(),l,k=g.startContainer,f=g.endContainer;if(!g){return h.dom.getRoot()}if(g.setStart){l=g.commonAncestorContainer;if(!g.collapsed){if(g.startContainer==g.endContainer){if(g.endOffset-g.startOffset<2){if(g.startContainer.hasChildNodes()){l=g.startContainer.childNodes[g.startOffset]}}}if(k.nodeType===3&&f.nodeType===3){function j(p,m){var o=p;while(p&&p.nodeType===3&&p.length===0){p=m?p.nextSibling:p.previousSibling}return p||o}if(k.length===g.startOffset){k=j(k.nextSibling,true)}else{k=k.parentNode}if(g.endOffset===0){f=j(f.previousSibling,false)}else{f=f.parentNode}if(k&&k===f){return k}}}if(l&&l.nodeType==3){return l.parentNode}return l}return g.item?g.item(0):g.parentElement()},getSelectedBlocks:function(o,g){var m=this,j=m.dom,l,k,h,i=[];l=j.getParent(o||m.getStart(),j.isBlock);k=j.getParent(g||m.getEnd(),j.isBlock);if(l){i.push(l)}if(l&&k&&l!=k){h=l;var f=new c.dom.TreeWalker(l,j.getRoot());while((h=f.next())&&h!=k){if(j.isBlock(h)){i.push(h)}}}if(k&&l!=k){i.push(k)}return i},normalize:function(){var g=this,f,i;if(c.isIE){return}function h(p){var k,o,n,m=g.dom,j=m.getRoot(),l;k=f[(p?"start":"end")+"Container"];o=f[(p?"start":"end")+"Offset"];if(k.nodeType===9){k=k.body;o=0}if(k===j){if(k.hasChildNodes()){k=k.childNodes[Math.min(!p&&o>0?o-1:o,k.childNodes.length-1)];o=0;if(k.hasChildNodes()){l=k;n=new c.dom.TreeWalker(k,j);do{if(l.nodeType===3){o=p?0:l.nodeValue.length-1;k=l;i=true;break}if(/^(BR|IMG)$/.test(l.nodeName)){o=m.nodeIndex(l);k=l.parentNode;if(l.nodeName=="IMG"&&!p){o++}i=true;break}}while(l=(p?n.next():n.prev()))}}}if(i){f["set"+(p?"Start":"End")](k,o)}}f=g.getRng();h(true);if(!f.collapsed){h()}if(i){g.setRng(f)}},destroy:function(g){var f=this;f.win=null;if(!g){c.removeUnload(f.destroy)}},_fixIESelection:function(){var g=this.dom,m=g.doc,h=m.body,j,n,f;m.documentElement.unselectable=true;function i(o,r){var p=h.createTextRange();try{p.moveToPoint(o,r)}catch(q){p=null}return p}function l(p){var o;if(p.button){o=i(p.x,p.y);if(o){if(o.compareEndPoints("StartToStart",n)>0){o.setEndPoint("StartToStart",n)}else{o.setEndPoint("EndToEnd",n)}o.select()}}else{k()}}function k(){var o=m.selection.createRange();if(n&&!o.item&&o.compareEndPoints("StartToEnd",o)===0){n.select()}g.unbind(m,"mouseup",k);g.unbind(m,"mousemove",l);n=j=0}g.bind(m,["mousedown","contextmenu"],function(o){if(o.target.nodeName==="HTML"){if(j){k()}f=m.documentElement;if(f.scrollHeight>f.clientHeight){return}j=1;n=i(o.x,o.y);if(n){g.bind(m,"mouseup",k);g.bind(m,"mousemove",l);g.win.focus();n.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";e.remove_trailing_brs="remove_trailing_brs" in e?e.remove_trailing_brs:true;h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/\s*mce(Item\w+|Selected)\s*/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addAttributeFilter("data-mce-expando",function(j,l,k){var m=j.length;while(m--){j[m].attr(l,null)}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// <![CDATA[\n"+j(o)+"\n// ]]>"}}else{if(o.length>0){n.firstChild.value="<!--\n"+j(o)+"\n-->"}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(m.getInner?o.innerHTML:a.trim(i.getOuterHTML(o),m),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF|\u200B/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],f={},d=[],g=0,e;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==e){j.push(m);l[m]=c}if(q){if(!f[m]){f[m]=[]}f[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(f[r],function(s){s.func.call(s.scope)});f[r]=e}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","previousSibling",e))}};(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&d<h.nodeValue.length){i=f(h,d);h=i.previousSibling;if(g>d){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d<h.nodeValue.length){h=f(h,d);d=0}if(i.nodeType==3&&g>0&&g<i.nodeValue.length){i=f(i,g).previousSibling;g=i.nodeValue.length}}return{startContainer:h,startOffset:d,endContainer:i,endOffset:g}}};a.dom.RangeUtils.compareRanges=function(c,b){if(c&&b){if(c.item||c.duplicate){if(c.item&&b.item&&c.item(0)===b.item(0)){return true}if(c.isEqual&&b.isEqual&&b.isEqual(c)){return true}}else{return c.startContainer==b.startContainer&&c.startOffset==b.startOffset}}return false}})(tinymce);(function(b){var a=b.dom.Event,c=b.each;b.create("tinymce.ui.KeyboardNavigation",{KeyboardNavigation:function(e,f){var p=this,m=e.root,l=e.items,n=e.enableUpDown,i=e.enableLeftRight||!e.enableUpDown,k=e.excludeFromTabOrder,j,h,o,d,g;f=f||b.DOM;j=function(q){g=q.target.id};h=function(q){f.setAttrib(q.target.id,"tabindex","-1")};d=function(q){var r=f.get(g);f.setAttrib(r,"tabindex","0");r.focus()};p.focus=function(){f.get(g).focus()};p.destroy=function(){c(l,function(q){f.unbind(f.get(q.id),"focus",j);f.unbind(f.get(q.id),"blur",h)});f.unbind(f.get(m),"focus",d);f.unbind(f.get(m),"keydown",o);l=f=m=p.focus=j=h=o=d=null;p.destroy=function(){}};p.moveFocus=function(u,r){var q=-1,t=p.controls,s;if(!g){return}c(l,function(x,v){if(x.id===g){q=v;return false}});q+=u;if(q<0){q=l.length-1}else{if(q>=l.length){q=0}}s=l[q];f.setAttrib(g,"tabindex","-1");f.setAttrib(s.id,"tabindex","0");f.get(s.id).focus();if(e.actOnFocus){e.onAction(s.id)}if(r){a.cancel(r)}};o=function(y){var u=37,t=39,x=38,z=40,q=27,s=14,r=13,v=32;switch(y.keyCode){case u:if(i){p.moveFocus(-1)}break;case t:if(i){p.moveFocus(1)}break;case x:if(n){p.moveFocus(-1)}break;case z:if(n){p.moveFocus(1)}break;case q:if(e.onCancel){e.onCancel();a.cancel(y)}break;case s:case r:case v:if(e.onAction){e.onAction(g);a.cancel(y)}break}};c(l,function(s,q){var r;if(!s.id){s.id=f.uniqueId("_mce_item_")}if(k){f.bind(s.id,"blur",h);r="-1"}else{r=(q===0?"0":"-1")}f.setAttrib(s.id,"tabindex",r);f.bind(f.get(s.id),"focus",j)});if(l[0]){g=l[0].id}f.setAttrib(m,"tabindex","-1");f.bind(f.get(m),"focus",d);f.bind(f.get(m),"keydown",o)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return false}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.get("menu_"+g.id);h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){if(typeof h.settings.style=="function"){h.settings.style=h.settings.style()}c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a role="button" id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" aria-labelledby="'+this.id+'_voice" title="'+a.encode(e.title)+'">';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+='<img class="mceIcon" src="'+e.image+'" alt="'+a.encode(e.title)+'" />'+c}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")}d+='<span class="mceVoiceLabel mceIconOnly" style="display: none;" id="'+this.id+'_voice">'+e.title+"</span>";d+="</a>";return d},postRender:function(){var d=this,e=d.settings,c;if(b.isIE&&d.editor){b.dom.Event.add(d.id,"mousedown",function(f){var g=d.editor.selection.getNode().nodeName;c=g==="IMG"?d.editor.selection.getBookmark():null})}b.dom.Event.add(d.id,"click",function(f){if(!d.isDisabled()){if(b.isIE&&d.editor&&c!==null){d.editor.selection.moveToBookmark(c)}return e.onclick.call(e.scope,f)}});b.dom.Event.add(d.id,"keyup",function(f){if(!d.isDisabled()&&f.keyCode==b.VK.SPACEBAR){return e.onclick.call(e.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(i,h,f){var g=this;g.parent(i,h,f);g.items=[];g.onChange=new a(g);g.onPostRender=new a(g);g.onAdd=new a(g);g.onRenderMenu=new d.util.Dispatcher(this);g.classPrefix="mceListBox";g.marked={}},select:function(h){var g=this,j,i;g.marked={};if(h==undefined){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var h=this,i,j,g;h.marked={};if(f!=h.selectedIndex){i=c.get(h.id+"_text");g=c.get(h.id+"_voiceDesc");j=h.items[f];if(j){h.selectedValue=j.value;h.selectedIndex=f;c.setHTML(i,c.encode(j.title));c.setHTML(g,h.settings.title+" - "+j.title);c.removeClass(i,"mceTitle");c.setAttrib(h.id,"aria-valuenow",j.title)}else{c.setHTML(i,c.encode(h.settings.title));c.setHTML(g,c.encode(h.settings.title));c.addClass(i,"mceTitle");h.selectedValue=h.selectedIndex=null;c.setAttrib(h.id,"aria-valuenow",h.settings.title)}i=0}},mark:function(f){this.marked[f]=true},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<span role="listbox" aria-haspopup="true" aria-labelledby="'+f.id+'_voiceDesc" aria-describedby="'+f.id+'_voiceDesc"><table role="presentation" tabindex="0" id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("span",{id:f.id+"_voiceDesc","class":"voiceLabel",style:"display:none;"},f.settings.title);i+=c.createHTML("a",{id:f.id+"_text",tabindex:-1,href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},'<span><span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span></span>')+"</td>";i+="</tr></tbody></table></span>";return i},showMenu:function(){var g=this,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;e(g.items,function(j){if(f.items[j.id]){f.items[j.id].setSelected(0)}});e(g.items,function(j){if(f.items[j.id]&&g.marked[j.value]){f.items[j.id].setSelected(1)}if(j.value===g.selectedValue){f.items[j.id].setSelected(1)}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(f.menu&&f.menu.isMenuVisible){c.removeClass(f.id,f.classPrefix+"Selected");if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(function(){g.hideMenu();g.focus()});f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){if(h.value===undefined){f.add({title:h.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}})}else{h.id=c.uniqueId();h.role="option";h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)}});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id,"keydown",function(h){if(h.keyCode==32){f.showMenu(h);b.cancel(h)}});b.add(f.id,"focus",function(){if(!f._focused){f.keyDownHandler=b.add(f.id,"keydown",function(h){if(h.keyCode==40){f.showMenu();b.cancel(h)}});f.keyPressHandler=b.add(f.id,"keypress",function(i){var h;if(i.keyCode==13){h=f.selectedValue;f.selectedValue=null;b.cancel(i);f.settings.onselect(h)}})}f._focused=1});b.add(f.id,"blur",function(){b.remove(f.id,"keydown",f.keyDownHandler);b.remove(f.id,"keypress",f.keyPressHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f;this.setAriaProperty("disabled",f)},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox","aria-labelledby":f.id+"_aria"},g);g+=c.createHTML("span",{id:f.id+"_aria",style:"display: none"},f.settings.title);return g},postRender:function(){var g=this,h,i=true;g.rendered=true;function f(k){var j=g.items[k.target.selectedIndex-1];if(j&&(j=j.value)){g.onChange.dispatch(g,j);if(g.settings.onselect){g.settings.onselect(j)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(k){var j;b.remove(g.id,"change",h);i=false;j=b.add(g.id,"blur",function(){if(i){return}i=true;b.add(g.id,"change",f);b.remove(g.id,"blur",j)});if(d.isWebKit&&(k.keyCode==37||k.keyCode==39)){return b.prevent(k)}if(k.keyCode==13||k.keyCode==32){f(k);return b.cancel(k)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+="<td >"+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'<span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span>');i+="<td >"+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(m){m=m.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");var i={href:"javascript:;",style:{backgroundColor:"#"+m},title:p.editor.getLang("colors."+m,m),"data-mce-color":"#"+m};if(!d.isIE){i.role="option"}g=c.add(g,"a",i);if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+m;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");new d.ui.KeyboardNavigation({root:p.id+"_menu",items:c.select("a",p.id+"_menu"),onCancel:function(){p.hideMenu();p.focus()}});a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return false});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('<div id="'+f.id+'" role="group" aria-labelledby="'+f.id+'_voice">');i.push("<span role='application'>");i.push('<span id="'+f.id+'_voice" class="mceVoiceLabel" style="display:none;">'+d.encode(g.name)+"</span>");j(e,function(h){i.push(h.renderHTML())});i.push("</span>");i.push("</div>");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e<l.length;e++){k=l[e];d=l[e-1];g=l[e+1];if(e===0){j="mceToolbarStart";if(k.Button){j+=" mceToolbarStartButton"}else{if(k.SplitButton){j+=" mceToolbarStartSplitButton"}else{if(k.ListBox){j+=" mceToolbarStartListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,"<!-- IE -->"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,"<!-- IE -->"))}}if(c.stdMode){f+='<td style="position: relative">'+k.renderHTML()+"</td>"}else{f+="<td>"+k.renderHTML()+"</td>"}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,"<!-- IE -->"))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,"<!-- IE -->"));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},"<tbody><tr>"+f+"</tr></tbody>")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(v){var u=this,o,n=j.ScriptLoader,r,l=[],q;function p(t){var s=t.id;if(!s){s=t.name;if(s&&!k.get(s)){s=t.name}else{s=k.uniqueId()}t.setAttribute("id",s)}return s}function m(y,z,t){var x=y[z];if(!x){return}if(j.is(x,"string")){t=x.replace(/\.\w+$/,"");t=t?j.resolve(t):0;x=j.resolve(x)}return x.apply(t||this,Array.prototype.slice.call(arguments,2))}v=d({theme:"simple",language:"en"},v);u.settings=v;i.bind(window,"ready",function(){var s,x;m(v,"onpageload");switch(v.mode){case"exact":s=v.elements||"";if(s.length>0){g(e(s),function(y){if(k.get(y)){q=new j.Editor(y,v);l.push(q);q.render(1)}else{g(document.forms,function(z){g(z.elements,function(A){if(A.name===y){y="mce_editor_"+c++;k.setAttrib(A,"id",y);q=new j.Editor(y,v);l.push(q);q.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(z,y){return y.constructor===RegExp?y.test(z.className):k.hasClass(z,y)}g(k.select("textarea"),function(y){if(v.editor_deselector&&t(y,v.editor_deselector)){return}if(!v.editor_selector||t(y,v.editor_selector)){q=new j.Editor(p(y),v);l.push(q);q.render(1)}});break;default:if(v.types){g(v.types,function(y){g(k.select(y.selector),function(A){var z=new j.Editor(p(A),j.extend({},v,y));l.push(z);z.render(1)})})}else{if(v.selector){g(k.select(v.selector),function(z){var y=new j.Editor(p(z),v);l.push(y);y.render(1)})}}}if(v.oninit){s=x=0;g(l,function(y){x++;if(!y.initialized){y.onInit.add(function(){s++;if(s==x){m(v,"oninit")}})}else{s++}if(s==x){m(v,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l<o.length;l++){if(o[l]==n){o.splice(l,1);break}}if(m.activeEditor==n){m._setActive(o[0])}n.destroy();m.onRemoveEditor.dispatch(m,n);return n},execCommand:function(r,p,o){var q=this,n=q.get(o),l;switch(r){case"mceFocus":n.focus();return true;case"mceAddEditor":case"mceAddControl":if(!q.get(o)){new j.Editor(o,q.settings).render()}return true;case"mceAddFrameControl":l=o.window;l.tinyMCE=tinyMCE;l.tinymce=j;j.DOM.doc=l.document;j.DOM.win=l;n=new j.Editor(o.element_id,o);n.render();if(j.isIE){function m(){n.destroy();l.detachEvent("onunload",m);l=l.tinyMCE=l.tinymce=null}l.attachEvent("onunload",m)}o.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(n){n.remove()}return true;case"mceToggleEditor":if(!n){q.execCommand("mceAddControl",0,o);return true}if(n.isHidden()){n.show()}else{n.hide()}return true}if(q.activeEditor){return q.activeEditor.execCommand(r,p,o)}return false},execInstanceCommand:function(p,o,n,m){var l=this.get(p);if(l){return l.execCommand(o,n,m)}return false},triggerSave:function(){g(this.editors,function(l){l.save()})},addI18n:function(n,q){var l,m=this.i18n;if(!j.is(n,"string")){g(n,function(r,p){g(r,function(t,s){g(t,function(v,u){if(s==="common"){m[p+"."+u]=v}else{m[p+"."+s+"."+u]=v}})})})}else{g(q,function(r,p){m[n+"."+p]=r})}},_setActive:function(l){this.selectedInstance=this.activeEditor=l}})})(tinymce);(function(n){var o=n.DOM,k=n.dom.Event,f=n.extend,l=n.util.Dispatcher,i=n.each,a=n.isGecko,b=n.isIE,e=n.isWebKit,d=n.is,h=n.ThemeManager,c=n.PluginManager,p=n.inArray,m=n.grep,g=n.explode,j=n.VK;n.create("tinymce.Editor",{Editor:function(u,r){var q=this;q.id=q.editorId=u;q.execCommands={};q.queryStateCommands={};q.queryValueCommands={};q.isNotDirty=false;q.plugins={};i(["onPreInit","onBeforeRenderUI","onPostRender","onLoad","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState","onSetAttrib"],function(s){q[s]=new l(q)});q.settings=r=f({id:u,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:n.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:n.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE>",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,inline_styles:1,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",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",validate:true,entity_encoding:"named",url_converter:q.convertURL,url_converter_scope:q,ie7_compat:true},r);q.documentBaseURI=new n.util.URI(r.document_base_url||n.documentBaseURL,{base_uri:tinyMCE.baseURI});q.baseURI=n.baseURI;q.contentCSS=[];q.execCallback("setup",q)},render:function(u){var v=this,x=v.settings,y=v.id,q=n.ScriptLoader;if(!k.domLoaded){k.add(window,"ready",function(){v.render()});return}tinyMCE.settings=x;if(!v.getElement()){return}if(n.isIDevice&&!n.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(v.getElement().nodeName)&&x.hidden_input&&o.getParent(y,"form")){o.insertAfter(o.create("input",{type:"hidden",name:y}),y)}if(n.WindowManager){v.windowManager=new n.WindowManager(v)}if(x.encoding=="xml"){v.onGetContent.add(function(s,t){if(t.save){t.content=o.encode(t.content)}})}if(x.add_form_submit_trigger){v.onSubmit.addToTop(function(){if(v.initialized){v.save();v.isNotDirty=1}})}if(x.add_unload_trigger){v._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(v.initialized&&!v.destroyed&&!v.isHidden()){v.save({format:"raw",no_events:true})}})}n.addUnload(v.destroy,v);if(x.submit_patch){v.onBeforeRenderUI.add(function(){var s=v.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){v.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){n.triggerSave();v.isNotDirty=1;return v.formElement._mceOldSubmit(v.formElement)}}s=null})}function r(){if(x.language&&x.language_load!==false){q.add(n.baseURL+"/langs/"+x.language+".js")}if(x.theme&&x.theme.charAt(0)!="-"&&!h.urls[x.theme]){h.load(x.theme,"themes/"+x.theme+"/editor_template"+n.suffix+".js")}i(g(x.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(A){var z={prefix:"plugins/",resource:A,suffix:"/editor_plugin"+n.suffix+".js"};var A=c.createUrl(z,A);c.load(A.resource,A)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+n.suffix+".js"})}}});q.loadQueue(function(){if(!v.removed){v.init()}})}r()},init:function(){var v,I=this,J=I.settings,F,B,E=I.getElement(),r,q,G,z,D,H,A,x=[];n.add(I);J.aria_label=J.aria_label||o.getAttrib(E,"aria-label",I.getLang("aria.rich_text_area"));if(J.theme){J.theme=J.theme.replace(/-/,"");r=h.get(J.theme);I.theme=new r();if(I.theme.init&&J.init_theme){I.theme.init(I,h.urls[J.theme]||n.documentBaseURL.replace(/\/$/,""))}}function C(K){var L=c.get(K),t=c.urls[K]||n.documentBaseURL.replace(/\/$/,""),s;if(L&&n.inArray(x,K)===-1){i(c.dependencies(K),function(u){C(u)});s=new L(I,t);I.plugins[K]=s;if(s.init){s.init(I,t);x.push(K)}}}i(g(J.plugins.replace(/\-/g,"")),C);if(J.popup_css!==false){if(J.popup_css){J.popup_css=I.documentBaseURI.toAbsolute(J.popup_css)}else{J.popup_css=I.baseURI.toAbsolute("themes/"+J.theme+"/skins/"+J.skin+"/dialog.css")}}if(J.popup_css_add){J.popup_css+=","+I.documentBaseURI.toAbsolute(J.popup_css_add)}I.controlManager=new n.ControlManager(I);if(J.custom_undo_redo){I.onBeforeExecCommand.add(function(t,K,u,L,s){if(K!="Undo"&&K!="Redo"&&K!="mceRepaint"&&(!s||!s.skip_undo)){I.undoManager.beforeChange()}});I.onExecCommand.add(function(t,K,u,L,s){if(K!="Undo"&&K!="Redo"&&K!="mceRepaint"&&(!s||!s.skip_undo)){I.undoManager.add()}})}I.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){I.nodeChanged()}});if(a){function y(s,t){if(!t||!t.initial){I.execCommand("mceRepaint")}}I.onUndo.add(y);I.onRedo.add(y);I.onSetContent.add(y)}I.onBeforeRenderUI.dispatch(I,I.controlManager);if(J.render_ui){F=J.width||E.style.width||E.offsetWidth;B=J.height||E.style.height||E.offsetHeight;I.orgDisplay=E.style.display;H=/^[0-9\.]+(|px)$/i;if(H.test(""+F)){F=Math.max(parseInt(F)+(r.deltaWidth||0),100)}if(H.test(""+B)){B=Math.max(parseInt(B)+(r.deltaHeight||0),100)}r=I.theme.renderUI({targetNode:E,width:F,height:B,deltaWidth:J.delta_width,deltaHeight:J.delta_height});I.editorContainer=r.editorContainer}if(document.domain&&location.hostname!=document.domain){n.relaxedDomain=document.domain}o.setStyles(r.sizeContainer||r.editorContainer,{width:F,height:B});if(J.content_css){n.each(g(J.content_css),function(s){I.contentCSS.push(I.documentBaseURI.toAbsolute(s))})}B=(r.iframeHeight||B)+(typeof(B)=="number"?(r.deltaHeight||0):"");if(B<100){B=100}I.iframeHTML=J.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(J.document_base_url!=n.documentBaseURL){I.iframeHTML+='<base href="'+I.documentBaseURI.getURI()+'" />'}if(J.ie7_compat){I.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'}else{I.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=edge" />'}I.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';for(A=0;A<I.contentCSS.length;A++){I.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+I.contentCSS[A]+'" />'}I.contentCSS=[];z=J.body_id||"tinymce";if(z.indexOf("=")!=-1){z=I.getParam("body_id","","hash");z=z[I.id]||z}D=J.body_class||"";if(D.indexOf("=")!=-1){D=I.getParam("body_class","","hash");D=D[I.id]||""}I.iframeHTML+='</head><body id="'+z+'" class="mceContentBody '+D+'" onload="window.parent.tinyMCE.get(\''+I.id+"').onLoad.dispatch();\"><br></body></html>";if(n.relaxedDomain&&(b||(n.isOpera&&parseFloat(opera.version())<11))){G='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+I.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}v=o.add(r.iframeContainer,"iframe",{id:I.id+"_ifr",src:G||'javascript:""',frameBorder:"0",allowTransparency:"true",title:J.aria_label,style:{width:"100%",height:B,display:"block"}});I.contentAreaContainer=r.iframeContainer;o.get(r.editorContainer).style.display=I.orgDisplay;o.get(I.id).style.display="none";o.setAttrib(I.id,"aria-hidden",true);if(!n.relaxedDomain||!G){I.setupIframe()}E=v=r=null},setupIframe:function(){var r=this,x=r.settings,y=o.get(r.id),z=r.getDoc(),v,q;if(!b||!n.relaxedDomain){z.open();z.write(r.iframeHTML);z.close();if(n.relaxedDomain){z.domain=n.relaxedDomain}}q=r.getBody();q.disabled=true;if(!x.readonly){q.contentEditable=true}q.disabled=false;r.schema=new n.html.Schema(x);r.dom=new n.dom.DOMUtils(r.getDoc(),{keep_values:true,url_converter:r.convertURL,url_converter_scope:r,hex_colors:x.force_hex_style_colors,class_filter:x.class_filter,update_styles:1,fix_ie_paragraphs:1,schema:r.schema});r.parser=new n.html.DomParser(x,r.schema);if(!r.settings.allow_html_in_named_anchor){r.parser.addAttributeFilter("name",function(s,t){var B=s.length,D,A,C,E;while(B--){E=s[B];if(E.name==="a"&&E.firstChild){C=E.parent;D=E.lastChild;do{A=D.prev;C.insert(D,E);D=A}while(D)}}})}r.parser.addAttributeFilter("src,href,style",function(s,t){var A=s.length,C,E=r.dom,D,B;while(A--){C=s[A];D=C.attr(t);B="data-mce-"+t;if(!C.attributes.map[B]){if(t==="style"){C.attr(B,E.serializeStyle(E.parseStyle(D),C.name))}else{C.attr(B,r.convertURL(D,t,C.name))}}}});r.parser.addNodeFilter("script",function(s,t){var A=s.length,B;while(A--){B=s[A];B.attr("type","mce-"+(B.attr("type")||"text/javascript"))}});r.parser.addNodeFilter("#cdata",function(s,t){var A=s.length,B;while(A--){B=s[A];B.type=8;B.name="#comment";B.value="[CDATA["+B.value+"]]"}});r.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(t,A){var B=t.length,C,s=r.schema.getNonEmptyElements();while(B--){C=t[B];if(C.isEmpty(s)){C.empty().append(new n.html.Node("br",1)).shortEnded=true}}});r.serializer=new n.dom.Serializer(x,r.dom,r.schema);r.selection=new n.dom.Selection(r.dom,r.getWin(),r.serializer);r.formatter=new n.Formatter(this);r.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"left"}}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,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:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"right"}}],alignfull:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,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"},link:{inline:"a",selector:"a",remove:"all",split:true,deep:true,onmatch:function(s){return true},onformat:function(A,s,t){i(t,function(C,B){r.dom.setAttrib(A,B,C)})}},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}]});i("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(s){r.formatter.register(s,{block:s,remove:"all"})});r.formatter.register(r.settings.formats);r.undoManager=new n.UndoManager(r);r.undoManager.onAdd.add(function(t,s){if(t.hasUndo()){return r.onChange.dispatch(r,s,t)}});r.undoManager.onUndo.add(function(t,s){return r.onUndo.dispatch(r,s,t)});r.undoManager.onRedo.add(function(t,s){return r.onRedo.dispatch(r,s,t)});r.forceBlocks=new n.ForceBlocks(r);r.enterKey=new n.EnterKey(r);r.editorCommands=new n.EditorCommands(r);r.serializer.onPreProcess.add(function(s,t){return r.onPreProcess.dispatch(r,t,s)});r.serializer.onPostProcess.add(function(s,t){return r.onPostProcess.dispatch(r,t,s)});r.onPreInit.dispatch(r);if(!x.gecko_spellcheck){r.getBody().spellcheck=0}if(!x.readonly){r._addEvents()}r.controlManager.onPostRender.dispatch(r,r.controlManager);r.onPostRender.dispatch(r);r.quirks=new n.util.Quirks(this);if(x.directionality){r.getBody().dir=x.directionality}if(x.nowrap){r.getBody().style.whiteSpace="nowrap"}if(x.handle_node_change_callback){r.onNodeChange.add(function(t,s,A){r.execCallback("handle_node_change_callback",r.id,A,-1,-1,true,r.selection.isCollapsed())})}if(x.save_callback){r.onSaveContent.add(function(s,A){var t=r.execCallback("save_callback",r.id,A.content,r.getBody());if(t){A.content=t}})}if(x.onchange_callback){r.onChange.add(function(t,s){r.execCallback("onchange_callback",r,s)})}if(x.protect){r.onBeforeSetContent.add(function(s,t){if(x.protect){i(x.protect,function(A){t.content=t.content.replace(A,function(B){return"<!--mce:protected "+escape(B)+"-->"})})}})}if(x.convert_newlines_to_brs){r.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(x.preformatted){r.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(x.verify_css_classes){r.serializer.attribValueFilter=function(C,A){var B,t;if(C=="class"){if(!r.classesRE){t=r.dom.getClasses();if(t.length>0){B="";i(t,function(s){B+=(B?"|":"")+s["class"]});r.classesRE=new RegExp("("+B+")","gi")}}return !r.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(A)||r.classesRE.test(A)?A:""}return A}}if(x.cleanup_callback){r.onBeforeSetContent.add(function(s,t){t.content=r.execCallback("cleanup_callback","insert_to_editor",t.content,t)});r.onPreProcess.add(function(s,t){if(t.set){r.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){r.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});r.onPostProcess.add(function(s,t){if(t.set){t.content=r.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=r.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(x.save_callback){r.onGetContent.add(function(s,t){if(t.save){t.content=r.execCallback("save_callback",r.id,t.content,r.getBody())}})}if(x.handle_event_callback){r.onEvent.add(function(s,t,A){if(r.execCallback("handle_event_callback",t,s,A)===false){k.cancel(t)}})}r.onSetContent.add(function(){r.addVisual(r.getBody())});if(x.padd_empty_editor){r.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function u(s,t){i(s.dom.select("a"),function(B){var A=B.parentNode;if(s.dom.isBlock(A)&&A.lastChild===B){s.dom.add(A,"br",{"data-mce-bogus":1})}})}r.onExecCommand.add(function(s,t){if(t==="CreateLink"){u(s)}});r.onSetContent.add(r.selection.onSetContent.add(u))}r.load({initial:true,format:"html"});r.startContent=r.getContent({format:"raw"});r.undoManager.add();r.initialized=true;r.onInit.dispatch(r);r.execCallback("setupcontent_callback",r.id,r.getBody(),r.getDoc());r.execCallback("init_instance_callback",r);r.focus(true);r.nodeChanged({initial:1});i(r.contentCSS,function(s){r.dom.loadCSS(s)});if(x.auto_focus){setTimeout(function(){var s=n.get(x.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getBody().focus();s.getWin().focus()},100)}y=null},focus:function(v){var z,r=this,u=r.selection,y=r.settings.content_editable,s,q,x=r.getDoc();if(!v){s=u.getRng();if(s.item){q=s.item(0)}r._refreshContentEditable();if(!y){r.getWin().focus()}if(n.isGecko){r.getBody().focus()}if(q&&q.ownerDocument==x){s=x.body.createControlRange();s.addElement(q);s.select()}}if(n.activeEditor!=r){if((z=n.activeEditor)!=null){z.onDeactivate.dispatch(z,r)}r.onActivate.dispatch(r,z)}n._setActive(r)},execCallback:function(v){var q=this,u=q.settings[v],r;if(!u){return}if(q.callbackLookup&&(r=q.callbackLookup[v])){u=r.func;r=r.scope}if(d(u,"string")){r=u.replace(/\.\w+$/,"");r=r?n.resolve(r):0;u=n.resolve(u);q.callbackLookup=q.callbackLookup||{};q.callbackLookup[v]={func:u,scope:r}}return u.apply(r||q,Array.prototype.slice.call(arguments,1))},translate:function(q){var t=this.settings.language||"en",r=n.i18n;if(!q){return""}return r[t+"."+q]||q.replace(/{\#([^}]+)\}/g,function(u,s){return r[t+"."+s]||"{#"+s+"}"})},getLang:function(r,q){return n.i18n[(this.settings.language||"en")+"."+r]||(d(q)?q:"{#"+r+"}")},getParam:function(x,s,q){var t=n.trim,r=d(this.settings[x])?this.settings[x]:s,u;if(q==="hash"){u={};if(d(r,"string")){i(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(y){y=y.split("=");if(y.length>1){u[t(y[0])]=t(y[1])}else{u[t(y[0])]=t(y)}})}else{u=r}return u}return r},nodeChanged:function(u){var q=this,r=q.selection,v=r.getStart()||q.getBody();if(q.initialized){u=u||{};v=b&&v.ownerDocument!=q.getDoc()?q.getBody():v;u.parents=[];q.dom.getParent(v,function(s){if(s.nodeName=="BODY"){return true}u.parents.push(s)});q.onNodeChange.dispatch(q,u?u.controlManager||q.controlManager:q.controlManager,v,r.isCollapsed(),u)}},addButton:function(u,r){var q=this;q.buttons=q.buttons||{};q.buttons[u]=r},addCommand:function(q,s,r){this.execCommands[q]={func:s,scope:r||this}},addQueryStateHandler:function(q,s,r){this.queryStateCommands[q]={func:s,scope:r||this}},addQueryValueHandler:function(q,s,r){this.queryValueCommands[q]={func:s,scope:r||this}},addShortcut:function(s,v,q,u){var r=this,x;if(!r.settings.custom_shortcuts){return false}r.shortcuts=r.shortcuts||{};if(d(q,"string")){x=q;q=function(){r.execCommand(x,false,null)}}if(d(q,"object")){x=q;q=function(){r.execCommand(x[0],x[1],x[2])}}i(g(s),function(t){var y={func:q,scope:u||this,desc:v,alt:false,ctrl:false,shift:false};i(g(t,"+"),function(z){switch(z){case"alt":case"ctrl":case"shift":y[z]=true;break;default:y.charCode=z.charCodeAt(0);y.keyCode=z.toUpperCase().charCodeAt(0)}});r.shortcuts[(y.ctrl?"ctrl":"")+","+(y.alt?"alt":"")+","+(y.shift?"shift":"")+","+y.keyCode]=y});return true},execCommand:function(y,x,A,q){var u=this,v=0,z,r;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(y)&&(!q||!q.skip_focus)){u.focus()}q=f({},q);u.onBeforeExecCommand.dispatch(u,y,x,A,q);if(q.terminate){return false}if(u.execCallback("execcommand_callback",u.id,u.selection.getNode(),y,x,A)){u.onExecCommand.dispatch(u,y,x,A,q);return true}if(z=u.execCommands[y]){r=z.func.call(z.scope,x,A);if(r!==true){u.onExecCommand.dispatch(u,y,x,A,q);return r}}i(u.plugins,function(s){if(s.execCommand&&s.execCommand(y,x,A)){u.onExecCommand.dispatch(u,y,x,A,q);v=1;return false}});if(v){return true}if(u.theme&&u.theme.execCommand&&u.theme.execCommand(y,x,A)){u.onExecCommand.dispatch(u,y,x,A,q);return true}if(u.editorCommands.execCommand(y,x,A)){u.onExecCommand.dispatch(u,y,x,A,q);return true}u.getDoc().execCommand(y,x,A);u.onExecCommand.dispatch(u,y,x,A,q)},queryCommandState:function(v){var r=this,x,u;if(r._isHidden()){return}if(x=r.queryStateCommands[v]){u=x.func.call(x.scope);if(u!==true){return u}}x=r.editorCommands.queryCommandState(v);if(x!==-1){return x}try{return this.getDoc().queryCommandState(v)}catch(q){}},queryCommandValue:function(x){var r=this,v,u;if(r._isHidden()){return}if(v=r.queryValueCommands[x]){u=v.func.call(v.scope);if(u!==true){return u}}v=r.editorCommands.queryCommandValue(x);if(d(v)){return v}try{return this.getDoc().queryCommandValue(x)}catch(q){}},show:function(){var q=this;o.show(q.getContainer());o.hide(q.id);q.load()},hide:function(){var q=this,r=q.getDoc();if(b&&r){r.execCommand("SelectAll")}q.save();o.hide(q.getContainer());o.setStyle(q.id,"display",q.orgDisplay)},isHidden:function(){return !o.isHidden(this.id)},setProgressState:function(q,r,s){this.onSetProgressState.dispatch(this,q,r,s);return q},load:function(u){var q=this,s=q.getElement(),r;if(s){u=u||{};u.load=true;r=q.setContent(d(s.value)?s.value:s.innerHTML,u);u.element=s;if(!u.no_events){q.onLoadContent.dispatch(q,u)}u.element=s=null;return r}},save:function(v){var q=this,u=q.getElement(),r,s;if(!u||!q.initialized){return}v=v||{};v.save=true;if(!v.no_events){q.undoManager.typing=false;q.undoManager.add()}v.element=u;r=v.content=q.getContent(v);if(!v.no_events){q.onSaveContent.dispatch(q,v)}r=v.content;if(!/TEXTAREA|INPUT/i.test(u.nodeName)){u.innerHTML=r;if(s=o.getParent(q.id,"form")){i(s.elements,function(t){if(t.name==q.id){t.value=r;return false}})}}else{u.value=r}v.element=u=null;return r},setContent:function(v,t){var s=this,r,q=s.getBody(),u;t=t||{};t.format=t.format||"html";t.set=true;t.content=v;if(!t.no_events){s.onBeforeSetContent.dispatch(s,t)}v=t.content;if(!n.isIE&&(v.length===0||/^\s+$/.test(v))){u=s.settings.forced_root_block;if(u){v="<"+u+'><br data-mce-bogus="1"></'+u+">"}else{v='<br data-mce-bogus="1">'}q.innerHTML=v;s.selection.select(q,true);s.selection.collapse(true);return}if(t.format!=="raw"){v=new n.html.Serializer({},s.schema).serialize(s.parser.parse(v))}t.content=n.trim(v);s.dom.setHTML(q,t.content);if(!t.no_events){s.onSetContent.dispatch(s,t)}s.selection.normalize();return t.content},getContent:function(r){var q=this,s;r=r||{};r.format=r.format||"html";r.get=true;if(!r.no_events){q.onBeforeGetContent.dispatch(q,r)}if(r.format=="raw"){s=q.getBody().innerHTML}else{s=q.serializer.serialize(q.getBody(),r)}r.content=n.trim(s);if(!r.no_events){q.onGetContent.dispatch(q,r)}return r.content},isDirty:function(){var q=this;return n.trim(q.startContent)!=n.trim(q.getContent({format:"raw",no_events:1}))&&!q.isNotDirty},getContainer:function(){var q=this;if(!q.container){q.container=o.get(q.editorContainer||q.id+"_parent")}return q.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return o.get(this.settings.content_element||this.id)},getWin:function(){var q=this,r;if(!q.contentWindow){r=o.get(q.id+"_ifr");if(r){q.contentWindow=r.contentWindow}}return q.contentWindow},getDoc:function(){var r=this,q;if(!r.contentDocument){q=r.getWin();if(q){r.contentDocument=q.document}}return r.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(q,y,x){var r=this,v=r.settings;if(v.urlconverter_callback){return r.execCallback("urlconverter_callback",q,x,true,y)}if(!v.convert_urls||(x&&x.nodeName=="LINK")||q.indexOf("file:")===0){return q}if(v.relative_urls){return r.documentBaseURI.toRelative(q)}q=r.documentBaseURI.toAbsolute(q,v.remove_script_host);return q},addVisual:function(u){var q=this,r=q.settings;u=u||q.getBody();if(!d(q.hasVisual)){q.hasVisual=r.visual}i(q.dom.select("table,a",u),function(t){var s;switch(t.nodeName){case"TABLE":s=q.dom.getAttrib(t,"border");if(!s||s=="0"){if(q.hasVisual){q.dom.addClass(t,r.visual_table_class)}else{q.dom.removeClass(t,r.visual_table_class)}}return;case"A":s=q.dom.getAttrib(t,"name");if(s){if(q.hasVisual){q.dom.addClass(t,"mceItemAnchor")}else{q.dom.removeClass(t,"mceItemAnchor")}}return}});q.onVisualAid.dispatch(q,u,q.hasVisual)},remove:function(){var q=this,r=q.getContainer();if(!q.removed){q.removed=1;q.hide();if(!q.settings.content_editable){k.clear(q.getWin());k.clear(q.getDoc())}k.clear(q.getBody());k.clear(q.formElement);k.unbind(r);q.execCallback("remove_instance_callback",q);q.onRemove.dispatch(q);q.onExecCommand.listeners=[];n.remove(q);o.remove(r)}},destroy:function(r){var q=this;if(q.destroyed){return}if(a){k.unbind(q.getDoc());k.unbind(q.getWin());k.unbind(q.getBody())}if(!r){n.removeUnload(q.destroy);tinyMCE.onBeforeUnload.remove(q._beforeUnload);if(q.theme&&q.theme.destroy){q.theme.destroy()}q.controlManager.destroy();q.selection.destroy();q.dom.destroy()}if(q.formElement){q.formElement.submit=q.formElement._mceOldSubmit;q.formElement._mceOldSubmit=null}q.contentAreaContainer=q.formElement=q.container=q.settings.content_element=q.bodyElement=q.contentDocument=q.contentWindow=null;if(q.selection){q.selection=q.selection.win=q.selection.dom=q.selection.dom.doc=null}q.destroyed=1},_addEvents:function(){var B=this,u,C=B.settings,r=B.dom,y={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function q(t,D){var s=t.type;if(B.removed){return}if(B.onEvent.dispatch(B,t,D)!==false){B[y[t.fakeType||t.type]].dispatch(B,t,D)}}i(y,function(t,s){switch(s){case"contextmenu":r.bind(B.getDoc(),s,q);break;case"paste":r.bind(B.getBody(),s,function(D){q(D)});break;case"submit":case"reset":r.bind(B.getElement().form||o.getParent(B.id,"form"),s,q);break;default:r.bind(C.content_editable?B.getBody():B.getDoc(),s,q)}});r.bind(C.content_editable?B.getBody():(a?B.getDoc():B.getWin()),"focus",function(s){B.focus(true)});if(n.isGecko){r.bind(B.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("data-mce-src"))){t.src=B.documentBaseURI.toAbsolute(s)}})}if(a){function v(){var E=this,G=E.getDoc(),F=E.settings;if(a&&!F.readonly){E._refreshContentEditable();try{G.execCommand("styleWithCSS",0,false)}catch(D){if(!E._isHidden()){try{G.execCommand("useCSS",0,true)}catch(D){}}}if(!F.table_inline_editing){try{G.execCommand("enableInlineTableEditing",false,false)}catch(D){}}if(!F.object_resizing){try{G.execCommand("enableObjectResizing",false,false)}catch(D){}}}}B.onBeforeExecCommand.add(v);B.onMouseDown.add(v)}B.onMouseUp.add(B.nodeChanged);B.onKeyUp.add(function(s,t){var D=t.keyCode;if((D>=33&&D<=36)||(D>=37&&D<=40)||D==13||D==45||D==46||D==8||(n.isMac&&(D==91||D==93))||t.ctrlKey){B.nodeChanged()}});B.onKeyDown.add(function(t,D){if(D.keyCode!=j.BACKSPACE){return}var s=t.selection.getRng();if(!s.collapsed){return}var F=s.startContainer;var E=s.startOffset;while(F&&F.nodeType&&F.nodeType!=1&&F.parentNode){F=F.parentNode}if(F&&F.parentNode&&F.parentNode.tagName==="BLOCKQUOTE"&&F.parentNode.firstChild==F&&E==0){t.formatter.toggle("blockquote",null,F.parentNode);s.setStart(F,0);s.setEnd(F,0);t.selection.setRng(s);t.selection.collapse(false)}});B.onReset.add(function(){B.setContent(B.startContent,{format:"raw"})});if(C.custom_shortcuts){if(C.custom_undo_redo_keyboard_shortcuts){B.addShortcut("ctrl+z",B.getLang("undo_desc"),"Undo");B.addShortcut("ctrl+y",B.getLang("redo_desc"),"Redo")}B.addShortcut("ctrl+b",B.getLang("bold_desc"),"Bold");B.addShortcut("ctrl+i",B.getLang("italic_desc"),"Italic");B.addShortcut("ctrl+u",B.getLang("underline_desc"),"Underline");for(u=1;u<=6;u++){B.addShortcut("ctrl+"+u,"",["FormatBlock",false,"h"+u])}B.addShortcut("ctrl+7","",["FormatBlock",false,"p"]);B.addShortcut("ctrl+8","",["FormatBlock",false,"div"]);B.addShortcut("ctrl+9","",["FormatBlock",false,"address"]);function x(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}i(B.shortcuts,function(D){if(n.isMac&&D.ctrl!=t.metaKey){return}else{if(!n.isMac&&D.ctrl!=t.ctrlKey){return}}if(D.alt!=t.altKey){return}if(D.shift!=t.shiftKey){return}if(t.keyCode==D.keyCode||(t.charCode&&t.charCode==D.charCode)){s=D;return false}});return s}B.onKeyUp.add(function(s,t){var D=x(t);if(D){return k.cancel(t)}});B.onKeyPress.add(function(s,t){var D=x(t);if(D){return k.cancel(t)}});B.onKeyDown.add(function(s,t){var D=x(t);if(D){D.func.call(D.scope);return k.cancel(t)}})}if(n.isIE){r.bind(B.getDoc(),"controlselect",function(D){var t=B.resizeInfo,s;D=D.target;if(D.nodeName!=="IMG"){return}if(t){r.unbind(t.node,t.ev,t.cb)}if(!r.hasClass(D,"mceItemNoResize")){ev="resizeend";s=r.bind(D,ev,function(F){var E;F=F.target;if(E=r.getStyle(F,"width")){r.setAttrib(F,"width",E.replace(/[^0-9%]+/g,""));r.setStyle(F,"width","")}if(E=r.getStyle(F,"height")){r.setAttrib(F,"height",E.replace(/[^0-9%]+/g,""));r.setStyle(F,"height","")}})}else{ev="resizestart";s=r.bind(D,"resizestart",k.cancel,k)}t=B.resizeInfo={node:D,ev:ev,cb:s}})}if(n.isOpera){B.onClick.add(function(s,t){k.prevent(t)})}if(C.custom_undo_redo){function A(){B.undoManager.typing=false;B.undoManager.add()}var z=n.isGecko?"blur":"focusout";r.bind(B.getDoc(),z,function(s){if(!B.removed&&B.undoManager.typing){A()}});B.dom.bind(B.dom.getRoot(),"dragend",function(s){A()});B.onKeyUp.add(function(s,D){var t=D.keyCode;if((t>=33&&t<=36)||(t>=37&&t<=40)||t==13||t==45||D.ctrlKey){A()}});B.onKeyDown.add(function(s,E){var D=E.keyCode,t;if(D==8){t=B.getDoc().selection;if(t&&t.createRange&&t.createRange().item){B.undoManager.beforeChange();s.dom.remove(t.createRange().item(0));A();return k.cancel(E)}}if((D>=33&&D<=36)||(D>=37&&D<=40)||D==13||D==45){if(n.isIE&&D==13){B.undoManager.beforeChange()}if(B.undoManager.typing){A()}return}if((D<16||D>20)&&D!=224&&D!=91&&!B.undoManager.typing){B.undoManager.beforeChange();B.undoManager.typing=true;B.undoManager.add()}});B.onMouseDown.add(function(){if(B.undoManager.typing){A()}})}},_refreshContentEditable:function(){var r=this,q,s;if(r._isHidden()){q=r.getBody();s=q.parentNode;s.removeChild(q);s.appendChild(q);q.focus()}},_isHidden:function(){var q;if(!a){return 0}q=this.selection.getSel();return(!q||!q.rangeCount||q.rangeCount==0)}})})(tinymce);(function(c){var d=c.each,e,a=true,b=false;c.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return b}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return b}function u(v,x){x=x||"exec";d(v,function(z,y){d(y.toLowerCase().split(","),function(A){j[x][A]=z})})}c.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===e){x=b}if(v===e){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:e)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(c.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(b)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);d("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=c.explode(k.font_size_style_values);v=c.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return b}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new c.html.Serializer({},n.schema);v='<span id="mce_marker" data-mce-type="bookmark">\uFEFF</span>';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=n.selection.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.y<L.y)||(C.x>L.x+L.w||C.x<L.x)){H=c.isIE?n.getDoc().documentElement:n.getBody();H.scrollLeft=C.x;H.scrollTop=C.y-L.h+25}x=m.createRng();A=D.previousSibling;if(A&&A.nodeType==3){x.setStart(A,A.nodeValue.length)}else{x.setStartBefore(D);x.setEndBefore(D)}m.remove(D);p.setRng(x);p.onSetContent.dispatch(p,G);n.addVisual()},mceInsertRawHTML:function(y,x,v){p.setContent("tiny_mce_marker");n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return v}))},mceSetContent:function(y,x,v){n.setContent(v)},"Indent,Outdent":function(z){var x,v,y;x=k.indentation;v=/[a-z%]+$/i.exec(x);x=parseInt(x);if(!l("InsertUnorderedList")&&!l("InsertOrderedList")){if(!k.forced_root_block&&!m.getParent(p.getNode(),m.isBlock)){q.apply("div")}d(p.getSelectedBlocks(),function(A){if(z=="outdent"){y=Math.max(0,parseInt(A.style.paddingLeft||0)-x);m.setStyle(A,"paddingLeft",y?y+v:"")}else{m.setStyle(A,"paddingLeft",(parseInt(A.style.paddingLeft||0)+x)+v)}})}else{f(z)}},mceRepaint:function(){var x;if(c.isGecko){try{i(a);if(p.getSel()){p.getSel().selectAllChildren(n.getBody())}p.collapse(a);g()}catch(v){}}},mceToggleFormat:function(y,x,v){q.toggle(v)},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",false,"<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();v.setStart(x,0);v.setEnd(x,x.childNodes.length);n.selection.setRng(v)}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(z){var x="align"+z.substring(7);var v=p.isCollapsed()?[p.getNode()]:p.getSelectedBlocks();var y=c.map(v,function(A){return !!q.matchNode(A,x)});return c.inArray(y,a)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(v){return m.getParent(p.getNode(),v=="insertunorderedlist"?"UL":"OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");if(k.custom_undo_redo){u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(f){var d,e=0,h=[],c;function g(){return b.trim(f.getContent({format:"raw",no_events:1}).replace(/<span[^>]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g,""))}return d={typing:false,onAdd:new a(d),onUndo:new a(d),onRedo:new a(d),beforeChange:function(){c=f.selection.getBookmark(2,true)},add:function(m){var j,k=f.settings,l;m=m||{};m.content=g();l=h[e];if(l&&l.content==m.content){return null}if(h[e]){h[e].beforeBookmark=c}if(k.custom_undo_redo_levels){if(h.length>k.custom_undo_redo_levels){for(j=0;j<h.length-1;j++){h[j]=h[j+1]}h.length--;e=h.length}}m.bookmark=f.selection.getBookmark(2,true);if(e<h.length-1){h.length=e+1}h.push(m);e=h.length-1;d.onAdd.dispatch(d,m);f.isNotDirty=0;return m},undo:function(){var k,j;if(d.typing){d.add();d.typing=false}if(e>0){k=h[--e];f.setContent(k.content,{format:"raw"});f.selection.moveToBookmark(k.beforeBookmark);d.onUndo.dispatch(d,k)}return k},redo:function(){var i;if(e<h.length-1){i=h[++e];f.setContent(i.content,{format:"raw"});f.selection.moveToBookmark(i.bookmark);d.onRedo.dispatch(d,i)}return i},clear:function(){h=[];e=0;d.typing=false},hasUndo:function(){return e>0||this.typing},hasRedo:function(){return e<h.length-1&&!this.typing}}}})(tinymce);tinymce.ForceBlocks=function(c){var b=c.settings,e=c.dom,a=c.selection,d=c.schema.getBlockElements();if(b.forced_root_block){function f(){var j=a.getStart(),h=c.getBody(),g,k,o,q,p,i,l,m=-16777215;if(!j||j.nodeType!==1||!b.forced_root_block){return}while(j!=h){if(d[j.nodeName]){return}j=j.parentNode}g=a.getRng();if(g.setStart){k=g.startContainer;o=g.startOffset;q=g.endContainer;p=g.endOffset}else{if(g.item){j=g.item(0);g=c.getDoc().body.createTextRange();g.moveToElementText(j)}tmpRng=g.duplicate();tmpRng.collapse(true);o=tmpRng.move("character",m)*-1;if(!tmpRng.collapsed){tmpRng=g.duplicate();tmpRng.collapse(false);p=(tmpRng.move("character",m)*-1)-o}}for(j=h.firstChild;j;j){if(j.nodeType===3||(j.nodeType==1&&!d[j.nodeName])){if(!i){i=e.create(b.forced_root_block);j.parentNode.insertBefore(i,j)}l=j;j=j.nextSibling;i.appendChild(l)}else{i=null;j=j.nextSibling}}if(g.setStart){g.setStart(k,o);g.setEnd(q,p);a.setRng(g)}else{try{g=c.getDoc().body.createTextRange();g.moveToElementText(h);g.collapse(true);g.moveStart("character",o);if(p>0){g.moveEnd("character",p)}g.select()}catch(n){}}c.nodeChanged()}c.onKeyUp.add(f);c.onClick.add(f)}};(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(f,n,h){var l=this,j=l.editor,i,k,m;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,scope:n.scope,control_manager:l},n);f=l.prefix+f;function g(o){return o.settings.use_accessible_selects&&!c.isGecko}if(j.settings.use_native_selects||g(j)){k=new c.ui.NativeListBox(f,n)}else{m=h||l._cls.listbox||c.ui.ListBox;k=new m(f,n,j)}l.controls[f]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){j.bookmark=j.selection.getBookmark(1)});a.add(o,"focus",function(){j.selection.moveToBookmark(j.bookmark);j.bookmark=null})})}if(k.hideMenu){j.onMouseDown.add(k.hideMenu,k)}return l.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i,g);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i,g)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i,g));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n,j);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createToolbarGroup:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||this._cls.toolbarGroup||c.ui.ToolbarGroup;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.Formatter=function(W){var N={},Q=a.each,c=W.dom,q=W.selection,t=a.dom.TreeWalker,L=new a.dom.RangeUtils(c),d=W.schema.isValidChild,G=c.isBlock,l=W.settings.forced_root_block,s=c.nodeIndex,F=a.isGecko?"\u200B":"\uFEFF",e=/^(src|href|style)$/,T=false,C=true,p;function x(Y){var X=Y.getAttribute("data-mce-contenteditable");if(X&&X!=="inherit"){return X}return Y.contentEditable!=="inherit"?Y.contentEditable:null}function A(X){return X instanceof Array}function m(Y,X){return c.getParents(Y,X,c.getRoot())}function b(X){return X.nodeType===1&&X.id==="_mce_caret"}function S(X){return X?N[X]:N}function k(X,Y){if(X){if(typeof(X)!=="string"){Q(X,function(aa,Z){k(Z,aa)})}else{Y=Y.length?Y:[Y];Q(Y,function(Z){if(Z.deep===p){Z.deep=!Z.selector}if(Z.split===p){Z.split=!Z.selector||Z.inline}if(Z.remove===p&&Z.selector&&!Z.inline){Z.remove="none"}if(Z.selector&&Z.inline){Z.mixed=true;Z.block_expand=true}if(typeof(Z.classes)==="string"){Z.classes=Z.classes.split(/\s+/)}});N[X]=Y}}}var i=function(Y){var X;W.dom.getParent(Y,function(Z){X=W.dom.getStyle(Z,"text-decoration");return X&&X!=="none"});return X};var J=function(X){var Y;if(X.nodeType===1&&X.parentNode&&X.parentNode.nodeType===1){Y=i(X.parentNode);if(W.dom.getStyle(X,"color")&&Y){W.dom.setStyle(X,"text-decoration",Y)}else{if(W.dom.getStyle(X,"textdecoration")===Y){W.dom.setStyle(X,"text-decoration",null)}}}};function U(aa,ah,ac){var ad=S(aa),ai=ad[0],ag,Y,af,ae=q.isCollapsed();function X(am,al){al=al||ai;if(am){if(al.onformat){al.onformat(am,al,ah,ac)}Q(al.styles,function(ao,an){c.setStyle(am,an,r(ao,ah))});Q(al.attributes,function(ao,an){c.setAttrib(am,an,r(ao,ah))});Q(al.classes,function(an){an=r(an,ah);if(!c.hasClass(am,an)){c.addClass(am,an)}})}}function ab(){function an(au,ar){var at=new t(ar);for(ac=at.current();ac;ac=at.prev()){if(ac.childNodes.length>1||ac==au){return ac}}}var am=W.selection.getRng();var aq=am.startContainer;var al=am.endContainer;if(aq!=al&&am.endOffset==0){var ap=an(aq,al);var ao=ap.nodeType==3?ap.length:ap.childNodes.length;am.setEnd(ap,ao)}return am}function Z(ao,au,ar,aq,am){var al=[],an=-1,at,aw=-1,ap=-1,av;Q(ao.childNodes,function(ay,ax){if(ay.nodeName==="UL"||ay.nodeName==="OL"){an=ax;at=ay;return false}});Q(ao.childNodes,function(ay,ax){if(ay.nodeName==="SPAN"&&c.getAttrib(ay,"data-mce-type")=="bookmark"){if(ay.id==au.id+"_start"){aw=ax}else{if(ay.id==au.id+"_end"){ap=ax}}}});if(an<=0||(aw<an&&ap>an)){Q(a.grep(ao.childNodes),am);return 0}else{av=c.clone(ar,T);Q(a.grep(ao.childNodes),function(ay,ax){if((aw<an&&ax<an)||(aw>an&&ax>an)){al.push(ay);ay.parentNode.removeChild(ay)}});if(aw<an){ao.insertBefore(av,at)}else{if(aw>an){ao.insertBefore(av,at.nextSibling)}}aq.push(av);Q(al,function(ax){av.appendChild(ax)});return av}}function aj(am,ao,ar){var al=[],aq,an,ap=true;aq=ai.inline||ai.block;an=c.create(aq);X(an);L.walk(am,function(at){var au;function av(aw){var aB,az,ax,ay,aA;aA=ap;aB=aw.nodeName.toLowerCase();az=aw.parentNode.nodeName.toLowerCase();if(aw.nodeType===1&&x(aw)){aA=ap;ap=x(aw)==="true";ay=true}if(g(aB,"br")){au=0;if(ai.block){c.remove(aw)}return}if(ai.wrapper&&y(aw,aa,ah)){au=0;return}if(ap&&!ay&&ai.block&&!ai.wrapper&&H(aB)){aw=c.rename(aw,aq);X(aw);al.push(aw);au=0;return}if(ai.selector){Q(ad,function(aC){if("collapsed" in aC&&aC.collapsed!==ae){return}if(c.is(aw,aC.selector)&&!b(aw)){X(aw,aC);ax=true}});if(!ai.inline||ax){au=0;return}}if(ap&&!ay&&d(aq,aB)&&d(az,aq)&&!(!ar&&aw.nodeType===3&&aw.nodeValue.length===1&&aw.nodeValue.charCodeAt(0)===65279)&&!b(aw)){if(!au){au=c.clone(an,T);aw.parentNode.insertBefore(au,aw);al.push(au)}au.appendChild(aw)}else{if(aB=="li"&&ao){au=Z(aw,ao,an,al,av)}else{au=0;Q(a.grep(aw.childNodes),av);if(ay){ap=aA}au=0}}}Q(at,av)});if(ai.wrap_links===false){Q(al,function(at){function au(ay){var ax,aw,av;if(ay.nodeName==="A"){aw=c.clone(an,T);al.push(aw);av=a.grep(ay.childNodes);for(ax=0;ax<av.length;ax++){aw.appendChild(av[ax])}ay.appendChild(aw)}Q(a.grep(ay.childNodes),au)}au(at)})}Q(al,function(av){var at;function aw(ay){var ax=0;Q(ay.childNodes,function(az){if(!f(az)&&!I(az)){ax++}});return ax}function au(ax){var az,ay;Q(ax.childNodes,function(aA){if(aA.nodeType==1&&!I(aA)&&!b(aA)){az=aA;return T}});if(az&&h(az,ai)){ay=c.clone(az,T);X(ay);c.replace(ay,ax,C);c.remove(az,1)}return ay||ax}at=aw(av);if((al.length>1||!G(av))&&at===0){c.remove(av,1);return}if(ai.inline||ai.wrapper){if(!ai.exact&&at===1){av=au(av)}Q(ad,function(ax){Q(c.select(ax.inline,av),function(az){var ay;if(ax.wrap_links===false){ay=az.parentNode;do{if(ay.nodeName==="A"){return}}while(ay=ay.parentNode)}V(ax,ah,az,ax.exact?az:null)})});if(y(av.parentNode,aa,ah)){c.remove(av,1);av=0;return C}if(ai.merge_with_parents){c.getParent(av.parentNode,function(ax){if(y(ax,aa,ah)){c.remove(av,1);av=0;return C}})}if(av&&ai.merge_siblings!==false){av=u(D(av),av);av=u(av,D(av,C))}}})}if(ai){if(ac){if(ac.nodeType){Y=c.createRng();Y.setStartBefore(ac);Y.setEndAfter(ac);aj(o(Y,ad),null,true)}else{aj(ac,null,true)}}else{if(!ae||!ai.inline||c.select("td.mceSelected,th.mceSelected").length){var ak=W.selection.getNode();if(!l&&ad[0].defaultBlock&&!c.getParent(ak,c.isBlock)){U(ad[0].defaultBlock)}W.selection.setRng(ab());ag=q.getBookmark();aj(o(q.getRng(C),ad),ag);if(ai.styles&&(ai.styles.color||ai.styles.textDecoration)){a.walk(ak,J,"childNodes");J(ak)}q.moveToBookmark(ag);O(q.getRng(C));W.nodeChanged()}else{R("apply",aa,ah)}}}}function B(Z,ai,ab){var ac=S(Z),ak=ac[0],ag,af,Y,ah=true;function aa(aq){var ap,ao,an,am,at,ar;if(aq.nodeType===1&&x(aq)){at=ah;ah=x(aq)==="true";ar=true}ap=a.grep(aq.childNodes);if(ah&&!ar){for(ao=0,an=ac.length;ao<an;ao++){if(V(ac[ao],ai,aq,aq)){break}}}if(ak.deep){if(ap.length){for(ao=0,an=ap.length;ao<an;ao++){aa(ap[ao])}if(ar){ah=at}}}}function ad(am){var an;Q(m(am.parentNode).reverse(),function(ao){var ap;if(!an&&ao.id!="_start"&&ao.id!="_end"){ap=y(ao,Z,ai);if(ap&&ap.split!==false){an=ao}}});return an}function X(ap,am,ar,av){var aw,au,at,ao,aq,an;if(ap){an=ap.parentNode;for(aw=am.parentNode;aw&&aw!=an;aw=aw.parentNode){au=c.clone(aw,T);for(aq=0;aq<ac.length;aq++){if(V(ac[aq],ai,au,au)){au=0;break}}if(au){if(at){au.appendChild(at)}if(!ao){ao=au}at=au}}if(av&&(!ak.mixed||!G(ap))){am=c.split(ap,am)}if(at){ar.parentNode.insertBefore(at,ar);ao.appendChild(ar)}}return am}function aj(am){return X(ad(am),am,am,true)}function ae(ao){var an=c.get(ao?"_start":"_end"),am=an[ao?"firstChild":"lastChild"];if(I(am)){am=am[ao?"firstChild":"lastChild"]}c.remove(an,true);return am}function al(am){var an,ao;am=o(am,ac,C);if(ak.split){an=K(am,C);ao=K(am);if(an!=ao){an=P(an,"span",{id:"_start","data-mce-type":"bookmark"});ao=P(ao,"span",{id:"_end","data-mce-type":"bookmark"});aj(an);aj(ao);an=ae(C);ao=ae()}else{an=ao=aj(an)}am.startContainer=an.parentNode;am.startOffset=s(an);am.endContainer=ao.parentNode;am.endOffset=s(ao)+1}L.walk(am,function(ap){Q(ap,function(aq){aa(aq);if(aq.nodeType===1&&W.dom.getStyle(aq,"text-decoration")==="underline"&&aq.parentNode&&i(aq.parentNode)==="underline"){V({deep:false,exact:true,inline:"span",styles:{textDecoration:"underline"}},null,aq)}})})}if(ab){if(ab.nodeType){Y=c.createRng();Y.setStartBefore(ab);Y.setEndAfter(ab);al(Y)}else{al(ab)}return}if(!q.isCollapsed()||!ak.inline||c.select("td.mceSelected,th.mceSelected").length){ag=q.getBookmark();al(q.getRng(C));q.moveToBookmark(ag);if(ak.inline&&j(Z,ai,q.getStart())){O(q.getRng(true))}W.nodeChanged()}else{R("remove",Z,ai)}}function E(Y,aa,Z){var X=S(Y);if(j(Y,aa,Z)&&(!("toggle" in X[0])||X[0]["toggle"])){B(Y,aa,Z)}else{U(Y,aa,Z)}}function y(Y,X,ad,ab){var Z=S(X),ae,ac,aa;function af(aj,al,am){var ai,ak,ag=al[am],ah;if(al.onmatch){return al.onmatch(aj,al,am)}if(ag){if(ag.length===p){for(ai in ag){if(ag.hasOwnProperty(ai)){if(am==="attributes"){ak=c.getAttrib(aj,ai)}else{ak=M(aj,ai)}if(ab&&!ak&&!al.exact){return}if((!ab||al.exact)&&!g(ak,r(ag[ai],ad))){return}}}}else{for(ah=0;ah<ag.length;ah++){if(am==="attributes"?c.getAttrib(aj,ag[ah]):M(aj,ag[ah])){return al}}}}return al}if(Z&&Y){for(ac=0;ac<Z.length;ac++){ae=Z[ac];if(h(Y,ae)&&af(Y,ae,"attributes")&&af(Y,ae,"styles")){if(aa=ae.classes){for(ac=0;ac<aa.length;ac++){if(!c.hasClass(Y,aa[ac])){return}}}return ae}}}}function j(Z,ab,aa){var Y;function X(ac){ac=c.getParent(ac,function(ad){return !!y(ad,Z,ab,true)});return y(ac,Z,ab)}if(aa){return X(aa)}aa=q.getNode();if(X(aa)){return C}Y=q.getStart();if(Y!=aa){if(X(Y)){return C}}return T}function v(ae,ad){var ab,ac=[],aa={},Z,Y,X;ab=q.getStart();c.getParent(ab,function(ah){var ag,af;for(ag=0;ag<ae.length;ag++){af=ae[ag];if(!aa[af]&&y(ah,af,ad)){aa[af]=true;ac.push(af)}}});return ac}function z(ab){var ad=S(ab),aa,Z,ac,Y,X;if(ad){aa=q.getStart();Z=m(aa);for(Y=ad.length-1;Y>=0;Y--){X=ad[Y].selector;if(!X){return C}for(ac=Z.length-1;ac>=0;ac--){if(c.is(Z[ac],X)){return C}}}}return T}a.extend(this,{get:S,register:k,apply:U,remove:B,toggle:E,match:j,matchAll:v,matchNode:y,canApply:z});function h(X,Y){if(g(X,Y.inline)){return C}if(g(X,Y.block)){return C}if(Y.selector){return c.is(X,Y.selector)}}function g(Y,X){Y=Y||"";X=X||"";Y=""+(Y.nodeName||Y);X=""+(X.nodeName||X);return Y.toLowerCase()==X.toLowerCase()}function M(Y,X){var Z=c.getStyle(Y,X);if(X=="color"||X=="backgroundColor"){Z=c.toHex(Z)}if(X=="fontWeight"&&Z==700){Z="bold"}return""+Z}function r(X,Y){if(typeof(X)!="string"){X=X(Y)}else{if(Y){X=X.replace(/%(\w+)/g,function(aa,Z){return Y[Z]||aa})}}return X}function f(X){return X&&X.nodeType===3&&/^([\t \r\n]+|)$/.test(X.nodeValue)}function P(Z,Y,X){var aa=c.create(Y,X);Z.parentNode.insertBefore(aa,Z);aa.appendChild(Z);return aa}function o(X,ai,aa){var al,aj,ad,Z=X.startContainer,ae=X.startOffset,an=X.endContainer,ag=X.endOffset,al,aj,ad,ah;function ak(au){var ao,ar,at,aq,ap;ao=ar=au?Z:an;ap=au?"previousSibling":"nextSibling";root=c.getRoot();if(ao.nodeType==3&&!f(ao)){if(au?ae>0:ag<ao.nodeValue.length){return ao}}for(;;){if(!ai[0].block_expand&&G(ar)){return ar}for(aq=ar[ap];aq;aq=aq[ap]){if(!I(aq)&&!f(aq)){return ar}}if(ar.parentNode==root){ao=ar;break}ar=ar.parentNode}return ao}function ac(ao,ap){if(ap===p){ap=ao.nodeType===3?ao.length:ao.childNodes.length}while(ao&&ao.hasChildNodes()){ao=ao.childNodes[ap];if(ao){ap=ao.nodeType===3?ao.length:ao.childNodes.length}}return{node:ao,offset:ap}}if(Z.nodeType==1&&Z.hasChildNodes()){aj=Z.childNodes.length-1;Z=Z.childNodes[ae>aj?aj:ae];if(Z.nodeType==3){ae=0}}if(an.nodeType==1&&an.hasChildNodes()){aj=an.childNodes.length-1;an=an.childNodes[ag>aj?aj:ag-1];if(an.nodeType==3){ag=an.nodeValue.length}}function am(ap){var ao=ap;while(ao){if(ao.nodeType===1&&x(ao)){return x(ao)==="false"?ao:ap}ao=ao.parentNode}return ap}Z=am(Z);an=am(an);if(I(Z.parentNode)||I(Z)){Z=I(Z)?Z:Z.parentNode;Z=Z.nextSibling||Z;if(Z.nodeType==3){ae=0}}if(I(an.parentNode)||I(an)){an=I(an)?an:an.parentNode;an=an.previousSibling||an;if(an.nodeType==3){ag=an.length}}if(ai[0].inline){if(X.collapsed){function af(ap,au,aw){var at,aq,av,ao;function ar(ay,aA){var aB,ax,az=ay.nodeValue;if(typeof(aA)=="undefined"){aA=aw?az.length:0}if(aw){aB=az.lastIndexOf(" ",aA);ax=az.lastIndexOf("\u00a0",aA);aB=aB>ax?aB:ax;if(aB!==-1&&!aa){aB++}}else{aB=az.indexOf(" ",aA);ax=az.indexOf("\u00a0",aA);aB=aB!==-1&&(ax===-1||aB<ax)?aB:ax}return aB}if(ap.nodeType===3){av=ar(ap,au);if(av!==-1){return{container:ap,offset:av}}ao=ap}at=new t(ap,c.getParent(ap,G)||W.getBody());while(aq=at[aw?"prev":"next"]()){if(aq.nodeType===3){ao=aq;av=ar(aq);if(av!==-1){return{container:aq,offset:av}}}else{if(G(aq)){break}}}if(ao){if(aw){au=0}else{au=ao.length}return{container:ao,offset:au}}}ah=af(Z,ae,true);if(ah){Z=ah.container;ae=ah.offset}ah=af(an,ag);if(ah){an=ah.container;ag=ah.offset}}ad=ac(an,ag);if(ad.node){while(ad.node&&ad.offset===0&&ad.node.previousSibling){ad=ac(ad.node.previousSibling)}if(ad.node&&ad.offset>0&&ad.node.nodeType===3&&ad.node.nodeValue.charAt(ad.offset-1)===" "){if(ad.offset>1){an=ad.node;an.splitText(ad.offset-1)}else{if(ad.node.previousSibling){}}}}}if(ai[0].inline||ai[0].block_expand){if(!ai[0].inline||(Z.nodeType!=3||ae===0)){Z=ak(true)}if(!ai[0].inline||(an.nodeType!=3||ag===an.nodeValue.length)){an=ak()}}if(ai[0].selector&&ai[0].expand!==T&&!ai[0].inline){function ab(ap,ao){var aq,ar,au,at;if(ap.nodeType==3&&ap.nodeValue.length==0&&ap[ao]){ap=ap[ao]}aq=m(ap);for(ar=0;ar<aq.length;ar++){for(au=0;au<ai.length;au++){at=ai[au];if("collapsed" in at&&at.collapsed!==X.collapsed){continue}if(c.is(aq[ar],at.selector)){return aq[ar]}}}return ap}Z=ab(Z,"previousSibling");an=ab(an,"nextSibling")}if(ai[0].block||ai[0].selector){function Y(ap,ao,ar){var aq;if(!ai[0].wrapper){aq=c.getParent(ap,ai[0].block)}if(!aq){aq=c.getParent(ap.nodeType==3?ap.parentNode:ap,G)}if(aq&&ai[0].wrapper){aq=m(aq,"ul,ol").reverse()[0]||aq}if(!aq){aq=ap;while(aq[ao]&&!G(aq[ao])){aq=aq[ao];if(g(aq,"br")){break}}}return aq||ap}Z=Y(Z,"previousSibling");an=Y(an,"nextSibling");if(ai[0].block){if(!G(Z)){Z=ak(true)}if(!G(an)){an=ak()}}}if(Z.nodeType==1){ae=s(Z);Z=Z.parentNode}if(an.nodeType==1){ag=s(an)+1;an=an.parentNode}return{startContainer:Z,startOffset:ae,endContainer:an,endOffset:ag}}function V(ad,ac,aa,X){var Z,Y,ab;if(!h(aa,ad)){return T}if(ad.remove!="all"){Q(ad.styles,function(af,ae){af=r(af,ac);if(typeof(ae)==="number"){ae=af;X=0}if(!X||g(M(X,ae),af)){c.setStyle(aa,ae,"")}ab=1});if(ab&&c.getAttrib(aa,"style")==""){aa.removeAttribute("style");aa.removeAttribute("data-mce-style")}Q(ad.attributes,function(ag,ae){var af;ag=r(ag,ac);if(typeof(ae)==="number"){ae=ag;X=0}if(!X||g(c.getAttrib(X,ae),ag)){if(ae=="class"){ag=c.getAttrib(aa,ae);if(ag){af="";Q(ag.split(/\s+/),function(ah){if(/mce\w+/.test(ah)){af+=(af?" ":"")+ah}});if(af){c.setAttrib(aa,ae,af);return}}}if(ae=="class"){aa.removeAttribute("className")}if(e.test(ae)){aa.removeAttribute("data-mce-"+ae)}aa.removeAttribute(ae)}});Q(ad.classes,function(ae){ae=r(ae,ac);if(!X||c.hasClass(X,ae)){c.removeClass(aa,ae)}});Y=c.getAttribs(aa);for(Z=0;Z<Y.length;Z++){if(Y[Z].nodeName.indexOf("_")!==0){return T}}}if(ad.remove!="none"){n(aa,ad);return C}}function n(Z,aa){var X=Z.parentNode,Y;if(aa.block){if(!l){function ab(ad,ac,ae){ad=D(ad,ac,ae);return !ad||(ad.nodeName=="BR"||G(ad))}if(G(Z)&&!G(X)){if(!ab(Z,T)&&!ab(Z.firstChild,C,1)){Z.insertBefore(c.create("br"),Z.firstChild)}if(!ab(Z,C)&&!ab(Z.lastChild,T,1)){Z.appendChild(c.create("br"))}}}else{if(X==c.getRoot()){if(!aa.list_block||!g(Z,aa.list_block)){Q(a.grep(Z.childNodes),function(ac){if(d(l,ac.nodeName.toLowerCase())){if(!Y){Y=P(ac,l)}else{Y.appendChild(ac)}}else{Y=0}})}}}}if(aa.selector&&aa.inline&&!g(aa.inline,Z)){return}c.remove(Z,1)}function D(Y,X,Z){if(Y){X=X?"nextSibling":"previousSibling";for(Y=Z?Y:Y[X];Y;Y=Y[X]){if(Y.nodeType==1||!f(Y)){return Y}}}}function I(X){return X&&X.nodeType==1&&X.getAttribute("data-mce-type")=="bookmark"}function u(ab,aa){var X,Z,Y;function ad(ag,af){if(ag.nodeName!=af.nodeName){return T}function ae(ai){var aj={};Q(c.getAttribs(ai),function(ak){var al=ak.nodeName.toLowerCase();if(al.indexOf("_")!==0&&al!=="style"){aj[al]=c.getAttrib(ai,al)}});return aj}function ah(al,ak){var aj,ai;for(ai in al){if(al.hasOwnProperty(ai)){aj=ak[ai];if(aj===p){return T}if(al[ai]!=aj){return T}delete ak[ai]}}for(ai in ak){if(ak.hasOwnProperty(ai)){return T}}return C}if(!ah(ae(ag),ae(af))){return T}if(!ah(c.parseStyle(c.getAttrib(ag,"style")),c.parseStyle(c.getAttrib(af,"style")))){return T}return C}if(ab&&aa){function ac(af,ae){for(Z=af;Z;Z=Z[ae]){if(Z.nodeType==3&&Z.nodeValue.length!==0){return af}if(Z.nodeType==1&&!I(Z)){return Z}}return af}ab=ac(ab,"previousSibling");aa=ac(aa,"nextSibling");if(ad(ab,aa)){for(Z=ab.nextSibling;Z&&Z!=aa;){Y=Z;Z=Z.nextSibling;ab.appendChild(Y)}c.remove(aa);Q(a.grep(aa.childNodes),function(ae){ab.appendChild(ae)});return ab}}return aa}function H(X){return/^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(X)}function K(Y,ac){var X,ab,Z,aa;X=Y[ac?"startContainer":"endContainer"];ab=Y[ac?"startOffset":"endOffset"];if(X.nodeType==1){Z=X.childNodes.length-1;if(!ac&&ab){ab--}X=X.childNodes[ab>Z?Z:ab]}if(X.nodeType===3&&ac&&ab>=X.nodeValue.length){X=new t(X,W.getBody()).next()||X}if(X.nodeType===3&&!ac&&ab==0){X=new t(X,W.getBody()).prev()||X}return X}function R(ag,X,ae){var ah="_mce_caret",Y=W.settings.caret_debug;function Z(ak){var aj=c.create("span",{id:ah,"data-mce-bogus":true,style:Y?"color:red":""});if(ak){aj.appendChild(W.getDoc().createTextNode(F))}return aj}function af(ak,aj){while(ak){if((ak.nodeType===3&&ak.nodeValue!==F)||ak.childNodes.length>1){return false}if(aj&&ak.nodeType===1){aj.push(ak)}ak=ak.firstChild}return true}function ac(aj){while(aj){if(aj.id===ah){return aj}aj=aj.parentNode}}function ab(aj){var ak;if(aj){ak=new t(aj,aj);for(aj=ak.current();aj;aj=ak.next()){if(aj.nodeType===3){return aj}}}}function aa(al,ak){var am,aj;if(!al){al=ac(q.getStart());if(!al){while(al=c.get(ah)){aa(al,false)}}}else{aj=q.getRng(true);if(af(al)){if(ak!==false){aj.setStartBefore(al);aj.setEndBefore(al)}c.remove(al)}else{am=ab(al);if(am.nodeValue.charAt(0)===F){am=am.deleteData(0,1)}c.remove(al,1)}q.setRng(aj)}}function ad(){var al,aj,ap,ao,am,ak,an;al=q.getRng(true);ao=al.startOffset;ak=al.startContainer;an=ak.nodeValue;aj=ac(q.getStart());if(aj){ap=ab(aj)}if(an&&ao>0&&ao<an.length&&/\w/.test(an.charAt(ao))&&/\w/.test(an.charAt(ao-1))){am=q.getBookmark();al.collapse(true);al=o(al,S(X));al=L.split(al);U(X,ae,al);q.moveToBookmark(am)}else{if(!aj||ap.nodeValue!==F){aj=Z(true);ap=aj.firstChild;al.insertNode(aj);ao=1;U(X,ae,aj)}else{U(X,ae,aj)}q.setCursorLocation(ap,ao)}}function ai(){var aj=q.getRng(true),ak,am,ap,ao,al,at,ar=[],an,aq;ak=aj.startContainer;am=aj.startOffset;al=ak;if(ak.nodeType==3){if(am!=ak.nodeValue.length||ak.nodeValue===F){ao=true}al=al.parentNode}while(al){if(y(al,X,ae)){at=al;break}if(al.nextSibling){ao=true}ar.push(al);al=al.parentNode}if(!at){return}if(ao){ap=q.getBookmark();aj.collapse(true);aj=o(aj,S(X),true);aj=L.split(aj);B(X,ae,aj);q.moveToBookmark(ap)}else{aq=Z();al=aq;for(an=ar.length-1;an>=0;an--){al.appendChild(c.clone(ar[an],false));al=al.firstChild}al.appendChild(c.doc.createTextNode(F));al=al.firstChild;c.insertAfter(aq,at);q.setCursorLocation(al,1)}}if(!self._hasCaretEvents){W.onBeforeGetContent.addToTop(function(){var aj=[],ak;if(af(ac(q.getStart()),aj)){ak=aj.length;while(ak--){c.setAttrib(aj[ak],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(aj){W[aj].addToTop(function(){aa()})});W.onKeyDown.addToTop(function(aj,al){var ak=al.keyCode;if(ak==8||ak==37||ak==39){aa(ac(q.getStart()))}});self._hasCaretEvents=true}if(ag=="apply"){ad()}else{ai()}}function O(Y){var X=Y.startContainer,ad=Y.startOffset,ac,ab,Z,aa;if(X.nodeType==3&&ad>=X.nodeValue.length){X=X.parentNode;ad=s(X)+1}if(X.nodeType==1){Z=X.childNodes;X=Z[Math.min(ad,Z.length-1)];ac=new t(X,c.getParent(X,c.isBlock));if(ad>Z.length-1){ac.next()}for(ab=ac.current();ab;ab=ac.next()){if(ab.nodeType==3&&!f(ab)){aa=c.create("a",null,F);ab.parentNode.insertBefore(aa,ab);Y.setStart(ab,0);q.setRng(Y);c.remove(aa);return}}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;if(c.inline_styles){h=e.explode(c.font_size_legacy_values);function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});(function(b){var a=b.dom.TreeWalker;b.EnterKey=function(e){var h=e.dom,d=e.selection,c=e.settings,g=e.undoManager;function f(x){var t=d.getRng(true),A,v,s,n,m,i,k,r,C,u;function z(E){return E&&h.isBlock(E)&&!/^(TD|TH|CAPTION)$/.test(E.nodeName)&&!/^(fixed|absolute)/i.test(E.style.position)}function l(F){var J,H,E,K,I,G=F;E=h.createRng();if(F.hasChildNodes()){J=new a(F,F);while(H=J.current()){if(H.nodeType==3){E.setStart(H,0);E.setEnd(H,0);break}if(/^(BR|IMG)$/.test(H.nodeName)){E.setStartBefore(H);E.setEndBefore(H);break}G=H;H=J.next()}if(!H){E.setStart(G,0);E.setEnd(G,0)}}else{if(F.nodeName=="BR"){E.setStartAfter(F);E.setEndAfter(F)}else{E.setStart(F,0);E.setEnd(F,0)}}d.setRng(E);I=h.getViewPort(e.getWin());K=h.getPos(F).y;if(K<I.y||K+25>I.y+I.h){e.getWin().scrollTo(0,K<I.y?K:K-I.h+25)}}function p(F){var G=v,I,H,E;I=F?h.create(F):n.cloneNode(false);E=I;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(G.nodeName)){H=G.cloneNode(false);h.setAttrib(H,"id","");if(I.hasChildNodes()){H.appendChild(I.firstChild);I.appendChild(H)}else{E=H;I.appendChild(H)}}}while(G=G.parentNode);if(!b.isIE){E.innerHTML="<br>"}return I}function o(G){var F,E;if(v.nodeType==3&&(G?s>0:s<v.nodeValue.length)){return false}F=new a(v,n);while(E=(G?F.prev():F.next())){if(E.nodeType===1){if(E.getAttribute("data-mce-bogus")){continue}name=E.nodeName.toLowerCase();if(name==="IMG"){return false}}else{if(E.nodeType===3&&!/^[ \t\r\n]*$/.test(E.nodeValue)){return false}}}return true}function j(E,J){var K,I,F,H,G;I=h.getParent(E,h.isBlock);if(u&&!x.shiftKey&&(!I||!z(I))){I=I||h.getRoot();if(!I.hasChildNodes()){K=h.create(u);I.appendChild(K);t.setStart(K,0);t.setEnd(K,0);return K}H=E;while(H.parentNode!=I){H=H.parentNode}while(H&&!h.isBlock(H)){F=H;H=H.previousSibling}if(F){K=h.create(u);F.parentNode.insertBefore(K,F);H=F;while(H&&!h.isBlock(H)){G=H.nextSibling;K.appendChild(H);H=G}t.setStart(E,J);t.setEnd(E,J)}}return E}function B(){function E(G){var F=k[G?"firstChild":"lastChild"];while(F){if(F.nodeType==1){break}F=F[G?"nextSibling":"previousSibling"]}return F===n}m=u?p(u):h.create("BR");if(E(true)&&E()){h.replace(m,k)}else{if(E(true)){k.parentNode.insertBefore(m,k)}else{if(E()){h.insertAfter(m,k)}else{A=t.cloneRange();A.setStartAfter(n);A.setEndAfter(k);i=A.extractContents();h.insertAfter(i,k);h.insertAfter(m,k)}}}h.remove(n);l(m);g.add()}function y(){var F=new a(v,n),E;while(E=F.current()){if(E.nodeName=="BR"){return true}E=F.next()}}function D(){var G,F,E;if(v&&v.nodeType==3&&s>=v.nodeValue.length){if(!b.isIE&&!y()){G=h.create("br");t.insertNode(G);t.setStartAfter(G);t.setEndAfter(G);F=true}}G=h.create("br");t.insertNode(G);E=h.doc.documentMode;if(b.isIE&&r=="PRE"&&(!E||E<8)){G.parentNode.insertBefore(h.doc.createTextNode("\r"),G)}if(!F){t.setStartAfter(G);t.setEndAfter(G)}else{t.setStartBefore(G);t.setEndBefore(G)}d.setRng(t);g.add()}function q(E){do{if(E.nodeType===3){E.nodeValue=E.nodeValue.replace(/^[\r\n]+/,"")}E=E.firstChild}while(E)}if(!t.collapsed){e.execCommand("Delete");return}if(x.isDefaultPrevented()){return}v=t.startContainer;s=t.startOffset;u=c.forced_root_block;u=u?u.toUpperCase():"";if(v.nodeType==1&&v.hasChildNodes()){v=v.childNodes[Math.min(s,v.childNodes.length-1)]||v;s=0}g.beforeChange();v=j(v,s);n=h.getParent(v,h.isBlock);k=n?h.getParent(n.parentNode,h.isBlock):null;r=n?n.nodeName.toUpperCase():"";C=k?k.nodeName.toUpperCase():"";if(r=="LI"&&h.isEmpty(n)){if(/^(UL|OL|LI)$/.test(k.parentNode.nodeName)){return false}B();return}if(r=="PRE"&&c.br_in_pre!==false){if(!x.shiftKey){D();return}}else{if((!u&&!x.shiftKey&&r!="LI")||(u&&x.shiftKey)){D();return}}u=u||"P";if(o()){if(/^(H[1-6]|PRE)$/.test(r)&&C!="HGROUP"){m=p(u)}else{m=p()}if(c.end_container_on_empty_block&&z(k)&&h.isEmpty(n)){m=h.split(k,n)}else{h.insertAfter(m,n)}}else{if(o(true)){m=n.parentNode.insertBefore(p(),n)}else{A=t.cloneRange();A.setEndAfter(n);i=A.extractContents();q(i);m=i.firstChild;h.insertAfter(i,n)}}h.setAttrib(m,"id","");l(m);g.add()}e.onKeyDown.add(function(j,i){if(i.keyCode==13){if(f(i)!==false){i.preventDefault()}}})}})(tinymce);
\ No newline at end of file
+(function(e){var a=/^\s*|\s*$/g,b,d="B".replace(/A(.)|B/,"$1")==="$1";var c={majorVersion:"3",minorVersion:"5.0.1",releaseDate:"2012-05-10",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=e.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(e.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m<f.length;m++){r=f[m].href;if(r){if(/^https?:\/\/[^\/]+$/.test(r)){r+="/"}k=r?r.match(/.*\//)[0]:""}}function h(i){if(i.src&&/tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(i.src)){if(/_(src|dev)\.js/g.test(i.src)){s.suffix="_src"}if((j=i.src.indexOf("?"))!=-1){s.query=i.src.substring(j+1)}s.baseURL=i.src.substring(0,i.src.lastIndexOf("/"));if(k&&s.baseURL.indexOf("://")==-1&&s.baseURL.indexOf("/")!==0){s.baseURL=k+s.baseURL}return s.baseURL}return null}f=q.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}l=q.getElementsByTagName("head")[0];if(l){f=l.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}}return},is:function(g,f){if(!f){return g!==b}if(f=="array"&&(g.hasOwnProperty&&g instanceof Array)){return true}return typeof(g)==f},makeMap:function(f,j,h){var g;f=f||[];j=j||",";if(typeof(f)=="string"){f=f.split(j)}h=h||{};g=f.length;while(g--){h[f[g]]={}}return h},each:function(i,f,h){var j,g;if(!i){return 0}h=h||i;if(i.length!==b){for(j=0,g=i.length;j<g;j++){if(f.call(h,i[j],j,i)===false){return 0}}}else{for(j in i){if(i.hasOwnProperty(j)){if(f.call(h,i[j],j,i)===false){return 0}}}}return 1},map:function(g,h){var i=[];c.each(g,function(f){i.push(h(f))});return i},grep:function(g,h){var i=[];c.each(g,function(f){if(!h||h(f)){i.push(f)}});return i},inArray:function(g,h){var j,f;if(g){for(j=0,f=g.length;j<f;j++){if(g[j]===h){return j}}}return -1},extend:function(n,k){var j,f,h,g=arguments,m;for(j=1,f=g.length;j<f;j++){k=g[j];for(h in k){if(k.hasOwnProperty(h)){m=k[h];if(m!==b){n[h]=m}}}}return n},trim:function(f){return(f?""+f:"").replace(a,"")},create:function(o,f,j){var n=this,g,i,k,l,h,m=0;o=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(o);k=o[3].match(/(^|\.)(\w+)$/i)[2];i=n.createNS(o[3].replace(/\.\w+$/,""),j);if(i[k]){return}if(o[2]=="static"){i[k]=f;if(this.onCreate){this.onCreate(o[2],o[3],i[k])}return}if(!f[k]){f[k]=function(){};m=1}i[k]=f[k];n.extend(i[k].prototype,f);if(o[5]){g=n.resolve(o[5]).prototype;l=o[5].match(/\.(\w+)$/i)[1];h=i[k];if(m){i[k]=function(){return g[l].apply(this,arguments)}}else{i[k]=function(){this.parent=g[l];return h.apply(this,arguments)}}i[k].prototype[k]=i[k];n.each(g,function(p,q){i[k].prototype[q]=g[q]});n.each(f,function(p,q){if(g[q]){i[k].prototype[q]=function(){this.parent=g[q];return p.apply(this,arguments)}}else{if(q!=k){i[k].prototype[q]=p}}})}n.each(f["static"],function(p,q){i[k][q]=p});if(this.onCreate){this.onCreate(o[2],o[3],i[k].prototype)}},walk:function(i,h,j,g){g=g||this;if(i){if(j){i=i[j]}c.each(i,function(k,f){if(h.call(g,k,f,j)===false){return false}c.walk(k,h,j,g)})}},createNS:function(j,h){var g,f;h=h||e;j=j.split(".");for(g=0;g<j.length;g++){f=j[g];if(!h[f]){h[f]={}}h=h[f]}return h},resolve:function(j,h){var g,f;h=h||e;j=j.split(".");for(g=0,f=j.length;g<f;g++){h=h[j[g]];if(!h){break}}return h},addUnload:function(j,i){var h=this,g;g=function(){var f=h.unloads,l,m;if(f){for(m in f){l=f[m];if(l&&l.func){l.func.call(l.scope,1)}}if(e.detachEvent){e.detachEvent("onbeforeunload",k);e.detachEvent("onunload",g)}else{if(e.removeEventListener){e.removeEventListener("unload",g,false)}}h.unloads=l=f=w=g=0;if(e.CollectGarbage){CollectGarbage()}}};function k(){var l=document;function f(){l.detachEvent("onstop",f);if(g){g()}l=0}if(l.readyState=="interactive"){if(l){l.attachEvent("onstop",f)}e.setTimeout(function(){if(l){l.detachEvent("onstop",f)}},0)}}j={func:j,scope:i||this};if(!h.unloads){if(e.attachEvent){e.attachEvent("onunload",g);e.attachEvent("onbeforeunload",k)}else{if(e.addEventListener){e.addEventListener("unload",g,false)}}h.unloads=[j]}else{h.unloads.push(j)}return j},removeUnload:function(i){var g=this.unloads,h=null;c.each(g,function(j,f){if(j&&j.func==i){g.splice(f,1);h=i;return false}});return h},explode:function(f,g){if(!f||c.is(f,"array")){return f}return c.map(f.split(g||","),c.trim)},_addVer:function(g){var f;if(!this.query){return g}f=(g.indexOf("?")==-1?"?":"&")+this.query;if(g.indexOf("#")==-1){return g+f}return g.replace("#",f+"#")},_replace:function(h,f,g){if(d){return g.replace(h,function(){var l=f,j=arguments,k;for(k=0;k<j.length-2;k++){if(j[k]===b){l=l.replace(new RegExp("\\$"+k,"g"),"")}else{l=l.replace(new RegExp("\\$"+k,"g"),j[k])}}return l})}return g.replace(h,f)}};c._init();e.tinymce=e.tinyMCE=c})(window);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,inDispatch:false,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(b,a){this.listeners.push({cb:b,scope:a||this.scope});return b},addToTop:function(d,b){var a=this,c={cb:d,scope:b||a.scope};if(a.inDispatch){a.listeners=[c].concat(a.listeners)}else{a.listeners.unshift(c)}return d},remove:function(c){var b=this.listeners,a=null;tinymce.each(b,function(e,d){if(c==e.cb){a=e;b.splice(d,1);return false}});return a},dispatch:function(){var a=this,e,b=arguments,c,d=a.listeners,f;a.inDispatch=true;for(c=0;c<d.length;c++){f=d[c];e=f.cb.apply(f.scope,b.length>0?b:[f.scope]);if(e===false){break}}a.inDispatch=false;return e}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,i,d,c,h;e=tinymce.trim(e);g=f.settings=g||{};if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w\-]*:?\/\//.test(e)){h=g.base_uri?g.base_uri.path:new tinymce.util.URI(location.href).directory;e=((g.base_uri&&g.base_uri.protocol)||"http")+"://mce_host"+f.toAbsPath(h,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});c=g.base_uri;if(c){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host==="mce_host"){f.port=c.port}if(!f.host||f.host==="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var d=this,f;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:d});if((b.host!="mce_host"&&d.host!=b.host&&b.host)||d.port!=b.port||d.protocol!=b.protocol){return b.getURI()}var c=d.getURI(),e=b.getURI();if(c==e||(c.charAt(c.length-1)=="/"&&c.substr(0,c.length-1)==e)){return c}f=d.toRelPath(d.path,b.path);if(b.query){f+="?"+b.query}if(b.anchor){f+="#"+b.anchor}return f},toAbsolute:function(b,c){b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f===1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=0;c--){if(f[c].length===0||f[c]==="."){continue}if(f[c]===".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!==0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();(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){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&&o instanceof Array){for(i=0,v="[";i<o.length;i++){v+=(i>0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(name in o){if(o.hasOwnProperty(name)){v+=typeof o[name]!="function"?(v.length>1?","+quote:quote)+name+quote+":"+serialize(o[name],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(b){return b.shiftKey||b.ctrlKey||b.altKey}}})(tinymce);tinymce.util.Quirks=function(d){var l=tinymce.VK,r=l.BACKSPACE,s=l.DELETE,o=d.dom,z=d.selection,q=d.settings;function c(D,C){try{d.getDoc().execCommand(D,false,C)}catch(B){}}function h(){function B(E){var C,G,D,F;C=z.getRng();G=o.getParent(C.startContainer,o.isBlock);if(E){G=o.getNext(G,o.isBlock)}if(G){D=G.firstChild;while(D&&D.nodeType==3&&D.nodeValue.length===0){D=D.nextSibling}if(D&&D.nodeName==="SPAN"){F=D.cloneNode(false)}}d.getDoc().execCommand(E?"ForwardDelete":"Delete",false,null);G=o.getParent(C.startContainer,o.isBlock);tinymce.each(o.select("span.Apple-style-span,font.Apple-style-span",G),function(H){var I=z.getBookmark();if(F){o.replace(F.cloneNode(false),H,true)}else{o.remove(H,true)}z.moveToBookmark(I)})}d.onKeyDown.add(function(C,E){var D;D=E.keyCode==s;if(!E.isDefaultPrevented()&&(D||E.keyCode==r)&&!l.modifierPressed(E)){E.preventDefault();B(D)}});d.addCommand("Delete",function(){B()})}function A(){function C(E,H){var D,G,F=H?"start":"end";D=E[F+"Container"];G=E[F+"Offset"];if(D.nodeType==1&&D.hasChildNodes()){D=D.childNodes[Math.min(H?G:(G>0?G-1:0),D.childNodes.length-1)]}return D}function B(G,K){var F,J,E,H,I=K?"start":"end",D;F=G[I+"Container"];J=G[I+"Offset"];E=o.getRoot();if(F.nodeType==1){D=J>=F.childNodes.length;F=C(G,K);if(F.nodeType==3){J=K&&!D?0:F.nodeValue.length}}if(F.nodeType==3&&((K&&J>0)||(!K&&J<F.nodeValue.length))){return false}while(F!==E){H=F.parentNode[K?"firstChild":"lastChild"];if(H.nodeName=="BR"){H=H[K?"nextSibling":"previousSibling"]||H}if(H!==F){return false}F=F.parentNode}return true}d.onKeyDown.addToTop(function(E,G){var D,F=G.keyCode;if(!G.isDefaultPrevented()&&(F==s||F==r)){D=z.getRng(true);if(B(D,true)&&B(D,false)&&(D.collapsed||o.findCommonAncestor(C(D,true),C(D))===o.getRoot())){E.setContent("");E.nodeChanged();G.preventDefault()}}})}function t(){if(!d.settings.content_editable){o.bind(d.getDoc(),"focusin",function(B){z.setRng(z.getRng())});o.bind(d.getDoc(),"mousedown",function(B){if(B.target==d.getDoc().documentElement){d.getWin().focus();z.setRng(z.getRng())}})}}function m(){d.onKeyDown.add(function(B,E){if(!E.isDefaultPrevented()&&E.keyCode===r){if(z.isCollapsed()&&z.getRng(true).startOffset===0){var D=z.getNode();var C=D.previousSibling;if(C&&C.nodeName&&C.nodeName.toLowerCase()==="hr"){o.remove(C);tinymce.dom.Event.cancel(E)}}}})}function b(){if(!Range.prototype.getClientRects){d.onMouseDown.add(function(C,D){if(D.target.nodeName==="HTML"){var B=C.getBody();B.blur();setTimeout(function(){B.focus()},0)}})}}function v(){d.onClick.add(function(B,C){C=C.target;if(/^(IMG|HR)$/.test(C.nodeName)){z.getSel().setBaseAndExtent(C,0,C,1)}if(C.nodeName=="A"&&o.hasClass(C,"mceItemAnchor")){z.select(C)}B.nodeChanged()})}function x(){function C(){var E=o.getAttribs(z.getStart().cloneNode(false));return function(){var F=z.getStart();if(F!==d.getBody()){o.setAttrib(F,"style",null);tinymce.each(E,function(G){F.setAttributeNode(G.cloneNode(true))})}}}function B(){return !z.isCollapsed()&&z.getStart()!=z.getEnd()}function D(E,F){F.preventDefault();return false}d.onKeyPress.add(function(E,G){var F;if((G.keyCode==8||G.keyCode==46)&&B()){F=C();E.getDoc().execCommand("delete",false,null);F();G.preventDefault();return false}});o.bind(d.getDoc(),"cut",function(F){var E;if(B()){E=C();d.onKeyUp.addToTop(D);setTimeout(function(){E();d.onKeyUp.remove(D)},0)}})}function i(){var C,B;o.bind(d.getDoc(),"selectionchange",function(){if(B){clearTimeout(B);B=0}B=window.setTimeout(function(){var D=z.getRng();if(!C||!tinymce.dom.RangeUtils.compareRanges(D,C)){d.nodeChanged();C=D}},50)})}function y(){document.body.setAttribute("role","application")}function u(){d.onKeyDown.add(function(B,D){if(!D.isDefaultPrevented()&&D.keyCode===r){if(z.isCollapsed()&&z.getRng(true).startOffset===0){var C=z.getNode().previousSibling;if(C&&C.nodeName&&C.nodeName.toLowerCase()==="table"){return tinymce.dom.Event.cancel(D)}}}})}function g(){var B=d.getDoc().documentMode;if(B&&B>7){return}c("RespectVisibilityInDesign",true);o.addClass(d.getBody(),"mceHideBrInPre");d.parser.addNodeFilter("pre",function(C,E){var F=C.length,H,D,I,G;while(F--){H=C[F].getAll("br");D=H.length;while(D--){I=H[D];G=I.prev;if(G&&G.type===3&&G.value.charAt(G.value-1)!="\n"){G.value+="\n"}else{I.parent.insert(new tinymce.html.Node("#text",3),I,true).value="\n"}}}});d.serializer.addNodeFilter("pre",function(C,E){var F=C.length,H,D,I,G;while(F--){H=C[F].getAll("br");D=H.length;while(D--){I=H[D];G=I.prev;if(G&&G.type==3){G.value=G.value.replace(/\r?\n$/,"")}}}})}function f(){o.bind(d.getBody(),"mouseup",function(D){var C,B=z.getNode();if(B.nodeName=="IMG"){if(C=o.getStyle(B,"width")){o.setAttrib(B,"width",C.replace(/[^0-9%]+/g,""));o.setStyle(B,"width","")}if(C=o.getStyle(B,"height")){o.setAttrib(B,"height",C.replace(/[^0-9%]+/g,""));o.setStyle(B,"height","")}}})}function p(){d.onKeyDown.add(function(H,I){var G,B,C,E,F,J,D;G=I.keyCode==s;if(!I.isDefaultPrevented()&&(G||I.keyCode==r)&&!l.modifierPressed(I)){B=z.getRng();C=B.startContainer;E=B.startOffset;D=B.collapsed;if(C.nodeType==3&&C.nodeValue.length>0&&((E===0&&!D)||(D&&E===(G?0:1)))){nonEmptyElements=H.schema.getNonEmptyElements();I.preventDefault();F=o.create("br",{id:"__tmp"});C.parentNode.insertBefore(F,C);H.getDoc().execCommand(G?"ForwardDelete":"Delete",false,null);C=z.getRng().startContainer;J=C.previousSibling;if(J&&J.nodeType==1&&!o.isBlock(J)&&o.isEmpty(J)&&!nonEmptyElements[J.nodeName.toLowerCase()]){o.remove(J)}o.remove("__tmp")}}})}function e(){d.onKeyDown.add(function(F,G){var D,C,H,B,E;if(G.isDefaultPrevented()||G.keyCode!=l.BACKSPACE){return}D=z.getRng();C=D.startContainer;H=D.startOffset;B=o.getRoot();E=C;if(!D.collapsed||H!==0){return}while(E&&E.parentNode&&E.parentNode.firstChild==E&&E.parentNode!=B){E=E.parentNode}if(E.tagName==="BLOCKQUOTE"){F.formatter.toggle("blockquote",null,E);D.setStart(C,0);D.setEnd(C,0);z.setRng(D);z.collapse(false)}})}function k(){function B(){d._refreshContentEditable();c("StyleWithCSS",false);c("enableInlineTableEditing",false);if(!q.object_resizing){c("enableObjectResizing",false)}}if(!q.readonly){d.onBeforeExecCommand.add(B);d.onMouseDown.add(B)}}function n(){function B(C,D){tinymce.each(o.select("a"),function(G){var E=G.parentNode,F=o.getRoot();if(E.lastChild===G){while(E&&!o.isBlock(E)){if(E.parentNode.lastChild!==E||E===F){return}E=E.parentNode}o.add(E,"br",{"data-mce-bogus":1})}})}d.onExecCommand.add(function(C,D){if(D==="CreateLink"){B(C)}});d.onSetContent.add(z.onSetContent.add(B))}function a(){function B(D,C){if(!D||!C.initial){d.execCommand("mceRepaint")}}d.onUndo.add(B);d.onRedo.add(B);d.onSetContent.add(B)}function j(){d.onKeyDown.add(function(B,C){if(!C.isDefaultPrevented()&&C.keyCode==8&&z.getNode().nodeName=="IMG"){C.preventDefault();B.undoManager.beforeChange();o.remove(z.getNode());B.undoManager.add()}})}u();e();A();if(tinymce.isWebKit){p();h();t();v();if(tinymce.isIDevice){i()}}if(tinymce.isIE){m();y();g();f();j()}if(tinymce.isGecko){m();b();x();k();n();a()}};(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={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"};g={'"':""","'":"'","<":"<",">":">","&":"&"};d={"<":"<",">":">","&":"&",""":'"',"'":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n<m.length;n+=2){o=String.fromCharCode(parseInt(m[n],p));if(!g[o]){l="&"+m[n+1]+";";q[o]=l;q[l]=o}}return q}}a=e("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);j.html=j.html||{};j.html.Entities={encodeRaw:function(m,l){return m.replace(l?k:b,function(n){return g[n]||n})},encodeAllRaw:function(l){return(""+l).replace(f,function(m){return g[m]||m})},encodeNumeric:function(m,l){return m.replace(l?k:b,function(n){if(n.length>1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g<j.length;g++){a[j[g]]="\uFEFF"+g;a["\uFEFF"+g]=j[g]}function c(n,q,p,i){function o(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(s){var z={},q,n,x,r,v=d.url_converter,y=d.url_converter_scope||this;function p(D,G){var F,C,B,E;F=z[D+"-top"+G];if(!F){return}C=z[D+"-right"+G];if(F!=C){return}B=z[D+"-bottom"+G];if(C!=B){return}E=z[D+"-left"+G];if(B!=E){return}z[D+G]=E;delete z[D+"-top"+G];delete z[D+"-right"+G];delete z[D+"-bottom"+G];delete z[D+"-left"+G]}function u(C){var D=z[C],B;if(!D||D.indexOf(" ")<0){return}D=D.split(" ");B=D.length;while(B--){if(D[B]!==D[0]){return false}}z[C]=D[0];return true}function A(D,C,B,E){if(!u(C)){return}if(!u(B)){return}if(!u(E)){return}z[D]=z[C]+" "+z[B]+" "+z[E];delete z[C];delete z[B];delete z[E]}function t(B){r=true;return a[B]}function i(C,B){if(r){C=C.replace(/\uFEFF[0-9]/g,function(D){return a[D]})}if(!B){C=C.replace(/\\([\'\";:])/g,"$1")}return C}function o(C,B,F,E,G,D){G=G||D;if(G){G=i(G);return"'"+G.replace(/\'/g,"\\'")+"'"}B=i(B||F||E);if(v){B=v.call(y,B,"style")}return"url('"+B.replace(/\'/g,"\\'")+"')"}if(s){s=s.replace(/\\[\"\';:\uFEFF]/g,t).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(B){return B.replace(/[;:]/g,t)});while(q=b.exec(s)){n=q[1].replace(l,"").toLowerCase();x=q[2].replace(l,"");if(n&&x.length>0){if(n==="font-weight"&&x==="700"){x="bold"}else{if(n==="color"||n==="background-color"){x=x.toLowerCase()}}x=x.replace(k,c);x=x.replace(h,o);z[n]=r?i(x,true):x}b.lastIndex=q.index+q[0].length}p("border","");p("border","-width");p("border","-color");p("border","-style");p("padding","");p("margin","");A("border","border-width","border-style","border-color");if(z.border==="medium none"){delete z.border}}return z},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u<s;u++){t=x[u];v=p[t];if(v!==e&&v.length>0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(f){var a={},e=f.makeMap,g=f.each;function d(j,i){return j.split(i||",")}function h(m,l){var j,k={};function i(n){return n.replace(/[A-Z]+/g,function(o){return i(m[o])})}for(j in m){if(m.hasOwnProperty(j)){m[j]=i(m[j])}}i(l).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(q,o,n,p){n=d(n,"|");k[o]={attributes:e(n),attributesOrder:n,children:e(p,"|",{"#comment":{}})}});return k}function b(){var i=a.html5;if(!i){i=a.html5=h({A:"id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title",B:"#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video",C:"#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video"},"html[A|manifest][body|head]head[A][base|command|link|meta|noscript|script|style|title]title[A][#]base[A|href|target][]link[A|href|rel|media|type|sizes][]meta[A|http-equiv|name|content|charset][]style[A|type|media|scoped][#]script[A|charset|type|src|defer|async][#]noscript[A][C]body[A][C]section[A][C]nav[A][C]article[A][C]aside[A][C]h1[A][B]h2[A][B]h3[A][B]h4[A][B]h5[A][B]h6[A][B]hgroup[A][h1|h2|h3|h4|h5|h6]header[A][C]footer[A][C]address[A][C]p[A][B]br[A][]pre[A][B]dialog[A][dd|dt]blockquote[A|cite][C]ol[A|start|reversed][li]ul[A][li]li[A|value][C]dl[A][dd|dt]dt[A][B]dd[A][C]a[A|href|target|ping|rel|media|type][C]em[A][B]strong[A][B]small[A][B]cite[A][B]q[A|cite][B]dfn[A][B]abbr[A][B]code[A][B]var[A][B]samp[A][B]kbd[A][B]sub[A][B]sup[A][B]i[A][B]b[A][B]mark[A][B]progress[A|value|max][B]meter[A|value|min|max|low|high|optimum][B]time[A|datetime][B]ruby[A][B|rt|rp]rt[A][B]rp[A][B]bdo[A][B]span[A][B]ins[A|cite|datetime][B]del[A|cite|datetime][B]figure[A][C|legend|figcaption]figcaption[A][C]img[A|alt|src|height|width|usemap|ismap][]iframe[A|name|src|height|width|sandbox|seamless][]embed[A|src|height|width|type][]object[A|data|type|height|width|usemap|name|form|classid][param]param[A|name|value][]details[A|open][C|legend]command[A|type|label|icon|disabled|checked|radiogroup][]menu[A|type|label][C|li]legend[A][C|B]div[A][C]source[A|src|type|media][]audio[A|src|autobuffer|autoplay|loop|controls][source]video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]hr[A][]form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]fieldset[A|disabled|form|name][C|legend]label[A|form|for][B]input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value][]button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]datalist[A][B|option]optgroup[A|disabled|label][option]option[A|disabled|selected|label|value][]textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]keygen[A|autofocus|challenge|disabled|form|keytype|name][]output[A|for|form|name][B]canvas[A|width|height][]map[A|name][B|C]area[A|shape|coords|href|alt|target|media|rel|ping|type][]mathml[A][]svg[A][]table[A|summary][caption|colgroup|thead|tfoot|tbody|tr]caption[A][C]colgroup[A|span][col]col[A|span][]thead[A][tr]tfoot[A][tr]tbody[A][tr]tr[A][th|td]th[A|headers|rowspan|colspan|scope][B]td[A|headers|rowspan|colspan][C]")}return i}function c(){var i=a.html4;if(!i){i=a.html4=h({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]")}return i}f.html.Schema=function(A){var u=this,s={},k={},j=[],D,y;var o,q,z,r,v,n,p={};function m(F,E,H){var G=A[F];if(!G){G=a[F];if(!G){G=e(E," ",e(E.toUpperCase()," "));G=f.extend(G,H);a[F]=G}}else{G=e(G,",",e(G.toUpperCase()," "))}return G}A=A||{};y=A.schema=="html5"?b():c();if(A.verify_html===false){A.valid_elements="*[*]"}if(A.valid_styles){D={};g(A.valid_styles,function(F,E){D[E]=f.explode(F)})}o=m("whitespace_elements","pre script style textarea");q=m("self_closing_elements","colgroup dd dt li options p td tfoot th thead tr");z=m("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source");r=m("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");n=m("non_empty_elements","td th iframe video audio object",z);v=m("block_elements","h1 h2 h3 h4 h5 h6 hr p div address pre form table tbody thead tfoot th tr td li ol ul caption blockquote center dl dt dd dir fieldset noscript menu isindex samp header footer article section hgroup aside nav figure");function i(E){return new RegExp("^"+E.replace(/([?+*])/g,".$1")+"$")}function C(L){var K,G,Z,V,aa,F,I,U,X,Q,Y,ac,O,J,W,E,S,H,ab,ad,P,T,N=/^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,R=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,M=/[*?+]/;if(L){L=d(L);if(s["@"]){S=s["@"].attributes;H=s["@"].attributesOrder}for(K=0,G=L.length;K<G;K++){F=N.exec(L[K]);if(F){W=F[1];Q=F[2];E=F[3];X=F[4];O={};J=[];I={attributes:O,attributesOrder:J};if(W==="#"){I.paddEmpty=true}if(W==="-"){I.removeEmpty=true}if(S){for(ad in S){O[ad]=S[ad]}J.push.apply(J,H)}if(X){X=d(X,"|");for(Z=0,V=X.length;Z<V;Z++){F=R.exec(X[Z]);if(F){U={};ac=F[1];Y=F[2].replace(/::/g,":");W=F[3];T=F[4];if(ac==="!"){I.attributesRequired=I.attributesRequired||[];I.attributesRequired.push(Y);U.required=true}if(ac==="-"){delete O[Y];J.splice(f.inArray(J,Y),1);continue}if(W){if(W==="="){I.attributesDefault=I.attributesDefault||[];I.attributesDefault.push({name:Y,value:T});U.defaultValue=T}if(W===":"){I.attributesForced=I.attributesForced||[];I.attributesForced.push({name:Y,value:T});U.forcedValue=T}if(W==="<"){U.validValues=e(T,"?")}}if(M.test(Y)){I.attributePatterns=I.attributePatterns||[];U.pattern=i(Y);I.attributePatterns.push(U)}else{if(!O[Y]){J.push(Y)}O[Y]=U}}}}if(!S&&Q=="@"){S=O;H=J}if(E){I.outputName=Q;s[E]=I}if(M.test(Q)){I.pattern=i(Q);j.push(I)}else{s[Q]=I}}}}}function t(E){s={};j=[];C(E);g(y,function(G,F){k[F]=G.children})}function l(F){var E=/^(~)?(.+)$/;if(F){g(d(F),function(J){var H=E.exec(J),I=H[1]==="~",K=I?"span":"div",G=H[2];k[G]=k[K];p[G]=K;if(!I){v[G]={}}g(k,function(L,M){if(L[K]){L[G]=L[K]}})})}}function x(F){var E=/^([+\-]?)(\w+)\[([^\]]+)\]$/;if(F){g(d(F),function(J){var I=E.exec(J),G,H;if(I){H=I[1];if(H){G=k[I[2]]}else{G=k[I[2]]={"#comment":{}}}G=k[I[2]];g(d(I[3],"|"),function(K){if(H==="-"){delete G[K]}else{G[K]={}}})}})}}function B(E){var G=s[E],F;if(G){return G}F=j.length;while(F--){G=j[F];if(G.pattern.test(E)){return G}}}if(!A.valid_elements){g(y,function(F,E){s[E]={attributes:F.attributes,attributesOrder:F.attributesOrder};k[E]=F.children});if(A.schema!="html5"){g(d("strong/b,em/i"),function(E){E=d(E,"/");s[E[1]].outputName=E[0]})}s.img.attributesDefault=[{name:"alt",value:""}];g(d("ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr,strong,em,b,i"),function(E){if(s[E]){s[E].removeEmpty=true}});g(d("p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption"),function(E){s[E].paddEmpty=true})}else{t(A.valid_elements)}l(A.custom_elements);x(A.valid_children);C(A.extended_valid_elements);x("+ol[ul|ol],+ul[ul|ol]");if(A.invalid_elements){f.each(f.explode(A.invalid_elements),function(E){if(s[E]){delete s[E]}})}if(!B("span")){C("span[!data-mce-type|*]")}u.children=k;u.styles=D;u.getBoolAttrs=function(){return r};u.getBlockElements=function(){return v};u.getShortEndedElements=function(){return z};u.getSelfClosingElements=function(){return q};u.getNonEmptyElements=function(){return n};u.getWhiteSpaceElements=function(){return o};u.isValidChild=function(E,G){var F=k[E];return !!(F&&F[G])};u.getElementRule=B;u.getCustomElements=function(){return p};u.addValidElements=C;u.setValidElements=t;u.addCustomElements=l;u.addValidChildren=x}})(tinymce);(function(a){a.html.SaxParser=function(c,e){var b=this,d=function(){};c=c||{};b.schema=e=e||new a.html.Schema();if(c.fix_self_closing!==false){c.fix_self_closing=true}a.each("comment cdata text start end pi doctype".split(" "),function(f){if(f){b[f]=c[f]||d}});b.parse=function(E){var n=this,g,G=0,I,B,A=[],N,Q,C,r,z,s,M,H,O,v,m,k,t,R,o,P,F,S,L,f,J,l,D,K,h,x=0,j=a.html.Entities.decode,y,q;function u(T){var V,U;V=A.length;while(V--){if(A[V].name===T){break}}if(V>=0){for(U=A.length-1;U>=V;U--){T=A[U];if(T.valid){n.end(T.name)}}A.length=V}}function p(U,T,Y,X,W){var Z,V;T=T.toLowerCase();Y=T in H?T:j(Y||X||W||"");if(v&&!z&&T.indexOf("data-")!==0){Z=P[T];if(!Z&&F){V=F.length;while(V--){Z=F[V];if(Z.pattern.test(T)){break}}if(V===-1){Z=null}}if(!Z){return}if(Z.validValues&&!(Y in Z.validValues)){return}}N.map[T]=Y;N.push({name:T,value:Y})}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");D=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;K={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};M=e.getShortEndedElements();J=e.getSelfClosingElements();H=e.getBoolAttrs();v=c.validate;s=c.remove_internals;y=c.fix_self_closing;q=a.isIE;o=/^:/;while(g=l.exec(E)){if(G<g.index){n.text(j(E.substr(G,g.index-G)))}if(I=g[6]){I=I.toLowerCase();if(q&&o.test(I)){I=I.substr(1)}u(I)}else{if(I=g[7]){I=I.toLowerCase();if(q&&o.test(I)){I=I.substr(1)}O=I in M;if(y&&J[I]&&A.length>0&&A[A.length-1].name===I){u(I)}if(!v||(m=e.getElementRule(I))){k=true;if(v){P=m.attributes;F=m.attributePatterns}if(R=g[8]){z=R.indexOf("data-mce-type")!==-1;if(z&&s){k=false}N=[];N.map={};R.replace(D,p)}else{N=[];N.map={}}if(v&&!z){S=m.attributesRequired;L=m.attributesDefault;f=m.attributesForced;if(f){Q=f.length;while(Q--){t=f[Q];r=t.name;h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}if(L){Q=L.length;while(Q--){t=L[Q];r=t.name;if(!(r in N.map)){h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}}if(S){Q=S.length;while(Q--){if(S[Q] in N.map){break}}if(Q===-1){k=false}}if(N.map["data-mce-bogus"]){k=false}}if(k){n.start(I,N,O)}}else{k=false}if(B=K[I]){B.lastIndex=G=g.index+g[0].length;if(g=B.exec(E)){if(k){C=E.substr(G,g.index-G)}G=g.index+g[0].length}else{C=E.substr(G);G=E.length}if(k&&C.length>0){n.text(C,true)}if(k){n.end(I)}l.lastIndex=G;continue}if(!O){if(!R||R.indexOf("/")!=R.length-1){A.push({name:I,valid:k})}else{if(k){n.end(I)}}}}else{if(I=g[1]){n.comment(I)}else{if(I=g[2]){n.cdata(I)}else{if(I=g[3]){n.doctype(I)}else{if(I=g[4]){n.pi(I,g[5])}}}}}}G=g.index+g[0].length}if(G<E.length){n.text(j(E.substr(G)))}for(Q=A.length-1;Q>=0;Q--){I=A[Q];if(I.valid){n.end(I.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h<f;h++){j=m[h];if(j.name!=="id"){k[k.length]={name:j.name,value:j.value};k.map[j.name]=j.value}}n.attributes=k}n.value=g.value;n.shortEnded=g.shortEnded;return n},wrap:function(g){var f=this;f.parent.insert(g,f);g.append(f);return f},unwrap:function(){var f=this,h,g;for(h=f.firstChild;h;){g=h.next;f.insert(h,f,true);h=g}f.remove()},remove:function(){var f=this,h=f.parent,g=f.next,i=f.prev;if(h){if(h.firstChild===f){h.firstChild=g;if(g){g.prev=null}}else{i.next=g}if(h.lastChild===f){h.lastChild=i;if(i){i.next=null}}else{g.prev=i}f.parent=f.next=f.prev=null}return f},append:function(h){var f=this,g;if(h.parent){h.remove()}g=f.lastChild;if(g){g.next=h;h.prev=g;f.lastChild=h}else{f.lastChild=f.firstChild=h}h.parent=f;return h},insert:function(h,f,i){var g;if(h.parent){h.remove()}g=f.parent||this;if(i){if(f===g.firstChild){g.firstChild=h}else{f.prev.next=h}h.prev=f.prev;h.next=f;f.prev=h}else{if(f===g.lastChild){g.lastChild=h}else{f.next.prev=h}h.next=f.next;h.prev=f;f.next=h}h.parent=g;return h},getAll:function(g){var f=this,h,i=[];for(h=f.firstChild;h;h=a(h,f)){if(h.name===g){i.push(h)}}return i},empty:function(){var g=this,f,h,j;if(g.firstChild){f=[];for(j=g.firstChild;j;j=a(j,g)){f.push(j)}h=f.length;while(h--){j=f[h];j.parent=j.firstChild=j.lastChild=j.next=j.prev=null}}g.firstChild=g.lastChild=null;return g},isEmpty:function(k){var f=this,j=f.firstChild,h,g;if(j){do{if(j.type===1){if(j.attributes.map["data-mce-bogus"]){continue}if(k[j.name]){return false}h=j.attributes.length;while(h--){g=j.attributes[h].name;if(g==="name"||g.indexOf("data-")===0){return false}}}if(j.type===8){return false}if((j.type===3&&!c.test(j.value))){return false}}while(j=a(j,f))}return true},walk:function(f){return a(this,null,f)}});d.extend(b,{create:function(g,f){var i,h;i=new b(g,e[g]||1);if(f){for(h in f){i.attr(h,f[h])}}return i}});d.html.Node=b})(tinymce);(function(b){var a=b.html.Node;b.html.DomParser=function(g,h){var f=this,e={},d=[],i={},c={};g=g||{};g.validate="validate" in g?g.validate:true;g.root_name=g.root_name||"body";f.schema=h=h||new b.html.Schema();function j(m){var o,p,x,v,z,n,q,l,t,u,k,s,y,r;s=b.makeMap("tr,td,th,tbody,thead,tfoot,table");k=h.getNonEmptyElements();for(o=0;o<m.length;o++){p=m[o];if(!p.parent){continue}v=[p];for(x=p.parent;x&&!h.isValidChild(x.name,p.name)&&!s[x.name];x=x.parent){v.push(x)}if(x&&v.length>1){v.reverse();z=n=f.filterNode(v[0].clone());for(t=0;t<v.length-1;t++){if(h.isValidChild(n.name,v[t].name)){q=f.filterNode(v[t].clone());n.append(q)}else{q=n}for(l=v[t].firstChild;l&&l!=v[t+1];){r=l.next;q.append(l);l=r}n=q}if(!z.isEmpty(k)){x.insert(z,v[0],true);x.insert(p,z)}else{x.insert(p,v[0],true)}x=v[0];if(x.isEmpty(k)||x.firstChild===x.lastChild&&x.firstChild.name==="br"){x.empty().remove()}}else{if(p.parent){if(p.name==="li"){y=p.prev;if(y&&(y.name==="ul"||y.name==="ul")){y.append(p);continue}y=p.next;if(y&&(y.name==="ul"||y.name==="ul")){y.insert(p,y.firstChild,true);continue}p.wrap(f.filterNode(new a("ul",1)));continue}if(h.isValidChild(p.parent.name,"div")&&h.isValidChild("div",p.name)){p.wrap(f.filterNode(new a("div",1)))}else{if(p.name==="style"||p.name==="script"){p.empty().remove()}else{p.unwrap()}}}}}}f.filterNode=function(m){var l,k,n;if(k in e){n=i[k];if(n){n.push(m)}else{i[k]=[m]}}l=d.length;while(l--){k=d[l].name;if(k in m.attributes.map){n=c[k];if(n){n.push(m)}else{c[k]=[m]}}}return m};f.addNodeFilter=function(k,l){b.each(b.explode(k),function(m){var n=e[m];if(!n){e[m]=n=[]}n.push(l)})};f.addAttributeFilter=function(k,l){b.each(b.explode(k),function(m){var n;for(n=0;n<d.length;n++){if(d[n].name===m){d[n].callbacks.push(l);return}}d.push({name:m,callbacks:[l]})})};f.parse=function(v,m){var n,I,B,A,D,C,x,r,F,M,z,o,E,L=[],K,t,k,y,s,p,u,q;m=m||{};i={};c={};o=b.extend(b.makeMap("script,style,head,html,body,title,meta,param"),h.getBlockElements());u=h.getNonEmptyElements();p=h.children;z=g.validate;q="forced_root_block" in m?m.forced_root_block:g.forced_root_block;s=h.getWhiteSpaceElements();E=/^[ \t\r\n]+/;t=/[ \t\r\n]+$/;k=/[ \t\r\n]+/g;y=/^[ \t\r\n]+$/;function G(){var N=I.firstChild,l,O;while(N){l=N.next;if(N.type==3||(N.type==1&&N.name!=="p"&&!o[N.name]&&!N.attr("data-mce-type"))){if(!O){O=J(q,1);I.insert(O,N);O.append(N)}else{O.append(N)}}else{O=null}N=l}}function J(l,N){var O=new a(l,N),P;if(l in e){P=i[l];if(P){P.push(O)}else{i[l]=[O]}}return O}function H(O){var P,l,N;for(P=O.prev;P&&P.type===3;){l=P.value.replace(t,"");if(l.length>0){P.value=l;P=P.prev}else{N=P.prev;P.remove();P=N}}}n=new b.html.SaxParser({validate:z,fix_self_closing:!z,cdata:function(l){B.append(J("#cdata",4)).value=l},text:function(O,l){var N;if(!K){O=O.replace(k," ");if(B.lastChild&&o[B.lastChild.name]){O=O.replace(E,"")}}if(O.length!==0){N=J("#text",3);N.raw=!!l;B.append(N).value=O}},comment:function(l){B.append(J("#comment",8)).value=l},pi:function(l,N){B.append(J(l,7)).value=N;H(B)},doctype:function(N){var l;l=B.append(J("#doctype",10));l.value=N;H(B)},start:function(l,V,O){var T,Q,P,N,R,W,U,S;P=z?h.getElementRule(l):{};if(P){T=J(P.outputName||l,1);T.attributes=V;T.shortEnded=O;B.append(T);S=p[B.name];if(S&&p[T.name]&&!S[T.name]){L.push(T)}Q=d.length;while(Q--){R=d[Q].name;if(R in V.map){F=c[R];if(F){F.push(T)}else{c[R]=[T]}}}if(o[l]){H(T)}if(!O){B=T}if(!K&&s[l]){K=true}}},end:function(l){var R,O,Q,N,P;O=z?h.getElementRule(l):{};if(O){if(o[l]){if(!K){R=B.firstChild;if(R&&R.type===3){Q=R.value.replace(E,"");if(Q.length>0){R.value=Q;R=R.next}else{N=R.next;R.remove();R=N}while(R&&R.type===3){Q=R.value;N=R.next;if(Q.length===0||y.test(Q)){R.remove();R=N}R=N}}R=B.lastChild;if(R&&R.type===3){Q=R.value.replace(t,"");if(Q.length>0){R.value=Q;R=R.prev}else{N=R.prev;R.remove();R=N}while(R&&R.type===3){Q=R.value;N=R.prev;if(Q.length===0||y.test(Q)){R.remove();R=N}R=N}}}R=B.prev;if(R&&R.type===3){Q=R.value.replace(E,"");if(Q.length>0){R.value=Q}else{R.remove()}}}if(K&&s[l]){K=false}if(O.removeEmpty||O.paddEmpty){if(B.isEmpty(u)){if(O.paddEmpty){B.empty().append(new a("#text","3")).value="\u00a0"}else{if(!B.attributes.map.name){P=B.parent;B.empty().remove();B=P;return}}}}B=B.parent}}},h);I=B=new a(m.context||g.root_name,11);n.parse(v);if(z&&L.length){if(!m.context){j(L)}else{m.invalid=true}}if(q&&I.name=="body"){G()}if(!m.invalid){for(M in i){F=e[M];A=i[M];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(D=0,C=F.length;D<C;D++){F[D](A,M,m)}}for(D=0,C=d.length;D<C;D++){F=d[D];if(F.name in c){A=c[F.name];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(x=0,r=F.callbacks.length;x<r;x++){F.callbacks[x](A,F.name,m)}}}}return I};if(g.remove_trailing_brs){f.addNodeFilter("br",function(n,m){var r,q=n.length,o,v=b.extend({},h.getBlockElements()),k=h.getNonEmptyElements(),t,s,p,u;v.body=1;for(r=0;r<q;r++){o=n[r];t=o.parent;if(v[o.parent.name]&&o===t.lastChild){p=o.prev;while(p){u=p.name;if(u!=="span"||p.attr("data-mce-type")!=="bookmark"){if(u!=="br"){break}if(u==="br"){o=null;break}}p=p.prev}if(o){o.remove();if(t.isEmpty(k)){elementRule=h.getElementRule(t.name);if(elementRule){if(elementRule.removeEmpty){t.remove()}else{if(elementRule.paddEmpty){t.empty().append(new b.html.Node("#text",3)).value="\u00a0"}}}}}}else{s=o;while(t.firstChild===s&&t.lastChild===s){s=t;if(v[t.name]){break}t=t.parent}if(s===t){textNode=new b.html.Node("#text",3);textNode.value="\u00a0";o.replace(textNode)}}}})}if(!g.allow_html_in_named_anchor){f.addAttributeFilter("name",function(k,l){var n=k.length,p,m,o,q;while(n--){q=k[n];if(q.name==="a"&&q.firstChild){o=q.parent;p=q.lastChild;do{m=p.prev;o.insert(p,q);p=m}while(p)}}})}}})(tinymce);tinymce.html.Writer=function(e){var c=[],a,b,d,f,g;e=e||{};a=e.indent;b=tinymce.makeMap(e.indent_before||"");d=tinymce.makeMap(e.indent_after||"");f=tinymce.html.Entities.getEncodeFunc(e.entity_encoding||"raw",e.entities);g=e.element_format=="html";return{start:function(m,k,p){var n,j,h,o;if(a&&b[m]&&c.length>0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n<j;n++){h=k[n];c.push(" ",h.name,'="',f(h.value,true),'"')}}if(!p||g){c[c.length]=">"}else{c[c.length]=" />"}if(p&&a&&d[m]&&c.length>0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("</",h,">");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("<![CDATA[",h,"]]>")},comment:function(h){c.push("<!--",h,"-->")},pi:function(h,i){if(i){c.push("<?",h," ",i,"?>")}else{c.push("<?",h,"?>")}if(a){c.push("\n")}},doctype:function(h){c.push("<!DOCTYPE",h,">",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n<m;n++){r=q.attributesOrder[n];if(r in s.map){p=s.map[r];u.map[r]=p;u.push({name:r,value:p})}}for(n=0,m=s.length;n<m;n++){r=s[n].name;if(!(r in u.map)){p=s.map[r];u.map[r]=p;u.push({name:r,value:p})}}s=u}e.start(k.name,s,o);if(!o){if((k=k.firstChild)){do{f(k)}while(k=k.next)}e.end(j)}}else{t(k)}}if(h.type==1&&!c.inner){f(h)}else{g[11](h)}return e.getContent()}}})(tinymce);tinymce.dom={};(function(b,h){var g=!!document.addEventListener;function c(k,j,l,i){if(k.addEventListener){k.addEventListener(j,l,i||false)}else{if(k.attachEvent){k.attachEvent("on"+j,l)}}}function e(k,j,l,i){if(k.removeEventListener){k.removeEventListener(j,l,i||false)}else{if(k.detachEvent){k.detachEvent("on"+j,l)}}}function a(n,l){var i,k=l||{};function j(){return false}function m(){return true}for(i in n){if(i!=="layerX"&&i!=="layerY"){k[i]=n[i]}}if(!k.target){k.target=k.srcElement||document}k.preventDefault=function(){k.isDefaultPrevented=m;if(n){if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}}};k.stopPropagation=function(){k.isPropagationStopped=m;if(n){if(n.stopPropagation){n.stopPropagation()}else{n.cancelBubble=true}}};k.stopImmediatePropagation=function(){k.isImmediatePropagationStopped=m;k.stopPropagation()};if(!k.isDefaultPrevented){k.isDefaultPrevented=j;k.isPropagationStopped=j;k.isImmediatePropagationStopped=j}return k}function d(m,n,l){var k=m.document,j={type:"ready"};function i(){if(!l.domLoaded){l.domLoaded=true;n(j)}}if(g){c(m,"DOMContentLoaded",i)}else{c(k,"readystatechange",function(){if(k.readyState==="complete"){e(k,"readystatechange",arguments.callee);i()}});if(k.documentElement.doScroll&&m===m.top){(function(){try{k.documentElement.doScroll("left")}catch(o){setTimeout(arguments.callee,0);return}i()})()}}c(m,"load",i)}function f(k){var q=this,p={},i,o,n,m,l;m="onmouseenter" in document.documentElement;n="onfocusin" in document.documentElement;l={mouseenter:"mouseover",mouseleave:"mouseout"};i=1;q.domLoaded=false;q.events=p;function j(t,x){var s,u,r,v;s=p[x][t.type];if(s){for(u=0,r=s.length;u<r;u++){v=s[u];if(v&&v.func.call(v.scope,t)===false){t.preventDefault()}if(t.isImmediatePropagationStopped()){return}}}}q.bind=function(x,A,D,E){var s,t,u,r,B,z,C,v=window;function y(F){j(a(F||v.event),s)}if(!x||x.nodeType===3||x.nodeType===8){return}if(!x[h]){s=i++;x[h]=s;p[s]={}}else{s=x[h];if(!p[s]){p[s]={}}}E=E||x;A=A.split(" ");u=A.length;while(u--){r=A[u];z=y;B=C=false;if(r==="DOMContentLoaded"){r="ready"}if((q.domLoaded||x.readyState=="complete")&&r==="ready"){q.domLoaded=true;D.call(E,a({type:r}));continue}if(!m){B=l[r];if(B){z=function(F){var H,G;H=F.currentTarget;G=F.relatedTarget;if(G&&H.contains){G=H.contains(G)}else{while(G&&G!==H){G=G.parentNode}}if(!G){F=a(F||v.event);F.type=F.type==="mouseout"?"mouseleave":"mouseenter";F.target=H;j(F,s)}}}}if(!n&&(r==="focusin"||r==="focusout")){C=true;B=r==="focusin"?"focus":"blur";z=function(F){F=a(F||v.event);F.type=F.type==="focus"?"focusin":"focusout";j(F,s)}}t=p[s][r];if(!t){p[s][r]=t=[{func:D,scope:E}];t.fakeName=B;t.capture=C;t.nativeHandler=z;if(!g){t.proxyHandler=k(s)}if(r==="ready"){d(x,z,q)}else{c(x,B||r,g?z:t.proxyHandler,C)}}else{t.push({func:D,scope:E})}}x=t=0;return D};q.unbind=function(x,z,A){var s,u,v,B,r,t;if(!x||x.nodeType===3||x.nodeType===8){return q}s=x[h];if(s){t=p[s];if(z){z=z.split(" ");v=z.length;while(v--){r=z[v];u=t[r];if(u){if(A){B=u.length;while(B--){if(u[B].func===A){u.splice(B,1)}}}if(!A||u.length===0){delete t[r];e(x,u.fakeName||r,g?u.nativeHandler:u.proxyHandler,u.capture)}}}}else{for(r in t){u=t[r];e(x,u.fakeName||r,g?u.nativeHandler:u.proxyHandler,u.capture)}t={}}for(r in t){return q}delete p[s];try{delete x[h]}catch(y){x[h]=null}}return q};q.fire=function(u,s,r){var v,t;if(!u||u.nodeType===3||u.nodeType===8){return q}t=a(null,r);t.type=s;do{v=u[h];if(v){j(t,v)}u=u.parentNode||u.ownerDocument||u.defaultView||u.parentWindow}while(u&&!t.isPropagationStopped());return q};q.clean=function(u){var s,r,t=q.unbind;if(!u||u.nodeType===3||u.nodeType===8){return q}if(u[h]){t(u)}if(!u.getElementsByTagName){u=u.document}if(u&&u.getElementsByTagName){t(u);r=u.getElementsByTagName("*");s=r.length;while(s--){u=r[s];if(u[h]){t(u)}}}return q};q.callNativeHandler=function(s,r){if(p){p[s][r.type].nativeHandler(r)}};q.destory=function(){p={}};q.add=function(v,s,u,t){if(typeof(v)==="string"){v=document.getElementById(v)}if(v&&v instanceof Array){var r=v;while(r--){q.add(v[r],s,u,t)}return}if(s==="init"){s="ready"}return q.bind(v,s instanceof Array?s.join(" "):s,u,t)};q.remove=function(v,s,u,t){if(!v){return q}if(typeof(v)==="string"){v=document.getElementById(v)}if(v instanceof Array){var r=v.length;while(r--){q.remove(v[r],s,u,t)}return q}return q.unbind(v,s instanceof Array?s.join(" "):s,u)};q.clear=function(r){if(typeof(r)==="string"){r=document.getElementById(r)}return q.clean(r)};q.cancel=function(r){if(r){q.prevent(r);q.stop(r)}return false};q.prevent=function(r){r.preventDefault();return false};q.stop=function(r){r.stopPropagation();return false}}b.EventUtils=f;b.Event=new f(function(i){return function(j){tinymce.dom.Event.callNativeHandler(i,j)}});b.Event.bind(window,"ready",function(){});b=0})(tinymce.dom,"data-mce-expando");tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","previousSibling",e))}};(function(e){var g=e.each,d=e.is,f=e.isWebKit,b=e.isIE,h=e.html.Entities,c=/^([a-z0-9],?)+$/i,a=/^[ \t\r\n]*$/;e.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,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"},DOMUtils:function(o,l){var k=this,i,j,n;k.doc=o;k.win=window;k.files={};k.cssFlicker=false;k.counter=0;k.stdMode=!e.isIE||o.documentMode>=8;k.boxModel=!e.isIE||o.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in o.createElement("a");k.settings=l=e.extend({keep_values:false,hex_colors:1},l);k.schema=l.schema;k.styles=new e.html.Styles({url_converter:l.url_converter,url_converter_scope:l.url_converter_scope},l.schema);if(e.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}k.fixDoc(o);k.events=l.ownEvents?new e.dom.EventUtils(l.proxy):e.dom.Event;e.addUnload(k.destroy,k);n=l.schema?l.schema.getBlockElements():{};k.isBlock=function(q){var p=q.nodeType;if(p){return !!(p===1&&n[q.nodeName])}return !!n[q]}},fixDoc:function(k){var j=this.settings,i;if(b&&j.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(l){k.createElement(l)});for(i in j.schema.getCustomElements()){k.createElement(i)}}},clone:function(k,i){var j=this,m,l;if(!b||k.nodeType!==1||i){return k.cloneNode(i)}l=j.doc;if(!i){m=l.createElement(k.nodeName);g(j.getAttribs(k),function(n){j.setAttrib(m,n.nodeName,j.getAttrib(k,n.nodeName))});return m}return m.firstChild},getRoot:function(){var i=this,j=i.settings;return(j&&i.get(j.root_element))||i.doc.body},getViewPort:function(j){var k,i;j=!j?this.win:j;k=j.document;i=this.boxModel?k.documentElement:k.body;return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop,w:j.innerWidth||i.clientWidth,h:j.innerHeight||i.clientHeight}},getRect:function(l){var k,i=this,j;l=i.get(l);k=i.getPos(l);j=i.getSize(l);return{x:k.x,y:k.y,w:j.w,h:j.h}},getSize:function(l){var j=this,i,k;l=j.get(l);i=j.getStyle(l,"width");k=j.getStyle(l,"height");if(i.indexOf("px")===-1){i=0}if(k.indexOf("px")===-1){k=0}return{w:parseInt(i,10)||l.offsetWidth||l.clientWidth,h:parseInt(k,10)||l.offsetHeight||l.clientHeight}},getParent:function(k,j,i){return this.getParents(k,j,i,false)},getParents:function(s,m,k,q){var j=this,i,l=j.settings,p=[];s=j.get(s);q=q===undefined;if(l.strict_root){k=k||j.getRoot()}if(d(m,"string")){i=m;if(m==="*"){m=function(o){return o.nodeType==1}}else{m=function(o){return j.is(o,i)}}}while(s){if(s==k||!s.nodeType||s.nodeType===9){break}if(!m||m(s)){if(q){p.push(s)}else{return s}}s=s.parentNode}return q?p:null},get:function(i){var j;if(i&&this.doc&&typeof(i)=="string"){j=i;i=this.doc.getElementById(i);if(i&&i.id!==j){return this.doc.getElementsByName(j)[1]}}return i},getNext:function(j,i){return this._findSib(j,i,"nextSibling")},getPrev:function(j,i){return this._findSib(j,i,"previousSibling")},select:function(k,j){var i=this;return e.dom.Sizzle(k,i.get(j)||i.get(i.settings.root_element)||i.doc,[])},is:function(l,j){var k;if(l.length===undefined){if(j==="*"){return l.nodeType==1}if(c.test(j)){j=j.toLowerCase().split(/,/);l=l.nodeName.toLowerCase();for(k=j.length-1;k>=0;k--){if(j[k]==l){return true}}return false}}return e.dom.Sizzle.matches(j,l.nodeType?[l]:l).length>0},add:function(l,o,i,k,m){var j=this;return this.run(l,function(r){var q,n;q=d(o,"string")?j.doc.createElement(o):o;j.setAttribs(q,i);if(k){if(k.nodeType){q.appendChild(k)}else{j.setHTML(q,k)}}return !m?r.appendChild(q):q})},create:function(k,i,j){return this.add(this.doc.createElement(k),k,i,j,1)},createHTML:function(q,i,m){var p="",l=this,j;p+="<"+q;for(j in i){if(i.hasOwnProperty(j)){p+=" "+j+'="'+l.encode(i[j])+'"'}}if(typeof(m)!="undefined"){return p+">"+m+"</"+q+">"}return p+" />"},remove:function(i,j){return this.run(i,function(l){var m,k=l.parentNode;if(!k){return null}if(j){while(m=l.firstChild){if(!e.isIE||m.nodeType!==3||m.nodeValue){k.insertBefore(m,l)}else{l.removeChild(m)}}}return k.removeChild(l)})},setStyle:function(l,i,j){var k=this;return k.run(l,function(o){var n,m;n=o.style;i=i.replace(/-(\D)/g,function(q,p){return p.toUpperCase()});if(k.pixelStyles.test(i)&&(e.is(j,"number")||/^[\-0-9\.]+$/.test(j))){j+="px"}switch(i){case"opacity":if(b){n.filter=j===""?"":"alpha(opacity="+(j*100)+")";if(!l.currentStyle||!l.currentStyle.hasLayout){n.display="inline-block"}}n[i]=n["-moz-opacity"]=n["-khtml-opacity"]=j||"";break;case"float":b?n.styleFloat=j:n.cssFloat=j;break;default:n[i]=j||""}if(k.settings.update_styles){k.setAttrib(o,"data-mce-style")}})},getStyle:function(l,i,k){l=this.get(l);if(!l){return}if(this.doc.defaultView&&k){i=i.replace(/[A-Z]/g,function(m){return"-"+m});try{return this.doc.defaultView.getComputedStyle(l,null).getPropertyValue(i)}catch(j){return null}}i=i.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(i=="float"){i=b?"styleFloat":"cssFloat"}if(l.currentStyle&&k){return l.currentStyle[i]}return l.style?l.style[i]:undefined},setStyles:function(l,m){var j=this,k=j.settings,i;i=k.update_styles;k.update_styles=0;g(m,function(o,p){j.setStyle(l,p,o)});k.update_styles=i;if(k.update_styles){j.setAttrib(l,k.cssText)}},removeAllAttribs:function(i){return this.run(i,function(l){var k,j=l.attributes;for(k=j.length-1;k>=0;k--){l.removeAttributeNode(j.item(k))}})},setAttrib:function(k,l,i){var j=this;if(!k||!l){return}if(j.settings.strict){l=l.toLowerCase()}return this.run(k,function(p){var o=j.settings;var m=p.getAttribute(l);if(i!==null){switch(l){case"style":if(!d(i,"string")){g(i,function(q,r){j.setStyle(p,r,q)});return}if(o.keep_values){if(i&&!j._isRes(i)){p.setAttribute("data-mce-style",i,2)}else{p.removeAttribute("data-mce-style",2)}}p.style.cssText=i;break;case"class":p.className=i||"";break;case"src":case"href":if(o.keep_values){if(o.url_converter){i=o.url_converter.call(o.url_converter_scope||j,i,l,p)}j.setAttrib(p,"data-mce-"+l,i,2)}break;case"shape":p.setAttribute("data-mce-style",i);break}}if(d(i)&&i!==null&&i.length!==0){p.setAttribute(l,""+i,2)}else{p.removeAttribute(l,2)}if(tinyMCE.activeEditor&&m!=i){var n=tinyMCE.activeEditor;n.onSetAttrib.dispatch(n,p,l,i)}})},setAttribs:function(j,k){var i=this;return this.run(j,function(l){g(k,function(m,o){i.setAttrib(l,o,m)})})},getAttrib:function(m,o,k){var i,j=this,l;m=j.get(m);if(!m||m.nodeType!==1){return k===l?false:k}if(!d(k)){k=""}if(/^(src|href|style|coords|shape)$/.test(o)){i=m.getAttribute("data-mce-"+o);if(i){return i}}if(b&&j.props[o]){i=m[j.props[o]];i=i&&i.nodeValue?i.nodeValue:i}if(!i){i=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[j.props[o]]===true&&i===""){return o}return i?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){i=i||m.style.cssText;if(i){i=j.serializeStyle(j.parseStyle(i),m.nodeName);if(j.settings.keep_values&&!j._isRes(i)){m.setAttribute("data-mce-style",i)}}}if(f&&o==="class"&&i){i=i.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(o){case"rowspan":case"colspan":if(i===1){i=""}break;case"size":if(i==="+0"||i===20||i===0){i=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(i===0){i=""}break;case"hspace":if(i===-1){i=""}break;case"maxlength":case"tabindex":if(i===32768||i===2147483647||i==="32768"){i=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(i===65535){return o}return k;case"shape":i=i.toLowerCase();break;default:if(o.indexOf("on")===0&&i){i=e._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+i)}}}return(i!==l&&i!==null&&i!=="")?""+i:k},getPos:function(q,l){var j=this,i=0,p=0,m,o=j.doc,k;q=j.get(q);l=l||o.body;if(q){if(q.getBoundingClientRect){q=q.getBoundingClientRect();m=j.boxModel?o.documentElement:o.body;i=q.left+(o.documentElement.scrollLeft||o.body.scrollLeft)-m.clientTop;p=q.top+(o.documentElement.scrollTop||o.body.scrollTop)-m.clientLeft;return{x:i,y:p}}k=q;while(k&&k!=l&&k.nodeType){i+=k.offsetLeft||0;p+=k.offsetTop||0;k=k.offsetParent}k=q.parentNode;while(k&&k!=l&&k.nodeType){i-=k.scrollLeft||0;p-=k.scrollTop||0;k=k.parentNode}}return{x:i,y:p}},parseStyle:function(i){return this.styles.parse(i)},serializeStyle:function(j,i){return this.styles.serialize(j,i)},loadCSS:function(i){var k=this,l=k.doc,j;if(!i){i=""}j=l.getElementsByTagName("head")[0];g(i.split(","),function(m){var n;if(k.files[m]){return}k.files[m]=true;n=k.create("link",{rel:"stylesheet",href:e._addVer(m)});if(b&&l.documentMode&&l.recalc){n.onload=function(){if(l.recalc){l.recalc()}n.onload=null}}j.appendChild(n)})},addClass:function(i,j){return this.run(i,function(k){var l;if(!j){return 0}if(this.hasClass(k,j)){return k.className}l=this.removeClass(k,j);return k.className=(l!=""?(l+" "):"")+j})},removeClass:function(k,l){var i=this,j;return i.run(k,function(n){var m;if(i.hasClass(n,l)){if(!j){j=new RegExp("(^|\\s+)"+l+"(\\s+|$)","g")}m=n.className.replace(j," ");m=e.trim(m!=" "?m:"");n.className=m;if(!m){n.removeAttribute("class");n.removeAttribute("className")}return m}return n.className})},hasClass:function(j,i){j=this.get(j);if(!j||!i){return false}return(" "+j.className+" ").indexOf(" "+i+" ")!==-1},show:function(i){return this.setStyle(i,"display","block")},hide:function(i){return this.setStyle(i,"display","none")},isHidden:function(i){i=this.get(i);return !i||i.style.display=="none"||this.getStyle(i,"display")=="none"},uniqueId:function(i){return(!i?"mce_":i)+(this.counter++)},setHTML:function(k,j){var i=this;return i.run(k,function(m){if(b){while(m.firstChild){m.removeChild(m.firstChild)}try{m.innerHTML="<br />"+j;m.removeChild(m.firstChild)}catch(l){m=i.create("div");m.innerHTML="<br />"+j;g(m.childNodes,function(o,n){if(n){m.appendChild(o)}})}}else{m.innerHTML=j}return j})},getOuterHTML:function(k){var j,i=this;k=i.get(k);if(!k){return null}if(k.nodeType===1&&i.hasOuterHTML){return k.outerHTML}j=(k.ownerDocument||i.doc).createElement("body");j.appendChild(k.cloneNode(true));return j.innerHTML},setOuterHTML:function(l,j,m){var i=this;function k(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){i.insertAfter(s.cloneNode(true),p);s=s.previousSibling}i.remove(p)}return this.run(l,function(o){o=i.get(o);if(o.nodeType==1){m=m||o.ownerDocument||i.doc;if(b){try{if(b&&o.nodeType==1){o.outerHTML=j}else{k(o,j,m)}}catch(n){k(o,j,m)}}else{k(o,j,m)}}})},decode:h.decode,encode:h.encodeAllRaw,insertAfter:function(i,j){j=this.get(j);return this.run(i,function(l){var k,m;k=j.parentNode;m=j.nextSibling;if(m){k.insertBefore(l,m)}else{k.appendChild(l)}return l})},replace:function(m,l,i){var j=this;if(d(l,"array")){m=m.cloneNode(true)}return j.run(l,function(k){if(i){g(e.grep(k.childNodes),function(n){m.appendChild(n)})}return k.parentNode.replaceChild(m,k)})},rename:function(l,i){var k=this,j;if(l.nodeName!=i.toUpperCase()){j=k.create(i);g(k.getAttribs(l),function(m){k.setAttrib(j,m.nodeName,k.getAttrib(l,m.nodeName))});k.replace(j,l,1)}return j||l},findCommonAncestor:function(k,i){var l=k,j;while(l){j=i;while(j&&l!=j){j=j.parentNode}if(l==j){break}l=l.parentNode}if(!l&&k.ownerDocument){return k.ownerDocument.documentElement}return l},toHex:function(i){var k=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i);function j(l){l=parseInt(l,10).toString(16);return l.length>1?l:"0"+l}if(k){i="#"+j(k[1])+j(k[2])+j(k[3]);return i}return i},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(i){g(i.imports,function(s){q(s)});g(i.cssRules||i.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){g(s.selectorText.split(","),function(r){r=r.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(r)||!/\.[\w\-]+$/.test(r)){return}l=r;r=e._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",r);if(p&&!(r=p(r,l))){return}if(!o[r]){j.push({"class":r});o[r]=1}})}break;case 3:q(s.styleSheet);break}})}try{g(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(l,k,j){var i=this,m;if(i.doc&&typeof(l)==="string"){l=i.get(l)}if(!l){return false}j=j||this;if(!l.nodeType&&(l.length||l.length===0)){m=[];g(l,function(o,n){if(o){if(typeof(o)=="string"){o=i.doc.getElementById(o)}m.push(k.call(j,o,n))}});return m}return k.call(j,l)},getAttribs:function(j){var i;j=this.get(j);if(!j){return[]}if(b){i=[];if(j.nodeName=="OBJECT"){return j.attributes}if(j.nodeName==="OPTION"&&this.getAttrib(j,"selected")){i.push({specified:1,nodeName:"selected"})}j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(k){i.push({specified:1,nodeName:k})});return i}return j.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p=0;m=m.firstChild;if(m){j=new e.dom.TreeWalker(m,m.parentNode);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){if(l==="br"){p++;continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if(q==8){return false}if((q===3&&!a.test(m.nodeValue))){return false}}while(m=j.next())}return p<=1},destroy:function(j){var i=this;i.win=i.doc=i.root=i.events=i.frag=null;if(!j){e.removeUnload(i.destroy)}},createRng:function(){var i=this.doc;return i.createRange?i.createRange():new e.dom.Range(this)},nodeIndex:function(m,n){var i=0,k,l,j;if(m){for(k=m.nodeType,m=m.previousSibling,l=m;m;m=m.previousSibling){j=m.nodeType;if(n&&j==3){if(j==k||!m.nodeValue.length){continue}}i++;k=j}}return i},split:function(m,l,p){var q=this,i=q.createRng(),n,k,o;function j(v){var t,s=v.childNodes,u=v.nodeType;function x(A){var z=A.previousSibling&&A.previousSibling.nodeName=="SPAN";var y=A.nextSibling&&A.nextSibling.nodeName=="SPAN";return z&&y}if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=s.length-1;t>=0;t--){j(s[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){var r=e.trim(v.nodeValue).length;if(!q.isBlock(v.parentNode)||r>0||r===0&&x(v)){return}}else{if(u==1){s=v.childNodes;if(s.length==1&&s[0]&&s[0].nodeType==1&&s[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(s[0],v)}if(s.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}q.remove(v)}return v}if(m&&l){i.setStart(m.parentNode,q.nodeIndex(m));i.setEnd(l.parentNode,q.nodeIndex(l));n=i.extractContents();i=q.createRng();i.setStart(l.parentNode,q.nodeIndex(l)+1);i.setEnd(m.parentNode,q.nodeIndex(m)+1);k=i.extractContents();o=m.parentNode;o.insertBefore(j(n),m);if(p){o.replaceChild(p,l)}else{o.insertBefore(l,m)}o.insertBefore(j(k),m);q.remove(m);return p||l}},bind:function(l,i,k,j){return this.events.add(l,i,k,j||this)},unbind:function(k,i,j){return this.events.remove(k,i,j)},fire:function(k,j,i){return this.events.fire(k,j,i)},getContentEditable:function(j){var i;if(j.nodeType!=1){return null}i=j.getAttribute("data-mce-contenteditable");if(i&&i!=="inherit"){return i}return j.contentEditable!=="inherit"?j.contentEditable:null},_findSib:function(l,i,j){var k=this,m=i;if(l){if(d(m,"string")){m=function(n){return k.is(n,i)}}for(l=l[j];l;l=l[j]){if(m(l)){return l}}}return null},_isRes:function(i){return/^(top|left|bottom|right|width|height)/i.test(i)||/;\s*(top|left|bottom|right|width|height)/i.test(i)}});e.DOM=new e.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var O=this,e=c.doc,T=0,F=1,j=2,E=true,S=false,V="startOffset",h="startContainer",Q="endContainer",A="endOffset",k=tinymce.extend,n=c.nodeIndex;k(O,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:E,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:J,setEndBefore:K,setEndAfter:u,collapse:B,selectNode:y,selectNodeContents:G,compareBoundaryPoints:v,deleteContents:p,extractContents:I,cloneContents:d,insertNode:D,surroundContents:N,cloneRange:L});function x(){return e.createDocumentFragment()}function q(W,t){C(E,W,t)}function s(W,t){C(S,W,t)}function g(t){q(t.parentNode,n(t))}function J(t){q(t.parentNode,n(t)+1)}function K(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function B(t){if(t){O[Q]=O[h];O[A]=O[V]}else{O[h]=O[Q];O[V]=O[A]}O.collapsed=E}function y(t){g(t);u(t)}function G(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(Z,t){var ac=O[h],X=O[V],ab=O[Q],W=O[A],aa=t.startContainer,ae=t.startOffset,Y=t.endContainer,ad=t.endOffset;if(Z===0){return H(ac,X,aa,ae)}if(Z===1){return H(ab,W,aa,ae)}if(Z===2){return H(ab,W,Y,ad)}if(Z===3){return H(ac,X,Y,ad)}}function p(){l(j)}function I(){return l(T)}function d(){return l(F)}function D(Z){var W=this[h],t=this[V],Y,X;if((W.nodeType===3||W.nodeType===4)&&W.nodeValue){if(!t){W.parentNode.insertBefore(Z,W)}else{if(t>=W.nodeValue.length){c.insertAfter(Z,W)}else{Y=W.splitText(t);W.parentNode.insertBefore(Z,Y)}}}else{if(W.childNodes.length>0){X=W.childNodes[t]}if(X){W.insertBefore(Z,X)}else{W.appendChild(Z)}}}function N(W){var t=O.extractContents();O.insertNode(W);W.appendChild(t);O.selectNode(W)}function L(){return k(new b(c),{startContainer:O[h],startOffset:O[V],endContainer:O[Q],endOffset:O[A],collapsed:O.collapsed,commonAncestorContainer:O.commonAncestorContainer})}function P(t,W){var X;if(t.nodeType==3){return t}if(W<0){return t}X=t.firstChild;while(X&&W>0){--W;X=X.nextSibling}if(X){return X}return t}function m(){return(O[h]==O[Q]&&O[V]==O[A])}function H(Y,aa,W,Z){var ab,X,t,ac,ae,ad;if(Y==W){if(aa==Z){return 0}if(aa<Z){return -1}return 1}ab=W;while(ab&&ab.parentNode!=Y){ab=ab.parentNode}if(ab){X=0;t=Y.firstChild;while(t!=ab&&X<aa){X++;t=t.nextSibling}if(aa<=X){return -1}return 1}ab=Y;while(ab&&ab.parentNode!=W){ab=ab.parentNode}if(ab){X=0;t=W.firstChild;while(t!=ab&&X<Z){X++;t=t.nextSibling}if(X<Z){return -1}return 1}ac=c.findCommonAncestor(Y,W);ae=Y;while(ae&&ae.parentNode!=ac){ae=ae.parentNode}if(!ae){ae=ac}ad=W;while(ad&&ad.parentNode!=ac){ad=ad.parentNode}if(!ad){ad=ac}if(ae==ad){return 0}t=ac.firstChild;while(t){if(t==ae){return -1}if(t==ad){return 1}t=t.nextSibling}}function C(W,Z,Y){var t,X;if(W){O[h]=Z;O[V]=Y}else{O[Q]=Z;O[A]=Y}t=O[Q];while(t.parentNode){t=t.parentNode}X=O[h];while(X.parentNode){X=X.parentNode}if(X==t){if(H(O[h],O[V],O[Q],O[A])>0){O.collapse(W)}}else{O.collapse(W)}O.collapsed=m();O.commonAncestorContainer=c.findCommonAncestor(O[h],O[Q])}function l(ac){var ab,Y=0,ae=0,W,aa,X,Z,t,ad;if(O[h]==O[Q]){return f(ac)}for(ab=O[Q],W=ab.parentNode;W;ab=W,W=W.parentNode){if(W==O[h]){return r(ab,ac)}++Y}for(ab=O[h],W=ab.parentNode;W;ab=W,W=W.parentNode){if(W==O[Q]){return U(ab,ac)}++ae}aa=ae-Y;X=O[h];while(aa>0){X=X.parentNode;aa--}Z=O[Q];while(aa<0){Z=Z.parentNode;aa++}for(t=X.parentNode,ad=Z.parentNode;t!=ad;t=t.parentNode,ad=ad.parentNode){X=t;Z=ad}return o(X,Z,ac)}function f(ab){var ad,ae,t,X,Y,ac,Z,W,aa;if(ab!=j){ad=x()}if(O[V]==O[A]){return ad}if(O[h].nodeType==3){ae=O[h].nodeValue;t=ae.substring(O[V],O[A]);if(ab!=F){X=O[h];W=O[V];aa=O[A]-O[V];if(W===0&&aa>=X.nodeValue.length-1){X.parentNode.removeChild(X)}else{X.deleteData(W,aa)}O.collapse(E)}if(ab==j){return}if(t.length>0){ad.appendChild(e.createTextNode(t))}return ad}X=P(O[h],O[V]);Y=O[A]-O[V];while(X&&Y>0){ac=X.nextSibling;Z=z(X,ab);if(ad){ad.appendChild(Z)}--Y;X=ac}if(ab!=F){O.collapse(E)}return ad}function r(ac,Z){var ab,aa,W,t,Y,X;if(Z!=j){ab=x()}aa=i(ac,Z);if(ab){ab.appendChild(aa)}W=n(ac);t=W-O[V];if(t<=0){if(Z!=F){O.setEndBefore(ac);O.collapse(S)}return ab}aa=ac.previousSibling;while(t>0){Y=aa.previousSibling;X=z(aa,Z);if(ab){ab.insertBefore(X,ab.firstChild)}--t;aa=Y}if(Z!=F){O.setEndBefore(ac);O.collapse(S)}return ab}function U(aa,Z){var ac,W,ab,t,Y,X;if(Z!=j){ac=x()}ab=R(aa,Z);if(ac){ac.appendChild(ab)}W=n(aa);++W;t=O[A]-W;ab=aa.nextSibling;while(ab&&t>0){Y=ab.nextSibling;X=z(ab,Z);if(ac){ac.appendChild(X)}--t;ab=Y}if(Z!=F){O.setStartAfter(aa);O.collapse(E)}return ac}function o(aa,t,ad){var X,af,Z,ab,ac,W,ae,Y;if(ad!=j){af=x()}X=R(aa,ad);if(af){af.appendChild(X)}Z=aa.parentNode;ab=n(aa);ac=n(t);++ab;W=ac-ab;ae=aa.nextSibling;while(W>0){Y=ae.nextSibling;X=z(ae,ad);if(af){af.appendChild(X)}ae=Y;--W}X=i(t,ad);if(af){af.appendChild(X)}if(ad!=F){O.setStartAfter(aa);O.collapse(E)}return af}function i(ab,ac){var X=P(O[Q],O[A]-1),ad,aa,Z,t,W,Y=X!=O[Q];if(X==ab){return M(X,Y,S,ac)}ad=X.parentNode;aa=M(ad,S,S,ac);while(ad){while(X){Z=X.previousSibling;t=M(X,Y,S,ac);if(ac!=j){aa.insertBefore(t,aa.firstChild)}Y=E;X=Z}if(ad==ab){return aa}X=ad.previousSibling;ad=ad.parentNode;W=M(ad,S,S,ac);if(ac!=j){W.appendChild(aa)}aa=W}}function R(ab,ac){var Y=P(O[h],O[V]),Z=Y!=O[h],ad,aa,X,t,W;if(Y==ab){return M(Y,Z,E,ac)}ad=Y.parentNode;aa=M(ad,S,E,ac);while(ad){while(Y){X=Y.nextSibling;t=M(Y,Z,E,ac);if(ac!=j){aa.appendChild(t)}Z=E;Y=X}if(ad==ab){return aa}Y=ad.nextSibling;ad=ad.parentNode;W=M(ad,S,E,ac);if(ac!=j){W.appendChild(aa)}aa=W}}function M(t,Z,ac,ad){var Y,X,aa,W,ab;if(Z){return z(t,ad)}if(t.nodeType==3){Y=t.nodeValue;if(ac){W=O[V];X=Y.substring(W);aa=Y.substring(0,W)}else{W=O[A];X=Y.substring(0,W);aa=Y.substring(W)}if(ad!=F){t.nodeValue=aa}if(ad==j){return}ab=c.clone(t,S);ab.nodeValue=X;return ab}if(ad==j){return}return c.clone(t,S)}function z(W,t){if(t!=j){return t==F?c.clone(W,E):W}W.parentNode.removeChild(W)}}a.Range=b})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",1)===0||s!=k.parentElement()){break}o++}}else{k.collapse(true);o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",-1)===0||s!=k.parentElement()){break}o++}}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,s,q,r=d.dom.doc,m=r.body;function j(z){var u,y,t,x,v;t=h.create("a");u=z?k:s;y=z?p:q;x=n.duplicate();if(u==r||u==r.documentElement){u=m;y=0}if(u.nodeType==3){u.parentNode.insertBefore(t,u);x.moveToElementText(t);x.moveStart("character",y);h.remove(t);n.setEndPoint(z?"StartToStart":"EndToEnd",x)}else{v=u.childNodes;if(v.length){if(y>=v.length){h.insertAfter(t,v[v.length-1])}else{u.insertBefore(t,v[y])}x.moveToElementText(t)}else{if(u.canHaveHTML){u.innerHTML="<span>\uFEFF</span>";t=u.firstChild;x.moveToElementText(t);x.collapse(f)}}n.setEndPoint(z?"StartToStart":"EndToEnd",x);h.remove(t)}}k=i.startContainer;p=i.startOffset;s=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==s&&k.nodeType==1){if(p==q&&!k.hasChildNodes()){if(k.canHaveHTML){k.innerHTML="<span>\uFEFF</span><span>\uFEFF</span>";n.moveToElementText(k.lastChild);n.select();h.doc.selection.clear();k.innerHTML="";return}else{p=h.nodeIndex(k);k=k.parentNode}}if(p==q-1){try{l=m.createControlRange();l.addElement(k.childNodes[p]);l.select();return}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(){var n=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i="sizcache",o=0,r=Object.prototype.toString,h=false,g=true,q=/\\/g,u=/\r\n/g,x=/\W/;[0,0].sort(function(){g=false;return 0});var d=function(C,e,F,G){F=F||[];e=e||document;var I=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!C||typeof C!=="string"){return F}var z,K,N,y,J,M,L,E,B=true,A=d.isXML(e),D=[],H=C;do{n.exec("");z=n.exec(H);if(z){H=z[3];D.push(z[1]);if(z[2]){y=z[3];break}}}while(z);if(D.length>1&&j.exec(C)){if(D.length===2&&k.relative[D[0]]){K=s(D[0]+D[1],e,G)}else{K=k.relative[D[0]]?[e]:d(D.shift(),e);while(D.length){C=D.shift();if(k.relative[C]){C+=D.shift()}K=s(C,K,G)}}}else{if(!G&&D.length>1&&e.nodeType===9&&!A&&k.match.ID.test(D[0])&&!k.match.ID.test(D[D.length-1])){J=d.find(D.shift(),e,A);e=J.expr?d.filter(J.expr,J.set)[0]:J.set[0]}if(e){J=G?{expr:D.pop(),set:l(G)}:d.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&e.parentNode?e.parentNode:e,A);K=J.expr?d.filter(J.expr,J.set):J.set;if(D.length>0){N=l(K)}else{B=false}while(D.length){M=D.pop();L=M;if(!k.relative[M]){M=""}else{L=D.pop()}if(L==null){L=e}k.relative[M](N,L,A)}}else{N=D=[]}}if(!N){N=K}if(!N){d.error(M||C)}if(r.call(N)==="[object Array]"){if(!B){F.push.apply(F,N)}else{if(e&&e.nodeType===1){for(E=0;N[E]!=null;E++){if(N[E]&&(N[E]===true||N[E].nodeType===1&&d.contains(e,N[E]))){F.push(K[E])}}}else{for(E=0;N[E]!=null;E++){if(N[E]&&N[E].nodeType===1){F.push(K[E])}}}}}else{l(N,F)}if(y){d(y,I,F,G);d.uniqueSort(F)}return F};d.uniqueSort=function(y){if(p){h=g;y.sort(p);if(h){for(var e=1;e<y.length;e++){if(y[e]===y[e-1]){y.splice(e--,1)}}}}return y};d.matches=function(e,y){return d(e,null,null,y)};d.matchesSelector=function(e,y){return d(y,null,null,[e]).length>0};d.find=function(E,e,F){var D,z,B,A,C,y;if(!E){return[]}for(z=0,B=k.order.length;z<B;z++){C=k.order[z];if((A=k.leftMatch[C].exec(E))){y=A[1];A.splice(1,1);if(y.substr(y.length-1)!=="\\"){A[1]=(A[1]||"").replace(q,"");D=k.find[C](A,e,F);if(D!=null){E=E.replace(k.match[C],"");break}}}}if(!D){D=typeof e.getElementsByTagName!=="undefined"?e.getElementsByTagName("*"):[]}return{set:D,expr:E}};d.filter=function(I,H,L,B){var D,e,G,N,K,y,A,C,J,z=I,M=[],F=H,E=H&&H[0]&&d.isXML(H[0]);while(I&&H.length){for(G in k.filter){if((D=k.leftMatch[G].exec(I))!=null&&D[2]){y=k.filter[G];A=D[1];e=false;D.splice(1,1);if(A.substr(A.length-1)==="\\"){continue}if(F===M){M=[]}if(k.preFilter[G]){D=k.preFilter[G](D,F,L,M,B,E);if(!D){e=N=true}else{if(D===true){continue}}}if(D){for(C=0;(K=F[C])!=null;C++){if(K){N=y(K,D,C,F);J=B^N;if(L&&N!=null){if(J){e=true}else{F[C]=false}}else{if(J){M.push(K);e=true}}}}}if(N!==undefined){if(!L){F=M}I=I.replace(k.match[G],"");if(!e){return[]}break}}}if(I===z){if(e==null){d.error(I)}else{break}}z=I}return F};d.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};var b=d.getText=function(B){var z,A,e=B.nodeType,y="";if(e){if(e===1||e===9||e===11){if(typeof B.textContent==="string"){return B.textContent}else{if(typeof B.innerText==="string"){return B.innerText.replace(u,"")}else{for(B=B.firstChild;B;B=B.nextSibling){y+=b(B)}}}}else{if(e===3||e===4){return B.nodeValue}}}else{for(z=0;(A=B[z]);z++){if(A.nodeType!==8){y+=b(A)}}}return y};var k=d.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")},type:function(e){return e.getAttribute("type")}},relative:{"+":function(D,y){var A=typeof y==="string",C=A&&!x.test(y),E=A&&!C;if(C){y=y.toLowerCase()}for(var z=0,e=D.length,B;z<e;z++){if((B=D[z])){while((B=B.previousSibling)&&B.nodeType!==1){}D[z]=E||B&&B.nodeName.toLowerCase()===y?B||false:B===y}}if(E){d.filter(y,D,true)}},">":function(D,y){var C,B=typeof y==="string",z=0,e=D.length;if(B&&!x.test(y)){y=y.toLowerCase();for(;z<e;z++){C=D[z];if(C){var A=C.parentNode;D[z]=A.nodeName.toLowerCase()===y?A:false}}}else{for(;z<e;z++){C=D[z];if(C){D[z]=B?C.parentNode:C.parentNode===y}}if(B){d.filter(y,D,true)}}},"":function(A,y,C){var B,z=o++,e=t;if(typeof y==="string"&&!x.test(y)){y=y.toLowerCase();B=y;e=a}e("parentNode",y,z,A,B,C)},"~":function(A,y,C){var B,z=o++,e=t;if(typeof y==="string"&&!x.test(y)){y=y.toLowerCase();B=y;e=a}e("previousSibling",y,z,A,B,C)}},find:{ID:function(y,z,A){if(typeof z.getElementById!=="undefined"&&!A){var e=z.getElementById(y[1]);return e&&e.parentNode?[e]:[]}},NAME:function(z,C){if(typeof C.getElementsByName!=="undefined"){var y=[],B=C.getElementsByName(z[1]);for(var A=0,e=B.length;A<e;A++){if(B[A].getAttribute("name")===z[1]){y.push(B[A])}}return y.length===0?null:y}},TAG:function(e,y){if(typeof y.getElementsByTagName!=="undefined"){return y.getElementsByTagName(e[1])}}},preFilter:{CLASS:function(A,y,z,e,D,E){A=" "+A[1].replace(q,"")+" ";if(E){return A}for(var B=0,C;(C=y[B])!=null;B++){if(C){if(D^(C.className&&(" "+C.className+" ").replace(/[\t\n\r]/g," ").indexOf(A)>=0)){if(!z){e.push(C)}}else{if(z){y[B]=false}}}}return false},ID:function(e){return e[1].replace(q,"")},TAG:function(y,e){return y[1].replace(q,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){d.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var y=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(y[1]+(y[2]||1))-0;e[3]=y[3]-0}else{if(e[2]){d.error(e[0])}}e[0]=o++;return e},ATTR:function(B,y,z,e,C,D){var A=B[1]=B[1].replace(q,"");if(!D&&k.attrMap[A]){B[1]=k.attrMap[A]}B[4]=(B[4]||B[5]||"").replace(q,"");if(B[2]==="~="){B[4]=" "+B[4]+" "}return B},PSEUDO:function(B,y,z,e,C){if(B[1]==="not"){if((n.exec(B[3])||"").length>1||/^\w/.test(B[3])){B[3]=d(B[3],null,null,y)}else{var A=d.filter(B[3],y,z,true^C);if(!z){e.push.apply(e,A)}return false}}else{if(k.match.POS.test(B[0])||k.match.CHILD.test(B[0])){return true}}return B},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(z,y,e){return !!d(e[3],z).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(z){var e=z.getAttribute("type"),y=z.type;return z.nodeName.toLowerCase()==="input"&&"text"===y&&(e===y||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===y.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===y.type},button:function(y){var e=y.nodeName.toLowerCase();return e==="input"&&"button"===y.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(y,e){return e===0},last:function(z,y,e,A){return y===A.length-1},even:function(y,e){return e%2===0},odd:function(y,e){return e%2===1},lt:function(z,y,e){return y<e[3]-0},gt:function(z,y,e){return y>e[3]-0},nth:function(z,y,e){return e[3]-0===y},eq:function(z,y,e){return e[3]-0===y}},filter:{PSEUDO:function(z,E,D,F){var e=E[1],y=k.filters[e];if(y){return y(z,D,E,F)}else{if(e==="contains"){return(z.textContent||z.innerText||b([z])||"").indexOf(E[3])>=0}else{if(e==="not"){var A=E[3];for(var C=0,B=A.length;C<B;C++){if(A[C]===z){return false}}return true}else{d.error(e)}}}},CHILD:function(z,B){var A,H,D,G,e,C,F,E=B[1],y=z;switch(E){case"only":case"first":while((y=y.previousSibling)){if(y.nodeType===1){return false}}if(E==="first"){return true}y=z;case"last":while((y=y.nextSibling)){if(y.nodeType===1){return false}}return true;case"nth":A=B[2];H=B[3];if(A===1&&H===0){return true}D=B[0];G=z.parentNode;if(G&&(G[i]!==D||!z.nodeIndex)){C=0;for(y=G.firstChild;y;y=y.nextSibling){if(y.nodeType===1){y.nodeIndex=++C}}G[i]=D}F=z.nodeIndex-H;if(A===0){return F===0}else{return(F%A===0&&F/A>=0)}}},ID:function(y,e){return y.nodeType===1&&y.getAttribute("id")===e},TAG:function(y,e){return(e==="*"&&y.nodeType===1)||!!y.nodeName&&y.nodeName.toLowerCase()===e},CLASS:function(y,e){return(" "+(y.className||y.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(C,A){var z=A[1],e=d.attr?d.attr(C,z):k.attrHandle[z]?k.attrHandle[z](C):C[z]!=null?C[z]:C.getAttribute(z),D=e+"",B=A[2],y=A[4];return e==null?B==="!=":!B&&d.attr?e!=null:B==="="?D===y:B==="*="?D.indexOf(y)>=0:B==="~="?(" "+D+" ").indexOf(y)>=0:!y?D&&e!==false:B==="!="?D!==y:B==="^="?D.indexOf(y)===0:B==="$="?D.substr(D.length-y.length)===y:B==="|="?D===y||D.substr(0,y.length+1)===y+"-":false},POS:function(B,y,z,C){var e=y[2],A=k.setFilters[e];if(A){return A(B,z,y,C)}}}};var j=k.match.POS,c=function(y,e){return"\\"+(e-0+1)};for(var f in k.match){k.match[f]=new RegExp(k.match[f].source+(/(?![^\[]*\])(?![^\(]*\))/.source));k.leftMatch[f]=new RegExp(/(^(?:.|\r|\n)*?)/.source+k.match[f].source.replace(/\\(\d+)/g,c))}k.match.globalPOS=j;var l=function(y,e){y=Array.prototype.slice.call(y,0);if(e){e.push.apply(e,y);return e}return y};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(v){l=function(B,A){var z=0,y=A||[];if(r.call(B)==="[object Array]"){Array.prototype.push.apply(y,B)}else{if(typeof B.length==="number"){for(var e=B.length;z<e;z++){y.push(B[z])}}else{for(;B[z];z++){y.push(B[z])}}}return y}}var p,m;if(document.documentElement.compareDocumentPosition){p=function(y,e){if(y===e){h=true;return 0}if(!y.compareDocumentPosition||!e.compareDocumentPosition){return y.compareDocumentPosition?-1:1}return y.compareDocumentPosition(e)&4?-1:1}}else{p=function(F,E){if(F===E){h=true;return 0}else{if(F.sourceIndex&&E.sourceIndex){return F.sourceIndex-E.sourceIndex}}var C,y,z=[],e=[],B=F.parentNode,D=E.parentNode,G=B;if(B===D){return m(F,E)}else{if(!B){return -1}else{if(!D){return 1}}}while(G){z.unshift(G);G=G.parentNode}G=D;while(G){e.unshift(G);G=G.parentNode}C=z.length;y=e.length;for(var A=0;A<C&&A<y;A++){if(z[A]!==e[A]){return m(z[A],e[A])}}return A===C?m(F,e[A],-1):m(z[A],E,1)};m=function(y,e,z){if(y===e){return z}var A=y.nextSibling;while(A){if(A===e){return -1}A=A.nextSibling}return 1}}(function(){var y=document.createElement("div"),z="script"+(new Date()).getTime(),e=document.documentElement;y.innerHTML="<a name='"+z+"'/>";e.insertBefore(y,e.firstChild);if(document.getElementById(z)){k.find.ID=function(B,C,D){if(typeof C.getElementById!=="undefined"&&!D){var A=C.getElementById(B[1]);return A?A.id===B[1]||typeof A.getAttributeNode!=="undefined"&&A.getAttributeNode("id").nodeValue===B[1]?[A]:undefined:[]}};k.filter.ID=function(C,A){var B=typeof C.getAttributeNode!=="undefined"&&C.getAttributeNode("id");return C.nodeType===1&&B&&B.nodeValue===A}}e.removeChild(y);e=y=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){k.find.TAG=function(y,C){var B=C.getElementsByTagName(y[1]);if(y[1]==="*"){var A=[];for(var z=0;B[z];z++){if(B[z].nodeType===1){A.push(B[z])}}B=A}return B}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){k.attrHandle.href=function(y){return y.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=d,A=document.createElement("div"),z="__sizzle__";A.innerHTML="<p class='TEST'></p>";if(A.querySelectorAll&&A.querySelectorAll(".TEST").length===0){return}d=function(L,C,G,K){C=C||document;if(!K&&!d.isXML(C)){var J=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(L);if(J&&(C.nodeType===1||C.nodeType===9)){if(J[1]){return l(C.getElementsByTagName(L),G)}else{if(J[2]&&k.find.CLASS&&C.getElementsByClassName){return l(C.getElementsByClassName(J[2]),G)}}}if(C.nodeType===9){if(L==="body"&&C.body){return l([C.body],G)}else{if(J&&J[3]){var F=C.getElementById(J[3]);if(F&&F.parentNode){if(F.id===J[3]){return l([F],G)}}else{return l([],G)}}}try{return l(C.querySelectorAll(L),G)}catch(H){}}else{if(C.nodeType===1&&C.nodeName.toLowerCase()!=="object"){var D=C,E=C.getAttribute("id"),B=E||z,N=C.parentNode,M=/^\s*[+~]/.test(L);if(!E){C.setAttribute("id",B)}else{B=B.replace(/'/g,"\\$&")}if(M&&N){C=C.parentNode}try{if(!M||N){return l(C.querySelectorAll("[id='"+B+"'] "+L),G)}}catch(I){}finally{if(!E){D.removeAttribute("id")}}}}}return e(L,C,G,K)};for(var y in e){d[y]=e[y]}A=null})()}(function(){var e=document.documentElement,z=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(z){var B=!z.call(document.createElement("div"),"div"),y=false;try{z.call(document.documentElement,"[test!='']:sizzle")}catch(A){y=true}d.matchesSelector=function(D,F){F=F.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!d.isXML(D)){try{if(y||!k.match.PSEUDO.test(F)&&!/!=/.test(F)){var C=z.call(D,F);if(C||!B||D.document&&D.document.nodeType!==11){return C}}}catch(E){}}return d(F,null,null,[D]).length>0}}})();(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}k.order.splice(1,0,"CLASS");k.find.CLASS=function(y,z,A){if(typeof z.getElementsByClassName!=="undefined"&&!A){return z.getElementsByClassName(y[1])}};e=null})();function a(y,D,C,G,E,F){for(var A=0,z=G.length;A<z;A++){var e=G[A];if(e){var B=false;e=e[y];while(e){if(e[i]===C){B=G[e.sizset];break}if(e.nodeType===1&&!F){e[i]=C;e.sizset=A}if(e.nodeName.toLowerCase()===D){B=e;break}e=e[y]}G[A]=B}}}function t(y,D,C,G,E,F){for(var A=0,z=G.length;A<z;A++){var e=G[A];if(e){var B=false;e=e[y];while(e){if(e[i]===C){B=G[e.sizset];break}if(e.nodeType===1){if(!F){e[i]=C;e.sizset=A}if(typeof D!=="string"){if(e===D){B=true;break}}else{if(d.filter(D,[e]).length>0){B=e;break}}}e=e[y]}G[A]=B}}}if(document.documentElement.contains){d.contains=function(y,e){return y!==e&&(y.contains?y.contains(e):true)}}else{if(document.documentElement.compareDocumentPosition){d.contains=function(y,e){return !!(y.compareDocumentPosition(e)&16)}}else{d.contains=function(){return false}}}d.isXML=function(e){var y=(e?e.ownerDocument||e:0).documentElement;return y?y.nodeName!=="HTML":false};var s=function(z,e,D){var C,E=[],B="",F=e.nodeType?[e]:e;while((C=k.match.PSEUDO.exec(z))){B+=C[0];z=z.replace(k.match.PSEUDO,"")}z=k.relative[z]?z+"*":z;for(var A=0,y=F.length;A<y;A++){d(z,F[A],E,D)}return d.filter(B,E)};window.tinymce.dom.Sizzle=d})();(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j<arguments.length;j++){h.push(arguments[j])}h=e[g].apply(e,h);b.update(g);return h}});a.extend(b,{on:function(i,h,g){return a.dom.Event.add(b.id,i,h,g)},getXY:function(){return{x:parseInt(b.getStyle("left")),y:parseInt(b.getStyle("top"))}},getSize:function(){var g=e.get(b.id);return{w:parseInt(b.getStyle("width")||g.clientWidth),h:parseInt(b.getStyle("height")||g.clientHeight)}},moveTo:function(g,h){b.setStyles({left:g,top:h})},moveBy:function(g,i){var h=b.getXY();b.moveTo(h.x+g,h.y+i)},resizeTo:function(g,i){b.setStyles({width:g,height:i})},resizeBy:function(g,j){var i=b.getSize();b.resizeTo(i.w+g,i.h+j)},update:function(h){var g;if(a.isIE6&&d.blocker){h=h||"";if(h.indexOf("get")===0||h.indexOf("has")===0||h.indexOf("is")===0){return}if(h=="remove"){e.remove(b.blocker);return}if(!b.blocker){b.blocker=e.uniqueId();g=e.add(d.container||e.getRoot(),"iframe",{id:b.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});e.setStyle(g,"opacity",0)}else{g=e.get(b.blocker)}e.setStyles(g,{left:b.getStyle("left",1),top:b.getStyle("top",1),width:b.getStyle("width",1),height:b.getStyle("height",1),display:b.getStyle("display",1),zIndex:parseInt(b.getStyle("zIndex",1)||0)-1})}}})}})(tinymce);(function(d){function f(g){return g.replace(/[\n\r]+/g,"")}var c=d.is,b=d.isIE,e=d.each,a=d.dom.TreeWalker;d.create("tinymce.dom.Selection",{Selection:function(j,i,h){var g=this;g.dom=j;g.win=i;g.serializer=h;e(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(k){g[k]=new d.util.Dispatcher(g)});if(!g.win.getSelection){g.tridentSel=new d.dom.TridentSelection(g)}if(d.isIE&&j.boxModel){this._fixIESelection()}d.addUnload(g.destroy,g)},setCursorLocation:function(i,j){var g=this;var h=g.dom.createRng();h.setStart(i,j);h.setEnd(i,j);g.setRng(h);g.collapse(false)},getContent:function(h){var g=this,i=g.getRng(),m=g.dom.create("body"),k=g.getSel(),j,l,o;h=h||{};j=l="";h.get=true;h.format=h.format||"html";h.forced_root_block="";g.onBeforeGetContent.dispatch(g,h);if(h.format=="text"){return g.isCollapsed()?"":(i.text||(k.toString?k.toString():""))}if(i.cloneContents){o=i.cloneContents();if(o){m.appendChild(o)}}else{if(c(i.item)||c(i.htmlText)){m.innerHTML="<br>"+(i.item?i.item(0).outerHTML:i.htmlText);m.removeChild(m.firstChild)}else{m.innerHTML=i.toString()}}if(/^\s/.test(m.innerHTML)){j=" "}if(/\s+$/.test(m.innerHTML)){l=" "}h.getInner=true;h.content=g.isCollapsed()?"":j+g.serializer.serialize(m,h)+l;g.onGetContent.dispatch(g,h);return h.content},setContent:function(h,j){var o=this,g=o.getRng(),k,l=o.win.document,n,m;j=j||{format:"html"};j.set=true;h=j.content=h;if(!j.no_events){o.onBeforeSetContent.dispatch(o,j)}h=j.content;if(g.insertNode){h+='<span id="__caret">_</span>';if(g.startContainer==l&&g.endContainer==l){l.body.innerHTML=h}else{g.deleteContents();if(l.body.childNodes.length===0){l.body.innerHTML=h}else{if(g.createContextualFragment){g.insertNode(g.createContextualFragment(h))}else{n=l.createDocumentFragment();m=l.createElement("div");n.appendChild(m);m.outerHTML=h;g.insertNode(n)}}}k=o.dom.get("__caret");g=l.createRange();g.setStartBefore(k);g.setEndBefore(k);o.setRng(g);o.dom.remove("__caret");try{o.setRng(g)}catch(i){}}else{if(g.item){l.execCommand("Delete",false,null);g=o.getRng()}if(/^\s+/.test(h)){g.pasteHTML('<span id="__mce_tmp">_</span>'+h);o.dom.remove("__mce_tmp")}else{g.pasteHTML(h)}}if(!j.no_events){o.onSetContent.dispatch(o,j)}},getStart:function(){var h=this.getRng(),i,g,k,j;if(h.duplicate||h.item){if(h.item){return h.item(0)}k=h.duplicate();k.collapse(1);i=k.parentElement();g=j=h.parentElement();while(j=j.parentNode){if(j==i){i=g;break}}return i}else{i=h.startContainer;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[Math.min(i.childNodes.length-1,h.startOffset)]}if(i&&i.nodeType==3){return i.parentNode}return i}},getEnd:function(){var h=this,i=h.getRng(),j,g;if(i.duplicate||i.item){if(i.item){return i.item(0)}i=i.duplicate();i.collapse(0);j=i.parentElement();if(j&&j.nodeName=="BODY"){return j.lastChild||j}return j}else{j=i.endContainer;g=i.endOffset;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[g>0?g-1:g]}if(j&&j.nodeType==3){return j.parentNode}return j}},getBookmark:function(s,v){var y=this,n=y.dom,h,k,j,o,i,p,q,m="\uFEFF",x;function g(z,A){var t=0;e(n.select(z),function(C,B){if(C==A){t=B}});return t}function u(t){function z(E){var A,D,C,B=E?"start":"end";A=t[B+"Container"];D=t[B+"Offset"];if(A.nodeType==1&&A.nodeName=="TR"){C=A.childNodes;A=C[Math.min(E?D:D-1,C.length-1)];if(A){D=E?0:A.childNodes.length;t["set"+(E?"Start":"End")](A,D)}}}z(true);z();return t}function l(){var z=y.getRng(true),t=n.getRoot(),A={};function B(E,J){var D=E[J?"startContainer":"endContainer"],I=E[J?"startOffset":"endOffset"],C=[],F,H,G=0;if(D.nodeType==3){if(v){for(F=D.previousSibling;F&&F.nodeType==3;F=F.previousSibling){I+=F.nodeValue.length}}C.push(I)}else{H=D.childNodes;if(I>=H.length&&H.length){G=1;I=Math.max(0,H.length-1)}C.push(y.dom.nodeIndex(H[I],v)+G)}for(;D&&D!=t;D=D.parentNode){C.push(y.dom.nodeIndex(D,v))}return C}A.start=B(z,true);if(!y.isCollapsed()){A.end=B(z)}return A}if(s==2){if(y.tridentSel){return y.tridentSel.getBookmark(s)}return l()}if(s){return{rng:y.getRng()}}h=y.getRng();j=n.uniqueId();o=tinyMCE.activeEditor.selection.isCollapsed();x="overflow:hidden;line-height:0px";if(h.duplicate||h.item){if(!h.item){k=h.duplicate();try{h.collapse();h.pasteHTML('<span data-mce-type="bookmark" id="'+j+'_start" style="'+x+'">'+m+"</span>");if(!o){k.collapse(false);h.moveToElementText(k.parentElement());if(h.compareEndPoints("StartToEnd",k)===0){k.move("character",-1)}k.pasteHTML('<span data-mce-type="bookmark" id="'+j+'_end" style="'+x+'">'+m+"</span>")}}catch(r){return null}}else{p=h.item(0);i=p.nodeName;return{name:i,index:g(i,p)}}}else{p=y.getNode();i=p.nodeName;if(i=="IMG"){return{name:i,index:g(i,p)}}k=u(h.cloneRange());if(!o){k.collapse(false);k.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_end",style:x},m))}h=u(h);h.collapse(true);h.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_start",style:x},m))}y.moveToBookmark({id:j,keep:1});return{id:j}},moveToBookmark:function(o){var s=this,m=s.dom,j,i,g,r,k,u,p,q;function h(A){var t=o[A?"start":"end"],x,y,z,v;if(t){z=t[0];for(y=r,x=t.length-1;x>=1;x--){v=y.childNodes;if(t[x]>v.length-1){return}y=v[t[x]]}if(y.nodeType===3){z=Math.min(t[0],y.nodeValue.length)}if(y.nodeType===1){z=Math.min(t[0],y.childNodes.length)}if(A){g.setStart(y,z)}else{g.setEnd(y,z)}}return true}function l(B){var v=m.get(o.id+"_"+B),A,t,y,z,x=o.keep;if(v){A=v.parentNode;if(B=="start"){if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}k=u=A;p=q=t}else{if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}u=A;q=t}if(!x){z=v.previousSibling;y=v.nextSibling;e(d.grep(v.childNodes),function(C){if(C.nodeType==3){C.nodeValue=C.nodeValue.replace(/\uFEFF/g,"")}});while(v=m.get(o.id+"_"+B)){m.remove(v,1)}if(z&&y&&z.nodeType==y.nodeType&&z.nodeType==3&&!d.isOpera){t=z.nodeValue.length;z.appendData(y.nodeValue);m.remove(y);if(B=="start"){k=u=z;p=q=t}else{u=z;q=t}}}}}function n(t){if(m.isBlock(t)&&!t.innerHTML&&!b){t.innerHTML='<br data-mce-bogus="1" />'}return t}if(o){if(o.start){g=m.createRng();r=m.getRoot();if(s.tridentSel){return s.tridentSel.moveToBookmark(o)}if(h(true)&&h()){s.setRng(g)}}else{if(o.id){l("start");l("end");if(k){g=m.createRng();g.setStart(n(k),p);g.setEnd(n(u),q);s.setRng(g)}}else{if(o.name){s.select(m.select(o.name)[o.index])}else{if(o.rng){s.setRng(o.rng)}}}}}},select:function(l,k){var j=this,m=j.dom,h=m.createRng(),g;function i(n,p){var o=new a(n,n);do{if(n.nodeType==3&&d.trim(n.nodeValue).length!==0){if(p){h.setStart(n,0)}else{h.setEnd(n,n.nodeValue.length)}return}if(n.nodeName=="BR"){if(p){h.setStartBefore(n)}else{h.setEndBefore(n)}return}}while(n=(p?o.next():o.prev()))}if(l){g=m.nodeIndex(l);h.setStart(l.parentNode,g);h.setEnd(l.parentNode,g+1);if(k){i(l,1);i(l)}j.setRng(h)}return l},isCollapsed:function(){var g=this,i=g.getRng(),h=g.getSel();if(!i||i.item){return false}if(i.compareEndPoints){return i.compareEndPoints("StartToEnd",i)===0}return !h||i.collapsed},collapse:function(g){var i=this,h=i.getRng(),j;if(h.item){j=h.item(0);h=i.win.document.body.createTextRange();h.moveToElementText(j)}h.collapse(!!g);i.setRng(h)},getSel:function(){var h=this,g=this.win;return g.getSelection?g.getSelection():g.document.selection},getRng:function(m){var h=this,j,g,l,k=h.win.document;if(m&&h.tridentSel){return h.tridentSel.getRangeAt(0)}try{if(j=h.getSel()){g=j.rangeCount>0?j.getRangeAt(0):(j.createRange?j.createRange():k.createRange())}}catch(i){}if(d.isIE&&g&&g.setStart&&k.selection.createRange().item){l=k.selection.createRange().item(0);g=k.createRange();g.setStartBefore(l);g.setEndAfter(l)}if(!g){g=k.createRange?k.createRange():k.body.createTextRange()}if(g.setStart&&g.startContainer.nodeType===9&&g.collapsed){l=h.dom.getRoot();g.setStart(l,0);g.setEnd(l,0)}if(h.selectedRange&&h.explicitRange){if(g.compareBoundaryPoints(g.START_TO_START,h.selectedRange)===0&&g.compareBoundaryPoints(g.END_TO_END,h.selectedRange)===0){g=h.explicitRange}else{h.selectedRange=null;h.explicitRange=null}}return g},setRng:function(k,g){var j,i=this;if(!i.tridentSel){j=i.getSel();if(j){i.explicitRange=k;try{j.removeAllRanges()}catch(h){}j.addRange(k);if(g===false&&j.extend){j.collapse(k.endContainer,k.endOffset);j.extend(k.startContainer,k.startOffset)}i.selectedRange=j.rangeCount>0?j.getRangeAt(0):null}}else{if(k.cloneRange){try{i.tridentSel.addRange(k);return}catch(h){}}try{k.select()}catch(h){}}},setNode:function(h){var g=this;g.setContent(g.dom.getOuterHTML(h));return h},getNode:function(){var i=this,h=i.getRng(),j=i.getSel(),m,l=h.startContainer,g=h.endContainer;function k(q,o){var p=q;while(q&&q.nodeType===3&&q.length===0){q=o?q.nextSibling:q.previousSibling}return q||p}if(!h){return i.dom.getRoot()}if(h.setStart){m=h.commonAncestorContainer;if(!h.collapsed){if(h.startContainer==h.endContainer){if(h.endOffset-h.startOffset<2){if(h.startContainer.hasChildNodes()){m=h.startContainer.childNodes[h.startOffset]}}}if(l.nodeType===3&&g.nodeType===3){if(l.length===h.startOffset){l=k(l.nextSibling,true)}else{l=l.parentNode}if(h.endOffset===0){g=k(g.previousSibling,false)}else{g=g.parentNode}if(l&&l===g){return l}}}if(m&&m.nodeType==3){return m.parentNode}return m}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(p,h){var o=this,k=o.dom,m,l,i,j=[];m=k.getParent(p||o.getStart(),k.isBlock);l=k.getParent(h||o.getEnd(),k.isBlock);if(m){j.push(m)}if(m&&l&&m!=l){i=m;var g=new a(m,k.getRoot());while((i=g.next())&&i!=l){if(k.isBlock(i)){j.push(i)}}}if(l&&m!=l){j.push(l)}return j},isForward:function(){var i=this.dom,g=this.getSel(),j,h;if(!g||g.anchorNode==null||g.focusNode==null){return true}j=i.createRng();j.setStart(g.anchorNode,g.anchorOffset);j.collapse(true);h=i.createRng();h.setStart(g.focusNode,g.focusOffset);h.collapse(true);return j.compareBoundaryPoints(j.START_TO_START,h)<=0},normalize:function(){var h=this,g,m,l,j,i;function k(p){var o,r,n,s=h.dom,u=s.getRoot(),q,t,v;function y(z,A){var B=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(z=B[A?"prev":"next"]()){if(z.nodeName==="BR"){return true}}}function x(B,z){var C,A;z=z||o;C=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(q=C[B?"prev":"next"]()){if(q.nodeType===3&&q.nodeValue.length>0){o=q;r=B?q.nodeValue.length:0;m=true;return}if(s.isBlock(q)||t[q.nodeName.toLowerCase()]){return}A=q}if(l&&A){o=A;m=true;r=0}}o=g[(p?"start":"end")+"Container"];r=g[(p?"start":"end")+"Offset"];t=s.schema.getNonEmptyElements();if(o.nodeType===9){o=s.getRoot();r=0}if(o===u){if(p){q=o.childNodes[r>0?r-1:0];if(q){v=q.nodeName.toLowerCase();if(t[q.nodeName]||q.nodeName=="TABLE"){return}}}if(o.hasChildNodes()){o=o.childNodes[Math.min(!p&&r>0?r-1:r,o.childNodes.length-1)];r=0;if(o.hasChildNodes()&&!/TABLE/.test(o.nodeName)){q=o;n=new a(o,u);do{if(q.nodeType===3&&q.nodeValue.length>0){r=p?0:q.nodeValue.length;o=q;m=true;break}if(t[q.nodeName.toLowerCase()]){r=s.nodeIndex(q);o=q.parentNode;if(q.nodeName=="IMG"&&!p){r++}m=true;break}}while(q=(p?n.next():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o.childNodes[r];if(q&&q.nodeName==="BR"&&!y(q)&&!y(q,true)){x(true,o.childNodes[r])}}}if(p&&!l&&o.nodeType===3&&r===o.nodeValue.length){x(false)}if(m){g["set"+(p?"Start":"End")](o,r)}}if(d.isIE){return}g=h.getRng();l=g.collapsed;k(true);if(!l){k()}if(m){if(l){g.collapse(true)}h.setRng(g,h.isForward())}},destroy:function(h){var g=this;g.win=null;if(!h){d.removeUnload(g.destroy)}},_fixIESelection:function(){var h=this.dom,n=h.doc,i=n.body,k,o,g;function j(p,s){var q=i.createTextRange();try{q.moveToPoint(p,s)}catch(r){q=null}return q}function m(q){var p;if(q.button){p=j(q.x,q.y);if(p){if(p.compareEndPoints("StartToStart",o)>0){p.setEndPoint("StartToStart",o)}else{p.setEndPoint("EndToEnd",o)}p.select()}}else{l()}}function l(){var p=n.selection.createRange();if(o&&!p.item&&p.compareEndPoints("StartToEnd",p)===0){o.select()}h.unbind(n,"mouseup",l);h.unbind(n,"mousemove",m);o=k=0}n.documentElement.unselectable=true;h.bind(n,["mousedown","contextmenu"],function(p){if(p.target.nodeName==="HTML"){if(k){l()}g=n.documentElement;if(g.scrollHeight>g.clientHeight){return}k=1;o=j(p.x,p.y);if(o){h.bind(n,"mouseup",l);h.bind(n,"mousemove",m);h.win.focus();o.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";e.remove_trailing_brs="remove_trailing_brs" in e?e.remove_trailing_brs:true;h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/(?:^|\s)mce(Item\w+|Selected)(?!\S)/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addAttributeFilter("data-mce-expando",function(j,l,k){var m=j.length;while(m--){j[m].attr(l,null)}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// <![CDATA[\n"+j(o)+"\n// ]]>"}}else{if(o.length>0){n.firstChild.value="<!--\n"+j(o)+"\n-->"}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(a.trim(m.getInner?o.innerHTML:i.getOuterHTML(o)),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF|\u200B/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],e={},d=[],g=0,f;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==f){j.push(m);l[m]=c}if(q){if(!e[m]){e[m]=[]}e[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(e[r],function(s){s.func.call(s.scope)});e[r]=f}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&d<h.nodeValue.length){i=f(h,d);h=i.previousSibling;if(g>d){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d<h.nodeValue.length){h=f(h,d);d=0}if(i.nodeType==3&&g>0&&g<i.nodeValue.length){i=f(i,g).previousSibling;g=i.nodeValue.length}}return{startContainer:h,startOffset:d,endContainer:i,endOffset:g}}};a.dom.RangeUtils.compareRanges=function(c,b){if(c&&b){if(c.item||c.duplicate){if(c.item&&b.item&&c.item(0)===b.item(0)){return true}if(c.isEqual&&b.isEqual&&b.isEqual(c)){return true}}else{return c.startContainer==b.startContainer&&c.startOffset==b.startOffset}}return false}})(tinymce);(function(b){var a=b.dom.Event,c=b.each;b.create("tinymce.ui.KeyboardNavigation",{KeyboardNavigation:function(e,f){var p=this,m=e.root,l=e.items,n=e.enableUpDown,i=e.enableLeftRight||!e.enableUpDown,k=e.excludeFromTabOrder,j,h,o,d,g;f=f||b.DOM;j=function(q){g=q.target.id};h=function(q){f.setAttrib(q.target.id,"tabindex","-1")};d=function(q){var r=f.get(g);f.setAttrib(r,"tabindex","0");r.focus()};p.focus=function(){f.get(g).focus()};p.destroy=function(){c(l,function(q){f.unbind(f.get(q.id),"focus",j);f.unbind(f.get(q.id),"blur",h)});f.unbind(f.get(m),"focus",d);f.unbind(f.get(m),"keydown",o);l=f=m=p.focus=j=h=o=d=null;p.destroy=function(){}};p.moveFocus=function(u,r){var q=-1,t=p.controls,s;if(!g){return}c(l,function(x,v){if(x.id===g){q=v;return false}});q+=u;if(q<0){q=l.length-1}else{if(q>=l.length){q=0}}s=l[q];f.setAttrib(g,"tabindex","-1");f.setAttrib(s.id,"tabindex","0");f.get(s.id).focus();if(e.actOnFocus){e.onAction(s.id)}if(r){a.cancel(r)}};o=function(y){var u=37,t=39,x=38,z=40,q=27,s=14,r=13,v=32;switch(y.keyCode){case u:if(i){p.moveFocus(-1)}break;case t:if(i){p.moveFocus(1)}break;case x:if(n){p.moveFocus(-1)}break;case z:if(n){p.moveFocus(1)}break;case q:if(e.onCancel){e.onCancel();a.cancel(y)}break;case s:case r:case v:if(e.onAction){e.onAction(g);a.cancel(y)}break}};c(l,function(s,q){var r;if(!s.id){s.id=f.uniqueId("_mce_item_")}if(k){f.bind(s.id,"blur",h);r="-1"}else{r=(q===0?"0":"-1")}f.setAttrib(s.id,"tabindex",r);f.bind(f.get(s.id),"focus",j)});if(l[0]){g=l[0].id}f.setAttrib(m,"tabindex","-1");f.bind(f.get(m),"focus",d);f.bind(f.get(m),"keydown",o)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.offsetWidth,j.max_width):g.offsetWidth;k=j.max_height?Math.min(g.offsetHeight,j.max_height):g.offsetHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return false}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.get("menu_"+g.id);h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){if(typeof h.settings.style=="function"){h.settings.style=h.settings.style()}c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a role="button" id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" aria-labelledby="'+this.id+'_voice" title="'+a.encode(e.title)+'">';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+='<img class="mceIcon" src="'+e.image+'" alt="'+a.encode(e.title)+'" />'+c}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")}d+='<span class="mceVoiceLabel mceIconOnly" style="display: none;" id="'+this.id+'_voice">'+e.title+"</span>";d+="</a>";return d},postRender:function(){var d=this,e=d.settings,c;if(b.isIE&&d.editor){b.dom.Event.add(d.id,"mousedown",function(f){var g=d.editor.selection.getNode().nodeName;c=g==="IMG"?d.editor.selection.getBookmark():null})}b.dom.Event.add(d.id,"click",function(f){if(!d.isDisabled()){if(b.isIE&&d.editor&&c!==null){d.editor.selection.moveToBookmark(c)}return e.onclick.call(e.scope,f)}});b.dom.Event.add(d.id,"keyup",function(f){if(!d.isDisabled()&&f.keyCode==b.VK.SPACEBAR){return e.onclick.call(e.scope,f)}})}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(j,i,g){var h=this;h.parent(j,i,g);h.items=[];h.onChange=new a(h);h.onPostRender=new a(h);h.onAdd=new a(h);h.onRenderMenu=new e.util.Dispatcher(this);h.classPrefix="mceListBox";h.marked={}},select:function(h){var g=this,j,i;g.marked={};if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){var i=this,j,k,h;i.marked={};if(g!=i.selectedIndex){j=d.get(i.id+"_text");h=d.get(i.id+"_voiceDesc");k=i.items[g];if(k){i.selectedValue=k.value;i.selectedIndex=g;d.setHTML(j,d.encode(k.title));d.setHTML(h,i.settings.title+" - "+k.title);d.removeClass(j,"mceTitle");d.setAttrib(i.id,"aria-valuenow",k.title)}else{d.setHTML(j,d.encode(i.settings.title));d.setHTML(h,d.encode(i.settings.title));d.addClass(j,"mceTitle");i.selectedValue=i.selectedIndex=null;d.setAttrib(i.id,"aria-valuenow",i.settings.title)}j=0}},mark:function(g){this.marked[g]=true},add:function(j,g,i){var h=this;i=i||{};i=e.extend(i,{title:j,value:g});h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var j="",g=this,i=g.settings,k=g.classPrefix;j='<span role="listbox" aria-haspopup="true" aria-labelledby="'+g.id+'_voiceDesc" aria-describedby="'+g.id+'_voiceDesc"><table role="presentation" tabindex="0" id="'+g.id+'" cellpadding="0" cellspacing="0" class="'+k+" "+k+"Enabled"+(i["class"]?(" "+i["class"]):"")+'"><tbody><tr>';j+="<td>"+d.createHTML("span",{id:g.id+"_voiceDesc","class":"voiceLabel",style:"display:none;"},g.settings.title);j+=d.createHTML("a",{id:g.id+"_text",tabindex:-1,href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},d.encode(g.settings.title))+"</td>";j+="<td>"+d.createHTML("a",{id:g.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},'<span><span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span></span>')+"</td>";j+="</tr></tbody></table></span>";return j},showMenu:function(){var h=this,j,i=d.get(this.id),g;if(h.isDisabled()||h.items.length===0){return}if(h.menu&&h.menu.isMenuVisible){return h.hideMenu()}if(!h.isMenuRendered){h.renderMenu();h.isMenuRendered=true}j=d.getPos(i);g=h.menu;g.settings.offset_x=j.x;g.settings.offset_y=j.y;g.settings.keyboard_focus=!e.isOpera;f(h.items,function(k){if(g.items[k.id]){g.items[k.id].setSelected(0)}});f(h.items,function(k){if(g.items[k.id]&&h.marked[k.value]){g.items[k.id].setSelected(1)}if(k.value===h.selectedValue){g.items[k.id].setSelected(1)}});g.showMenu(0,i.clientHeight);b.add(d.doc,"mousedown",h.hideMenu,h);d.addClass(h.id,h.classPrefix+"Selected")},hideMenu:function(h){var g=this;if(g.menu&&g.menu.isMenuVisible){d.removeClass(g.id,g.classPrefix+"Selected");if(h&&h.type=="mousedown"&&(h.target.id==g.id+"_text"||h.target.id==g.id+"_open")){return}if(!h||!d.getParent(h.target,".mceMenu")){d.removeClass(g.id,g.classPrefix+"Selected");b.remove(d.doc,"mousedown",g.hideMenu,g);g.menu.hideMenu()}}},renderMenu:function(){var h=this,g;g=h.settings.control_manager.createDropMenu(h.id+"_menu",{menu_line:1,"class":h.classPrefix+"Menu mceNoIcons",max_width:250,max_height:150});g.onHideMenu.add(function(){h.hideMenu();h.focus()});g.add({title:h.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}});f(h.items,function(i){if(i.value===c){g.add({title:i.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}})}else{i.id=d.uniqueId();i.role="option";i.onclick=function(){if(h.settings.onselect(i.value)!==false){h.select(i.value)}};g.add(i)}});h.onRenderMenu.dispatch(h,g);h.menu=g},postRender:function(){var g=this,h=g.classPrefix;b.add(g.id,"click",g.showMenu,g);b.add(g.id,"keydown",function(i){if(i.keyCode==32){g.showMenu(i);b.cancel(i)}});b.add(g.id,"focus",function(){if(!g._focused){g.keyDownHandler=b.add(g.id,"keydown",function(i){if(i.keyCode==40){g.showMenu();b.cancel(i)}});g.keyPressHandler=b.add(g.id,"keypress",function(j){var i;if(j.keyCode==13){i=g.selectedValue;g.selectedValue=null;b.cancel(j);g.settings.onselect(i)}})}g._focused=1});b.add(g.id,"blur",function(){b.remove(g.id,"keydown",g.keyDownHandler);b.remove(g.id,"keypress",g.keyPressHandler);g._focused=0});if(e.isIE6||!d.boxModel){b.add(g.id,"mouseover",function(){if(!d.hasClass(g.id,h+"Disabled")){d.addClass(g.id,h+"Hover")}});b.add(g.id,"mouseout",function(){if(!d.hasClass(g.id,h+"Disabled")){d.removeClass(g.id,h+"Hover")}})}g.onPostRender.dispatch(g,d.get(g.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(h,g){this.parent(h,g);this.classPrefix="mceNativeListBox"},setDisabled:function(g){d.get(this.id).disabled=g;this.setAriaProperty("disabled",g)},isDisabled:function(){return d.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){d.get(this.id).selectedIndex=g+1;this.selectedValue=this.items[g]?this.items[g].value:null},add:function(k,h,g){var j,i=this;g=g||{};g.value=h;if(i.isRendered()){d.add(d.get(this.id),"option",g,k)}j={title:k,value:h,attribs:g};i.items.push(j);i.onAdd.dispatch(i,j)},getLength:function(){return this.items.length},renderHTML:function(){var i,g=this;i=d.createHTML("option",{value:""},"-- "+g.settings.title+" --");f(g.items,function(h){i+=d.createHTML("option",{value:h.value},h.title)});i=d.createHTML("select",{id:g.id,"class":"mceNativeListBox","aria-labelledby":g.id+"_aria"},i);i+=d.createHTML("span",{id:g.id+"_aria",style:"display: none"},g.settings.title);return i},postRender:function(){var h=this,i,j=true;h.rendered=true;function g(l){var k=h.items[l.target.selectedIndex-1];if(k&&(k=k.value)){h.onChange.dispatch(h,k);if(h.settings.onselect){h.settings.onselect(k)}}}b.add(h.id,"change",g);b.add(h.id,"keydown",function(l){var k;b.remove(h.id,"change",i);j=false;k=b.add(h.id,"blur",function(){if(j){return}j=true;b.add(h.id,"change",g);b.remove(h.id,"blur",k)});if(e.isWebKit&&(l.keyCode==37||l.keyCode==39)){return b.prevent(l)}if(l.keyCode==13||l.keyCode==32){g(l);return b.cancel(l)}});h.onPostRender.dispatch(h,d.get(h.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.firstChild.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+="<td >"+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'<span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span>');i+="<td >"+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.firstChild.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(m){m=m.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");var i={href:"javascript:;",style:{backgroundColor:"#"+m},title:p.editor.getLang("colors."+m,m),"data-mce-color":"#"+m};if(!d.isIE){i.role="option"}g=c.add(g,"a",i);if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+m;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");new d.ui.KeyboardNavigation({root:p.id+"_menu",items:c.select("a",p.id+"_menu"),onCancel:function(){p.hideMenu();p.focus()}});a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return false});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('<div id="'+f.id+'" role="group" aria-labelledby="'+f.id+'_voice">');i.push("<span role='application'>");i.push('<span id="'+f.id+'_voice" class="mceVoiceLabel" style="display:none;">'+d.encode(g.name)+"</span>");j(e,function(h){i.push(h.renderHTML())});i.push("</span>");i.push("</div>");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e<l.length;e++){k=l[e];d=l[e-1];g=l[e+1];if(e===0){j="mceToolbarStart";if(k.Button){j+=" mceToolbarStartButton"}else{if(k.SplitButton){j+=" mceToolbarStartSplitButton"}else{if(k.ListBox){j+=" mceToolbarStartListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,"<!-- IE -->"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,"<!-- IE -->"))}}if(c.stdMode){f+='<td style="position: relative">'+k.renderHTML()+"</td>"}else{f+="<td>"+k.renderHTML()+"</td>"}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,"<!-- IE -->"))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,"<!-- IE -->"));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},"<tbody><tr>"+f+"</tr></tbody>")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!==0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(x){var v=this,o,n=j.ScriptLoader,u,l=[],r;function q(t){var s=t.id;if(!s){s=t.name;if(s&&!k.get(s)){s=t.name}else{s=k.uniqueId()}t.setAttribute("id",s)}return s}function m(z,A,t){var y=z[A];if(!y){return}if(j.is(y,"string")){t=y.replace(/\.\w+$/,"");t=t?j.resolve(t):0;y=j.resolve(y)}return y.apply(t||this,Array.prototype.slice.call(arguments,2))}function p(t,s){return s.constructor===RegExp?s.test(t.className):k.hasClass(t,s)}x=d({theme:"simple",language:"en"},x);v.settings=x;i.bind(window,"ready",function(){var s,t;m(x,"onpageload");switch(x.mode){case"exact":s=x.elements||"";if(s.length>0){g(e(s),function(y){if(k.get(y)){r=new j.Editor(y,x);l.push(r);r.render(1)}else{g(document.forms,function(z){g(z.elements,function(A){if(A.name===y){y="mce_editor_"+c++;k.setAttrib(A,"id",y);r=new j.Editor(y,x);l.push(r);r.render(1)}})})}})}break;case"textareas":case"specific_textareas":g(k.select("textarea"),function(y){if(x.editor_deselector&&p(y,x.editor_deselector)){return}if(!x.editor_selector||p(y,x.editor_selector)){r=new j.Editor(q(y),x);l.push(r);r.render(1)}});break;default:if(x.types){g(x.types,function(y){g(k.select(y.selector),function(A){var z=new j.Editor(q(A),j.extend({},x,y));l.push(z);z.render(1)})})}else{if(x.selector){g(k.select(x.selector),function(z){var y=new j.Editor(q(z),x);l.push(y);y.render(1)})}}}if(x.oninit){s=t=0;g(l,function(y){t++;if(!y.initialized){y.onInit.add(function(){s++;if(s==t){m(x,"oninit")}})}else{s++}if(s==t){m(x,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l<o.length;l++){if(o[l]==n){o.splice(l,1);break}}if(m.activeEditor==n){m._setActive(o[0])}n.destroy();m.onRemoveEditor.dispatch(m,n);return n},execCommand:function(r,p,o){var q=this,n=q.get(o),l;function m(){n.destroy();l.detachEvent("onunload",m);l=l.tinyMCE=l.tinymce=null}switch(r){case"mceFocus":n.focus();return true;case"mceAddEditor":case"mceAddControl":if(!q.get(o)){new j.Editor(o,q.settings).render()}return true;case"mceAddFrameControl":l=o.window;l.tinyMCE=tinyMCE;l.tinymce=j;j.DOM.doc=l.document;j.DOM.win=l;n=new j.Editor(o.element_id,o);n.render();if(j.isIE){l.attachEvent("onunload",m)}o.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(n){n.remove()}return true;case"mceToggleEditor":if(!n){q.execCommand("mceAddControl",0,o);return true}if(n.isHidden()){n.show()}else{n.hide()}return true}if(q.activeEditor){return q.activeEditor.execCommand(r,p,o)}return false},execInstanceCommand:function(p,o,n,m){var l=this.get(p);if(l){return l.execCommand(o,n,m)}return false},triggerSave:function(){g(this.editors,function(l){l.save()})},addI18n:function(n,q){var l,m=this.i18n;if(!j.is(n,"string")){g(n,function(r,p){g(r,function(t,s){g(t,function(v,u){if(s==="common"){m[p+"."+u]=v}else{m[p+"."+s+"."+u]=v}})})})}else{g(q,function(r,p){m[n+"."+p]=r})}},_setActive:function(l){this.selectedInstance=this.activeEditor=l}})})(tinymce);(function(k){var l=k.DOM,j=k.dom.Event,f=k.extend,i=k.each,a=k.isGecko,b=k.isIE,e=k.isWebKit,d=k.is,h=k.ThemeManager,c=k.PluginManager,g=k.explode;k.create("tinymce.Editor",{Editor:function(p,o){var m=this,n=true;m.settings=o=f({id:p,language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:k.documentBaseURL,add_form_submit_trigger:n,submit_patch:n,add_unload_trigger:n,convert_urls:n,relative_urls:n,remove_script_host:n,table_inline_editing:false,object_resizing:n,accessibility_focus:n,doctype:k.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE>",visual:n,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:n,directionality:"ltr",forced_root_block:"p",hidden_input:n,padd_empty_editor:n,render_ui:n,indentation:"30px",fix_table_elements:n,inline_styles:n,convert_fonts_to_spans:n,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",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",validate:n,entity_encoding:"named",url_converter:m.convertURL,url_converter_scope:m,ie7_compat:n},o);m.id=m.editorId=p;m.isNotDirty=false;m.plugins={};m.documentBaseURI=new k.util.URI(o.document_base_url||k.documentBaseURL,{base_uri:tinyMCE.baseURI});m.baseURI=k.baseURI;m.contentCSS=[];m.setupEvents();m.execCommands={};m.queryStateCommands={};m.queryValueCommands={};m.execCallback("setup",m)},render:function(o){var p=this,q=p.settings,r=p.id,m=k.ScriptLoader;if(!j.domLoaded){j.add(window,"ready",function(){p.render()});return}tinyMCE.settings=q;if(!p.getElement()){return}if(k.isIDevice&&!k.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(p.getElement().nodeName)&&q.hidden_input&&l.getParent(r,"form")){l.insertAfter(l.create("input",{type:"hidden",name:r}),r)}if(k.WindowManager){p.windowManager=new k.WindowManager(p)}if(q.encoding=="xml"){p.onGetContent.add(function(s,t){if(t.save){t.content=l.encode(t.content)}})}if(q.add_form_submit_trigger){p.onSubmit.addToTop(function(){if(p.initialized){p.save();p.isNotDirty=1}})}if(q.add_unload_trigger){p._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(p.initialized&&!p.destroyed&&!p.isHidden()){p.save({format:"raw",no_events:true})}})}k.addUnload(p.destroy,p);if(q.submit_patch){p.onBeforeRenderUI.add(function(){var s=p.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){p.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){k.triggerSave();p.isNotDirty=1;return p.formElement._mceOldSubmit(p.formElement)}}s=null})}function n(){if(q.language&&q.language_load!==false){m.add(k.baseURL+"/langs/"+q.language+".js")}if(q.theme&&q.theme.charAt(0)!="-"&&!h.urls[q.theme]){h.load(q.theme,"themes/"+q.theme+"/editor_template"+k.suffix+".js")}i(g(q.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(v){var u={prefix:"plugins/",resource:v,suffix:"/editor_plugin"+k.suffix+".js"};v=c.createUrl(u,v);c.load(v.resource,v)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+k.suffix+".js"})}}});m.loadQueue(function(){if(!p.removed){p.init()}})}n()},init:function(){var q,F=this,G=F.settings,C,y,B=F.getElement(),p,m,D,v,A,E,x,r=[];k.add(F);G.aria_label=G.aria_label||l.getAttrib(B,"aria-label",F.getLang("aria.rich_text_area"));if(G.theme){G.theme=G.theme.replace(/-/,"");p=h.get(G.theme);F.theme=new p();if(F.theme.init){F.theme.init(F,h.urls[G.theme]||k.documentBaseURL.replace(/\/$/,""))}}function z(s){var t=c.get(s),o=c.urls[s]||k.documentBaseURL.replace(/\/$/,""),n;if(t&&k.inArray(r,s)===-1){i(c.dependencies(s),function(u){z(u)});n=new t(F,o);F.plugins[s]=n;if(n.init){n.init(F,o);r.push(s)}}}i(g(G.plugins.replace(/\-/g,"")),z);if(G.popup_css!==false){if(G.popup_css){G.popup_css=F.documentBaseURI.toAbsolute(G.popup_css)}else{G.popup_css=F.baseURI.toAbsolute("themes/"+G.theme+"/skins/"+G.skin+"/dialog.css")}}if(G.popup_css_add){G.popup_css+=","+F.documentBaseURI.toAbsolute(G.popup_css_add)}F.controlManager=new k.ControlManager(F);F.onExecCommand.add(function(n,o){if(!/^(FontName|FontSize)$/.test(o)){F.nodeChanged()}});F.onBeforeRenderUI.dispatch(F,F.controlManager);if(G.render_ui&&F.theme){C=G.width||B.style.width||B.offsetWidth;y=G.height||B.style.height||B.offsetHeight;F.orgDisplay=B.style.display;E=/^[0-9\.]+(|px)$/i;if(E.test(""+C)){C=Math.max(parseInt(C,10)+(p.deltaWidth||0),100)}if(E.test(""+y)){y=Math.max(parseInt(y,10)+(p.deltaHeight||0),100)}p=F.theme.renderUI({targetNode:B,width:C,height:y,deltaWidth:G.delta_width,deltaHeight:G.delta_height});F.editorContainer=p.editorContainer}if(G.content_css){i(g(G.content_css),function(n){F.contentCSS.push(F.documentBaseURI.toAbsolute(n))})}if(G.content_editable){B=q=p=null;return F.initContentBody()}if(document.domain&&location.hostname!=document.domain){k.relaxedDomain=document.domain}l.setStyles(p.sizeContainer||p.editorContainer,{width:C,height:y});y=(p.iframeHeight||y)+(typeof(y)=="number"?(p.deltaHeight||0):"");if(y<100){y=100}F.iframeHTML=G.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(G.document_base_url!=k.documentBaseURL){F.iframeHTML+='<base href="'+F.documentBaseURI.getURI()+'" />'}if(G.ie7_compat){F.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'}else{F.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=edge" />'}F.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';for(x=0;x<F.contentCSS.length;x++){F.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+F.contentCSS[x]+'" />'}F.contentCSS=[];v=G.body_id||"tinymce";if(v.indexOf("=")!=-1){v=F.getParam("body_id","","hash");v=v[F.id]||v}A=G.body_class||"";if(A.indexOf("=")!=-1){A=F.getParam("body_class","","hash");A=A[F.id]||""}F.iframeHTML+='</head><body id="'+v+'" class="mceContentBody '+A+'" onload="window.parent.tinyMCE.get(\''+F.id+"').onLoad.dispatch();\"><br></body></html>";if(k.relaxedDomain&&(b||(k.isOpera&&parseFloat(opera.version())<11))){D='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+F.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody();})()'}q=l.add(p.iframeContainer,"iframe",{id:F.id+"_ifr",src:D||'javascript:""',frameBorder:"0",allowTransparency:"true",title:G.aria_label,style:{width:"100%",height:y,display:"block"}});F.contentAreaContainer=p.iframeContainer;l.get(p.editorContainer).style.display=F.orgDisplay;l.get(F.id).style.display="none";l.setAttrib(F.id,"aria-hidden",true);if(!k.relaxedDomain||!D){F.initContentBody()}B=q=p=null},initContentBody:function(){var n=this,p=n.settings,q=l.get(n.id),r=n.getDoc(),o,m;if((!b||!k.relaxedDomain)&&!p.content_editable){r.open();r.write(n.iframeHTML);r.close();if(k.relaxedDomain){r.domain=k.relaxedDomain}}if(p.content_editable){l.addClass(q,"mceContentBody");n.contentDocument=r=p.content_document||document;n.contentWindow=p.content_window||window;n.bodyElement=q;p.content_document=p.content_window=null}m=n.getBody();m.disabled=true;if(!p.readonly){m.contentEditable=n.getParam("content_editable_state",true)}m.disabled=false;n.schema=new k.html.Schema(p);n.dom=new k.dom.DOMUtils(r,{keep_values:true,url_converter:n.convertURL,url_converter_scope:n,hex_colors:p.force_hex_style_colors,class_filter:p.class_filter,update_styles:true,root_element:p.content_editable?n.id:null,schema:n.schema});n.parser=new k.html.DomParser(p,n.schema);n.parser.addAttributeFilter("src,href,style",function(s,t){var u=s.length,x,z=n.dom,y,v;while(u--){x=s[u];y=x.attr(t);v="data-mce-"+t;if(!x.attributes.map[v]){if(t==="style"){x.attr(v,z.serializeStyle(z.parseStyle(y),x.name))}else{x.attr(v,n.convertURL(y,t,x.name))}}}});n.parser.addNodeFilter("script",function(s,t){var u=s.length,v;while(u--){v=s[u];v.attr("type","mce-"+(v.attr("type")||"text/javascript"))}});n.parser.addNodeFilter("#cdata",function(s,t){var u=s.length,v;while(u--){v=s[u];v.type=8;v.name="#comment";v.value="[CDATA["+v.value+"]]"}});n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(t,u){var v=t.length,x,s=n.schema.getNonEmptyElements();while(v--){x=t[v];if(x.isEmpty(s)){x.empty().append(new k.html.Node("br",1)).shortEnded=true}}});n.serializer=new k.dom.Serializer(p,n.dom,n.schema);n.selection=new k.dom.Selection(n.dom,n.getWin(),n.serializer);n.formatter=new k.Formatter(n);n.undoManager=new k.UndoManager(n);n.forceBlocks=new k.ForceBlocks(n);n.enterKey=new k.EnterKey(n);n.editorCommands=new k.EditorCommands(n);n.serializer.onPreProcess.add(function(s,t){return n.onPreProcess.dispatch(n,t,s)});n.serializer.onPostProcess.add(function(s,t){return n.onPostProcess.dispatch(n,t,s)});n.onPreInit.dispatch(n);if(!p.gecko_spellcheck){r.body.spellcheck=false}if(!p.readonly){n.bindNativeEvents()}n.controlManager.onPostRender.dispatch(n,n.controlManager);n.onPostRender.dispatch(n);n.quirks=k.util.Quirks(n);if(p.directionality){m.dir=p.directionality}if(p.nowrap){m.style.whiteSpace="nowrap"}if(p.protect){n.onBeforeSetContent.add(function(s,t){i(p.protect,function(u){t.content=t.content.replace(u,function(v){return"<!--mce:protected "+escape(v)+"-->"})})})}n.onSetContent.add(function(){n.addVisual(n.getBody())});if(p.padd_empty_editor){n.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}n.load({initial:true,format:"html"});n.startContent=n.getContent({format:"raw"});n.initialized=true;n.onInit.dispatch(n);n.execCallback("setupcontent_callback",n.id,m,r);n.execCallback("init_instance_callback",n);n.focus(true);n.nodeChanged({initial:true});i(n.contentCSS,function(s){n.dom.loadCSS(s)});if(p.auto_focus){setTimeout(function(){var s=k.get(p.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getBody().focus();s.getWin().focus()},100)}q=r=m=null},focus:function(p){var o,u=this,t=u.selection,q=u.settings.content_editable,n,r,s=u.getDoc(),m;if(!p){n=t.getRng();if(n.item){r=n.item(0)}u._refreshContentEditable();if(!q){u.getWin().focus()}if(k.isGecko||q){m=u.getBody();if(m.setActive){m.setActive()}else{m.focus()}if(q){t.normalize()}}if(r&&r.ownerDocument==s){n=s.body.createControlRange();n.addElement(r);n.select()}}if(k.activeEditor!=u){if((o=k.activeEditor)!=null){o.onDeactivate.dispatch(o,u)}u.onActivate.dispatch(u,o)}k._setActive(u)},execCallback:function(q){var m=this,p=m.settings[q],o;if(!p){return}if(m.callbackLookup&&(o=m.callbackLookup[q])){p=o.func;o=o.scope}if(d(p,"string")){o=p.replace(/\.\w+$/,"");o=o?k.resolve(o):0;p=k.resolve(p);m.callbackLookup=m.callbackLookup||{};m.callbackLookup[q]={func:p,scope:o}}return p.apply(o||m,Array.prototype.slice.call(arguments,1))},translate:function(m){var o=this.settings.language||"en",n=k.i18n;if(!m){return""}return n[o+"."+m]||m.replace(/\{\#([^\}]+)\}/g,function(q,p){return n[o+"."+p]||"{#"+p+"}"})},getLang:function(o,m){return k.i18n[(this.settings.language||"en")+"."+o]||(d(m)?m:"{#"+o+"}")},getParam:function(t,q,m){var r=k.trim,p=d(this.settings[t])?this.settings[t]:q,s;if(m==="hash"){s={};if(d(p,"string")){i(p.indexOf("=")>0?p.split(/[;,](?![^=;,]*(?:[;,]|$))/):p.split(","),function(n){n=n.split("=");if(n.length>1){s[r(n[0])]=r(n[1])}else{s[r(n[0])]=r(n)}})}else{s=p}return s}return p},nodeChanged:function(q){var m=this,n=m.selection,p;if(m.initialized){q=q||{};p=n.getStart()||m.getBody();p=b&&p.ownerDocument!=m.getDoc()?m.getBody():p;q.parents=[];m.dom.getParent(p,function(o){if(o.nodeName=="BODY"){return true}q.parents.push(o)});m.onNodeChange.dispatch(m,q?q.controlManager||m.controlManager:m.controlManager,p,n.isCollapsed(),q)}},addButton:function(n,o){var m=this;m.buttons=m.buttons||{};m.buttons[n]=o},addCommand:function(m,o,n){this.execCommands[m]={func:o,scope:n||this}},addQueryStateHandler:function(m,o,n){this.queryStateCommands[m]={func:o,scope:n||this}},addQueryValueHandler:function(m,o,n){this.queryValueCommands[m]={func:o,scope:n||this}},addShortcut:function(o,q,m,p){var n=this,r;if(n.settings.custom_shortcuts===false){return false}n.shortcuts=n.shortcuts||{};if(d(m,"string")){r=m;m=function(){n.execCommand(r,false,null)}}if(d(m,"object")){r=m;m=function(){n.execCommand(r[0],r[1],r[2])}}i(g(o),function(s){var t={func:m,scope:p||this,desc:n.translate(q),alt:false,ctrl:false,shift:false};i(g(s,"+"),function(u){switch(u){case"alt":case"ctrl":case"shift":t[u]=true;break;default:t.charCode=u.charCodeAt(0);t.keyCode=u.toUpperCase().charCodeAt(0)}});n.shortcuts[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t});return true},execCommand:function(u,r,x,m){var p=this,q=0,v,n;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(u)&&(!m||!m.skip_focus)){p.focus()}m=f({},m);p.onBeforeExecCommand.dispatch(p,u,r,x,m);if(m.terminate){return false}if(p.execCallback("execcommand_callback",p.id,p.selection.getNode(),u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(v=p.execCommands[u]){n=v.func.call(v.scope,r,x);if(n!==true){p.onExecCommand.dispatch(p,u,r,x,m);return n}}i(p.plugins,function(o){if(o.execCommand&&o.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);q=1;return false}});if(q){return true}if(p.theme&&p.theme.execCommand&&p.theme.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(p.editorCommands.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}p.getDoc().execCommand(u,r,x);p.onExecCommand.dispatch(p,u,r,x,m)},queryCommandState:function(q){var n=this,r,p;if(n._isHidden()){return}if(r=n.queryStateCommands[q]){p=r.func.call(r.scope);if(p!==true){return p}}r=n.editorCommands.queryCommandState(q);if(r!==-1){return r}try{return this.getDoc().queryCommandState(q)}catch(m){}},queryCommandValue:function(r){var n=this,q,p;if(n._isHidden()){return}if(q=n.queryValueCommands[r]){p=q.func.call(q.scope);if(p!==true){return p}}q=n.editorCommands.queryCommandValue(r);if(d(q)){return q}try{return this.getDoc().queryCommandValue(r)}catch(m){}},show:function(){var m=this;l.show(m.getContainer());l.hide(m.id);m.load()},hide:function(){var m=this,n=m.getDoc();if(b&&n){n.execCommand("SelectAll")}m.save();l.hide(m.getContainer());l.setStyle(m.id,"display",m.orgDisplay)},isHidden:function(){return !l.isHidden(this.id)},setProgressState:function(m,n,p){this.onSetProgressState.dispatch(this,m,n,p);return m},load:function(q){var m=this,p=m.getElement(),n;if(p){q=q||{};q.load=true;n=m.setContent(d(p.value)?p.value:p.innerHTML,q);q.element=p;if(!q.no_events){m.onLoadContent.dispatch(m,q)}q.element=p=null;return n}},save:function(r){var m=this,q=m.getElement(),n,p;if(!q||!m.initialized){return}r=r||{};r.save=true;r.element=q;n=r.content=m.getContent(r);if(!r.no_events){m.onSaveContent.dispatch(m,r)}n=r.content;if(!/TEXTAREA|INPUT/i.test(q.nodeName)){q.innerHTML=n;if(p=l.getParent(m.id,"form")){i(p.elements,function(o){if(o.name==m.id){o.value=n;return false}})}}else{q.value=n}r.element=q=null;return n},setContent:function(r,p){var o=this,n,m=o.getBody(),q;p=p||{};p.format=p.format||"html";p.set=true;p.content=r;if(!p.no_events){o.onBeforeSetContent.dispatch(o,p)}r=p.content;if(!k.isIE&&(r.length===0||/^\s+$/.test(r))){q=o.settings.forced_root_block;if(q){r="<"+q+'><br data-mce-bogus="1"></'+q+">"}else{r='<br data-mce-bogus="1">'}m.innerHTML=r;o.selection.select(m,true);o.selection.collapse(true);return}if(p.format!=="raw"){r=new k.html.Serializer({},o.schema).serialize(o.parser.parse(r))}p.content=k.trim(r);o.dom.setHTML(m,p.content);if(!p.no_events){o.onSetContent.dispatch(o,p)}o.selection.normalize();return p.content},getContent:function(n){var m=this,o;n=n||{};n.format=n.format||"html";n.get=true;n.getInner=true;if(!n.no_events){m.onBeforeGetContent.dispatch(m,n)}if(n.format=="raw"){o=m.getBody().innerHTML}else{o=m.serializer.serialize(m.getBody(),n)}n.content=k.trim(o);if(!n.no_events){m.onGetContent.dispatch(m,n)}return n.content},isDirty:function(){var m=this;return k.trim(m.startContent)!=k.trim(m.getContent({format:"raw",no_events:1}))&&!m.isNotDirty},getContainer:function(){var m=this;if(!m.container){m.container=l.get(m.editorContainer||m.id+"_parent")}return m.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return l.get(this.settings.content_element||this.id)},getWin:function(){var m=this,n;if(!m.contentWindow){n=l.get(m.id+"_ifr");if(n){m.contentWindow=n.contentWindow}}return m.contentWindow},getDoc:function(){var m=this,n;if(!m.contentDocument){n=m.getWin();if(n){m.contentDocument=n.document}}return m.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(o,n,q){var m=this,p=m.settings;if(p.urlconverter_callback){return m.execCallback("urlconverter_callback",o,q,true,n)}if(!p.convert_urls||(q&&q.nodeName=="LINK")||o.indexOf("file:")===0){return o}if(p.relative_urls){return m.documentBaseURI.toRelative(o)}o=m.documentBaseURI.toAbsolute(o,p.remove_script_host);return o},addVisual:function(q){var n=this,o=n.settings,p=n.dom,m;q=q||n.getBody();if(!d(n.hasVisual)){n.hasVisual=o.visual}i(p.select("table,a",q),function(s){var r;switch(s.nodeName){case"TABLE":m=o.visual_table_class||"mceItemTable";r=p.getAttrib(s,"border");if(!r||r=="0"){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return;case"A":r=p.getAttrib(s,"name");m="mceItemAnchor";if(r){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return}});n.onVisualAid.dispatch(n,q,n.hasVisual)},remove:function(){var m=this,n=m.getContainer();if(!m.removed){m.removed=1;m.hide();if(!m.settings.content_editable){j.clear(m.getWin());j.clear(m.getDoc())}j.clear(m.getBody());j.clear(m.formElement);j.unbind(n);m.execCallback("remove_instance_callback",m);m.onRemove.dispatch(m);m.onExecCommand.listeners=[];k.remove(m);l.remove(n)}},destroy:function(n){var m=this;if(m.destroyed){return}if(a){j.unbind(m.getDoc());j.unbind(m.getWin());j.unbind(m.getBody())}if(!n){k.removeUnload(m.destroy);tinyMCE.onBeforeUnload.remove(m._beforeUnload);if(m.theme&&m.theme.destroy){m.theme.destroy()}m.controlManager.destroy();m.selection.destroy();m.dom.destroy()}if(m.formElement){m.formElement.submit=m.formElement._mceOldSubmit;m.formElement._mceOldSubmit=null}m.contentAreaContainer=m.formElement=m.container=m.settings.content_element=m.bodyElement=m.contentDocument=m.contentWindow=null;if(m.selection){m.selection=m.selection.win=m.selection.dom=m.selection.dom.doc=null}m.destroyed=1},_refreshContentEditable:function(){var n=this,m,o;if(n._isHidden()){m=n.getBody();o=m.parentNode;o.removeChild(m);o.appendChild(m);m.focus()}},_isHidden:function(){var m;if(!a){return 0}m=this.selection.getSel();return(!m||!m.rangeCount||m.rangeCount===0)}})})(tinymce);(function(a){var b=a.each;a.Editor.prototype.setupEvents=function(){var c=this,d=c.settings;b(["onPreInit","onBeforeRenderUI","onPostRender","onLoad","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState","onSetAttrib"],function(e){c[e]=new a.util.Dispatcher(c)});if(d.cleanup_callback){c.onBeforeSetContent.add(function(e,f){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)});c.onPreProcess.add(function(e,f){if(f.set){e.execCallback("cleanup_callback","insert_to_editor_dom",f.node,f)}if(f.get){e.execCallback("cleanup_callback","get_from_editor_dom",f.node,f)}});c.onPostProcess.add(function(e,f){if(f.set){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)}if(f.get){f.content=e.execCallback("cleanup_callback","get_from_editor",f.content,f)}})}if(d.save_callback){c.onGetContent.add(function(e,f){if(f.save){f.content=e.execCallback("save_callback",e.id,f.content,e.getBody())}})}if(d.handle_event_callback){c.onEvent.add(function(f,g,h){if(c.execCallback("handle_event_callback",g,f,h)===false){Event.cancel(g)}})}if(d.handle_node_change_callback){c.onNodeChange.add(function(f,e,g){f.execCallback("handle_node_change_callback",f.id,g,-1,-1,true,f.selection.isCollapsed())})}if(d.save_callback){c.onSaveContent.add(function(e,g){var f=e.execCallback("save_callback",e.id,g.content,e.getBody());if(f){g.content=f}})}if(d.onchange_callback){c.onChange.add(function(f,e){f.execCallback("onchange_callback",f,e)})}};a.Editor.prototype.bindNativeEvents=function(){var l=this,f,d=l.settings,e=l.dom,h;h={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function c(i,m){var n=i.type;if(l.removed){return}if(l.onEvent.dispatch(l,i,m)!==false){l[h[i.fakeType||i.type]].dispatch(l,i,m)}}function j(i){l.focus(true)}function k(){l.selection.normalize();l.nodeChanged()}b(h,function(m,n){var i=d.content_editable?l.getBody():l.getDoc();switch(n){case"contextmenu":e.bind(i,n,c);break;case"paste":e.bind(l.getBody(),n,c);break;case"submit":case"reset":e.bind(l.getElement().form||a.DOM.getParent(l.id,"form"),n,c);break;default:e.bind(i,n,c)}});e.bind(d.content_editable?l.getBody():(a.isGecko?l.getDoc():l.getWin()),"focus",function(i){l.focus(true)});if(d.content_editable&&a.isOpera){e.bind(l.getBody(),"click",j);e.bind(l.getBody(),"keydown",j)}l.onMouseUp.add(k);l.onKeyUp.add(function(i,n){var m=n.keyCode;if((m>=33&&m<=36)||(m>=37&&m<=40)||m==13||m==45||m==46||m==8||(a.isMac&&(m==91||m==93))||n.ctrlKey){k()}});l.onReset.add(function(){l.setContent(l.startContent,{format:"raw"})});function g(m,i){if(m.altKey||m.ctrlKey||m.metaKey){b(l.shortcuts,function(n){var o=a.isMac?m.metaKey:m.ctrlKey;if(n.ctrl!=o||n.alt!=m.altKey||n.shift!=m.shiftKey){return}if(m.keyCode==n.keyCode||(m.charCode&&m.charCode==n.charCode)){m.preventDefault();if(i){n.func.call(n.scope)}return true}})}}l.onKeyUp.add(function(i,m){g(m)});l.onKeyPress.add(function(i,m){g(m)});l.onKeyDown.add(function(i,m){g(m,true)});if(a.isOpera){l.onClick.add(function(i,m){m.preventDefault()})}}})(tinymce);(function(d){var e=d.each,b,a=true,c=false;d.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return c}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return c}function u(v,x){x=x||"exec";e(v,function(z,y){e(y.toLowerCase().split(","),function(A){j[x][A]=z})})}d.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===b){x=c}if(v===b){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:b)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(d.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(c)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);e("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=d.explode(k.font_size_style_values);v=d.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return c}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new d.html.Serializer({},n.schema);v='<span id="mce_marker" data-mce-type="bookmark">\uFEFF</span>';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=n.selection.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.y<L.y)||(C.x>L.x+L.w||C.x<L.x)){H=d.isIE?n.getDoc().documentElement:n.getBody();H.scrollLeft=C.x;H.scrollTop=C.y-L.h+25}x=m.createRng();A=D.previousSibling;if(A&&A.nodeType==3){x.setStart(A,A.nodeValue.length)}else{x.setStartBefore(D);x.setEndBefore(D)}m.remove(D);p.setRng(x);p.onSetContent.dispatch(p,G);n.addVisual()},mceInsertRawHTML:function(y,x,v){p.setContent("tiny_mce_marker");n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return v}))},mceSetContent:function(y,x,v){n.setContent(v)},"Indent,Outdent":function(z){var x,v,y;x=k.indentation;v=/[a-z%]+$/i.exec(x);x=parseInt(x);if(!l("InsertUnorderedList")&&!l("InsertOrderedList")){if(!k.forced_root_block&&!m.getParent(p.getNode(),m.isBlock)){q.apply("div")}e(p.getSelectedBlocks(),function(A){if(z=="outdent"){y=Math.max(0,parseInt(A.style.paddingLeft||0)-x);m.setStyle(A,"paddingLeft",y?y+v:"")}else{m.setStyle(A,"paddingLeft",(parseInt(A.style.paddingLeft||0)+x)+v)}})}else{f(z)}},mceRepaint:function(){var x;if(d.isGecko){try{i(a);if(p.getSel()){p.getSel().selectAllChildren(n.getBody())}p.collapse(a);g()}catch(v){}}},mceToggleFormat:function(y,x,v){q.toggle(v)},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",false,"<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();v.setStart(x,0);v.setEnd(x,x.childNodes.length);n.selection.setRng(v)}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(z){var x="align"+z.substring(7);var v=p.isCollapsed()?[m.getParent(p.getNode(),m.isBlock)]:p.getSelectedBlocks();var y=d.map(v,function(A){return !!q.matchNode(A,x)});return d.inArray(y,a)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(v){return m.getParent(p.getNode(),v=="insertunorderedlist"?"UL":"OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(h){var l,i=0,e=[],g,k,j,f;function c(){return b.trim(h.getContent({format:"raw",no_events:1}).replace(/<span[^>]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g,""))}function d(){l.typing=false;l.add()}k=new a(l);j=new a(l);f=new a(l);k.add(function(m,n){if(m.hasUndo()){return h.onChange.dispatch(h,n,m)}});j.add(function(m,n){return h.onUndo.dispatch(h,n,m)});f.add(function(m,n){return h.onRedo.dispatch(h,n,m)});h.onInit.add(function(){l.add()});h.onBeforeExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.beforeChange()}});h.onExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.add()}});h.onSaveContent.add(d);h.dom.bind(h.dom.getRoot(),"dragend",d);h.dom.bind(h.getDoc(),b.isGecko?"blur":"focusout",function(m){if(!h.removed&&l.typing){d()}});h.onKeyUp.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45||n==13||o.ctrlKey){d()}});h.onKeyDown.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45){if(l.typing){d()}return}if((n<16||n>20)&&n!=224&&n!=91&&!l.typing){l.beforeChange();l.typing=true;l.add()}});h.onMouseDown.add(function(m,n){if(l.typing){d()}});h.addShortcut("ctrl+z","undo_desc","Undo");h.addShortcut("ctrl+y","redo_desc","Redo");l={data:e,typing:false,onAdd:k,onUndo:j,onRedo:f,beforeChange:function(){g=h.selection.getBookmark(2,true)},add:function(p){var m,n=h.settings,o;p=p||{};p.content=c();o=e[i];if(o&&o.content==p.content){return null}if(e[i]){e[i].beforeBookmark=g}if(n.custom_undo_redo_levels){if(e.length>n.custom_undo_redo_levels){for(m=0;m<e.length-1;m++){e[m]=e[m+1]}e.length--;i=e.length}}p.bookmark=h.selection.getBookmark(2,true);if(i<e.length-1){e.length=i+1}e.push(p);i=e.length-1;l.onAdd.dispatch(l,p);h.isNotDirty=0;return p},undo:function(){var n,m;if(l.typing){l.add();l.typing=false}if(i>0){n=e[--i];h.setContent(n.content,{format:"raw"});h.selection.moveToBookmark(n.beforeBookmark);l.onUndo.dispatch(l,n)}return n},redo:function(){var m;if(i<e.length-1){m=e[++i];h.setContent(m.content,{format:"raw"});h.selection.moveToBookmark(m.bookmark);l.onRedo.dispatch(l,m)}return m},clear:function(){e=[];i=0;l.typing=false},hasUndo:function(){return i>0||this.typing},hasRedo:function(){return i<e.length-1&&!this.typing}};return l}})(tinymce);tinymce.ForceBlocks=function(c){var b=c.settings,e=c.dom,a=c.selection,d=c.schema.getBlockElements();function f(){var j=a.getStart(),h=c.getBody(),g,k,o,r,q,i,l,m=-16777215,p;if(!j||j.nodeType!==1||!b.forced_root_block){return}while(j&&j!=h){if(d[j.nodeName]){return}j=j.parentNode}g=a.getRng();if(g.setStart){k=g.startContainer;o=g.startOffset;r=g.endContainer;q=g.endOffset}else{if(g.item){j=g.item(0);g=c.getDoc().body.createTextRange();g.moveToElementText(j)}tmpRng=g.duplicate();tmpRng.collapse(true);o=tmpRng.move("character",m)*-1;if(!tmpRng.collapsed){tmpRng=g.duplicate();tmpRng.collapse(false);q=(tmpRng.move("character",m)*-1)-o}}j=h.firstChild;while(j){if(j.nodeType===3||(j.nodeType==1&&!d[j.nodeName])){if(!i){i=e.create(b.forced_root_block);j.parentNode.insertBefore(i,j);p=true}l=j;j=j.nextSibling;i.appendChild(l)}else{i=null;j=j.nextSibling}}if(g.setStart){g.setStart(k,o);g.setEnd(r,q);a.setRng(g)}else{try{g=c.getDoc().body.createTextRange();g.moveToElementText(h);g.collapse(true);g.moveStart("character",o);if(q>0){g.moveEnd("character",q)}g.select()}catch(n){}}if(p){c.nodeChanged()}}if(b.forced_root_block){c.onKeyUp.add(f);c.onNodeChange.add(f)}};(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}n["class"]+=i.settings.directionality=="rtl"?" mceRtl":"";f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(f,n,h){var l=this,j=l.editor,i,k,m;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,scope:n.scope,control_manager:l},n);f=l.prefix+f;function g(o){return o.settings.use_accessible_selects&&!c.isGecko}if(j.settings.use_native_selects||g(j)){k=new c.ui.NativeListBox(f,n)}else{m=h||l._cls.listbox||c.ui.ListBox;k=new m(f,n,j)}l.controls[f]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){j.bookmark=j.selection.getBookmark(1)});a.add(o,"focus",function(){j.selection.moveToBookmark(j.bookmark);j.bookmark=null})})}if(k.hideMenu){j.onMouseDown.add(k.hideMenu,k)}return l.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i,g);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i,g)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i,g));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n,j);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createToolbarGroup:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||this._cls.toolbarGroup||c.ui.ToolbarGroup;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.Formatter=function(Y){var O={},R=a.each,c=Y.dom,r=Y.selection,t=a.dom.TreeWalker,M=new a.dom.RangeUtils(c),d=Y.schema.isValidChild,H=c.isBlock,m=Y.settings.forced_root_block,s=c.nodeIndex,G=a.isGecko?"\u200B":"\uFEFF",e=/^(src|href|style)$/,V=false,C=true,D,x=c.getContentEditable;function A(Z){return Z instanceof Array}function n(aa,Z){return c.getParents(aa,Z,c.getRoot())}function b(Z){return Z.nodeType===1&&Z.id==="_mce_caret"}function j(){l({alignleft:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,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,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,div,ul,ol,li",styles:{textAlign:"right"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"right"}}],alignfull:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,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"},link:{inline:"a",selector:"a",remove:"all",split:true,deep:true,onmatch:function(Z){return true},onformat:function(ab,Z,aa){R(aa,function(ad,ac){c.setAttrib(ab,ac,ad)})}},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}]});R("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(Z){l(Z,{block:Z,remove:"all"})});l(Y.settings.formats)}function U(){Y.addShortcut("ctrl+b","bold_desc","Bold");Y.addShortcut("ctrl+i","italic_desc","Italic");Y.addShortcut("ctrl+u","underline_desc","Underline");for(var Z=1;Z<=6;Z++){Y.addShortcut("ctrl+"+Z,"",["FormatBlock",false,"h"+Z])}Y.addShortcut("ctrl+7","",["FormatBlock",false,"p"]);Y.addShortcut("ctrl+8","",["FormatBlock",false,"div"]);Y.addShortcut("ctrl+9","",["FormatBlock",false,"address"])}function T(Z){return Z?O[Z]:O}function l(Z,aa){if(Z){if(typeof(Z)!=="string"){R(Z,function(ac,ab){l(ab,ac)})}else{aa=aa.length?aa:[aa];R(aa,function(ab){if(ab.deep===D){ab.deep=!ab.selector}if(ab.split===D){ab.split=!ab.selector||ab.inline}if(ab.remove===D&&ab.selector&&!ab.inline){ab.remove="none"}if(ab.selector&&ab.inline){ab.mixed=true;ab.block_expand=true}if(typeof(ab.classes)==="string"){ab.classes=ab.classes.split(/\s+/)}});O[Z]=aa}}}var i=function(aa){var Z;Y.dom.getParent(aa,function(ab){Z=Y.dom.getStyle(ab,"text-decoration");return Z&&Z!=="none"});return Z};var K=function(Z){var aa;if(Z.nodeType===1&&Z.parentNode&&Z.parentNode.nodeType===1){aa=i(Z.parentNode);if(Y.dom.getStyle(Z,"color")&&aa){Y.dom.setStyle(Z,"text-decoration",aa)}else{if(Y.dom.getStyle(Z,"textdecoration")===aa){Y.dom.setStyle(Z,"text-decoration",null)}}}};function W(ac,aj,ae){var af=T(ac),ak=af[0],ai,aa,ah,ag=r.isCollapsed();function Z(ao,an){an=an||ak;if(ao){if(an.onformat){an.onformat(ao,an,aj,ae)}R(an.styles,function(aq,ap){c.setStyle(ao,ap,q(aq,aj))});R(an.attributes,function(aq,ap){c.setAttrib(ao,ap,q(aq,aj))});R(an.classes,function(ap){ap=q(ap,aj);if(!c.hasClass(ao,ap)){c.addClass(ao,ap)}})}}function ad(){function ap(aw,au){var av=new t(au);for(ae=av.current();ae;ae=av.prev()){if(ae.childNodes.length>1||ae==aw||ae.tagName=="BR"){return ae}}}var ao=Y.selection.getRng();var at=ao.startContainer;var an=ao.endContainer;if(at!=an&&ao.endOffset===0){var ar=ap(at,an);var aq=ar.nodeType==3?ar.length:ar.childNodes.length;ao.setEnd(ar,aq)}return ao}function ab(aq,aw,au,at,ao){var an=[],ap=-1,av,ay=-1,ar=-1,ax;R(aq.childNodes,function(aA,az){if(aA.nodeName==="UL"||aA.nodeName==="OL"){ap=az;av=aA;return false}});R(aq.childNodes,function(aA,az){if(aA.nodeName==="SPAN"&&c.getAttrib(aA,"data-mce-type")=="bookmark"){if(aA.id==aw.id+"_start"){ay=az}else{if(aA.id==aw.id+"_end"){ar=az}}}});if(ap<=0||(ay<ap&&ar>ap)){R(a.grep(aq.childNodes),ao);return 0}else{ax=c.clone(au,V);R(a.grep(aq.childNodes),function(aA,az){if((ay<ap&&az<ap)||(ay>ap&&az>ap)){an.push(aA);aA.parentNode.removeChild(aA)}});if(ay<ap){aq.insertBefore(ax,av)}else{if(ay>ap){aq.insertBefore(ax,av.nextSibling)}}at.push(ax);R(an,function(az){ax.appendChild(az)});return ax}}function al(ao,aq,au){var an=[],at,ap,ar=true;at=ak.inline||ak.block;ap=c.create(at);Z(ap);M.walk(ao,function(av){var aw;function ax(ay){var aD,aB,az,aA,aC;aC=ar;aD=ay.nodeName.toLowerCase();aB=ay.parentNode.nodeName.toLowerCase();if(ay.nodeType===1&&x(ay)){aC=ar;ar=x(ay)==="true";aA=true}if(g(aD,"br")){aw=0;if(ak.block){c.remove(ay)}return}if(ak.wrapper&&y(ay,ac,aj)){aw=0;return}if(ar&&!aA&&ak.block&&!ak.wrapper&&I(aD)){ay=c.rename(ay,at);Z(ay);an.push(ay);aw=0;return}if(ak.selector){R(af,function(aE){if("collapsed" in aE&&aE.collapsed!==ag){return}if(c.is(ay,aE.selector)&&!b(ay)){Z(ay,aE);az=true}});if(!ak.inline||az){aw=0;return}}if(ar&&!aA&&d(at,aD)&&d(aB,at)&&!(!au&&ay.nodeType===3&&ay.nodeValue.length===1&&ay.nodeValue.charCodeAt(0)===65279)&&!b(ay)){if(!aw){aw=c.clone(ap,V);ay.parentNode.insertBefore(aw,ay);an.push(aw)}aw.appendChild(ay)}else{if(aD=="li"&&aq){aw=ab(ay,aq,ap,an,ax)}else{aw=0;R(a.grep(ay.childNodes),ax);if(aA){ar=aC}aw=0}}}R(av,ax)});if(ak.wrap_links===false){R(an,function(av){function aw(aA){var az,ay,ax;if(aA.nodeName==="A"){ay=c.clone(ap,V);an.push(ay);ax=a.grep(aA.childNodes);for(az=0;az<ax.length;az++){ay.appendChild(ax[az])}aA.appendChild(ay)}R(a.grep(aA.childNodes),aw)}aw(av)})}R(an,function(ax){var av;function ay(aA){var az=0;R(aA.childNodes,function(aB){if(!f(aB)&&!J(aB)){az++}});return az}function aw(az){var aB,aA;R(az.childNodes,function(aC){if(aC.nodeType==1&&!J(aC)&&!b(aC)){aB=aC;return V}});if(aB&&h(aB,ak)){aA=c.clone(aB,V);Z(aA);c.replace(aA,az,C);c.remove(aB,1)}return aA||az}av=ay(ax);if((an.length>1||!H(ax))&&av===0){c.remove(ax,1);return}if(ak.inline||ak.wrapper){if(!ak.exact&&av===1){ax=aw(ax)}R(af,function(az){R(c.select(az.inline,ax),function(aB){var aA;if(az.wrap_links===false){aA=aB.parentNode;do{if(aA.nodeName==="A"){return}}while(aA=aA.parentNode)}X(az,aj,aB,az.exact?aB:null)})});if(y(ax.parentNode,ac,aj)){c.remove(ax,1);ax=0;return C}if(ak.merge_with_parents){c.getParent(ax.parentNode,function(az){if(y(az,ac,aj)){c.remove(ax,1);ax=0;return C}})}if(ax&&ak.merge_siblings!==false){ax=u(E(ax),ax);ax=u(ax,E(ax,C))}}})}if(ak){if(ae){if(ae.nodeType){aa=c.createRng();aa.setStartBefore(ae);aa.setEndAfter(ae);al(p(aa,af),null,true)}else{al(ae,null,true)}}else{if(!ag||!ak.inline||c.select("td.mceSelected,th.mceSelected").length){var am=Y.selection.getNode();if(!m&&af[0].defaultBlock&&!c.getParent(am,c.isBlock)){W(af[0].defaultBlock)}Y.selection.setRng(ad());ai=r.getBookmark();al(p(r.getRng(C),af),ai);if(ak.styles&&(ak.styles.color||ak.styles.textDecoration)){a.walk(am,K,"childNodes");K(am)}r.moveToBookmark(ai);P(r.getRng(C));Y.nodeChanged()}else{S("apply",ac,aj)}}}}function B(ab,ak,ad){var ae=T(ab),am=ae[0],ai,ah,aa,aj=true;function ac(at){var ar,aq,ap,ao,av,au;if(at.nodeType===1&&x(at)){av=aj;aj=x(at)==="true";au=true}ar=a.grep(at.childNodes);if(aj&&!au){for(aq=0,ap=ae.length;aq<ap;aq++){if(X(ae[aq],ak,at,at)){break}}}if(am.deep){if(ar.length){for(aq=0,ap=ar.length;aq<ap;aq++){ac(ar[aq])}if(au){aj=av}}}}function af(ao){var ap;R(n(ao.parentNode).reverse(),function(aq){var ar;if(!ap&&aq.id!="_start"&&aq.id!="_end"){ar=y(aq,ab,ak);if(ar&&ar.split!==false){ap=aq}}});return ap}function Z(ar,ao,au,ax){var ay,aw,av,aq,at,ap;if(ar){ap=ar.parentNode;for(ay=ao.parentNode;ay&&ay!=ap;ay=ay.parentNode){aw=c.clone(ay,V);for(at=0;at<ae.length;at++){if(X(ae[at],ak,aw,aw)){aw=0;break}}if(aw){if(av){aw.appendChild(av)}if(!aq){aq=aw}av=aw}}if(ax&&(!am.mixed||!H(ar))){ao=c.split(ar,ao)}if(av){au.parentNode.insertBefore(av,au);aq.appendChild(au)}}return ao}function al(ao){return Z(af(ao),ao,ao,true)}function ag(aq){var ap=c.get(aq?"_start":"_end"),ao=ap[aq?"firstChild":"lastChild"];if(J(ao)){ao=ao[aq?"firstChild":"lastChild"]}c.remove(ap,true);return ao}function an(ao){var aq,ar,ap;ao=p(ao,ae,C);if(am.split){aq=L(ao,C);ar=L(ao);if(aq!=ar){if(/^(TR|TD)$/.test(aq.nodeName)&&aq.firstChild){aq=(aq.nodeName=="TD"?aq.firstChild:aq.firstChild.firstChild)||aq}aq=Q(aq,"span",{id:"_start","data-mce-type":"bookmark"});ar=Q(ar,"span",{id:"_end","data-mce-type":"bookmark"});al(aq);al(ar);aq=ag(C);ar=ag()}else{aq=ar=al(aq)}ao.startContainer=aq.parentNode;ao.startOffset=s(aq);ao.endContainer=ar.parentNode;ao.endOffset=s(ar)+1}M.walk(ao,function(at){R(at,function(au){ac(au);if(au.nodeType===1&&Y.dom.getStyle(au,"text-decoration")==="underline"&&au.parentNode&&i(au.parentNode)==="underline"){X({deep:false,exact:true,inline:"span",styles:{textDecoration:"underline"}},null,au)}})})}if(ad){if(ad.nodeType){aa=c.createRng();aa.setStartBefore(ad);aa.setEndAfter(ad);an(aa)}else{an(ad)}return}if(!r.isCollapsed()||!am.inline||c.select("td.mceSelected,th.mceSelected").length){ai=r.getBookmark();an(r.getRng(C));r.moveToBookmark(ai);if(am.inline&&k(ab,ak,r.getStart())){P(r.getRng(true))}Y.nodeChanged()}else{S("remove",ab,ak)}}function F(aa,ac,ab){var Z=T(aa);if(k(aa,ac,ab)&&(!("toggle" in Z[0])||Z[0].toggle)){B(aa,ac,ab)}else{W(aa,ac,ab)}}function y(aa,Z,af,ad){var ab=T(Z),ag,ae,ac;function ah(al,an,ao){var ak,am,ai=an[ao],aj;if(an.onmatch){return an.onmatch(al,an,ao)}if(ai){if(ai.length===D){for(ak in ai){if(ai.hasOwnProperty(ak)){if(ao==="attributes"){am=c.getAttrib(al,ak)}else{am=N(al,ak)}if(ad&&!am&&!an.exact){return}if((!ad||an.exact)&&!g(am,q(ai[ak],af))){return}}}}else{for(aj=0;aj<ai.length;aj++){if(ao==="attributes"?c.getAttrib(al,ai[aj]):N(al,ai[aj])){return an}}}}return an}if(ab&&aa){for(ae=0;ae<ab.length;ae++){ag=ab[ae];if(h(aa,ag)&&ah(aa,ag,"attributes")&&ah(aa,ag,"styles")){if(ac=ag.classes){for(ae=0;ae<ac.length;ae++){if(!c.hasClass(aa,ac[ae])){return}}}return ag}}}}function k(ab,ad,ac){var aa;function Z(ae){ae=c.getParent(ae,function(af){return !!y(af,ab,ad,true)});return y(ae,ab,ad)}if(ac){return Z(ac)}ac=r.getNode();if(Z(ac)){return C}aa=r.getStart();if(aa!=ac){if(Z(aa)){return C}}return V}function v(ag,af){var ad,ae=[],ac={},ab,aa,Z;ad=r.getStart();c.getParent(ad,function(aj){var ai,ah;for(ai=0;ai<ag.length;ai++){ah=ag[ai];if(!ac[ah]&&y(aj,ah,af)){ac[ah]=true;ae.push(ah)}}});return ae}function z(ad){var af=T(ad),ac,ab,ae,aa,Z;if(af){ac=r.getStart();ab=n(ac);for(aa=af.length-1;aa>=0;aa--){Z=af[aa].selector;if(!Z){return C}for(ae=ab.length-1;ae>=0;ae--){if(c.is(ab[ae],Z)){return C}}}}return V}a.extend(this,{get:T,register:l,apply:W,remove:B,toggle:F,match:k,matchAll:v,matchNode:y,canApply:z});j();U();function h(Z,aa){if(g(Z,aa.inline)){return C}if(g(Z,aa.block)){return C}if(aa.selector){return c.is(Z,aa.selector)}}function g(aa,Z){aa=aa||"";Z=Z||"";aa=""+(aa.nodeName||aa);Z=""+(Z.nodeName||Z);return aa.toLowerCase()==Z.toLowerCase()}function N(aa,Z){var ab=c.getStyle(aa,Z);if(Z=="color"||Z=="backgroundColor"){ab=c.toHex(ab)}if(Z=="fontWeight"&&ab==700){ab="bold"}return""+ab}function q(Z,aa){if(typeof(Z)!="string"){Z=Z(aa)}else{if(aa){Z=Z.replace(/%(\w+)/g,function(ac,ab){return aa[ab]||ac})}}return Z}function f(Z){return Z&&Z.nodeType===3&&/^([\t \r\n]+|)$/.test(Z.nodeValue)}function Q(ab,aa,Z){var ac=c.create(aa,Z);ab.parentNode.insertBefore(ac,ab);ac.appendChild(ab);return ac}function p(Z,ak,ac){var an,al,af,aj,ab=Z.startContainer,ag=Z.startOffset,ap=Z.endContainer,ai=Z.endOffset;function am(ax){var ar,av,aw,au,at,aq;ar=av=ax?ab:ap;at=ax?"previousSibling":"nextSibling";aq=c.getRoot();if(ar.nodeType==3&&!f(ar)){if(ax?ag>0:ai<ar.nodeValue.length){return ar}}for(;;){if(!ak[0].block_expand&&H(av)){return av}for(au=av[at];au;au=au[at]){if(!J(au)&&!f(au)){return av}}if(av.parentNode==aq){ar=av;break}av=av.parentNode}return ar}function ae(aq,ar){if(ar===D){ar=aq.nodeType===3?aq.length:aq.childNodes.length}while(aq&&aq.hasChildNodes()){aq=aq.childNodes[ar];if(aq){ar=aq.nodeType===3?aq.length:aq.childNodes.length}}return{node:aq,offset:ar}}if(ab.nodeType==1&&ab.hasChildNodes()){al=ab.childNodes.length-1;ab=ab.childNodes[ag>al?al:ag];if(ab.nodeType==3){ag=0}}if(ap.nodeType==1&&ap.hasChildNodes()){al=ap.childNodes.length-1;ap=ap.childNodes[ai>al?al:ai-1];if(ap.nodeType==3){ai=ap.nodeValue.length}}function ao(ar){var aq=ar;while(aq){if(aq.nodeType===1&&x(aq)){return x(aq)==="false"?aq:ar}aq=aq.parentNode}return ar}function ah(ar,aw,ay){var av,at,ax,aq;function au(aA,aC){var aD,az,aB=aA.nodeValue;if(typeof(aC)=="undefined"){aC=ay?aB.length:0}if(ay){aD=aB.lastIndexOf(" ",aC);az=aB.lastIndexOf("\u00a0",aC);aD=aD>az?aD:az;if(aD!==-1&&!ac){aD++}}else{aD=aB.indexOf(" ",aC);az=aB.indexOf("\u00a0",aC);aD=aD!==-1&&(az===-1||aD<az)?aD:az}return aD}if(ar.nodeType===3){ax=au(ar,aw);if(ax!==-1){return{container:ar,offset:ax}}aq=ar}av=new t(ar,c.getParent(ar,H)||Y.getBody());while(at=av[ay?"prev":"next"]()){if(at.nodeType===3){aq=at;ax=au(at);if(ax!==-1){return{container:at,offset:ax}}}else{if(H(at)){break}}}if(aq){if(ay){aw=0}else{aw=aq.length}return{container:aq,offset:aw}}}function ad(ar,aq){var at,au,aw,av;if(ar.nodeType==3&&ar.nodeValue.length===0&&ar[aq]){ar=ar[aq]}at=n(ar);for(au=0;au<at.length;au++){for(aw=0;aw<ak.length;aw++){av=ak[aw];if("collapsed" in av&&av.collapsed!==Z.collapsed){continue}if(c.is(at[au],av.selector)){return at[au]}}}return ar}function aa(ar,aq,au){var at;if(!ak[0].wrapper){at=c.getParent(ar,ak[0].block)}if(!at){at=c.getParent(ar.nodeType==3?ar.parentNode:ar,H)}if(at&&ak[0].wrapper){at=n(at,"ul,ol").reverse()[0]||at}if(!at){at=ar;while(at[aq]&&!H(at[aq])){at=at[aq];if(g(at,"br")){break}}}return at||ar}ab=ao(ab);ap=ao(ap);if(J(ab.parentNode)||J(ab)){ab=J(ab)?ab:ab.parentNode;ab=ab.nextSibling||ab;if(ab.nodeType==3){ag=0}}if(J(ap.parentNode)||J(ap)){ap=J(ap)?ap:ap.parentNode;ap=ap.previousSibling||ap;if(ap.nodeType==3){ai=ap.length}}if(ak[0].inline){if(Z.collapsed){aj=ah(ab,ag,true);if(aj){ab=aj.container;ag=aj.offset}aj=ah(ap,ai);if(aj){ap=aj.container;ai=aj.offset}}af=ae(ap,ai);if(af.node){while(af.node&&af.offset===0&&af.node.previousSibling){af=ae(af.node.previousSibling)}if(af.node&&af.offset>0&&af.node.nodeType===3&&af.node.nodeValue.charAt(af.offset-1)===" "){if(af.offset>1){ap=af.node;ap.splitText(af.offset-1)}}}}if(ak[0].inline||ak[0].block_expand){if(!ak[0].inline||(ab.nodeType!=3||ag===0)){ab=am(true)}if(!ak[0].inline||(ap.nodeType!=3||ai===ap.nodeValue.length)){ap=am()}}if(ak[0].selector&&ak[0].expand!==V&&!ak[0].inline){ab=ad(ab,"previousSibling");ap=ad(ap,"nextSibling")}if(ak[0].block||ak[0].selector){ab=aa(ab,"previousSibling");ap=aa(ap,"nextSibling");if(ak[0].block){if(!H(ab)){ab=am(true)}if(!H(ap)){ap=am()}}}if(ab.nodeType==1){ag=s(ab);ab=ab.parentNode}if(ap.nodeType==1){ai=s(ap)+1;ap=ap.parentNode}return{startContainer:ab,startOffset:ag,endContainer:ap,endOffset:ai}}function X(af,ae,ac,Z){var ab,aa,ad;if(!h(ac,af)){return V}if(af.remove!="all"){R(af.styles,function(ah,ag){ah=q(ah,ae);if(typeof(ag)==="number"){ag=ah;Z=0}if(!Z||g(N(Z,ag),ah)){c.setStyle(ac,ag,"")}ad=1});if(ad&&c.getAttrib(ac,"style")==""){ac.removeAttribute("style");ac.removeAttribute("data-mce-style")}R(af.attributes,function(ai,ag){var ah;ai=q(ai,ae);if(typeof(ag)==="number"){ag=ai;Z=0}if(!Z||g(c.getAttrib(Z,ag),ai)){if(ag=="class"){ai=c.getAttrib(ac,ag);if(ai){ah="";R(ai.split(/\s+/),function(aj){if(/mce\w+/.test(aj)){ah+=(ah?" ":"")+aj}});if(ah){c.setAttrib(ac,ag,ah);return}}}if(ag=="class"){ac.removeAttribute("className")}if(e.test(ag)){ac.removeAttribute("data-mce-"+ag)}ac.removeAttribute(ag)}});R(af.classes,function(ag){ag=q(ag,ae);if(!Z||c.hasClass(Z,ag)){c.removeClass(ac,ag)}});aa=c.getAttribs(ac);for(ab=0;ab<aa.length;ab++){if(aa[ab].nodeName.indexOf("_")!==0){return V}}}if(af.remove!="none"){o(ac,af);return C}}function o(ab,ac){var Z=ab.parentNode,aa;function ad(af,ae,ag){af=E(af,ae,ag);return !af||(af.nodeName=="BR"||H(af))}if(ac.block){if(!m){if(H(ab)&&!H(Z)){if(!ad(ab,V)&&!ad(ab.firstChild,C,1)){ab.insertBefore(c.create("br"),ab.firstChild)}if(!ad(ab,C)&&!ad(ab.lastChild,V,1)){ab.appendChild(c.create("br"))}}}else{if(Z==c.getRoot()){if(!ac.list_block||!g(ab,ac.list_block)){R(a.grep(ab.childNodes),function(ae){if(d(m,ae.nodeName.toLowerCase())){if(!aa){aa=Q(ae,m)}else{aa.appendChild(ae)}}else{aa=0}})}}}}if(ac.selector&&ac.inline&&!g(ac.inline,ab)){return}c.remove(ab,1)}function E(aa,Z,ab){if(aa){Z=Z?"nextSibling":"previousSibling";for(aa=ab?aa:aa[Z];aa;aa=aa[Z]){if(aa.nodeType==1||!f(aa)){return aa}}}}function J(Z){return Z&&Z.nodeType==1&&Z.getAttribute("data-mce-type")=="bookmark"}function u(ad,ac){var Z,ab,aa;function af(ai,ah){if(ai.nodeName!=ah.nodeName){return V}function ag(ak){var al={};R(c.getAttribs(ak),function(am){var an=am.nodeName.toLowerCase();if(an.indexOf("_")!==0&&an!=="style"){al[an]=c.getAttrib(ak,an)}});return al}function aj(an,am){var al,ak;for(ak in an){if(an.hasOwnProperty(ak)){al=am[ak];if(al===D){return V}if(an[ak]!=al){return V}delete am[ak]}}for(ak in am){if(am.hasOwnProperty(ak)){return V}}return C}if(!aj(ag(ai),ag(ah))){return V}if(!aj(c.parseStyle(c.getAttrib(ai,"style")),c.parseStyle(c.getAttrib(ah,"style")))){return V}return C}function ae(ah,ag){for(ab=ah;ab;ab=ab[ag]){if(ab.nodeType==3&&ab.nodeValue.length!==0){return ah}if(ab.nodeType==1&&!J(ab)){return ab}}return ah}if(ad&&ac){ad=ae(ad,"previousSibling");ac=ae(ac,"nextSibling");if(af(ad,ac)){for(ab=ad.nextSibling;ab&&ab!=ac;){aa=ab;ab=ab.nextSibling;ad.appendChild(aa)}c.remove(ac);R(a.grep(ac.childNodes),function(ag){ad.appendChild(ag)});return ad}}return ac}function I(Z){return/^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(Z)}function L(aa,ae){var Z,ad,ab,ac;Z=aa[ae?"startContainer":"endContainer"];ad=aa[ae?"startOffset":"endOffset"];if(Z.nodeType==1){ab=Z.childNodes.length-1;if(!ae&&ad){ad--}Z=Z.childNodes[ad>ab?ab:ad]}if(Z.nodeType===3&&ae&&ad>=Z.nodeValue.length){Z=new t(Z,Y.getBody()).next()||Z}if(Z.nodeType===3&&!ae&&ad===0){Z=new t(Z,Y.getBody()).prev()||Z}return Z}function S(ai,Z,ag){var aj="_mce_caret",aa=Y.settings.caret_debug;function ab(am){var al=c.create("span",{id:aj,"data-mce-bogus":true,style:aa?"color:red":""});if(am){al.appendChild(Y.getDoc().createTextNode(G))}return al}function ah(am,al){while(am){if((am.nodeType===3&&am.nodeValue!==G)||am.childNodes.length>1){return false}if(al&&am.nodeType===1){al.push(am)}am=am.firstChild}return true}function ae(al){while(al){if(al.id===aj){return al}al=al.parentNode}}function ad(al){var am;if(al){am=new t(al,al);for(al=am.current();al;al=am.next()){if(al.nodeType===3){return al}}}}function ac(an,am){var ao,al;if(!an){an=ae(r.getStart());if(!an){while(an=c.get(aj)){ac(an,false)}}}else{al=r.getRng(true);if(ah(an)){if(am!==false){al.setStartBefore(an);al.setEndBefore(an)}c.remove(an)}else{ao=ad(an);if(ao.nodeValue.charAt(0)===G){ao=ao.deleteData(0,1)}c.remove(an,1)}r.setRng(al)}}function af(){var an,al,ar,aq,ao,am,ap;an=r.getRng(true);aq=an.startOffset;am=an.startContainer;ap=am.nodeValue;al=ae(r.getStart());if(al){ar=ad(al)}if(ap&&aq>0&&aq<ap.length&&/\w/.test(ap.charAt(aq))&&/\w/.test(ap.charAt(aq-1))){ao=r.getBookmark();an.collapse(true);an=p(an,T(Z));an=M.split(an);W(Z,ag,an);r.moveToBookmark(ao)}else{if(!al||ar.nodeValue!==G){al=ab(true);ar=al.firstChild;an.insertNode(al);aq=1;W(Z,ag,al)}else{W(Z,ag,al)}r.setCursorLocation(ar,aq)}}function ak(){var al=r.getRng(true),am,ao,ar,aq,an,av,au=[],ap,at;am=al.startContainer;ao=al.startOffset;an=am;if(am.nodeType==3){if(ao!=am.nodeValue.length||am.nodeValue===G){aq=true}an=an.parentNode}while(an){if(y(an,Z,ag)){av=an;break}if(an.nextSibling){aq=true}au.push(an);an=an.parentNode}if(!av){return}if(aq){ar=r.getBookmark();al.collapse(true);al=p(al,T(Z),true);al=M.split(al);B(Z,ag,al);r.moveToBookmark(ar)}else{at=ab();an=at;for(ap=au.length-1;ap>=0;ap--){an.appendChild(c.clone(au[ap],false));an=an.firstChild}an.appendChild(c.doc.createTextNode(G));an=an.firstChild;c.insertAfter(at,av);r.setCursorLocation(an,1)}}if(!self._hasCaretEvents){Y.onBeforeGetContent.addToTop(function(){var al=[],am;if(ah(ae(r.getStart()),al)){am=al.length;while(am--){c.setAttrib(al[am],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(al){Y[al].addToTop(function(){ac()})});Y.onKeyDown.addToTop(function(al,an){var am=an.keyCode;if(am==8||am==37||am==39){ac(ae(r.getStart()))}});r.onSetContent.add(function(){c.getParent(r.getStart(),function(al){if(al.id!==aj&&c.getAttrib(al,"data-mce-bogus")&&!c.isEmpty(al)){c.setAttrib(al,"data-mce-bogus",null)}})});self._hasCaretEvents=true}if(ai=="apply"){af()}else{ak()}}function P(aa){var Z=aa.startContainer,ag=aa.startOffset,ac,af,ae,ab,ad;if(Z.nodeType==3&&ag>=Z.nodeValue.length){ag=s(Z);Z=Z.parentNode;ac=true}if(Z.nodeType==1){ab=Z.childNodes;Z=ab[Math.min(ag,ab.length-1)];af=new t(Z,c.getParent(Z,c.isBlock));if(ag>ab.length-1||ac){af.next()}for(ae=af.current();ae;ae=af.next()){if(ae.nodeType==3&&!f(ae)){ad=c.create("a",null,G);ae.parentNode.insertBefore(ad,ae);aa.setStart(ae,0);r.setRng(aa);c.remove(ad);return}}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}if(c.inline_styles){h=e.explode(c.font_size_legacy_values);d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size,10)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});(function(b){var a=b.dom.TreeWalker;b.EnterKey=function(e){var h=e.dom,d=e.selection,c=e.settings,g=e.undoManager;function f(y){var u=d.getRng(true),C,i,x,t,o,H,n,j,l,s,E,v,z;function B(I){return I&&h.isBlock(I)&&!/^(TD|TH|CAPTION)$/.test(I.nodeName)&&!/^(fixed|absolute)/i.test(I.style.position)&&h.getContentEditable(I)!=="true"}function m(J){var O,M,I,P,N,L=J,K;I=h.createRng();if(J.hasChildNodes()){O=new a(J,J);while(M=O.current()){if(M.nodeType==3){I.setStart(M,0);I.setEnd(M,0);break}if(/^(BR|IMG)$/.test(M.nodeName)){I.setStartBefore(M);I.setEndBefore(M);break}L=M;M=O.next()}if(!M){I.setStart(L,0);I.setEnd(L,0)}}else{if(J.nodeName=="BR"){if(J.nextSibling&&h.isBlock(J.nextSibling)){if(!H||H<9){K=h.create("br");J.parentNode.insertBefore(K,J)}I.setStartBefore(J);I.setEndBefore(J)}else{I.setStartAfter(J);I.setEndAfter(J)}}else{I.setStart(J,0);I.setEnd(J,0)}}d.setRng(I);h.remove(K);N=h.getViewPort(e.getWin());P=h.getPos(J).y;if(P<N.y||P+25>N.y+N.h){e.getWin().scrollTo(0,P<N.y?P:P-N.h+25)}}function q(J){var K=x,M,L,I;M=J||s=="TABLE"?h.create(J||v):o.cloneNode(false);I=M;if(c.keep_styles!==false){do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(K.nodeName)){L=K.cloneNode(false);h.setAttrib(L,"id","");if(M.hasChildNodes()){L.appendChild(M.firstChild);M.appendChild(L)}else{I=L;M.appendChild(L)}}}while(K=K.parentNode)}if(!b.isIE){I.innerHTML="<br>"}return M}function p(L){var K,J,I;if(x.nodeType==3&&(L?t>0:t<x.nodeValue.length)){return false}if(x.parentNode==o&&z&&!L){return true}if(x.nodeName==="TABLE"||(x.previousSibling&&x.previousSibling.nodeName=="TABLE")){return(z&&!L)||(!z&&L)}K=new a(x,o);while(J=(L?K.prev():K.next())){if(J.nodeType===1){if(J.getAttribute("data-mce-bogus")){continue}I=J.nodeName.toLowerCase();if(I==="IMG"){return false}}else{if(J.nodeType===3&&!/^[ \t\r\n]*$/.test(J.nodeValue)){return false}}}return true}function k(I,O){var P,N,K,M,L,J=v||"P";N=h.getParent(I,h.isBlock);if(!N||!B(N)){N=N||i;if(!N.hasChildNodes()){P=h.create(J);N.appendChild(P);u.setStart(P,0);u.setEnd(P,0);return P}M=I;while(M.parentNode!=N){M=M.parentNode}while(M&&!h.isBlock(M)){K=M;M=M.previousSibling}if(K){P=h.create(J);K.parentNode.insertBefore(P,K);M=K;while(M&&!h.isBlock(M)){L=M.nextSibling;P.appendChild(M);M=L}u.setStart(I,O);u.setEnd(I,O)}}return I}function D(){function I(K){var J=l[K?"firstChild":"lastChild"];while(J){if(J.nodeType==1){break}J=J[K?"nextSibling":"previousSibling"]}return J===o}n=v?q(v):h.create("BR");if(I(true)&&I()){h.replace(n,l)}else{if(I(true)){l.parentNode.insertBefore(n,l)}else{if(I()){h.insertAfter(n,l)}else{C=u.cloneRange();C.setStartAfter(o);C.setEndAfter(l);j=C.extractContents();h.insertAfter(j,l);h.insertAfter(n,l)}}}h.remove(o);m(n);g.add()}function A(){var J=new a(x,o),I;while(I=J.current()){if(I.nodeName=="BR"){return true}I=J.next()}}function G(){var J,I;if(x&&x.nodeType==3&&t>=x.nodeValue.length){if(!b.isIE&&!A()){J=h.create("br");u.insertNode(J);u.setStartAfter(J);u.setEndAfter(J);I=true}}J=h.create("br");u.insertNode(J);if(b.isIE&&s=="PRE"&&(!H||H<8)){J.parentNode.insertBefore(h.doc.createTextNode("\r"),J)}if(!I){u.setStartAfter(J);u.setEndAfter(J)}else{u.setStartBefore(J);u.setEndBefore(J)}d.setRng(u);g.add()}function r(I){do{if(I.nodeType===3){I.nodeValue=I.nodeValue.replace(/^[\r\n]+/,"")}I=I.firstChild}while(I)}function F(K){var I=h.getRoot(),J,L;J=K;while(J!==I&&h.getContentEditable(J)!=="false"){if(h.getContentEditable(J)==="true"){L=J}J=J.parentNode}return J!==I?L:I}if(!u.collapsed){e.execCommand("Delete");return}if(y.isDefaultPrevented()){return}x=u.startContainer;t=u.startOffset;v=c.forced_root_block;v=v?v.toUpperCase():"";H=h.doc.documentMode;if(x.nodeType==1&&x.hasChildNodes()){z=t>x.childNodes.length-1;x=x.childNodes[Math.min(t,x.childNodes.length-1)]||x;t=0}i=F(x);if(!i){return}g.beforeChange();if(!h.isBlock(i)&&i!=h.getRoot()){if(!v||y.shiftKey){G()}return}if((v&&!y.shiftKey)||(!v&&y.shiftKey)){x=k(x,t)}o=h.getParent(x,h.isBlock);l=o?h.getParent(o.parentNode,h.isBlock):null;s=o?o.nodeName.toUpperCase():"";E=l?l.nodeName.toUpperCase():"";if(s=="LI"&&h.isEmpty(o)){if(/^(UL|OL|LI)$/.test(l.parentNode.nodeName)){return false}D();return}if(s=="PRE"&&c.br_in_pre!==false){if(!y.shiftKey){G();return}}else{if((!v&&!y.shiftKey&&s!="LI")||(v&&y.shiftKey)){G();return}}v=v||"P";if(p()){if(/^(H[1-6]|PRE)$/.test(s)&&E!="HGROUP"){n=q(v)}else{n=q()}if(c.end_container_on_empty_block&&B(l)&&h.isEmpty(o)){n=h.split(l,o)}else{h.insertAfter(n,o)}}else{if(p(true)){n=o.parentNode.insertBefore(q(),o)}else{C=u.cloneRange();C.setEndAfter(o);j=C.extractContents();r(j);n=j.firstChild;h.insertAfter(j,o)}}h.setAttrib(n,"id","");m(n);g.add()}e.onKeyDown.add(function(j,i){if(i.keyCode==13){if(f(i)!==false){i.preventDefault()}}})}})(tinymce);
\ No newline at end of file
+// FILE IS GENERATED BY COMBINING THE SOURCES IN THE "classes" DIRECTORY SO DON'T MODIFY THIS FILE DIRECTLY\r
(function(win) {\r
var whiteSpaceRe = /^\s*|\s*$/g,\r
- undefined, isRegExpBroken = 'B'.replace(/A(.)|B/, '$1') === '$1';\r
+ undef, isRegExpBroken = 'B'.replace(/A(.)|B/, '$1') === '$1';\r
\r
var tinymce = {\r
majorVersion : '3',\r
\r
- minorVersion : '5b2',\r
+ minorVersion : '5.0.1',\r
\r
- releaseDate : '2012-03-15',\r
+ releaseDate : '2012-05-10',\r
\r
_init : function() {\r
var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v;\r
// If base element found, add that infront of baseURL\r
nl = d.getElementsByTagName('base');\r
for (i=0; i<nl.length; i++) {\r
- if (v = nl[i].href) {\r
+ v = nl[i].href;\r
+ if (v) {\r
// Host only value like http://site.com or http://site.com:8008\r
if (/^https?:\/\/[^\/]+$/.test(v))\r
v += '/';\r
\r
is : function(o, t) {\r
if (!t)\r
- return o !== undefined;\r
+ return o !== undef;\r
\r
if (t == 'array' && (o.hasOwnProperty && o instanceof Array))\r
return true;\r
\r
s = s || o;\r
\r
- if (o.length !== undefined) {\r
+ if (o.length !== undef) {\r
// Indexed arrays, needed for Safari\r
for (n=0, l = o.length; n < l; n++) {\r
if (cb.call(s, o[n], n, o) === false)\r
return -1;\r
},\r
\r
- extend : function(o, e) {\r
- var i, l, a = arguments;\r
+ extend : function(obj, ext) {\r
+ var i, l, name, args = arguments, value;\r
\r
- for (i = 1, l = a.length; i < l; i++) {\r
- e = a[i];\r
+ for (i = 1, l = args.length; i < l; i++) {\r
+ ext = args[i];\r
+ for (name in ext) {\r
+ if (ext.hasOwnProperty(name)) {\r
+ value = ext[name];\r
\r
- tinymce.each(e, function(v, n) {\r
- if (v !== undefined)\r
- o[n] = v;\r
- });\r
+ if (value !== undef) {\r
+ obj[name] = value;\r
+ }\r
+ }\r
+ }\r
}\r
\r
- return o;\r
+ return obj;\r
},\r
\r
\r
},\r
\r
addUnload : function(f, s) {\r
- var t = this;\r
+ var t = this, unload;\r
\r
- f = {func : f, scope : s || this};\r
+ unload = function() {\r
+ var li = t.unloads, o, n;\r
\r
- if (!t.unloads) {\r
- function unload() {\r
- var li = t.unloads, o, n;\r
+ if (li) {\r
+ // Call unload handlers\r
+ for (n in li) {\r
+ o = li[n];\r
\r
- if (li) {\r
- // Call unload handlers\r
- for (n in li) {\r
- o = li[n];\r
+ if (o && o.func)\r
+ o.func.call(o.scope, 1); // Send in one arg to distinct unload and user destroy\r
+ }\r
\r
- if (o && o.func)\r
- o.func.call(o.scope, 1); // Send in one arg to distinct unload and user destroy\r
- }\r
+ // Detach unload function\r
+ if (win.detachEvent) {\r
+ win.detachEvent('onbeforeunload', fakeUnload);\r
+ win.detachEvent('onunload', unload);\r
+ } else if (win.removeEventListener)\r
+ win.removeEventListener('unload', unload, false);\r
\r
- // Detach unload function\r
- if (win.detachEvent) {\r
- win.detachEvent('onbeforeunload', fakeUnload);\r
- win.detachEvent('onunload', unload);\r
- } else if (win.removeEventListener)\r
- win.removeEventListener('unload', unload, false);\r
+ // Destroy references\r
+ t.unloads = o = li = w = unload = 0;\r
\r
- // Destroy references\r
- t.unloads = o = li = w = unload = 0;\r
+ // Run garbarge collector on IE\r
+ if (win.CollectGarbage)\r
+ CollectGarbage();\r
+ }\r
+ };\r
\r
- // Run garbarge collector on IE\r
- if (win.CollectGarbage)\r
- CollectGarbage();\r
- }\r
- };\r
+ function fakeUnload() {\r
+ var d = document;\r
\r
- function fakeUnload() {\r
- var d = document;\r
+ function stop() {\r
+ // Prevent memory leak\r
+ d.detachEvent('onstop', stop);\r
\r
- // Is there things still loading, then do some magic\r
- if (d.readyState == 'interactive') {\r
- function stop() {\r
- // Prevent memory leak\r
- d.detachEvent('onstop', stop);\r
+ // Call unload handler\r
+ if (unload)\r
+ unload();\r
\r
- // Call unload handler\r
- if (unload)\r
- unload();\r
+ d = 0;\r
+ };\r
\r
- d = 0;\r
- };\r
+ // Is there things still loading, then do some magic\r
+ if (d.readyState == 'interactive') {\r
+ // Fire unload when the currently loading page is stopped\r
+ if (d)\r
+ d.attachEvent('onstop', stop);\r
\r
- // Fire unload when the currently loading page is stopped\r
+ // Remove onstop listener after a while to prevent the unload function\r
+ // to execute if the user presses cancel in an onbeforeunload\r
+ // confirm dialog and then presses the browser stop button\r
+ win.setTimeout(function() {\r
if (d)\r
- d.attachEvent('onstop', stop);\r
-\r
- // Remove onstop listener after a while to prevent the unload function\r
- // to execute if the user presses cancel in an onbeforeunload\r
- // confirm dialog and then presses the browser stop button\r
- win.setTimeout(function() {\r
- if (d)\r
- d.detachEvent('onstop', stop);\r
- }, 0);\r
- }\r
- };\r
+ d.detachEvent('onstop', stop);\r
+ }, 0);\r
+ }\r
+ };\r
\r
+ f = {func : f, scope : s || this};\r
+\r
+ if (!t.unloads) {\r
// Attach unload handler\r
if (win.attachEvent) {\r
win.attachEvent('onunload', unload);\r
},\r
\r
explode : function(s, d) {\r
- return s ? tinymce.map(s.split(d || ','), tinymce.trim) : s;\r
+ if (!s || tinymce.is(s, 'array')) {\r
+ return s;\r
+ }\r
+\r
+ return tinymce.map(s.split(d || ','), tinymce.trim);\r
},\r
\r
_addVer : function(u) {\r
var val = replace, args = arguments, i;\r
\r
for (i = 0; i < args.length - 2; i++) {\r
- if (args[i] === undefined) {\r
+ if (args[i] === undef) {\r
val = val.replace(new RegExp('\\$' + i, 'g'), '');\r
} else {\r
val = val.replace(new RegExp('\\$' + i, 'g'), args[i]);\r
tinymce.create('tinymce.util.Dispatcher', {\r
scope : null,\r
listeners : null,\r
+ inDispatch: false,\r
\r
- Dispatcher : function(s) {\r
- this.scope = s || this;\r
+ Dispatcher : function(scope) {\r
+ this.scope = scope || this;\r
this.listeners = [];\r
},\r
\r
- add : function(cb, s) {\r
- this.listeners.push({cb : cb, scope : s || this.scope});\r
+ add : function(callback, scope) {\r
+ this.listeners.push({cb : callback, scope : scope || this.scope});\r
\r
- return cb;\r
+ return callback;\r
},\r
\r
- addToTop : function(cb, s) {\r
- this.listeners.unshift({cb : cb, scope : s || this.scope});\r
+ addToTop : function(callback, scope) {\r
+ var self = this, listener = {cb : callback, scope : scope || self.scope};\r
+\r
+ // Create new listeners if addToTop is executed in a dispatch loop\r
+ if (self.inDispatch) {\r
+ self.listeners = [listener].concat(self.listeners);\r
+ } else {\r
+ self.listeners.unshift(listener);\r
+ }\r
\r
- return cb;\r
+ return callback;\r
},\r
\r
- remove : function(cb) {\r
- var l = this.listeners, o = null;\r
+ remove : function(callback) {\r
+ var listeners = this.listeners, output = null;\r
\r
- tinymce.each(l, function(c, i) {\r
- if (cb == c.cb) {\r
- o = cb;\r
- l.splice(i, 1);\r
+ tinymce.each(listeners, function(listener, i) {\r
+ if (callback == listener.cb) {\r
+ output = listener;\r
+ listeners.splice(i, 1);\r
return false;\r
}\r
});\r
\r
- return o;\r
+ return output;\r
},\r
\r
dispatch : function() {\r
- var s, a = arguments, i, li = this.listeners, c;\r
+ var self = this, returnValue, args = arguments, i, listeners = self.listeners, listener;\r
\r
+ self.inDispatch = true;\r
+ \r
// Needs to be a real loop since the listener count might change while looping\r
// And this is also more efficient\r
- for (i = 0; i<li.length; i++) {\r
- c = li[i];\r
- s = c.cb.apply(c.scope, a.length > 0 ? a : [c.scope]);\r
+ for (i = 0; i < listeners.length; i++) {\r
+ listener = listeners[i];\r
+ returnValue = listener.cb.apply(listener.scope, args.length > 0 ? args : [listener.scope]);\r
\r
- if (s === false)\r
+ if (returnValue === false)\r
break;\r
}\r
\r
- return s;\r
+ self.inDispatch = false;\r
+\r
+ return returnValue;\r
}\r
\r
});\r
u = (s.base_uri ? s.base_uri.protocol || 'http' : 'http') + '://mce_host' + u;\r
\r
// Relative path http:// or protocol relative //path\r
- if (!/^[\w-]*:?\/\//.test(u)) {\r
+ if (!/^[\w\-]*:?\/\//.test(u)) {\r
base_url = s.base_uri ? s.base_uri.path : new tinymce.util.URI(location.href).directory;\r
u = ((s.base_uri && s.base_uri.protocol) || 'http') + '://mce_host' + t.toAbsPath(base_url, u);\r
}\r
t[v] = s;\r
});\r
\r
- if (b = s.base_uri) {\r
+ b = s.base_uri;\r
+ if (b) {\r
if (!t.protocol)\r
t.protocol = b.protocol;\r
\r
if (!t.userInfo)\r
t.userInfo = b.userInfo;\r
\r
- if (!t.port && t.host == 'mce_host')\r
+ if (!t.port && t.host === 'mce_host')\r
t.port = b.port;\r
\r
- if (!t.host || t.host == 'mce_host')\r
+ if (!t.host || t.host === 'mce_host')\r
t.host = b.host;\r
\r
t.source = '';\r
if ((u.host != 'mce_host' && t.host != u.host && u.host) || t.port != u.port || t.protocol != u.protocol)\r
return u.getURI();\r
\r
+ var tu = t.getURI(), uu = u.getURI();\r
+ \r
+ // Allow usage of the base_uri when relative_urls = true\r
+ if(tu == uu || (tu.charAt(tu.length - 1) == "/" && tu.substr(0, tu.length - 1) == uu))\r
+ return tu;\r
+\r
o = t.toRelPath(t.path, u.path);\r
\r
// Add query\r
},\r
\r
toAbsolute : function(u, nh) {\r
- var u = new tinymce.util.URI(u, {base_uri : this});\r
+ u = new tinymce.util.URI(u, {base_uri : this});\r
\r
return u.getURI(this.host == u.host && this.protocol == u.protocol ? nh : 0);\r
},\r
}\r
}\r
\r
- if (bp == 1)\r
+ if (bp === 1)\r
return path;\r
\r
for (i = 0, l = base.length - (bp - 1); i < l; i++)\r
// Merge relURLParts chunks\r
for (i = path.length - 1, o = []; i >= 0; i--) {\r
// Ignore empty or .\r
- if (path[i].length == 0 || path[i] == ".")\r
+ if (path[i].length === 0 || path[i] === ".")\r
continue;\r
\r
// Is parent\r
- if (path[i] == '..') {\r
+ if (path[i] === '..') {\r
nb++;\r
continue;\r
}\r
if (b == -1) {\r
b = c.indexOf(p);\r
\r
- if (b != 0)\r
+ if (b !== 0)\r
return null;\r
} else\r
b += 2;\r
\r
(function() {\r
function serialize(o, quote) {\r
- var i, v, t;\r
+ var i, v, t, name;\r
\r
quote = quote || '"';\r
\r
\r
v = '{';\r
\r
- for (i in o) {\r
- if (o.hasOwnProperty(i)) {\r
- v += typeof o[i] != 'function' ? (v.length > 1 ? ',' + quote : quote) + i + quote +':' + serialize(o[i], quote) : '';\r
+ for (name in o) {\r
+ if (o.hasOwnProperty(name)) {\r
+ v += typeof o[name] != 'function' ? (v.length > 1 ? ',' + quote : quote) + name + quote +':' + serialize(o[name], quote) : '';\r
}\r
}\r
\r
send : function(o) {\r
var x, t, w = window, c = 0;\r
\r
+ function ready() {\r
+ if (!o.async || x.readyState == 4 || c++ > 10000) {\r
+ if (o.success && c < 10000 && x.status == 200)\r
+ o.success.call(o.success_scope, '' + x.responseText, x, o);\r
+ else if (o.error)\r
+ o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o);\r
+\r
+ x = null;\r
+ } else\r
+ w.setTimeout(ready, 10);\r
+ };\r
+\r
// Default settings\r
o.scope = o.scope || this;\r
o.success_scope = o.success_scope || o.scope;\r
\r
x.send(o.data);\r
\r
- function ready() {\r
- if (!o.async || x.readyState == 4 || c++ > 10000) {\r
- if (o.success && c < 10000 && x.status == 200)\r
- o.success.call(o.success_scope, '' + x.responseText, x, o);\r
- else if (o.error)\r
- o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o);\r
-\r
- x = null;\r
- } else\r
- w.setTimeout(ready, 10);\r
- };\r
-\r
// Syncronous request\r
if (!o.async)\r
return ready();\r
modifierPressed: function (e) {\r
return e.shiftKey || e.ctrlKey || e.altKey;\r
}\r
- }\r
+ };\r
})(tinymce);\r
\r
-(function(tinymce) {\r
- var VK = tinymce.VK, BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE;\r
+tinymce.util.Quirks = function(editor) {\r
+ var VK = tinymce.VK, BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection, settings = editor.settings;\r
\r
- function setEditorCommandState(editor, cmd, state) {\r
+ function setEditorCommandState(cmd, state) {\r
try {\r
editor.getDoc().execCommand(cmd, false, state);\r
} catch (ex) {\r
}\r
}\r
\r
- function cleanupStylesWhenDeleting(ed) {\r
- var dom = ed.dom, selection = ed.selection;\r
+ function cleanupStylesWhenDeleting() {\r
+ function removeMergedFormatSpans(isDelete) {\r
+ var rng, blockElm, node, clonedSpan;\r
\r
- ed.onKeyDown.add(function(ed, e) {\r
- var rng, blockElm, node, clonedSpan, isDelete;\r
+ rng = selection.getRng();\r
\r
- if (e.isDefaultPrevented()) {\r
- return;\r
+ // Find root block\r
+ blockElm = dom.getParent(rng.startContainer, dom.isBlock);\r
+\r
+ // On delete clone the root span of the next block element\r
+ if (isDelete)\r
+ blockElm = dom.getNext(blockElm, dom.isBlock);\r
+\r
+ // Locate root span element and clone it since it would otherwise get merged by the "apple-style-span" on delete/backspace\r
+ if (blockElm) {\r
+ node = blockElm.firstChild;\r
+\r
+ // Ignore empty text nodes\r
+ while (node && node.nodeType == 3 && node.nodeValue.length === 0)\r
+ node = node.nextSibling;\r
+\r
+ if (node && node.nodeName === 'SPAN') {\r
+ clonedSpan = node.cloneNode(false);\r
+ }\r
}\r
\r
+ // Do the backspace/delete action\r
+ editor.getDoc().execCommand(isDelete ? 'ForwardDelete' : 'Delete', false, null);\r
+\r
+ // Find all odd apple-style-spans\r
+ blockElm = dom.getParent(rng.startContainer, dom.isBlock);\r
+ tinymce.each(dom.select('span.Apple-style-span,font.Apple-style-span', blockElm), function(span) {\r
+ var bm = selection.getBookmark();\r
+\r
+ if (clonedSpan) {\r
+ dom.replace(clonedSpan.cloneNode(false), span, true);\r
+ } else {\r
+ dom.remove(span, true);\r
+ }\r
+\r
+ // Restore the selection\r
+ selection.moveToBookmark(bm);\r
+ });\r
+ };\r
+\r
+ editor.onKeyDown.add(function(editor, e) {\r
+ var isDelete;\r
+\r
isDelete = e.keyCode == DELETE;\r
- if ((isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {\r
+ if (!e.isDefaultPrevented() && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {\r
e.preventDefault();\r
- rng = selection.getRng();\r
+ removeMergedFormatSpans(isDelete);\r
+ }\r
+ });\r
\r
- // Find root block\r
- blockElm = dom.getParent(rng.startContainer, dom.isBlock);\r
+ editor.addCommand('Delete', function() {removeMergedFormatSpans();});\r
+ };\r
+ \r
+ function emptyEditorWhenDeleting() {\r
+ function getEndPointNode(rng, start) {\r
+ var container, offset, prefix = start ? 'start' : 'end';\r
\r
- // On delete clone the root span of the next block element\r
- if (isDelete)\r
- blockElm = dom.getNext(blockElm, dom.isBlock);\r
+ container = rng[prefix + 'Container'];\r
+ offset = rng[prefix + 'Offset'];\r
\r
- // Locate root span element and clone it since it would otherwise get merged by the "apple-style-span" on delete/backspace\r
- if (blockElm) {\r
- node = blockElm.firstChild;\r
+ // Resolve indexed container\r
+ if (container.nodeType == 1 && container.hasChildNodes()) {\r
+ container = container.childNodes[Math.min(start ? offset : (offset > 0 ? offset - 1 : 0), container.childNodes.length - 1)]\r
+ }\r
\r
- // Ignore empty text nodes\r
- while (node && node.nodeType == 3 && node.nodeValue.length == 0)\r
- node = node.nextSibling;\r
+ return container;\r
+ };\r
\r
- if (node && node.nodeName === 'SPAN') {\r
- clonedSpan = node.cloneNode(false);\r
- }\r
- }\r
+ function isAtStartEndOfBody(rng, start) {\r
+ var container, offset, root, childNode, prefix = start ? 'start' : 'end', isAfter;\r
\r
- // Do the backspace/delete action\r
- ed.getDoc().execCommand(isDelete ? 'ForwardDelete' : 'Delete', false, null);\r
+ container = rng[prefix + 'Container'];\r
+ offset = rng[prefix + 'Offset'];\r
+ root = dom.getRoot();\r
\r
- // Find all odd apple-style-spans\r
- blockElm = dom.getParent(rng.startContainer, dom.isBlock);\r
- tinymce.each(dom.select('span.Apple-style-span,font.Apple-style-span', blockElm), function(span) {\r
- var bm = selection.getBookmark();\r
+ // Resolve indexed container\r
+ if (container.nodeType == 1) {\r
+ isAfter = offset >= container.childNodes.length;\r
+ container = getEndPointNode(rng, start);\r
\r
- if (clonedSpan) {\r
- dom.replace(clonedSpan.cloneNode(false), span, true);\r
- } else {\r
- dom.remove(span, true);\r
- }\r
+ if (container.nodeType == 3) {\r
+ offset = start && !isAfter ? 0 : container.nodeValue.length;\r
+ }\r
+ }\r
\r
- // Restore the selection\r
- selection.moveToBookmark(bm);\r
- });\r
+ // Check if start/end is in the middle of text\r
+ if (container.nodeType == 3 && ((start && offset > 0) || (!start && offset < container.nodeValue.length))) {\r
+ return false;\r
}\r
- });\r
- };\r
\r
- function emptyEditorWhenDeleting(ed) {\r
- function serializeRng(rng) {\r
- var body = ed.dom.create("body");\r
- var contents = rng.cloneContents();\r
- body.appendChild(contents);\r
- return ed.selection.serializer.serialize(body, {format: 'html'});\r
- }\r
+ // Walk up the DOM tree to see if the endpoint is at the beginning/end of body\r
+ while (container !== root) {\r
+ childNode = container.parentNode[start ? 'firstChild' : 'lastChild'];\r
\r
- function allContentsSelected(rng) {\r
- var selection = serializeRng(rng);\r
+ // If first/last element is a BR then jump to it's sibling in case: <p>x<br></p>\r
+ if (childNode.nodeName == "BR") {\r
+ childNode = childNode[start ? 'nextSibling' : 'previousSibling'] || childNode;\r
+ }\r
\r
- var allRng = ed.dom.createRng();\r
- allRng.selectNode(ed.getBody());\r
+ // If the childNode isn't the container node then break in case <p><span>A</span>[X]</p>\r
+ if (childNode !== container) {\r
+ return false;\r
+ }\r
\r
- var allSelection = serializeRng(allRng);\r
- return selection === allSelection;\r
- }\r
+ container = container.parentNode;\r
+ }\r
\r
- ed.onKeyDown.addToTop(function(ed, e) {\r
- var keyCode = e.keyCode;\r
- if (keyCode == DELETE || keyCode == BACKSPACE) {\r
- var rng = ed.selection.getRng(true);\r
- if (!rng.collapsed && allContentsSelected(rng)) {\r
- ed.setContent('', {format : 'raw'});\r
- ed.nodeChanged();\r
+ return true;\r
+ };\r
+\r
+ editor.onKeyDown.addToTop(function(editor, e) {\r
+ var rng, keyCode = e.keyCode;\r
+\r
+ if (!e.isDefaultPrevented() && (keyCode == DELETE || keyCode == BACKSPACE)) {\r
+ rng = selection.getRng(true);\r
+\r
+ if (isAtStartEndOfBody(rng, true) && isAtStartEndOfBody(rng, false) &&\r
+ (rng.collapsed || dom.findCommonAncestor(getEndPointNode(rng, true), getEndPointNode(rng)) === dom.getRoot())) {\r
+ editor.setContent('');\r
+ editor.nodeChanged();\r
e.preventDefault();\r
}\r
}\r
});\r
};\r
\r
- function inputMethodFocus(ed) {\r
- ed.dom.bind(ed.getDoc(), 'focusin', function() {\r
- ed.selection.setRng(ed.selection.getRng());\r
- });\r
+ function inputMethodFocus() {\r
+ if (!editor.settings.content_editable) {\r
+ // Case 1 IME doesn't initialize if you focus the document\r
+ dom.bind(editor.getDoc(), 'focusin', function(e) {\r
+ selection.setRng(selection.getRng());\r
+ });\r
+\r
+ // Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event\r
+ dom.bind(editor.getDoc(), 'mousedown', function(e) {\r
+ if (e.target == editor.getDoc().documentElement) {\r
+ editor.getWin().focus();\r
+ selection.setRng(selection.getRng());\r
+ }\r
+ });\r
+ }\r
};\r
\r
- function removeHrOnBackspace(ed) {\r
- ed.onKeyDown.add(function(ed, e) {\r
- if (e.keyCode === BACKSPACE) {\r
- if (ed.selection.isCollapsed() && ed.selection.getRng(true).startOffset === 0) {\r
- var node = ed.selection.getNode();\r
+ function removeHrOnBackspace() {\r
+ editor.onKeyDown.add(function(editor, e) {\r
+ if (!e.isDefaultPrevented() && e.keyCode === BACKSPACE) {\r
+ if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {\r
+ var node = selection.getNode();\r
var previousSibling = node.previousSibling;\r
+\r
if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "hr") {\r
- ed.dom.remove(previousSibling);\r
+ dom.remove(previousSibling);\r
tinymce.dom.Event.cancel(e);\r
}\r
}\r
})\r
}\r
\r
- function focusBody(ed) {\r
+ function focusBody() {\r
// Fix for a focus bug in FF 3.x where the body element\r
// wouldn't get proper focus if the user clicked on the HTML element\r
if (!Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4\r
- ed.onMouseDown.add(function(ed, e) {\r
+ editor.onMouseDown.add(function(editor, e) {\r
if (e.target.nodeName === "HTML") {\r
- var body = ed.getBody();\r
+ var body = editor.getBody();\r
\r
// Blur the body it's focused but not correctly focused\r
body.blur();\r
}\r
};\r
\r
- function selectControlElements(ed) {\r
- ed.onClick.add(function(ed, e) {\r
+ function selectControlElements() {\r
+ editor.onClick.add(function(editor, e) {\r
e = e.target;\r
\r
// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250\r
// WebKit can't even do simple things like selecting an image\r
// Needs tobe the setBaseAndExtend or it will fail to select floated images\r
- if (/^(IMG|HR)$/.test(e.nodeName))\r
- ed.selection.getSel().setBaseAndExtent(e, 0, e, 1);\r
+ if (/^(IMG|HR)$/.test(e.nodeName)) {\r
+ selection.getSel().setBaseAndExtent(e, 0, e, 1);\r
+ }\r
\r
- if (e.nodeName == 'A' && ed.dom.hasClass(e, 'mceItemAnchor'))\r
- ed.selection.select(e);\r
+ if (e.nodeName == 'A' && dom.hasClass(e, 'mceItemAnchor')) {\r
+ selection.select(e);\r
+ }\r
\r
- ed.nodeChanged();\r
+ editor.nodeChanged();\r
});\r
};\r
\r
- function removeStylesWhenDeletingAccrossBlockElements(ed) {\r
- var selection = ed.selection, dom = ed.dom;\r
-\r
+ function removeStylesWhenDeletingAccrossBlockElements() {\r
function getAttributeApplyFunction() {\r
var template = dom.getAttribs(selection.getStart().cloneNode(false));\r
\r
return function() {\r
var target = selection.getStart();\r
\r
- if (target !== ed.getBody()) {\r
+ if (target !== editor.getBody()) {\r
dom.setAttrib(target, "style", null);\r
\r
- tinymce.each(template, function(attr) {\r
- target.setAttributeNode(attr.cloneNode(true));\r
- });\r
+ tinymce.each(template, function(attr) {\r
+ target.setAttributeNode(attr.cloneNode(true));\r
+ });\r
}\r
};\r
}\r
return !selection.isCollapsed() && selection.getStart() != selection.getEnd();\r
}\r
\r
- function blockEvent(ed, e) {\r
+ function blockEvent(editor, e) {\r
e.preventDefault();\r
return false;\r
}\r
\r
- ed.onKeyPress.add(function(ed, e) {\r
+ editor.onKeyPress.add(function(editor, e) {\r
var applyAttributes;\r
\r
if ((e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) {\r
applyAttributes = getAttributeApplyFunction();\r
- ed.getDoc().execCommand('delete', false, null);\r
+ editor.getDoc().execCommand('delete', false, null);\r
applyAttributes();\r
e.preventDefault();\r
return false;\r
}\r
});\r
\r
- dom.bind(ed.getDoc(), 'cut', function(e) {\r
+ dom.bind(editor.getDoc(), 'cut', function(e) {\r
var applyAttributes;\r
\r
if (isSelectionAcrossElements()) {\r
applyAttributes = getAttributeApplyFunction();\r
- ed.onKeyUp.addToTop(blockEvent);\r
+ editor.onKeyUp.addToTop(blockEvent);\r
\r
setTimeout(function() {\r
applyAttributes();\r
- ed.onKeyUp.remove(blockEvent);\r
- }, 0);\r
- }\r
- });\r
- }\r
- \r
- /*\r
- function removeStylesOnPTagsInheritedFromHeadingTag(ed) {\r
- ed.onKeyDown.add(function(ed, event) {\r
- function checkInHeadingTag(ed) {\r
- var currentNode = ed.selection.getNode();\r
- var headingTags = 'h1,h2,h3,h4,h5,h6';\r
- return ed.dom.is(currentNode, headingTags) || ed.dom.getParent(currentNode, headingTags) !== null;\r
- }\r
-\r
- if (event.keyCode === VK.ENTER && !VK.modifierPressed(event) && checkInHeadingTag(ed)) {\r
- setTimeout(function() {\r
- var currentNode = ed.selection.getNode();\r
- if (ed.dom.is(currentNode, 'p')) {\r
- ed.dom.setAttrib(currentNode, 'style', null);\r
- // While tiny's content is correct after this method call, the content shown is not representative of it and needs to be 'repainted'\r
- ed.execCommand('mceCleanup');\r
- }\r
+ editor.onKeyUp.remove(blockEvent);\r
}, 0);\r
}\r
});\r
}\r
- */\r
\r
- function selectionChangeNodeChanged(ed) {\r
+ function selectionChangeNodeChanged() {\r
var lastRng, selectionTimer;\r
\r
- ed.dom.bind(ed.getDoc(), 'selectionchange', function() {\r
+ dom.bind(editor.getDoc(), 'selectionchange', function() {\r
if (selectionTimer) {\r
clearTimeout(selectionTimer);\r
selectionTimer = 0;\r
}\r
\r
selectionTimer = window.setTimeout(function() {\r
- var rng = ed.selection.getRng();\r
+ var rng = selection.getRng();\r
\r
// Compare the ranges to see if it was a real change or not\r
if (!lastRng || !tinymce.dom.RangeUtils.compareRanges(rng, lastRng)) {\r
- ed.nodeChanged();\r
+ editor.nodeChanged();\r
lastRng = rng;\r
}\r
}, 50);\r
});\r
}\r
\r
- function ensureBodyHasRoleApplication(ed) {\r
+ function ensureBodyHasRoleApplication() {\r
document.body.setAttribute("role", "application");\r
}\r
- \r
- function disableBackspaceIntoATable(ed) {\r
- ed.onKeyDown.add(function(ed, e) {\r
- if (e.keyCode === BACKSPACE) {\r
- if (ed.selection.isCollapsed() && ed.selection.getRng(true).startOffset === 0) {\r
- var previousSibling = ed.selection.getNode().previousSibling;\r
+\r
+ function disableBackspaceIntoATable() {\r
+ editor.onKeyDown.add(function(editor, e) {\r
+ if (!e.isDefaultPrevented() && e.keyCode === BACKSPACE) {\r
+ if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {\r
+ var previousSibling = selection.getNode().previousSibling;\r
if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "table") {\r
return tinymce.dom.Event.cancel(e);\r
}\r
})\r
}\r
\r
- function addNewLinesBeforeBrInPre(editor) {\r
+ function addNewLinesBeforeBrInPre() {\r
var documentMode = editor.getDoc().documentMode;\r
\r
// IE8+ rendering mode does the right thing with BR in PRE\r
\r
// Enable display: none in area and add a specific class that hides all BR elements in PRE to\r
// avoid the caret from getting stuck at the BR elements while pressing the right arrow key\r
- setEditorCommandState(editor, 'RespectVisibilityInDesign', true);\r
- editor.dom.addClass(editor.getBody(), 'mceHideBrInPre');\r
+ setEditorCommandState('RespectVisibilityInDesign', true);\r
+ dom.addClass(editor.getBody(), 'mceHideBrInPre');\r
\r
// Adds a \n before all BR elements in PRE to get them visual\r
editor.parser.addNodeFilter('pre', function(nodes, name) {\r
});\r
}\r
\r
- tinymce.create('tinymce.util.Quirks', {\r
- Quirks: function(ed) {\r
- // All browsers\r
- disableBackspaceIntoATable(ed);\r
+ function removePreSerializedStylesWhenSelectingControls() {\r
+ dom.bind(editor.getBody(), 'mouseup', function(e) {\r
+ var value, node = selection.getNode();\r
\r
- // WebKit\r
- if (tinymce.isWebKit) {\r
- cleanupStylesWhenDeleting(ed);\r
- emptyEditorWhenDeleting(ed);\r
- inputMethodFocus(ed);\r
- selectControlElements(ed);\r
+ // Moved styles to attributes on IMG eements\r
+ if (node.nodeName == 'IMG') {\r
+ // Convert style width to width attribute\r
+ if (value = dom.getStyle(node, 'width')) {\r
+ dom.setAttrib(node, 'width', value.replace(/[^0-9%]+/g, ''));\r
+ dom.setStyle(node, 'width', '');\r
+ }\r
\r
- // iOS\r
- if (tinymce.isIDevice) {\r
- selectionChangeNodeChanged(ed);\r
+ // Convert style height to height attribute\r
+ if (value = dom.getStyle(node, 'height')) {\r
+ dom.setAttrib(node, 'height', value.replace(/[^0-9%]+/g, ''));\r
+ dom.setStyle(node, 'height', '');\r
}\r
}\r
+ });\r
+ }\r
\r
- // IE\r
- if (tinymce.isIE) {\r
- removeHrOnBackspace(ed);\r
- emptyEditorWhenDeleting(ed);\r
- ensureBodyHasRoleApplication(ed);\r
- //removeStylesOnPTagsInheritedFromHeadingTag(ed)\r
- addNewLinesBeforeBrInPre(ed);\r
+ function keepInlineElementOnDeleteBackspace() {\r
+ editor.onKeyDown.add(function(editor, e) {\r
+ var isDelete, rng, container, offset, brElm, sibling, collapsed;\r
+\r
+ isDelete = e.keyCode == DELETE;\r
+ if (!e.isDefaultPrevented() && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {\r
+ rng = selection.getRng();\r
+ container = rng.startContainer;\r
+ offset = rng.startOffset;\r
+ collapsed = rng.collapsed;\r
+\r
+ // Override delete if the start container is a text node and is at the beginning of text or\r
+ // just before/after the last character to be deleted in collapsed mode\r
+ if (container.nodeType == 3 && container.nodeValue.length > 0 && ((offset === 0 && !collapsed) || (collapsed && offset === (isDelete ? 0 : 1)))) {\r
+ nonEmptyElements = editor.schema.getNonEmptyElements();\r
+\r
+ // Prevent default logic since it's broken\r
+ e.preventDefault();\r
+\r
+ // Insert a BR before the text node this will prevent the containing element from being deleted/converted\r
+ brElm = dom.create('br', {id: '__tmp'});\r
+ container.parentNode.insertBefore(brElm, container);\r
+\r
+ // Do the browser delete\r
+ editor.getDoc().execCommand(isDelete ? 'ForwardDelete' : 'Delete', false, null);\r
+\r
+ // Check if the previous sibling is empty after deleting for example: <p><b></b>|</p>\r
+ container = selection.getRng().startContainer;\r
+ sibling = container.previousSibling;\r
+ if (sibling && sibling.nodeType == 1 && !dom.isBlock(sibling) && dom.isEmpty(sibling) && !nonEmptyElements[sibling.nodeName.toLowerCase()]) {\r
+ dom.remove(sibling);\r
+ }\r
+\r
+ // Remove the temp element we inserted\r
+ dom.remove('__tmp');\r
+ }\r
}\r
+ });\r
+ }\r
\r
- // Gecko\r
- if (tinymce.isGecko) {\r
- removeHrOnBackspace(ed);\r
- focusBody(ed);\r
- removeStylesWhenDeletingAccrossBlockElements(ed);\r
+ function removeBlockQuoteOnBackSpace() {\r
+ // Add block quote deletion handler\r
+ editor.onKeyDown.add(function(editor, e) {\r
+ var rng, container, offset, root, parent;\r
+\r
+ if (e.isDefaultPrevented() || e.keyCode != VK.BACKSPACE) {\r
+ return;\r
+ }\r
+\r
+ rng = selection.getRng();\r
+ container = rng.startContainer;\r
+ offset = rng.startOffset;\r
+ root = dom.getRoot();\r
+ parent = container;\r
+\r
+ if (!rng.collapsed || offset !== 0) {\r
+ return;\r
+ }\r
+\r
+ while (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) {\r
+ parent = parent.parentNode;\r
+ }\r
+\r
+ // Is the cursor at the beginning of a blockquote?\r
+ if (parent.tagName === 'BLOCKQUOTE') {\r
+ // Remove the blockquote\r
+ editor.formatter.toggle('blockquote', null, parent);\r
+\r
+ // Move the caret to the beginning of container\r
+ rng.setStart(container, 0);\r
+ rng.setEnd(container, 0);\r
+ selection.setRng(rng);\r
+ selection.collapse(false);\r
+ }\r
+ });\r
+ };\r
+\r
+ function setGeckoEditingOptions() {\r
+ function setOpts() {\r
+ editor._refreshContentEditable();\r
+\r
+ setEditorCommandState("StyleWithCSS", false);\r
+ setEditorCommandState("enableInlineTableEditing", false);\r
+\r
+ if (!settings.object_resizing) {\r
+ setEditorCommandState("enableObjectResizing", false);\r
}\r
+ };\r
+\r
+ if (!settings.readonly) {\r
+ editor.onBeforeExecCommand.add(setOpts);\r
+ editor.onMouseDown.add(setOpts);\r
}\r
- });\r
-})(tinymce);\r
+ };\r
+\r
+ function addBrAfterLastLinks() {\r
+ function fixLinks(editor, o) {\r
+ tinymce.each(dom.select('a'), function(node) {\r
+ var parentNode = node.parentNode, root = dom.getRoot();\r
+\r
+ if (parentNode.lastChild === node) {\r
+ while (parentNode && !dom.isBlock(parentNode)) {\r
+ if (parentNode.parentNode.lastChild !== parentNode || parentNode === root) {\r
+ return;\r
+ }\r
+\r
+ parentNode = parentNode.parentNode;\r
+ }\r
+\r
+ dom.add(parentNode, 'br', {'data-mce-bogus' : 1});\r
+ }\r
+ });\r
+ };\r
+\r
+ editor.onExecCommand.add(function(editor, cmd) {\r
+ if (cmd === 'CreateLink') {\r
+ fixLinks(editor);\r
+ }\r
+ });\r
+\r
+ editor.onSetContent.add(selection.onSetContent.add(fixLinks));\r
+ };\r
+\r
+ function removeGhostSelection() {\r
+ function repaint(sender, args) {\r
+ if (!sender || !args.initial) {\r
+ editor.execCommand('mceRepaint');\r
+ }\r
+ };\r
+\r
+ editor.onUndo.add(repaint);\r
+ editor.onRedo.add(repaint);\r
+ editor.onSetContent.add(repaint);\r
+ };\r
+\r
+ function deleteImageOnBackSpace() {\r
+ editor.onKeyDown.add(function(editor, e) {\r
+ if (!e.isDefaultPrevented() && e.keyCode == 8 && selection.getNode().nodeName == 'IMG') {\r
+ e.preventDefault();\r
+ editor.undoManager.beforeChange();\r
+ dom.remove(selection.getNode());\r
+ editor.undoManager.add();\r
+ }\r
+ });\r
+ };\r
+\r
+ // All browsers\r
+ disableBackspaceIntoATable();\r
+ removeBlockQuoteOnBackSpace();\r
+ emptyEditorWhenDeleting();\r
+\r
+ // WebKit\r
+ if (tinymce.isWebKit) {\r
+ keepInlineElementOnDeleteBackspace();\r
+ cleanupStylesWhenDeleting();\r
+ inputMethodFocus();\r
+ selectControlElements();\r
+\r
+ // iOS\r
+ if (tinymce.isIDevice) {\r
+ selectionChangeNodeChanged();\r
+ }\r
+ }\r
+\r
+ // IE\r
+ if (tinymce.isIE) {\r
+ removeHrOnBackspace();\r
+ ensureBodyHasRoleApplication();\r
+ addNewLinesBeforeBrInPre();\r
+ removePreSerializedStylesWhenSelectingControls();\r
+ deleteImageOnBackSpace();\r
+ }\r
\r
+ // Gecko\r
+ if (tinymce.isGecko) {\r
+ removeHrOnBackspace();\r
+ focusBody();\r
+ removeStylesWhenDeletingAccrossBlockElements();\r
+ setGeckoEditingOptions();\r
+ addBrAfterLastLinks();\r
+ removeGhostSelection();\r
+ }\r
+};\r
(function(tinymce) {\r
var namedEntities, baseEntities, reverseEntities,\r
attrsCharsRegExp = /[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,\r
'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' +\r
'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' +\r
'80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' +\r
- '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro'\r
- , 32);\r
+ '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro', 32);\r
\r
tinymce.html = tinymce.html || {};\r
\r
str = str.replace(/\\([\'\";:])/g, "$1");\r
\r
return str;\r
- }\r
+ };\r
+\r
+ function processUrl(match, url, url2, url3, str, str2) {\r
+ str = str || str2;\r
+\r
+ if (str) {\r
+ str = decode(str);\r
+\r
+ // Force strings into single quote format\r
+ return "'" + str.replace(/\'/g, "\\'") + "'";\r
+ }\r
+\r
+ url = decode(url || url2 || url3);\r
+\r
+ // Convert the URL to relative/absolute depending on config\r
+ if (urlConverter)\r
+ url = urlConverter.call(urlConverterScope, url, 'style');\r
+\r
+ // Output new URL format\r
+ return "url('" + url.replace(/\'/g, "\\'") + "')";\r
+ };\r
\r
if (css) {\r
// Encode \" \' % and ; and : inside strings so they don't interfere with the style parsing\r
value = value.replace(rgbRegExp, toHex);\r
\r
// Convert URLs and force them into url('value') format\r
- value = value.replace(urlOrStrRegExp, function(match, url, url2, url3, str, str2) {\r
- str = str || str2;\r
-\r
- if (str) {\r
- str = decode(str);\r
-\r
- // Force strings into single quote format\r
- return "'" + str.replace(/\'/g, "\\'") + "'";\r
- }\r
-\r
- url = decode(url || url2 || url3);\r
-\r
- // Convert the URL to relative/absolute depending on config\r
- if (urlConverter)\r
- url = urlConverter.call(urlConverterScope, url, 'style');\r
-\r
- // Output new URL format\r
- return "url('" + url.replace(/\'/g, "\\'") + "')";\r
- });\r
-\r
+ value = value.replace(urlOrStrRegExp, processUrl);\r
styles[name] = isEncoded ? decode(value, true) : value;\r
}\r
\r
'span[A][B]' +\r
'ins[A|cite|datetime][B]' +\r
'del[A|cite|datetime][B]' +\r
- 'figure[A][C|legend]' +\r
+ 'figure[A][C|legend|figcaption]' +\r
+ 'figcaption[A][C]' +\r
'img[A|alt|src|height|width|usemap|ismap][]' +\r
'iframe[A|name|src|height|width|sandbox|seamless][]' +\r
'embed[A|src|height|width|type][]' +\r
nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object', shortEndedElementsMap);\r
blockElementsMap = createLookupTable('block_elements', 'h1 h2 h3 h4 h5 h6 hr p div address pre form table tbody thead tfoot ' + \r
'th tr td li ol ul caption blockquote center dl dt dd dir fieldset ' + \r
- 'noscript menu isindex samp header footer article section hgroup aside nav');\r
+ 'noscript menu isindex samp header footer article section hgroup aside nav figure');\r
\r
// Converts a wildcard expression string to a regexp for example *a will become /.*a/.\r
function patternToRegExp(str) {\r
function addValidElements(valid_elements) {\r
var ei, el, ai, al, yl, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder,\r
prefix, outputName, globalAttributes, globalAttributesOrder, transElement, key, childKey, value,\r
- elementRuleRegExp = /^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,\r
+ elementRuleRegExp = /^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,\r
attrRuleRegExp = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,\r
hasPatternsRegExp = /[*?+]/;\r
\r
}\r
};\r
\r
+ function parseAttribute(match, name, value, val2, val3) {\r
+ var attrRule, i;\r
+\r
+ name = name.toLowerCase();\r
+ value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute\r
+\r
+ // Validate name and value\r
+ if (validate && !isInternalElement && name.indexOf('data-') !== 0) {\r
+ attrRule = validAttributesMap[name];\r
+\r
+ // Find rule by pattern matching\r
+ if (!attrRule && validAttributePatterns) {\r
+ i = validAttributePatterns.length;\r
+ while (i--) {\r
+ attrRule = validAttributePatterns[i];\r
+ if (attrRule.pattern.test(name))\r
+ break;\r
+ }\r
+\r
+ // No rule matched\r
+ if (i === -1)\r
+ attrRule = null;\r
+ }\r
+\r
+ // No attribute rule found\r
+ if (!attrRule)\r
+ return;\r
+\r
+ // Validate value\r
+ if (attrRule.validValues && !(value in attrRule.validValues))\r
+ return;\r
+ }\r
+\r
+ // Add attribute to list and map\r
+ attrList.map[name] = value;\r
+ attrList.push({\r
+ name: name,\r
+ value: value\r
+ });\r
+ };\r
+\r
// Precompile RegExps and map objects\r
tokenRegExp = new RegExp('<(?:' +\r
'(?:!--([\\w\\W]*?)-->)|' + // Comment\r
'(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE\r
'(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI\r
'(?:\\/([^>]+)>)|' + // End element\r
- '(?:([A-Za-z0-9\-\:]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + // Start element\r
+ '(?:([A-Za-z0-9\\-\\:]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + // Start element\r
')', 'g');\r
\r
attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;\r
attrList = [];\r
attrList.map = {};\r
\r
- attribsValue.replace(attrRegExp, function(match, name, value, val2, val3) {\r
- var attrRule, i;\r
-\r
- name = name.toLowerCase();\r
- value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute\r
-\r
- // Validate name and value\r
- if (validate && !isInternalElement && name.indexOf('data-') !== 0) {\r
- attrRule = validAttributesMap[name];\r
+ attribsValue.replace(attrRegExp, parseAttribute);\r
+ } else {\r
+ attrList = [];\r
+ attrList.map = {};\r
+ }\r
\r
- // Find rule by pattern matching\r
- if (!attrRule && validAttributePatterns) {\r
- i = validAttributePatterns.length;\r
- while (i--) {\r
- attrRule = validAttributePatterns[i];\r
- if (attrRule.pattern.test(name))\r
- break;\r
- }\r
-\r
- // No rule matched\r
- if (i === -1)\r
- attrRule = null;\r
- }\r
-\r
- // No attribute rule found\r
- if (!attrRule)\r
- return;\r
-\r
- // Validate value\r
- if (attrRule.validValues && !(value in attrRule.validValues))\r
- return;\r
- }\r
-\r
- // Add attribute to list and map\r
- attrList.map[name] = value;\r
- attrList.push({\r
- name: name,\r
- value: value\r
- });\r
- });\r
- } else {\r
- attrList = [];\r
- attrList.map = {};\r
- }\r
-\r
- // Process attributes if validation is enabled\r
- if (validate && !isInternalElement) {\r
- attributesRequired = elementRule.attributesRequired;\r
- attributesDefault = elementRule.attributesDefault;\r
- attributesForced = elementRule.attributesForced;\r
+ // Process attributes if validation is enabled\r
+ if (validate && !isInternalElement) {\r
+ attributesRequired = elementRule.attributesRequired;\r
+ attributesDefault = elementRule.attributesDefault;\r
+ attributesForced = elementRule.attributesForced;\r
\r
// Handle forced attributes\r
if (attributesForced) {\r
self.parse = function(html, args) {\r
var parser, rootNode, node, nodes, i, l, fi, fl, list, name, validate,\r
blockElements, startWhiteSpaceRegExp, invalidChildren = [], isInWhiteSpacePreservedElement,\r
- endWhiteSpaceRegExp, allWhiteSpaceRegExp, whiteSpaceElements, children, nonEmptyElements, rootBlockName;\r
+ endWhiteSpaceRegExp, allWhiteSpaceRegExp, isAllWhiteSpaceRegExp, whiteSpaceElements, children, nonEmptyElements, rootBlockName;\r
\r
args = args || {};\r
matchedNodes = {};\r
startWhiteSpaceRegExp = /^[ \t\r\n]+/;\r
endWhiteSpaceRegExp = /[ \t\r\n]+$/;\r
allWhiteSpaceRegExp = /[ \t\r\n]+/g;\r
+ isAllWhiteSpaceRegExp = /^[ \t\r\n]+$/;\r
\r
function addRootBlocks() {\r
var node = rootNode.firstChild, next, rootBlockNode;\r
if (elementRule) {\r
if (blockElements[name]) {\r
if (!isInWhiteSpacePreservedElement) {\r
- // Trim whitespace at beginning of block\r
- for (textNode = node.firstChild; textNode && textNode.type === 3; ) {\r
+ // Trim whitespace of the first node in a block\r
+ textNode = node.firstChild;\r
+ if (textNode && textNode.type === 3) {\r
text = textNode.value.replace(startWhiteSpaceRegExp, '');\r
\r
+ // Any characters left after trim or should we remove it\r
if (text.length > 0) {\r
textNode.value = text;\r
textNode = textNode.next;\r
textNode.remove();\r
textNode = sibling;\r
}\r
+\r
+ // Remove any pure whitespace siblings\r
+ while (textNode && textNode.type === 3) {\r
+ text = textNode.value;\r
+ sibling = textNode.next;\r
+\r
+ if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {\r
+ textNode.remove();\r
+ textNode = sibling;\r
+ }\r
+\r
+ textNode = sibling;\r
+ }\r
}\r
\r
- // Trim whitespace at end of block\r
- for (textNode = node.lastChild; textNode && textNode.type === 3; ) {\r
+ // Trim whitespace of the last node in a block\r
+ textNode = node.lastChild;\r
+ if (textNode && textNode.type === 3) {\r
text = textNode.value.replace(endWhiteSpaceRegExp, '');\r
\r
+ // Any characters left after trim or should we remove it\r
if (text.length > 0) {\r
textNode.value = text;\r
textNode = textNode.prev;\r
textNode.remove();\r
textNode = sibling;\r
}\r
+\r
+ // Remove any pure whitespace siblings\r
+ while (textNode && textNode.type === 3) {\r
+ text = textNode.value;\r
+ sibling = textNode.prev;\r
+\r
+ if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {\r
+ textNode.remove();\r
+ textNode = sibling;\r
+ }\r
+\r
+ textNode = sibling;\r
+ }\r
}\r
}\r
\r
// these elements and keep br elements that where intended to be there intact\r
if (settings.remove_trailing_brs) {\r
self.addNodeFilter('br', function(nodes, name) {\r
- var i, l = nodes.length, node, blockElements = schema.getBlockElements(),\r
- nonEmptyElements = schema.getNonEmptyElements(), parent, prev, prevName;\r
+ var i, l = nodes.length, node, blockElements = tinymce.extend({}, schema.getBlockElements()),\r
+ nonEmptyElements = schema.getNonEmptyElements(), parent, lastParent, prev, prevName;\r
\r
// Remove brs from body element as well\r
blockElements.body = 1;\r
parent = node.parent;\r
\r
if (blockElements[node.parent.name] && node === parent.lastChild) {\r
- // Loop all nodes to the right of the current node and check for other BR elements\r
+ // Loop all nodes to the left of the current node and check for other BR elements\r
// excluding bookmarks since they are invisible\r
prev = node.prev;\r
while (prev) {\r
}\r
}\r
}\r
+ } else {\r
+ // Replaces BR elements inside inline elements like <p><b><i><br></i></b></p> so they become <p><b><i> </i></b></p> \r
+ lastParent = node;\r
+ while (parent.firstChild === lastParent && parent.lastChild === lastParent) {\r
+ lastParent = parent;\r
+\r
+ if (blockElements[parent.name]) {\r
+ break;\r
+ }\r
+\r
+ parent = parent.parent;\r
+ }\r
+\r
+ if (lastParent === parent) {\r
+ textNode = new tinymce.html.Node('#text', 3);\r
+ textNode.value = '\u00a0';\r
+ node.replace(textNode);\r
+ }\r
+ }\r
+ }\r
+ });\r
+ }\r
+\r
+ // Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included.\r
+ if (!settings.allow_html_in_named_anchor) {\r
+ self.addAttributeFilter('name', function(nodes, name) {\r
+ var i = nodes.length, sibling, prevSibling, parent, node;\r
+\r
+ while (i--) {\r
+ node = nodes[i];\r
+ if (node.name === 'a' && node.firstChild) {\r
+ parent = node.parent;\r
+\r
+ // Move children after current node\r
+ sibling = node.lastChild;\r
+ do {\r
+ prevSibling = sibling.prev;\r
+ parent.insert(sibling, node);\r
+ sibling = prevSibling;\r
+ } while (sibling);\r
}\r
}\r
});\r
writer.cdata(node.value);\r
},\r
\r
- // Document fragment\r
+ // Document fragment\r
11: function(node) {\r
if ((node = node.firstChild)) {\r
do {\r
return self.bind(target, events instanceof Array ? events.join(' ') : events, func, scope);\r
};\r
\r
- self.remove = function(target, events, func) {\r
+ self.remove = function(target, events, func, scope) {\r
+ if (!target) {\r
+ return self;\r
+ }\r
+\r
// Old API supported direct ID assignment\r
if (typeof(target) === "string") {\r
target = document.getElementById(target);\r
\r
// Old API supported multiple targets\r
if (target instanceof Array) {\r
- var i = target;\r
+ var i = target.length;\r
\r
while (i--) {\r
self.remove(target[i], events, func, scope);\r
namespace = 0;\r
})(tinymce.dom, 'data-mce-expando'); // Namespace and expando\r
\r
+tinymce.dom.TreeWalker = function(start_node, root_node) {\r
+ var node = start_node;\r
+\r
+ function findSibling(node, start_name, sibling_name, shallow) {\r
+ var sibling, parent;\r
+\r
+ if (node) {\r
+ // Walk into nodes if it has a start\r
+ if (!shallow && node[start_name])\r
+ return node[start_name];\r
+\r
+ // Return the sibling if it has one\r
+ if (node != root_node) {\r
+ sibling = node[sibling_name];\r
+ if (sibling)\r
+ return sibling;\r
+\r
+ // Walk up the parents to look for siblings\r
+ for (parent = node.parentNode; parent && parent != root_node; parent = parent.parentNode) {\r
+ sibling = parent[sibling_name];\r
+ if (sibling)\r
+ return sibling;\r
+ }\r
+ }\r
+ }\r
+ };\r
+\r
+ this.current = function() {\r
+ return node;\r
+ };\r
+\r
+ this.next = function(shallow) {\r
+ return (node = findSibling(node, 'firstChild', 'nextSibling', shallow));\r
+ };\r
+\r
+ this.prev = function(shallow) {\r
+ return (node = findSibling(node, 'lastChild', 'previousSibling', shallow));\r
+ };\r
+};\r
+\r
(function(tinymce) {\r
// Shorten names\r
var each = tinymce.each,\r
h = 0;\r
\r
return {\r
- w : parseInt(w) || e.offsetWidth || e.clientWidth,\r
- h : parseInt(h) || e.offsetHeight || e.clientHeight\r
+ w : parseInt(w, 10) || e.offsetWidth || e.clientWidth,\r
+ h : parseInt(h, 10) || e.offsetHeight || e.clientHeight\r
};\r
},\r
\r
if (!u)\r
u = '';\r
\r
- head = t.select('head')[0];\r
+ head = d.getElementsByTagName('head')[0];\r
\r
each(u.split(','), function(u) {\r
var link;\r
var c = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);\r
\r
function hex(s) {\r
- s = parseInt(s).toString(16);\r
+ s = parseInt(s, 10).toString(16);\r
\r
return s.length > 1 ? s : '0' + s; // 0 -> 00\r
};\r
// Also keep text nodes with only spaces if surrounded by spans.\r
// eg. "<p><span>a</span> <span>b</span></p>" should keep space between a and b\r
var trimmedLength = tinymce.trim(node.nodeValue).length;\r
- if (!t.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength == 0 && surroundedBySpans(node))\r
+ if (!t.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node))\r
return;\r
} else if (type == 1) {\r
// If the only child is a bookmark then move it up\r
return this.events.fire(target, name, evt);\r
},\r
\r
+ // Returns the content editable state of a node\r
+ getContentEditable: function(node) {\r
+ var contentEditable;\r
+\r
+ // Check type\r
+ if (node.nodeType != 1) {\r
+ return null;\r
+ }\r
+\r
+ // Check for fake content editable\r
+ contentEditable = node.getAttribute("data-mce-contenteditable");\r
+ if (contentEditable && contentEditable !== "inherit") {\r
+ return contentEditable;\r
+ }\r
+\r
+ // Check for real content editable\r
+ return node.contentEditable !== "inherit" ? node.contentEditable : null;\r
+ },\r
+\r
\r
_findSib : function(node, selector, name) {\r
var t = this, f = selector;\r
// We need to walk char by char since rng.text or rng.htmlText will trim line endings\r
offset = 0;\r
while (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) !== 0) {\r
- if (checkRng.move('character', 1) == 0 || parent != checkRng.parentElement()) {\r
+ if (checkRng.move('character', 1) === 0 || parent != checkRng.parentElement()) {\r
break;\r
}\r
\r
// 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\r
offset = 0;\r
while (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) !== 0) {\r
- if (checkRng.move('character', -1) == 0 || parent != checkRng.parentElement()) {\r
+ if (checkRng.move('character', -1) === 0 || parent != checkRng.parentElement()) {\r
break;\r
}\r
\r
var rng = selection.getRng(), start, end, bookmark = {};\r
\r
function getIndexes(node) {\r
- var node, parent, root, children, i, indexes = [];\r
+ var parent, root, children, i, indexes = [];\r
\r
parent = node.parentNode;\r
root = dom.getRoot().parentNode;\r
// If single element selection then try making a control selection out of it\r
if (startContainer == endContainer && startContainer.nodeType == 1) {\r
// Trick to place the caret inside an empty block element like <p></p>\r
- if (!startContainer.hasChildNodes()) {\r
- startContainer.innerHTML = '<span>\uFEFF</span><span>\uFEFF</span>';\r
- ieRng.moveToElementText(startContainer.lastChild);\r
- ieRng.select();\r
- dom.doc.selection.clear();\r
- startContainer.innerHTML = '';\r
- return;\r
+ if (startOffset == endOffset && !startContainer.hasChildNodes()) {\r
+ if (startContainer.canHaveHTML) {\r
+ startContainer.innerHTML = '<span>\uFEFF</span><span>\uFEFF</span>';\r
+ ieRng.moveToElementText(startContainer.lastChild);\r
+ ieRng.select();\r
+ dom.doc.selection.clear();\r
+ startContainer.innerHTML = '';\r
+ return;\r
+ } else {\r
+ startOffset = dom.nodeIndex(startContainer);\r
+ startContainer = startContainer.parentNode;\r
+ }\r
}\r
\r
if (startOffset == endOffset - 1) {\r
\r
\r
/*\r
- * Sizzle CSS Selector Engine - v1.0\r
- * Copyright 2009, The Dojo Foundation\r
+ * Sizzle CSS Selector Engine\r
+ * Copyright, The Dojo Foundation\r
* Released under the MIT, BSD, and GPL Licenses.\r
* More information: http://sizzlejs.com/\r
*/\r
(function(){\r
\r
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,\r
+ expando = "sizcache",\r
done = 0,\r
toString = Object.prototype.toString,\r
hasDuplicate = false,\r
- baseHasDuplicate = true;\r
+ baseHasDuplicate = true,\r
+ rBackslash = /\\/g,\r
+ rReturn = /\r\n/g,\r
+ rNonWord = /\W/;\r
\r
// Here we check if the JavaScript engine is using some sort of\r
// optimization where it does not always call our comparision\r
// function. If that is the case, discard the hasDuplicate value.\r
// Thus far that includes Google Chrome.\r
-[0, 0].sort(function(){\r
+[0, 0].sort(function() {\r
baseHasDuplicate = false;\r
return 0;\r
});\r
\r
-var Sizzle = function(selector, context, results, seed) {\r
+var Sizzle = function( selector, context, results, seed ) {\r
results = results || [];\r
context = context || document;\r
\r
if ( context.nodeType !== 1 && context.nodeType !== 9 ) {\r
return [];\r
}\r
- \r
+\r
if ( !selector || typeof selector !== "string" ) {\r
return results;\r
}\r
\r
- var parts = [], m, set, checkSet, extra, prune = true, contextXML = Sizzle.isXML(context),\r
- soFar = selector, ret, cur, pop, i;\r
- \r
+ var m, set, checkSet, extra, ret, cur, pop, i,\r
+ prune = true,\r
+ contextXML = Sizzle.isXML( context ),\r
+ parts = [],\r
+ soFar = selector;\r
+\r
// Reset the position of the chunker regexp (start from head)\r
do {\r
- chunker.exec("");\r
- m = chunker.exec(soFar);\r
+ chunker.exec( "" );\r
+ m = chunker.exec( soFar );\r
\r
if ( m ) {\r
soFar = m[3];\r
- \r
+\r
parts.push( m[1] );\r
- \r
+\r
if ( m[2] ) {\r
extra = m[3];\r
break;\r
} while ( m );\r
\r
if ( parts.length > 1 && origPOS.exec( selector ) ) {\r
+\r
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {\r
- set = posProcess( parts[0] + parts[1], context );\r
+ set = posProcess( parts[0] + parts[1], context, seed );\r
+\r
} else {\r
set = Expr.relative[ parts[0] ] ?\r
[ context ] :\r
if ( Expr.relative[ selector ] ) {\r
selector += parts.shift();\r
}\r
- \r
- set = posProcess( selector, set );\r
+\r
+ set = posProcess( selector, set, seed );\r
}\r
}\r
+\r
} else {\r
// Take a shortcut and set the context if the root selector is an ID\r
// (but not if it'll be faster if the inner selector is an ID)\r
if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&\r
Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {\r
+\r
ret = Sizzle.find( parts.shift(), context, contextXML );\r
- context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];\r
+ context = ret.expr ?\r
+ Sizzle.filter( ret.expr, ret.set )[0] :\r
+ ret.set[0];\r
}\r
\r
if ( context ) {\r
ret = seed ?\r
{ expr: parts.pop(), set: makeArray(seed) } :\r
Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );\r
- set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;\r
+\r
+ set = ret.expr ?\r
+ Sizzle.filter( ret.expr, ret.set ) :\r
+ ret.set;\r
\r
if ( parts.length > 0 ) {\r
- checkSet = makeArray(set);\r
+ checkSet = makeArray( set );\r
+\r
} else {\r
prune = false;\r
}\r
\r
Expr.relative[ cur ]( checkSet, pop, contextXML );\r
}\r
+\r
} else {\r
checkSet = parts = [];\r
}\r
if ( toString.call(checkSet) === "[object Array]" ) {\r
if ( !prune ) {\r
results.push.apply( results, checkSet );\r
+\r
} else if ( context && context.nodeType === 1 ) {\r
for ( i = 0; checkSet[i] != null; i++ ) {\r
if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {\r
results.push( set[i] );\r
}\r
}\r
+\r
} else {\r
for ( i = 0; checkSet[i] != null; i++ ) {\r
if ( checkSet[i] && checkSet[i].nodeType === 1 ) {\r
}\r
}\r
}\r
+\r
} else {\r
makeArray( checkSet, results );\r
}\r
return results;\r
};\r
\r
-Sizzle.uniqueSort = function(results){\r
+Sizzle.uniqueSort = function( results ) {\r
if ( sortOrder ) {\r
hasDuplicate = baseHasDuplicate;\r
- results.sort(sortOrder);\r
+ results.sort( sortOrder );\r
\r
if ( hasDuplicate ) {\r
for ( var i = 1; i < results.length; i++ ) {\r
- if ( results[i] === results[i-1] ) {\r
- results.splice(i--, 1);\r
+ if ( results[i] === results[ i - 1 ] ) {\r
+ results.splice( i--, 1 );\r
}\r
}\r
}\r
return results;\r
};\r
\r
-Sizzle.matches = function(expr, set){\r
- return Sizzle(expr, null, null, set);\r
+Sizzle.matches = function( expr, set ) {\r
+ return Sizzle( expr, null, null, set );\r
+};\r
+\r
+Sizzle.matchesSelector = function( node, expr ) {\r
+ return Sizzle( expr, null, null, [node] ).length > 0;\r
};\r
\r
-Sizzle.find = function(expr, context, isXML){\r
- var set;\r
+Sizzle.find = function( expr, context, isXML ) {\r
+ var set, i, len, match, type, left;\r
\r
if ( !expr ) {\r
return [];\r
}\r
\r
- for ( var i = 0, l = Expr.order.length; i < l; i++ ) {\r
- var type = Expr.order[i], match;\r
- \r
+ for ( i = 0, len = Expr.order.length; i < len; i++ ) {\r
+ type = Expr.order[i];\r
+\r
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {\r
- var left = match[1];\r
- match.splice(1,1);\r
+ left = match[1];\r
+ match.splice( 1, 1 );\r
\r
if ( left.substr( left.length - 1 ) !== "\\" ) {\r
- match[1] = (match[1] || "").replace(/\\/g, "");\r
+ match[1] = (match[1] || "").replace( rBackslash, "" );\r
set = Expr.find[ type ]( match, context, isXML );\r
+\r
if ( set != null ) {\r
expr = expr.replace( Expr.match[ type ], "" );\r
break;\r
}\r
\r
if ( !set ) {\r
- set = context.getElementsByTagName("*");\r
+ set = typeof context.getElementsByTagName !== "undefined" ?\r
+ context.getElementsByTagName( "*" ) :\r
+ [];\r
}\r
\r
- return {set: set, expr: expr};\r
+ return { set: set, expr: expr };\r
};\r
\r
-Sizzle.filter = function(expr, set, inplace, not){\r
- var old = expr, result = [], curLoop = set, match, anyFound,\r
- isXMLFilter = set && set[0] && Sizzle.isXML(set[0]);\r
+Sizzle.filter = function( expr, set, inplace, not ) {\r
+ var match, anyFound,\r
+ type, found, item, filter, left,\r
+ i, pass,\r
+ old = expr,\r
+ result = [],\r
+ curLoop = set,\r
+ isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );\r
\r
while ( expr && set.length ) {\r
- for ( var type in Expr.filter ) {\r
+ for ( type in Expr.filter ) {\r
if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {\r
- var filter = Expr.filter[ type ], found, item, left = match[1];\r
+ filter = Expr.filter[ type ];\r
+ left = match[1];\r
+\r
anyFound = false;\r
\r
match.splice(1,1);\r
\r
if ( !match ) {\r
anyFound = found = true;\r
+\r
} else if ( match === true ) {\r
continue;\r
}\r
}\r
\r
if ( match ) {\r
- for ( var i = 0; (item = curLoop[i]) != null; i++ ) {\r
+ for ( i = 0; (item = curLoop[i]) != null; i++ ) {\r
if ( item ) {\r
found = filter( item, match, i, curLoop );\r
- var pass = not ^ !!found;\r
+ pass = not ^ found;\r
\r
if ( inplace && found != null ) {\r
if ( pass ) {\r
anyFound = true;\r
+\r
} else {\r
curLoop[i] = false;\r
}\r
+\r
} else if ( pass ) {\r
result.push( item );\r
anyFound = true;\r
if ( expr === old ) {\r
if ( anyFound == null ) {\r
Sizzle.error( expr );\r
+\r
} else {\r
break;\r
}\r
};\r
\r
Sizzle.error = function( msg ) {\r
- throw "Syntax error, unrecognized expression: " + msg;\r
+ throw new Error( "Syntax error, unrecognized expression: " + msg );\r
+};\r
+\r
+var getText = Sizzle.getText = function( elem ) {\r
+ var i, node,\r
+ nodeType = elem.nodeType,\r
+ ret = "";\r
+\r
+ if ( nodeType ) {\r
+ if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\r
+ // Use textContent || innerText for elements\r
+ if ( typeof elem.textContent === 'string' ) {\r
+ return elem.textContent;\r
+ } else if ( typeof elem.innerText === 'string' ) {\r
+ // Replace IE's carriage returns\r
+ return elem.innerText.replace( rReturn, '' );\r
+ } else {\r
+ // Traverse it's children\r
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {\r
+ ret += getText( elem );\r
+ }\r
+ }\r
+ } else if ( nodeType === 3 || nodeType === 4 ) {\r
+ return elem.nodeValue;\r
+ }\r
+ } else {\r
+\r
+ // If no nodeType, this is expected to be an array\r
+ for ( i = 0; (node = elem[i]); i++ ) {\r
+ // Do not traverse comment nodes\r
+ if ( node.nodeType !== 8 ) {\r
+ ret += getText( node );\r
+ }\r
+ }\r
+ }\r
+ return ret;\r
};\r
\r
var Expr = Sizzle.selectors = {\r
order: [ "ID", "NAME", "TAG" ],\r
+\r
match: {\r
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,\r
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,\r
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,\r
- ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,\r
+ ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,\r
TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,\r
- CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,\r
+ CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,\r
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,\r
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/\r
},\r
+\r
leftMatch: {},\r
+\r
attrMap: {\r
"class": "className",\r
"for": "htmlFor"\r
},\r
+\r
attrHandle: {\r
- href: function(elem){\r
- return elem.getAttribute("href");\r
+ href: function( elem ) {\r
+ return elem.getAttribute( "href" );\r
+ },\r
+ type: function( elem ) {\r
+ return elem.getAttribute( "type" );\r
}\r
},\r
+\r
relative: {\r
"+": function(checkSet, part){\r
var isPartStr = typeof part === "string",\r
- isTag = isPartStr && !/\W/.test(part),\r
+ isTag = isPartStr && !rNonWord.test( part ),\r
isPartStrNotTag = isPartStr && !isTag;\r
\r
if ( isTag ) {\r
Sizzle.filter( part, checkSet, true );\r
}\r
},\r
- ">": function(checkSet, part){\r
- var isPartStr = typeof part === "string",\r
- elem, i = 0, l = checkSet.length;\r
\r
- if ( isPartStr && !/\W/.test(part) ) {\r
+ ">": function( checkSet, part ) {\r
+ var elem,\r
+ isPartStr = typeof part === "string",\r
+ i = 0,\r
+ l = checkSet.length;\r
+\r
+ if ( isPartStr && !rNonWord.test( part ) ) {\r
part = part.toLowerCase();\r
\r
for ( ; i < l; i++ ) {\r
elem = checkSet[i];\r
+\r
if ( elem ) {\r
var parent = elem.parentNode;\r
checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;\r
}\r
}\r
+\r
} else {\r
for ( ; i < l; i++ ) {\r
elem = checkSet[i];\r
+\r
if ( elem ) {\r
checkSet[i] = isPartStr ?\r
elem.parentNode :\r
}\r
}\r
},\r
+\r
"": function(checkSet, part, isXML){\r
- var doneName = done++, checkFn = dirCheck, nodeCheck;\r
+ var nodeCheck,\r
+ doneName = done++,\r
+ checkFn = dirCheck;\r
\r
- if ( typeof part === "string" && !/\W/.test(part) ) {\r
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {\r
part = part.toLowerCase();\r
nodeCheck = part;\r
checkFn = dirNodeCheck;\r
}\r
\r
- checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);\r
+ checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );\r
},\r
- "~": function(checkSet, part, isXML){\r
- var doneName = done++, checkFn = dirCheck, nodeCheck;\r
\r
- if ( typeof part === "string" && !/\W/.test(part) ) {\r
+ "~": function( checkSet, part, isXML ) {\r
+ var nodeCheck,\r
+ doneName = done++,\r
+ checkFn = dirCheck;\r
+\r
+ if ( typeof part === "string" && !rNonWord.test( part ) ) {\r
part = part.toLowerCase();\r
nodeCheck = part;\r
checkFn = dirNodeCheck;\r
}\r
\r
- checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);\r
+ checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );\r
}\r
},\r
+\r
find: {\r
- ID: function(match, context, isXML){\r
+ ID: function( match, context, isXML ) {\r
if ( typeof context.getElementById !== "undefined" && !isXML ) {\r
var m = context.getElementById(match[1]);\r
- return m ? [m] : [];\r
+ // Check parentNode to catch when Blackberry 4.6 returns\r
+ // nodes that are no longer in the document #6963\r
+ return m && m.parentNode ? [m] : [];\r
}\r
},\r
- NAME: function(match, context){\r
+\r
+ NAME: function( match, context ) {\r
if ( typeof context.getElementsByName !== "undefined" ) {\r
- var ret = [], results = context.getElementsByName(match[1]);\r
+ var ret = [],\r
+ results = context.getElementsByName( match[1] );\r
\r
for ( var i = 0, l = results.length; i < l; i++ ) {\r
if ( results[i].getAttribute("name") === match[1] ) {\r
return ret.length === 0 ? null : ret;\r
}\r
},\r
- TAG: function(match, context){\r
- return context.getElementsByTagName(match[1]);\r
+\r
+ TAG: function( match, context ) {\r
+ if ( typeof context.getElementsByTagName !== "undefined" ) {\r
+ return context.getElementsByTagName( match[1] );\r
+ }\r
}\r
},\r
preFilter: {\r
- CLASS: function(match, curLoop, inplace, result, not, isXML){\r
- match = " " + match[1].replace(/\\/g, "") + " ";\r
+ CLASS: function( match, curLoop, inplace, result, not, isXML ) {\r
+ match = " " + match[1].replace( rBackslash, "" ) + " ";\r
\r
if ( isXML ) {\r
return match;\r
\r
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {\r
if ( elem ) {\r
- if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {\r
+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {\r
if ( !inplace ) {\r
result.push( elem );\r
}\r
+\r
} else if ( inplace ) {\r
curLoop[i] = false;\r
}\r
\r
return false;\r
},\r
- ID: function(match){\r
- return match[1].replace(/\\/g, "");\r
+\r
+ ID: function( match ) {\r
+ return match[1].replace( rBackslash, "" );\r
},\r
- TAG: function(match, curLoop){\r
- return match[1].toLowerCase();\r
+\r
+ TAG: function( match, curLoop ) {\r
+ return match[1].replace( rBackslash, "" ).toLowerCase();\r
},\r
- CHILD: function(match){\r
+\r
+ CHILD: function( match ) {\r
if ( match[1] === "nth" ) {\r
+ if ( !match[2] ) {\r
+ Sizzle.error( match[0] );\r
+ }\r
+\r
+ match[2] = match[2].replace(/^\+|\s*/g, '');\r
+\r
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'\r
- var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(\r
+ var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(\r
match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||\r
!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);\r
\r
match[2] = (test[1] + (test[2] || 1)) - 0;\r
match[3] = test[3] - 0;\r
}\r
+ else if ( match[2] ) {\r
+ Sizzle.error( match[0] );\r
+ }\r
\r
// TODO: Move to normal caching system\r
match[0] = done++;\r
\r
return match;\r
},\r
- ATTR: function(match, curLoop, inplace, result, not, isXML){\r
- var name = match[1].replace(/\\/g, "");\r
- \r
+\r
+ ATTR: function( match, curLoop, inplace, result, not, isXML ) {\r
+ var name = match[1] = match[1].replace( rBackslash, "" );\r
+\r
if ( !isXML && Expr.attrMap[name] ) {\r
match[1] = Expr.attrMap[name];\r
}\r
\r
+ // Handle if an un-quoted value was used\r
+ match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );\r
+\r
if ( match[2] === "~=" ) {\r
match[4] = " " + match[4] + " ";\r
}\r
\r
return match;\r
},\r
- PSEUDO: function(match, curLoop, inplace, result, not){\r
+\r
+ PSEUDO: function( match, curLoop, inplace, result, not ) {\r
if ( match[1] === "not" ) {\r
// If we're dealing with a complex expression, or a simple one\r
if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {\r
match[3] = Sizzle(match[3], null, null, curLoop);\r
+\r
} else {\r
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);\r
+\r
if ( !inplace ) {\r
result.push.apply( result, ret );\r
}\r
+\r
return false;\r
}\r
+\r
} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {\r
return true;\r
}\r
- \r
+\r
return match;\r
},\r
- POS: function(match){\r
+\r
+ POS: function( match ) {\r
match.unshift( true );\r
+\r
return match;\r
}\r
},\r
+\r
filters: {\r
- enabled: function(elem){\r
+ enabled: function( elem ) {\r
return elem.disabled === false && elem.type !== "hidden";\r
},\r
- disabled: function(elem){\r
+\r
+ disabled: function( elem ) {\r
return elem.disabled === true;\r
},\r
- checked: function(elem){\r
+\r
+ checked: function( elem ) {\r
return elem.checked === true;\r
},\r
- selected: function(elem){\r
+\r
+ selected: function( elem ) {\r
// Accessing this property makes selected-by-default\r
// options in Safari work properly\r
- elem.parentNode.selectedIndex;\r
+ if ( elem.parentNode ) {\r
+ elem.parentNode.selectedIndex;\r
+ }\r
+\r
return elem.selected === true;\r
},\r
- parent: function(elem){\r
+\r
+ parent: function( elem ) {\r
return !!elem.firstChild;\r
},\r
- empty: function(elem){\r
+\r
+ empty: function( elem ) {\r
return !elem.firstChild;\r
},\r
- has: function(elem, i, match){\r
+\r
+ has: function( elem, i, match ) {\r
return !!Sizzle( match[3], elem ).length;\r
},\r
- header: function(elem){\r
+\r
+ header: function( elem ) {\r
return (/h\d/i).test( elem.nodeName );\r
},\r
- text: function(elem){\r
- return "text" === elem.type;\r
+\r
+ text: function( elem ) {\r
+ var attr = elem.getAttribute( "type" ), type = elem.type;\r
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)\r
+ // use getAttribute instead to test this case\r
+ return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );\r
+ },\r
+\r
+ radio: function( elem ) {\r
+ return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;\r
},\r
- radio: function(elem){\r
- return "radio" === elem.type;\r
+\r
+ checkbox: function( elem ) {\r
+ return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;\r
},\r
- checkbox: function(elem){\r
- return "checkbox" === elem.type;\r
+\r
+ file: function( elem ) {\r
+ return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;\r
},\r
- file: function(elem){\r
- return "file" === elem.type;\r
+\r
+ password: function( elem ) {\r
+ return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;\r
},\r
- password: function(elem){\r
- return "password" === elem.type;\r
+\r
+ submit: function( elem ) {\r
+ var name = elem.nodeName.toLowerCase();\r
+ return (name === "input" || name === "button") && "submit" === elem.type;\r
},\r
- submit: function(elem){\r
- return "submit" === elem.type;\r
+\r
+ image: function( elem ) {\r
+ return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;\r
},\r
- image: function(elem){\r
- return "image" === elem.type;\r
+\r
+ reset: function( elem ) {\r
+ var name = elem.nodeName.toLowerCase();\r
+ return (name === "input" || name === "button") && "reset" === elem.type;\r
},\r
- reset: function(elem){\r
- return "reset" === elem.type;\r
+\r
+ button: function( elem ) {\r
+ var name = elem.nodeName.toLowerCase();\r
+ return name === "input" && "button" === elem.type || name === "button";\r
},\r
- button: function(elem){\r
- return "button" === elem.type || elem.nodeName.toLowerCase() === "button";\r
+\r
+ input: function( elem ) {\r
+ return (/input|select|textarea|button/i).test( elem.nodeName );\r
},\r
- input: function(elem){\r
- return (/input|select|textarea|button/i).test(elem.nodeName);\r
+\r
+ focus: function( elem ) {\r
+ return elem === elem.ownerDocument.activeElement;\r
}\r
},\r
setFilters: {\r
- first: function(elem, i){\r
+ first: function( elem, i ) {\r
return i === 0;\r
},\r
- last: function(elem, i, match, array){\r
+\r
+ last: function( elem, i, match, array ) {\r
return i === array.length - 1;\r
},\r
- even: function(elem, i){\r
+\r
+ even: function( elem, i ) {\r
return i % 2 === 0;\r
},\r
- odd: function(elem, i){\r
+\r
+ odd: function( elem, i ) {\r
return i % 2 === 1;\r
},\r
- lt: function(elem, i, match){\r
+\r
+ lt: function( elem, i, match ) {\r
return i < match[3] - 0;\r
},\r
- gt: function(elem, i, match){\r
+\r
+ gt: function( elem, i, match ) {\r
return i > match[3] - 0;\r
},\r
- nth: function(elem, i, match){\r
+\r
+ nth: function( elem, i, match ) {\r
return match[3] - 0 === i;\r
},\r
- eq: function(elem, i, match){\r
+\r
+ eq: function( elem, i, match ) {\r
return match[3] - 0 === i;\r
}\r
},\r
filter: {\r
- PSEUDO: function(elem, match, i, array){\r
- var name = match[1], filter = Expr.filters[ name ];\r
+ PSEUDO: function( elem, match, i, array ) {\r
+ var name = match[1],\r
+ filter = Expr.filters[ name ];\r
\r
if ( filter ) {\r
return filter( elem, i, match, array );\r
+\r
} else if ( name === "contains" ) {\r
- return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;\r
+ return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;\r
+\r
} else if ( name === "not" ) {\r
var not = match[3];\r
\r
}\r
\r
return true;\r
+\r
} else {\r
- Sizzle.error( "Syntax error, unrecognized expression: " + name );\r
+ Sizzle.error( name );\r
}\r
},\r
- CHILD: function(elem, match){\r
- var type = match[1], node = elem;\r
- switch (type) {\r
- case 'only':\r
- case 'first':\r
- while ( (node = node.previousSibling) ) {\r
- if ( node.nodeType === 1 ) { \r
- return false; \r
+\r
+ CHILD: function( elem, match ) {\r
+ var first, last,\r
+ doneName, parent, cache,\r
+ count, diff,\r
+ type = match[1],\r
+ node = elem;\r
+\r
+ switch ( type ) {\r
+ case "only":\r
+ case "first":\r
+ while ( (node = node.previousSibling) ) {\r
+ if ( node.nodeType === 1 ) {\r
+ return false;\r
}\r
}\r
- if ( type === "first" ) { \r
- return true; \r
+\r
+ if ( type === "first" ) {\r
+ return true;\r
}\r
+\r
node = elem;\r
- case 'last':\r
- while ( (node = node.nextSibling) ) {\r
- if ( node.nodeType === 1 ) { \r
- return false; \r
+\r
+ /* falls through */\r
+ case "last":\r
+ while ( (node = node.nextSibling) ) {\r
+ if ( node.nodeType === 1 ) {\r
+ return false;\r
}\r
}\r
+\r
return true;\r
- case 'nth':\r
- var first = match[2], last = match[3];\r
+\r
+ case "nth":\r
+ first = match[2];\r
+ last = match[3];\r
\r
if ( first === 1 && last === 0 ) {\r
return true;\r
}\r
- \r
- var doneName = match[0],\r
- parent = elem.parentNode;\r
- \r
- if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {\r
- var count = 0;\r
+\r
+ doneName = match[0];\r
+ parent = elem.parentNode;\r
+\r
+ if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {\r
+ count = 0;\r
+\r
for ( node = parent.firstChild; node; node = node.nextSibling ) {\r
if ( node.nodeType === 1 ) {\r
node.nodeIndex = ++count;\r
}\r
- } \r
- parent.sizcache = doneName;\r
+ }\r
+\r
+ parent[ expando ] = doneName;\r
}\r
- \r
- var diff = elem.nodeIndex - last;\r
+\r
+ diff = elem.nodeIndex - last;\r
+\r
if ( first === 0 ) {\r
return diff === 0;\r
+\r
} else {\r
return ( diff % first === 0 && diff / first >= 0 );\r
}\r
}\r
},\r
- ID: function(elem, match){\r
+\r
+ ID: function( elem, match ) {\r
return elem.nodeType === 1 && elem.getAttribute("id") === match;\r
},\r
- TAG: function(elem, match){\r
- return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;\r
+\r
+ TAG: function( elem, match ) {\r
+ return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;\r
},\r
- CLASS: function(elem, match){\r
+\r
+ CLASS: function( elem, match ) {\r
return (" " + (elem.className || elem.getAttribute("class")) + " ")\r
.indexOf( match ) > -1;\r
},\r
- ATTR: function(elem, match){\r
+\r
+ ATTR: function( elem, match ) {\r
var name = match[1],\r
- result = Expr.attrHandle[ name ] ?\r
+ result = Sizzle.attr ?\r
+ Sizzle.attr( elem, name ) :\r
+ Expr.attrHandle[ name ] ?\r
Expr.attrHandle[ name ]( elem ) :\r
elem[ name ] != null ?\r
elem[ name ] :\r
\r
return result == null ?\r
type === "!=" :\r
+ !type && Sizzle.attr ?\r
+ result != null :\r
type === "=" ?\r
value === check :\r
type === "*=" ?\r
value === check || value.substr(0, check.length + 1) === check + "-" :\r
false;\r
},\r
- POS: function(elem, match, i, array){\r
- var name = match[2], filter = Expr.setFilters[ name ];\r
+\r
+ POS: function( elem, match, i, array ) {\r
+ var name = match[2],\r
+ filter = Expr.setFilters[ name ];\r
\r
if ( filter ) {\r
return filter( elem, i, match, array );\r
Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );\r
Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );\r
}\r
+// Expose origPOS\r
+// "global" as in regardless of relation to brackets/parens\r
+Expr.match.globalPOS = origPOS;\r
\r
-var makeArray = function(array, results) {\r
+var makeArray = function( array, results ) {\r
array = Array.prototype.slice.call( array, 0 );\r
\r
if ( results ) {\r
results.push.apply( results, array );\r
return results;\r
}\r
- \r
+\r
return array;\r
};\r
\r
Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;\r
\r
// Provide a fallback method if it does not work\r
-} catch(e){\r
- makeArray = function(array, results) {\r
- var ret = results || [], i = 0;\r
+} catch( e ) {\r
+ makeArray = function( array, results ) {\r
+ var i = 0,\r
+ ret = results || [];\r
\r
if ( toString.call(array) === "[object Array]" ) {\r
Array.prototype.push.apply( ret, array );\r
+\r
} else {\r
if ( typeof array.length === "number" ) {\r
for ( var l = array.length; i < l; i++ ) {\r
ret.push( array[i] );\r
}\r
+\r
} else {\r
for ( ; array[i]; i++ ) {\r
ret.push( array[i] );\r
};\r
}\r
\r
-var sortOrder;\r
+var sortOrder, siblingCheck;\r
\r
if ( document.documentElement.compareDocumentPosition ) {\r
sortOrder = function( a, b ) {\r
+ if ( a === b ) {\r
+ hasDuplicate = true;\r
+ return 0;\r
+ }\r
+\r
if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {\r
- if ( a == b ) {\r
- hasDuplicate = true;\r
- }\r
return a.compareDocumentPosition ? -1 : 1;\r
}\r
\r
- var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;\r
- if ( ret === 0 ) {\r
- hasDuplicate = true;\r
- }\r
- return ret;\r
+ return a.compareDocumentPosition(b) & 4 ? -1 : 1;\r
};\r
-} else if ( "sourceIndex" in document.documentElement ) {\r
+\r
+} else {\r
sortOrder = function( a, b ) {\r
- if ( !a.sourceIndex || !b.sourceIndex ) {\r
- if ( a == b ) {\r
- hasDuplicate = true;\r
- }\r
- return a.sourceIndex ? -1 : 1;\r
+ // The nodes are identical, we can exit early\r
+ if ( a === b ) {\r
+ hasDuplicate = true;\r
+ return 0;\r
+\r
+ // Fallback to using sourceIndex (in IE) if it's available on both nodes\r
+ } else if ( a.sourceIndex && b.sourceIndex ) {\r
+ return a.sourceIndex - b.sourceIndex;\r
}\r
\r
- var ret = a.sourceIndex - b.sourceIndex;\r
- if ( ret === 0 ) {\r
- hasDuplicate = true;\r
+ var al, bl,\r
+ ap = [],\r
+ bp = [],\r
+ aup = a.parentNode,\r
+ bup = b.parentNode,\r
+ cur = aup;\r
+\r
+ // If the nodes are siblings (or identical) we can do a quick check\r
+ if ( aup === bup ) {\r
+ return siblingCheck( a, b );\r
+\r
+ // If no parents were found then the nodes are disconnected\r
+ } else if ( !aup ) {\r
+ return -1;\r
+\r
+ } else if ( !bup ) {\r
+ return 1;\r
}\r
- return ret;\r
- };\r
-} else if ( document.createRange ) {\r
- sortOrder = function( a, b ) {\r
- if ( !a.ownerDocument || !b.ownerDocument ) {\r
- if ( a == b ) {\r
- hasDuplicate = true;\r
- }\r
- return a.ownerDocument ? -1 : 1;\r
+\r
+ // Otherwise they're somewhere else in the tree so we need\r
+ // to build up a full list of the parentNodes for comparison\r
+ while ( cur ) {\r
+ ap.unshift( cur );\r
+ cur = cur.parentNode;\r
}\r
\r
- var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();\r
- aRange.setStart(a, 0);\r
- aRange.setEnd(a, 0);\r
- bRange.setStart(b, 0);\r
- bRange.setEnd(b, 0);\r
- var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);\r
- if ( ret === 0 ) {\r
- hasDuplicate = true;\r
+ cur = bup;\r
+\r
+ while ( cur ) {\r
+ bp.unshift( cur );\r
+ cur = cur.parentNode;\r
}\r
- return ret;\r
+\r
+ al = ap.length;\r
+ bl = bp.length;\r
+\r
+ // Start walking down the tree looking for a discrepancy\r
+ for ( var i = 0; i < al && i < bl; i++ ) {\r
+ if ( ap[i] !== bp[i] ) {\r
+ return siblingCheck( ap[i], bp[i] );\r
+ }\r
+ }\r
+\r
+ // We ended someplace up the tree so do a sibling check\r
+ return i === al ?\r
+ siblingCheck( a, bp[i], -1 ) :\r
+ siblingCheck( ap[i], b, 1 );\r
};\r
-}\r
\r
-// Utility function for retreiving the text value of an array of DOM nodes\r
-Sizzle.getText = function( elems ) {\r
- var ret = "", elem;\r
+ siblingCheck = function( a, b, ret ) {\r
+ if ( a === b ) {\r
+ return ret;\r
+ }\r
\r
- for ( var i = 0; elems[i]; i++ ) {\r
- elem = elems[i];\r
+ var cur = a.nextSibling;\r
\r
- // Get the text from text nodes and CDATA nodes\r
- if ( elem.nodeType === 3 || elem.nodeType === 4 ) {\r
- ret += elem.nodeValue;\r
+ while ( cur ) {\r
+ if ( cur === b ) {\r
+ return -1;\r
+ }\r
\r
- // Traverse everything else, except comment nodes\r
- } else if ( elem.nodeType !== 8 ) {\r
- ret += Sizzle.getText( elem.childNodes );\r
+ cur = cur.nextSibling;\r
}\r
- }\r
\r
- return ret;\r
-};\r
+ return 1;\r
+ };\r
+}\r
\r
// Check to see if the browser returns elements by name when\r
// querying by getElementById (and provide a workaround)\r
(function(){\r
// We're going to inject a fake input element with a specified name\r
var form = document.createElement("div"),\r
- id = "script" + (new Date()).getTime();\r
+ id = "script" + (new Date()).getTime(),\r
+ root = document.documentElement;\r
+\r
form.innerHTML = "<a name='" + id + "'/>";\r
\r
// Inject it into the root element, check its status, and remove it quickly\r
- var root = document.documentElement;\r
root.insertBefore( form, root.firstChild );\r
\r
// The workaround has to do additional checks after a getElementById\r
// Which slows things down for other browsers (hence the branching)\r
if ( document.getElementById( id ) ) {\r
- Expr.find.ID = function(match, context, isXML){\r
+ Expr.find.ID = function( match, context, isXML ) {\r
if ( typeof context.getElementById !== "undefined" && !isXML ) {\r
var m = context.getElementById(match[1]);\r
- return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];\r
+\r
+ return m ?\r
+ m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?\r
+ [m] :\r
+ undefined :\r
+ [];\r
}\r
};\r
\r
- Expr.filter.ID = function(elem, match){\r
+ Expr.filter.ID = function( elem, match ) {\r
var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");\r
+\r
return elem.nodeType === 1 && node && node.nodeValue === match;\r
};\r
}\r
\r
root.removeChild( form );\r
- root = form = null; // release memory in IE\r
+\r
+ // release memory in IE\r
+ root = form = null;\r
})();\r
\r
(function(){\r
\r
// Make sure no comments are found\r
if ( div.getElementsByTagName("*").length > 0 ) {\r
- Expr.find.TAG = function(match, context){\r
- var results = context.getElementsByTagName(match[1]);\r
+ Expr.find.TAG = function( match, context ) {\r
+ var results = context.getElementsByTagName( match[1] );\r
\r
// Filter out possible comments\r
if ( match[1] === "*" ) {\r
\r
// Check to see if an attribute returns normalized href attributes\r
div.innerHTML = "<a href='#'></a>";\r
+\r
if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&\r
div.firstChild.getAttribute("href") !== "#" ) {\r
- Expr.attrHandle.href = function(elem){\r
- return elem.getAttribute("href", 2);\r
+\r
+ Expr.attrHandle.href = function( elem ) {\r
+ return elem.getAttribute( "href", 2 );\r
};\r
}\r
\r
- div = null; // release memory in IE\r
+ // release memory in IE\r
+ div = null;\r
})();\r
\r
if ( document.querySelectorAll ) {\r
(function(){\r
- var oldSizzle = Sizzle, div = document.createElement("div");\r
+ var oldSizzle = Sizzle,\r
+ div = document.createElement("div"),\r
+ id = "__sizzle__";\r
+\r
div.innerHTML = "<p class='TEST'></p>";\r
\r
// Safari can't handle uppercase or unicode characters when\r
if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {\r
return;\r
}\r
- \r
- Sizzle = function(query, context, extra, seed){\r
+\r
+ Sizzle = function( query, context, extra, seed ) {\r
context = context || document;\r
\r
// Only use querySelectorAll on non-XML documents\r
// (ID selectors don't work in non-HTML documents)\r
- if ( !seed && context.nodeType === 9 && !Sizzle.isXML(context) ) {\r
- try {\r
- return makeArray( context.querySelectorAll(query), extra );\r
- } catch(e){}\r
+ if ( !seed && !Sizzle.isXML(context) ) {\r
+ // See if we find a selector to speed up\r
+ var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );\r
+\r
+ if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {\r
+ // Speed-up: Sizzle("TAG")\r
+ if ( match[1] ) {\r
+ return makeArray( context.getElementsByTagName( query ), extra );\r
+\r
+ // Speed-up: Sizzle(".CLASS")\r
+ } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {\r
+ return makeArray( context.getElementsByClassName( match[2] ), extra );\r
+ }\r
+ }\r
+\r
+ if ( context.nodeType === 9 ) {\r
+ // Speed-up: Sizzle("body")\r
+ // The body element only exists once, optimize finding it\r
+ if ( query === "body" && context.body ) {\r
+ return makeArray( [ context.body ], extra );\r
+\r
+ // Speed-up: Sizzle("#ID")\r
+ } else if ( match && match[3] ) {\r
+ var elem = context.getElementById( match[3] );\r
+\r
+ // Check parentNode to catch when Blackberry 4.6 returns\r
+ // nodes that are no longer in the document #6963\r
+ if ( elem && elem.parentNode ) {\r
+ // Handle the case where IE and Opera return items\r
+ // by name instead of ID\r
+ if ( elem.id === match[3] ) {\r
+ return makeArray( [ elem ], extra );\r
+ }\r
+\r
+ } else {\r
+ return makeArray( [], extra );\r
+ }\r
+ }\r
+\r
+ try {\r
+ return makeArray( context.querySelectorAll(query), extra );\r
+ } catch(qsaError) {}\r
+\r
+ // qSA works strangely on Element-rooted queries\r
+ // We can work around this by specifying an extra ID on the root\r
+ // and working up from there (Thanks to Andrew Dupont for the technique)\r
+ // IE 8 doesn't work on object elements\r
+ } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {\r
+ var oldContext = context,\r
+ old = context.getAttribute( "id" ),\r
+ nid = old || id,\r
+ hasParent = context.parentNode,\r
+ relativeHierarchySelector = /^\s*[+~]/.test( query );\r
+\r
+ if ( !old ) {\r
+ context.setAttribute( "id", nid );\r
+ } else {\r
+ nid = nid.replace( /'/g, "\\$&" );\r
+ }\r
+ if ( relativeHierarchySelector && hasParent ) {\r
+ context = context.parentNode;\r
+ }\r
+\r
+ try {\r
+ if ( !relativeHierarchySelector || hasParent ) {\r
+ return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );\r
+ }\r
+\r
+ } catch(pseudoError) {\r
+ } finally {\r
+ if ( !old ) {\r
+ oldContext.removeAttribute( "id" );\r
+ }\r
+ }\r
+ }\r
}\r
- \r
+\r
return oldSizzle(query, context, extra, seed);\r
};\r
\r
Sizzle[ prop ] = oldSizzle[ prop ];\r
}\r
\r
- div = null; // release memory in IE\r
+ // release memory in IE\r
+ div = null;\r
})();\r
}\r
\r
+(function(){\r
+ var html = document.documentElement,\r
+ matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;\r
+\r
+ if ( matches ) {\r
+ // Check to see if it's possible to do matchesSelector\r
+ // on a disconnected node (IE 9 fails this)\r
+ var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),\r
+ pseudoWorks = false;\r
+\r
+ try {\r
+ // This should fail with an exception\r
+ // Gecko does not error, returns false instead\r
+ matches.call( document.documentElement, "[test!='']:sizzle" );\r
+\r
+ } catch( pseudoError ) {\r
+ pseudoWorks = true;\r
+ }\r
+\r
+ Sizzle.matchesSelector = function( node, expr ) {\r
+ // Make sure that attribute selectors are quoted\r
+ expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");\r
+\r
+ if ( !Sizzle.isXML( node ) ) {\r
+ try {\r
+ if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {\r
+ var ret = matches.call( node, expr );\r
+\r
+ // IE 9's matchesSelector returns false on disconnected nodes\r
+ if ( ret || !disconnectedMatch ||\r
+ // As well, disconnected nodes are said to be in a document\r
+ // fragment in IE 9, so check for that\r
+ node.document && node.document.nodeType !== 11 ) {\r
+ return ret;\r
+ }\r
+ }\r
+ } catch(e) {}\r
+ }\r
+\r
+ return Sizzle(expr, null, null, [node]).length > 0;\r
+ };\r
+ }\r
+})();\r
+\r
(function(){\r
var div = document.createElement("div");\r
\r
if ( div.getElementsByClassName("e").length === 1 ) {\r
return;\r
}\r
- \r
+\r
Expr.order.splice(1, 0, "CLASS");\r
- Expr.find.CLASS = function(match, context, isXML) {\r
+ Expr.find.CLASS = function( match, context, isXML ) {\r
if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {\r
return context.getElementsByClassName(match[1]);\r
}\r
};\r
\r
- div = null; // release memory in IE\r
+ // release memory in IE\r
+ div = null;\r
})();\r
\r
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {\r
for ( var i = 0, l = checkSet.length; i < l; i++ ) {\r
var elem = checkSet[i];\r
+\r
if ( elem ) {\r
- elem = elem[dir];\r
var match = false;\r
\r
+ elem = elem[dir];\r
+\r
while ( elem ) {\r
- if ( elem.sizcache === doneName ) {\r
+ if ( elem[ expando ] === doneName ) {\r
match = checkSet[elem.sizset];\r
break;\r
}\r
\r
if ( elem.nodeType === 1 && !isXML ){\r
- elem.sizcache = doneName;\r
+ elem[ expando ] = doneName;\r
elem.sizset = i;\r
}\r
\r
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {\r
for ( var i = 0, l = checkSet.length; i < l; i++ ) {\r
var elem = checkSet[i];\r
+\r
if ( elem ) {\r
- elem = elem[dir];\r
var match = false;\r
\r
+ elem = elem[dir];\r
+\r
while ( elem ) {\r
- if ( elem.sizcache === doneName ) {\r
+ if ( elem[ expando ] === doneName ) {\r
match = checkSet[elem.sizset];\r
break;\r
}\r
\r
if ( elem.nodeType === 1 ) {\r
if ( !isXML ) {\r
- elem.sizcache = doneName;\r
+ elem[ expando ] = doneName;\r
elem.sizset = i;\r
}\r
+\r
if ( typeof cur !== "string" ) {\r
if ( elem === cur ) {\r
match = true;\r
}\r
}\r
\r
-Sizzle.contains = document.compareDocumentPosition ? function(a, b){\r
- return !!(a.compareDocumentPosition(b) & 16);\r
-} : function(a, b){\r
- return a !== b && (a.contains ? a.contains(b) : true);\r
-};\r
+if ( document.documentElement.contains ) {\r
+ Sizzle.contains = function( a, b ) {\r
+ return a !== b && (a.contains ? a.contains(b) : true);\r
+ };\r
+\r
+} else if ( document.documentElement.compareDocumentPosition ) {\r
+ Sizzle.contains = function( a, b ) {\r
+ return !!(a.compareDocumentPosition(b) & 16);\r
+ };\r
+\r
+} else {\r
+ Sizzle.contains = function() {\r
+ return false;\r
+ };\r
+}\r
\r
-Sizzle.isXML = function(elem){\r
+Sizzle.isXML = function( elem ) {\r
// documentElement is verified for cases where it doesn't yet exist\r
- // (such as loading iframes in IE - #4833) \r
+ // (such as loading iframes in IE - #4833)\r
var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;\r
+\r
return documentElement ? documentElement.nodeName !== "HTML" : false;\r
};\r
\r
-var posProcess = function(selector, context){\r
- var tmpSet = [], later = "", match,\r
+var posProcess = function( selector, context, seed ) {\r
+ var match,\r
+ tmpSet = [],\r
+ later = "",\r
root = context.nodeType ? [context] : context;\r
\r
// Position selectors must be done after the filter\r
selector = Expr.relative[selector] ? selector + "*" : selector;\r
\r
for ( var i = 0, l = root.length; i < l; i++ ) {\r
- Sizzle( selector, root[i], tmpSet );\r
+ Sizzle( selector, root[i], tmpSet, seed );\r
}\r
\r
return Sizzle.filter( later, tmpSet );\r
('getPos,getRect,getParent,add,setStyle,getStyle,setStyles,' + \r
'setAttrib,setAttribs,getAttrib,addClass,removeClass,' + \r
'hasClass,getOuterHTML,setOuterHTML,remove,show,hide,' + \r
- 'isHidden,setHTML,get').split(/,/)\r
- , function(k) {\r
- t[k] = function() {\r
- var a = [id], i;\r
+ 'isHidden,setHTML,get').split(/,/), function(k) {\r
+ t[k] = function() {\r
+ var a = [id], i;\r
\r
- for (i = 0; i < arguments.length; i++)\r
- a.push(arguments[i]);\r
+ for (i = 0; i < arguments.length; i++)\r
+ a.push(arguments[i]);\r
\r
- a = dom[k].apply(dom, a);\r
- t.update(k);\r
+ a = dom[k].apply(dom, a);\r
+ t.update(k);\r
\r
- return a;\r
- };\r
- });\r
+ return a;\r
+ };\r
+ }\r
+ );\r
\r
tinymce.extend(t, {\r
on : function(n, f, s) {\r
};\r
\r
// Shorten names\r
- var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each;\r
+ var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each, TreeWalker = tinymce.dom.TreeWalker;\r
\r
tinymce.create('tinymce.dom.Selection', {\r
Selection : function(dom, win, serializer) {\r
} else {\r
rng.deleteContents();\r
\r
- if (doc.body.childNodes.length == 0) {\r
+ if (doc.body.childNodes.length === 0) {\r
doc.body.innerHTML = content;\r
} else {\r
// createContextualFragment doesn't exists in IE 9 DOMRanges\r
return index;\r
};\r
\r
- if (type == 2) {\r
- function getLocation() {\r
- var rng = t.getRng(true), root = dom.getRoot(), bookmark = {};\r
+ function normalizeTableCellSelection(rng) {\r
+ function moveEndPoint(start) {\r
+ var container, offset, childNodes, prefix = start ? 'start' : 'end';\r
\r
- function getPoint(rng, start) {\r
- var container = rng[start ? 'startContainer' : 'endContainer'],\r
- offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0;\r
+ container = rng[prefix + 'Container'];\r
+ offset = rng[prefix + 'Offset'];\r
\r
- if (container.nodeType == 3) {\r
- if (normalized) {\r
- for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling)\r
- offset += node.nodeValue.length;\r
- }\r
+ if (container.nodeType == 1 && container.nodeName == "TR") {\r
+ childNodes = container.childNodes;\r
+ container = childNodes[Math.min(start ? offset : offset - 1, childNodes.length - 1)];\r
+ if (container) {\r
+ offset = start ? 0 : container.childNodes.length;\r
+ rng['set' + (start ? 'Start' : 'End')](container, offset);\r
+ }\r
+ }\r
+ };\r
\r
- point.push(offset);\r
- } else {\r
- childNodes = container.childNodes;\r
+ moveEndPoint(true);\r
+ moveEndPoint();\r
\r
- if (offset >= childNodes.length && childNodes.length) {\r
- after = 1;\r
- offset = Math.max(0, childNodes.length - 1);\r
- }\r
+ return rng;\r
+ };\r
+\r
+ function getLocation() {\r
+ var rng = t.getRng(true), root = dom.getRoot(), bookmark = {};\r
+\r
+ function getPoint(rng, start) {\r
+ var container = rng[start ? 'startContainer' : 'endContainer'],\r
+ offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0;\r
\r
- point.push(t.dom.nodeIndex(childNodes[offset], normalized) + after);\r
+ if (container.nodeType == 3) {\r
+ if (normalized) {\r
+ for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling)\r
+ offset += node.nodeValue.length;\r
}\r
\r
- for (; container && container != root; container = container.parentNode)\r
- point.push(t.dom.nodeIndex(container, normalized));\r
+ point.push(offset);\r
+ } else {\r
+ childNodes = container.childNodes;\r
\r
- return point;\r
- };\r
+ if (offset >= childNodes.length && childNodes.length) {\r
+ after = 1;\r
+ offset = Math.max(0, childNodes.length - 1);\r
+ }\r
\r
- bookmark.start = getPoint(rng, true);\r
+ point.push(t.dom.nodeIndex(childNodes[offset], normalized) + after);\r
+ }\r
\r
- if (!t.isCollapsed())\r
- bookmark.end = getPoint(rng);\r
+ for (; container && container != root; container = container.parentNode)\r
+ point.push(t.dom.nodeIndex(container, normalized));\r
\r
- return bookmark;\r
+ return point;\r
};\r
\r
+ bookmark.start = getPoint(rng, true);\r
+\r
+ if (!t.isCollapsed())\r
+ bookmark.end = getPoint(rng);\r
+\r
+ return bookmark;\r
+ };\r
+\r
+ if (type == 2) {\r
if (t.tridentSel)\r
return t.tridentSel.getBookmark(type);\r
\r
\r
// Detect the empty space after block elements in IE and move the end back one character <p></p>] becomes <p>]</p>\r
rng.moveToElementText(rng2.parentElement());\r
- if (rng.compareEndPoints('StartToEnd', rng2) == 0)\r
+ if (rng.compareEndPoints('StartToEnd', rng2) === 0)\r
rng2.move('character', -1);\r
\r
rng2.pasteHTML('<span data-mce-type="bookmark" id="' + id + '_end" style="' + styles + '">' + chr + '</span>');\r
if (name == 'IMG')\r
return {name : name, index : findIndex(name, element)};\r
\r
- // Can't insert a node into the root of document WebKit defaults to document\r
- if (rng.startContainer.nodeType == 9) {\r
- return;\r
- }\r
-\r
// W3C method\r
- rng2 = rng.cloneRange();\r
+ rng2 = normalizeTableCellSelection(rng.cloneRange());\r
\r
// Insert end marker\r
if (!collapsed) {\r
rng2.insertNode(dom.create('span', {'data-mce-type' : "bookmark", id : id + '_end', style : styles}, chr));\r
}\r
\r
+ rng = normalizeTableCellSelection(rng);\r
rng.collapse(true);\r
rng.insertNode(dom.create('span', {'data-mce-type' : "bookmark", id : id + '_start', style : styles}, chr));\r
}\r
moveToBookmark : function(bookmark) {\r
var t = this, dom = t.dom, marker1, marker2, rng, root, startContainer, endContainer, startOffset, endOffset;\r
\r
- if (bookmark) {\r
- if (bookmark.start) {\r
- rng = dom.createRng();\r
- root = dom.getRoot();\r
+ function setEndPoint(start) {\r
+ var point = bookmark[start ? 'start' : 'end'], i, node, offset, children;\r
\r
- function setEndPoint(start) {\r
- var point = bookmark[start ? 'start' : 'end'], i, node, offset, children;\r
+ if (point) {\r
+ offset = point[0];\r
\r
- if (point) {\r
- offset = point[0];\r
+ // Find container node\r
+ for (node = root, i = point.length - 1; i >= 1; i--) {\r
+ children = node.childNodes;\r
\r
- // Find container node\r
- for (node = root, i = point.length - 1; i >= 1; i--) {\r
- children = node.childNodes;\r
+ if (point[i] > children.length - 1)\r
+ return;\r
\r
- if (point[i] > children.length - 1)\r
- return;\r
+ node = children[point[i]];\r
+ }\r
\r
- node = children[point[i]];\r
- }\r
+ // Move text offset to best suitable location\r
+ if (node.nodeType === 3)\r
+ offset = Math.min(point[0], node.nodeValue.length);\r
\r
- // Move text offset to best suitable location\r
- if (node.nodeType === 3)\r
- offset = Math.min(point[0], node.nodeValue.length);\r
+ // Move element offset to best suitable location\r
+ if (node.nodeType === 1)\r
+ offset = Math.min(point[0], node.childNodes.length);\r
\r
- // Move element offset to best suitable location\r
- if (node.nodeType === 1)\r
- offset = Math.min(point[0], node.childNodes.length);\r
+ // Set offset within container node\r
+ if (start)\r
+ rng.setStart(node, offset);\r
+ else\r
+ rng.setEnd(node, offset);\r
+ }\r
\r
- // Set offset within container node\r
- if (start)\r
- rng.setStart(node, offset);\r
- else\r
- rng.setEnd(node, offset);\r
- }\r
+ return true;\r
+ };\r
\r
- return true;\r
- };\r
+ function restoreEndPoint(suffix) {\r
+ var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep;\r
\r
- if (t.tridentSel)\r
- return t.tridentSel.moveToBookmark(bookmark);\r
+ if (marker) {\r
+ node = marker.parentNode;\r
\r
- if (setEndPoint(true) && setEndPoint()) {\r
- t.setRng(rng);\r
+ if (suffix == 'start') {\r
+ if (!keep) {\r
+ idx = dom.nodeIndex(marker);\r
+ } else {\r
+ node = marker.firstChild;\r
+ idx = 1;\r
+ }\r
+\r
+ startContainer = endContainer = node;\r
+ startOffset = endOffset = idx;\r
+ } else {\r
+ if (!keep) {\r
+ idx = dom.nodeIndex(marker);\r
+ } else {\r
+ node = marker.firstChild;\r
+ idx = 1;\r
+ }\r
+\r
+ endContainer = node;\r
+ endOffset = idx;\r
}\r
- } else if (bookmark.id) {\r
- function restoreEndPoint(suffix) {\r
- var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep;\r
\r
- if (marker) {\r
- node = marker.parentNode;\r
+ if (!keep) {\r
+ prev = marker.previousSibling;\r
+ next = marker.nextSibling;\r
\r
- if (suffix == 'start') {\r
- if (!keep) {\r
- idx = dom.nodeIndex(marker);\r
- } else {\r
- node = marker.firstChild;\r
- idx = 1;\r
- }\r
+ // Remove all marker text nodes\r
+ each(tinymce.grep(marker.childNodes), function(node) {\r
+ if (node.nodeType == 3)\r
+ node.nodeValue = node.nodeValue.replace(/\uFEFF/g, '');\r
+ });\r
+\r
+ // Remove marker but keep children if for example contents where inserted into the marker\r
+ // Also remove duplicated instances of the marker for example by a split operation or by WebKit auto split on paste feature\r
+ while (marker = dom.get(bookmark.id + '_' + suffix))\r
+ dom.remove(marker, 1);\r
\r
- startContainer = endContainer = node;\r
+ // If siblings are text nodes then merge them unless it's Opera since it some how removes the node\r
+ // 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\r
+ if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3 && !tinymce.isOpera) {\r
+ idx = prev.nodeValue.length;\r
+ prev.appendData(next.nodeValue);\r
+ dom.remove(next);\r
+\r
+ if (suffix == 'start') {\r
+ startContainer = endContainer = prev;\r
startOffset = endOffset = idx;\r
} else {\r
- if (!keep) {\r
- idx = dom.nodeIndex(marker);\r
- } else {\r
- node = marker.firstChild;\r
- idx = 1;\r
- }\r
-\r
- endContainer = node;\r
+ endContainer = prev;\r
endOffset = idx;\r
}\r
+ }\r
+ }\r
+ }\r
+ };\r
\r
- if (!keep) {\r
- prev = marker.previousSibling;\r
- next = marker.nextSibling;\r
-\r
- // Remove all marker text nodes\r
- each(tinymce.grep(marker.childNodes), function(node) {\r
- if (node.nodeType == 3)\r
- node.nodeValue = node.nodeValue.replace(/\uFEFF/g, '');\r
- });\r
+ function addBogus(node) {\r
+ // Adds a bogus BR element for empty block elements\r
+ if (dom.isBlock(node) && !node.innerHTML && !isIE)\r
+ node.innerHTML = '<br data-mce-bogus="1" />';\r
\r
- // Remove marker but keep children if for example contents where inserted into the marker\r
- // Also remove duplicated instances of the marker for example by a split operation or by WebKit auto split on paste feature\r
- while (marker = dom.get(bookmark.id + '_' + suffix))\r
- dom.remove(marker, 1);\r
-\r
- // If siblings are text nodes then merge them unless it's Opera since it some how removes the node\r
- // 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\r
- if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3 && !tinymce.isOpera) {\r
- idx = prev.nodeValue.length;\r
- prev.appendData(next.nodeValue);\r
- dom.remove(next);\r
-\r
- if (suffix == 'start') {\r
- startContainer = endContainer = prev;\r
- startOffset = endOffset = idx;\r
- } else {\r
- endContainer = prev;\r
- endOffset = idx;\r
- }\r
- }\r
- }\r
- }\r
- };\r
+ return node;\r
+ };\r
\r
- function addBogus(node) {\r
- // Adds a bogus BR element for empty block elements or just a space on IE since it renders BR elements incorrectly\r
- if (dom.isBlock(node) && !node.innerHTML)\r
- node.innerHTML = !isIE ? '<br data-mce-bogus="1" />' : ' ';\r
+ if (bookmark) {\r
+ if (bookmark.start) {\r
+ rng = dom.createRng();\r
+ root = dom.getRoot();\r
\r
- return node;\r
- };\r
+ if (t.tridentSel)\r
+ return t.tridentSel.moveToBookmark(bookmark);\r
\r
+ if (setEndPoint(true) && setEndPoint()) {\r
+ t.setRng(rng);\r
+ }\r
+ } else if (bookmark.id) {\r
// Restore start/end points\r
restoreEndPoint('start');\r
restoreEndPoint('end');\r
select : function(node, content) {\r
var t = this, dom = t.dom, rng = dom.createRng(), idx;\r
\r
+ function setPoint(node, start) {\r
+ var walker = new TreeWalker(node, node);\r
+\r
+ do {\r
+ // Text node\r
+ if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length !== 0) {\r
+ if (start)\r
+ rng.setStart(node, 0);\r
+ else\r
+ rng.setEnd(node, node.nodeValue.length);\r
+\r
+ return;\r
+ }\r
+\r
+ // BR element\r
+ if (node.nodeName == 'BR') {\r
+ if (start)\r
+ rng.setStartBefore(node);\r
+ else\r
+ rng.setEndBefore(node);\r
+\r
+ return;\r
+ }\r
+ } while (node = (start ? walker.next() : walker.prev()));\r
+ };\r
+\r
if (node) {\r
idx = dom.nodeIndex(node);\r
rng.setStart(node.parentNode, idx);\r
\r
// Find first/last text node or BR element\r
if (content) {\r
- function setPoint(node, start) {\r
- var walker = new tinymce.dom.TreeWalker(node, node);\r
-\r
- do {\r
- // Text node\r
- if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) {\r
- if (start)\r
- rng.setStart(node, 0);\r
- else\r
- rng.setEnd(node, node.nodeValue.length);\r
-\r
- return;\r
- }\r
-\r
- // BR element\r
- if (node.nodeName == 'BR') {\r
- if (start)\r
- rng.setStartBefore(node);\r
- else\r
- rng.setEndBefore(node);\r
-\r
- return;\r
- }\r
- } while (node = (start ? walker.next() : walker.prev()));\r
- };\r
-\r
setPoint(node, 1);\r
setPoint(node);\r
}\r
},\r
\r
getRng : function(w3c) {\r
- var t = this, s, r, elm, doc = t.win.document;\r
+ var self = this, selection, rng, elm, doc = self.win.document;\r
\r
// Found tridentSel object then we need to use that one\r
- if (w3c && t.tridentSel)\r
- return t.tridentSel.getRangeAt(0);\r
+ if (w3c && self.tridentSel) {\r
+ return self.tridentSel.getRangeAt(0);\r
+ }\r
\r
try {\r
- if (s = t.getSel())\r
- r = s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : doc.createRange());\r
+ if (selection = self.getSel()) {\r
+ rng = selection.rangeCount > 0 ? selection.getRangeAt(0) : (selection.createRange ? selection.createRange() : doc.createRange());\r
+ }\r
} catch (ex) {\r
// IE throws unspecified error here if TinyMCE is placed in a frame/iframe\r
}\r
\r
// We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet\r
- if (tinymce.isIE && r && r.setStart && doc.selection.createRange().item) {\r
+ if (tinymce.isIE && rng && rng.setStart && doc.selection.createRange().item) {\r
elm = doc.selection.createRange().item(0);\r
- r = doc.createRange();\r
- r.setStartBefore(elm);\r
- r.setEndAfter(elm);\r
+ rng = doc.createRange();\r
+ rng.setStartBefore(elm);\r
+ rng.setEndAfter(elm);\r
}\r
\r
// No range found then create an empty one\r
// This can occur when the editor is placed in a hidden container element on Gecko\r
// Or on IE when there was an exception\r
- if (!r)\r
- r = doc.createRange ? doc.createRange() : doc.body.createTextRange();\r
+ if (!rng) {\r
+ rng = doc.createRange ? doc.createRange() : doc.body.createTextRange();\r
+ }\r
+\r
+ // If range is at start of document then move it to start of body\r
+ if (rng.setStart && rng.startContainer.nodeType === 9 && rng.collapsed) {\r
+ elm = self.dom.getRoot();\r
+ rng.setStart(elm, 0);\r
+ rng.setEnd(elm, 0);\r
+ }\r
\r
- if (t.selectedRange && t.explicitRange) {\r
- if (r.compareBoundaryPoints(r.START_TO_START, t.selectedRange) === 0 && r.compareBoundaryPoints(r.END_TO_END, t.selectedRange) === 0) {\r
+ if (self.selectedRange && self.explicitRange) {\r
+ if (rng.compareBoundaryPoints(rng.START_TO_START, self.selectedRange) === 0 && rng.compareBoundaryPoints(rng.END_TO_END, self.selectedRange) === 0) {\r
// Safari, Opera and Chrome only ever select text which causes the range to change.\r
// This lets us use the originally set range if the selection hasn't been changed by the user.\r
- r = t.explicitRange;\r
+ rng = self.explicitRange;\r
} else {\r
- t.selectedRange = null;\r
- t.explicitRange = null;\r
+ self.selectedRange = null;\r
+ self.explicitRange = null;\r
}\r
}\r
\r
- return r;\r
+ return rng;\r
},\r
\r
- setRng : function(r) {\r
+ setRng : function(r, forward) {\r
var s, t = this;\r
\r
if (!t.tridentSel) {\r
}\r
\r
s.addRange(r);\r
+\r
+ // Forward is set to false and we have an extend function\r
+ if (forward === false && s.extend) {\r
+ s.collapse(r.endContainer, r.endOffset);\r
+ s.extend(r.startContainer, r.startOffset);\r
+ }\r
+\r
// adding range isn't always successful so we need to check range count otherwise an exception can occur\r
t.selectedRange = s.rangeCount > 0 ? s.getRangeAt(0) : null;\r
}\r
getNode : function() {\r
var t = this, rng = t.getRng(), sel = t.getSel(), elm, start = rng.startContainer, end = rng.endContainer;\r
\r
+ function skipEmptyTextNodes(n, forwards) {\r
+ var orig = n;\r
+ while (n && n.nodeType === 3 && n.length === 0) {\r
+ n = forwards ? n.nextSibling : n.previousSibling;\r
+ }\r
+ return n || orig;\r
+ };\r
+\r
// Range maybe lost after the editor is made visible again\r
if (!rng)\r
return t.dom.getRoot();\r
// Handle cases where the selection is immediately wrapped around a node and return that node instead of it's parent.\r
// This happens when you double click an underlined word in FireFox.\r
if (start.nodeType === 3 && end.nodeType === 3) {\r
- function skipEmptyTextNodes(n, forwards) {\r
- var orig = n;\r
- while (n && n.nodeType === 3 && n.length === 0) {\r
- n = forwards ? n.nextSibling : n.previousSibling;\r
- }\r
- return n || orig;\r
- }\r
if (start.length === rng.startOffset) {\r
start = skipEmptyTextNodes(start.nextSibling, true);\r
} else {\r
if (sb && eb && sb != eb) {\r
n = sb;\r
\r
- var walker = new tinymce.dom.TreeWalker(sb, dom.getRoot());\r
+ var walker = new TreeWalker(sb, dom.getRoot());\r
while ((n = walker.next()) && n != eb) {\r
if (dom.isBlock(n))\r
bl.push(n);\r
return bl;\r
},\r
\r
- normalize : function() {\r
- var self = this, rng, normalized;\r
+ isForward: function(){\r
+ var dom = this.dom, sel = this.getSel(), anchorRange, focusRange;\r
\r
- // TODO:\r
- // Retain selection direction.\r
- // Lean left/right on Gecko for inline elements.\r
- // Run this on mouse up/key up when the user manually moves the selection\r
+ // No support for selection direction then always return true\r
+ if (!sel || sel.anchorNode == null || sel.focusNode == null) {\r
+ return true;\r
+ }\r
\r
- // Normalize only on non IE browsers for now\r
- if (tinymce.isIE)\r
- return;\r
+ anchorRange = dom.createRng();\r
+ anchorRange.setStart(sel.anchorNode, sel.anchorOffset);\r
+ anchorRange.collapse(true);\r
+\r
+ focusRange = dom.createRng();\r
+ focusRange.setStart(sel.focusNode, sel.focusOffset);\r
+ focusRange.collapse(true);\r
+\r
+ return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0;\r
+ },\r
+\r
+ normalize : function() {\r
+ var self = this, rng, normalized, collapsed, node, sibling;\r
\r
function normalizeEndPoint(start) {\r
- var container, offset, walker, dom = self.dom, body = dom.getRoot(), node;\r
+ var container, offset, walker, dom = self.dom, body = dom.getRoot(), node, nonEmptyElementsMap, nodeName;\r
+\r
+ function hasBrBeforeAfter(node, left) {\r
+ var walker = new TreeWalker(node, dom.getParent(node.parentNode, dom.isBlock) || body);\r
+\r
+ while (node = walker[left ? 'prev' : 'next']()) {\r
+ if (node.nodeName === "BR") {\r
+ return true;\r
+ }\r
+ }\r
+ };\r
+\r
+ // Walks the dom left/right to find a suitable text node to move the endpoint into\r
+ // It will only walk within the current parent block or body and will stop if it hits a block or a BR/IMG\r
+ function findTextNodeRelative(left, startNode) {\r
+ var walker, lastInlineElement;\r
+\r
+ startNode = startNode || container;\r
+ walker = new TreeWalker(startNode, dom.getParent(startNode.parentNode, dom.isBlock) || body);\r
+\r
+ // Walk left until we hit a text node we can move to or a block/br/img\r
+ while (node = walker[left ? 'prev' : 'next']()) {\r
+ // Found text node that has a length\r
+ if (node.nodeType === 3 && node.nodeValue.length > 0) {\r
+ container = node;\r
+ offset = left ? node.nodeValue.length : 0;\r
+ normalized = true;\r
+ return;\r
+ }\r
+\r
+ // Break if we find a block or a BR/IMG/INPUT etc\r
+ if (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) {\r
+ return;\r
+ }\r
+\r
+ lastInlineElement = node;\r
+ }\r
+\r
+ // Only fetch the last inline element when in caret mode for now\r
+ if (collapsed && lastInlineElement) {\r
+ container = lastInlineElement;\r
+ normalized = true;\r
+ offset = 0;\r
+ }\r
+ };\r
\r
container = rng[(start ? 'start' : 'end') + 'Container'];\r
offset = rng[(start ? 'start' : 'end') + 'Offset'];\r
+ nonEmptyElementsMap = dom.schema.getNonEmptyElements();\r
\r
// If the container is a document move it to the body element\r
if (container.nodeType === 9) {\r
- container = container.body;\r
+ container = dom.getRoot();\r
offset = 0;\r
}\r
\r
// If the container is body try move it into the closest text node or position\r
- // TODO: Add more logic here to handle element selection cases\r
if (container === body) {\r
+ // If start is before/after a image, table etc\r
+ if (start) {\r
+ node = container.childNodes[offset > 0 ? offset - 1 : 0];\r
+ if (node) {\r
+ nodeName = node.nodeName.toLowerCase();\r
+ if (nonEmptyElementsMap[node.nodeName] || node.nodeName == "TABLE") {\r
+ return;\r
+ }\r
+ }\r
+ }\r
+\r
// Resolve the index\r
if (container.hasChildNodes()) {\r
container = container.childNodes[Math.min(!start && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1)];\r
offset = 0;\r
\r
// Don't walk into elements that doesn't have any child nodes like a IMG\r
- if (container.hasChildNodes()) {\r
+ if (container.hasChildNodes() && !/TABLE/.test(container.nodeName)) {\r
// Walk the DOM to find a text node to place the caret at or a BR\r
node = container;\r
- walker = new tinymce.dom.TreeWalker(container, body);\r
+ walker = new TreeWalker(container, body);\r
+\r
do {\r
// Found a text node use that position\r
- if (node.nodeType === 3) {\r
- offset = start ? 0 : node.nodeValue.length - 1;\r
+ if (node.nodeType === 3 && node.nodeValue.length > 0) {\r
+ offset = start ? 0 : node.nodeValue.length;\r
container = node;\r
normalized = true;\r
break;\r
}\r
\r
// Found a BR/IMG element that we can place the caret before\r
- if (/^(BR|IMG)$/.test(node.nodeName)) {\r
+ if (nonEmptyElementsMap[node.nodeName.toLowerCase()]) {\r
offset = dom.nodeIndex(node);\r
container = node.parentNode;\r
\r
}\r
}\r
\r
+ // Lean the caret to the left if possible\r
+ if (collapsed) {\r
+ // So this: <b>x</b><i>|x</i>\r
+ // Becomes: <b>x|</b><i>x</i>\r
+ // Seems that only gecko has issues with this\r
+ if (container.nodeType === 3 && offset === 0) {\r
+ findTextNodeRelative(true);\r
+ }\r
+\r
+ // Lean left into empty inline elements when the caret is before a BR\r
+ // So this: <i><b></b><i>|<br></i>\r
+ // Becomes: <i><b>|</b><i><br></i>\r
+ // Seems that only gecko has issues with this\r
+ if (container.nodeType === 1) {\r
+ node = container.childNodes[offset];\r
+ if(node && node.nodeName === 'BR' && !hasBrBeforeAfter(node) && !hasBrBeforeAfter(node, true)) {\r
+ findTextNodeRelative(true, container.childNodes[offset]);\r
+ }\r
+ }\r
+ }\r
+\r
+ // Lean the start of the selection right if possible\r
+ // So this: x[<b>x]</b>\r
+ // Becomes: x<b>[x]</b>\r
+ if (start && !collapsed && container.nodeType === 3 && offset === container.nodeValue.length) {\r
+ findTextNodeRelative(false);\r
+ }\r
+\r
// Set endpoint if it was normalized\r
if (normalized)\r
rng['set' + (start ? 'Start' : 'End')](container, offset);\r
};\r
\r
+ // Normalize only on non IE browsers for now\r
+ if (tinymce.isIE)\r
+ return;\r
+ \r
rng = self.getRng();\r
+ collapsed = rng.collapsed;\r
\r
// Normalize the end points\r
normalizeEndPoint(true);\r
\r
- if (!rng.collapsed)\r
+ if (!collapsed)\r
normalizeEndPoint();\r
\r
// Set the selection if it was normalized\r
if (normalized) {\r
+ // If it was collapsed then make sure it still is\r
+ if (collapsed) {\r
+ rng.collapse(true);\r
+ }\r
+\r
//console.log(self.dom.dumpRng(rng));\r
- self.setRng(rng);\r
+ self.setRng(rng, self.isForward());\r
}\r
},\r
\r
_fixIESelection : function() {\r
var dom = this.dom, doc = dom.doc, body = doc.body, started, startRng, htmlElm;\r
\r
- // Make HTML element unselectable since we are going to handle selection by hand\r
- doc.documentElement.unselectable = true;\r
-\r
// Return range from point or null if it failed\r
function rngFromPoint(x, y) {\r
var rng = body.createTextRange();\r
startRng = started = 0;\r
};\r
\r
+ // Make HTML element unselectable since we are going to handle selection by hand\r
+ doc.documentElement.unselectable = true;\r
+ \r
// Detect when user selects outside BODY\r
dom.bind(doc, ['mousedown', 'contextmenu'], function(e) {\r
if (e.target.nodeName === 'HTML') {\r
}\r
});\r
\r
- // Remove internal classes mceItem<..>\r
+ // Remove internal classes mceItem<..> or mceSelected\r
htmlParser.addAttributeFilter('class', function(nodes, name) {\r
var i = nodes.length, node, value;\r
\r
while (i--) {\r
node = nodes[i];\r
- value = node.attr('class').replace(/\s*mce(Item\w+|Selected)\s*/g, '');\r
+ value = node.attr('class').replace(/(?:^|\s)mce(Item\w+|Selected)(?!\S)/g, '');\r
node.attr('class', value.length > 0 ? value : null);\r
}\r
});\r
\r
// Parse and serialize HTML\r
args.content = htmlSerializer.serialize(\r
- htmlParser.parse(args.getInner ? node.innerHTML : tinymce.trim(dom.getOuterHTML(node), args), args)\r
+ htmlParser.parse(tinymce.trim(args.getInner ? node.innerHTML : dom.getOuterHTML(node)), args)\r
);\r
\r
// Replace all BOM characters for now until we can find a better solution\r
scriptLoadedCallbacks = {},\r
queueLoadedCallbacks = [],\r
loading = 0,\r
- undefined;\r
+ undef;\r
\r
function loadScript(url, callback) {\r
var t = this, dom = tinymce.DOM, elm, uri, loc, id;\r
var item, state = states[url];\r
\r
// Add url to load queue\r
- if (state == undefined) {\r
+ if (state == undef) {\r
queue.push(url);\r
states[url] = QUEUED;\r
}\r
callback.func.call(callback.scope);\r
});\r
\r
- scriptLoadedCallbacks[url] = undefined;\r
+ scriptLoadedCallbacks[url] = undef;\r
};\r
\r
queueLoadedCallbacks.push({\r
tinymce.ScriptLoader = new tinymce.dom.ScriptLoader();\r
})(tinymce);\r
\r
-tinymce.dom.TreeWalker = function(start_node, root_node) {\r
- var node = start_node;\r
-\r
- function findSibling(node, start_name, sibling_name, shallow) {\r
- var sibling, parent;\r
-\r
- if (node) {\r
- // Walk into nodes if it has a start\r
- if (!shallow && node[start_name])\r
- return node[start_name];\r
-\r
- // Return the sibling if it has one\r
- if (node != root_node) {\r
- sibling = node[sibling_name];\r
- if (sibling)\r
- return sibling;\r
-\r
- // Walk up the parents to look for siblings\r
- for (parent = node.parentNode; parent && parent != root_node; parent = parent.parentNode) {\r
- sibling = parent[sibling_name];\r
- if (sibling)\r
- return sibling;\r
- }\r
- }\r
- }\r
- };\r
-\r
- this.current = function() {\r
- return node;\r
- };\r
-\r
- this.next = function(shallow) {\r
- return (node = findSibling(node, 'firstChild', 'nextSibling', shallow));\r
- };\r
-\r
- this.prev = function(shallow) {\r
- return (node = findSibling(node, 'lastChild', 'previousSibling', shallow));\r
- };\r
-};\r
-\r
(function(tinymce) {\r
tinymce.dom.RangeUtils = function(dom) {\r
var INVISIBLE_CHAR = '\uFEFF';\r
update : function() {\r
var t = this, s = t.settings, tb = DOM.get('menu_' + t.id + '_tbl'), co = DOM.get('menu_' + t.id + '_co'), tw, th;\r
\r
- tw = s.max_width ? Math.min(tb.clientWidth, s.max_width) : tb.clientWidth;\r
- th = s.max_height ? Math.min(tb.clientHeight, s.max_height) : tb.clientHeight;\r
+ tw = s.max_width ? Math.min(tb.offsetWidth, s.max_width) : tb.offsetWidth;\r
+ th = s.max_height ? Math.min(tb.offsetHeight, s.max_height) : tb.offsetHeight;\r
\r
if (!DOM.boxModel)\r
t.element.setStyles({width : tw + 2, height : th + 2});\r
})(tinymce);\r
\r
(function(tinymce) {\r
- var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher;\r
+ var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, undef;\r
\r
tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control', {\r
ListBox : function(id, s, ed) {\r
\r
t.marked = {};\r
\r
- if (va == undefined)\r
+ if (va == undef)\r
return t.selectByIndex(-1);\r
\r
// Is string or number make function selector\r
showMenu : function() {\r
var t = this, p2, e = DOM.get(this.id), m;\r
\r
- if (t.isDisabled() || t.items.length == 0)\r
+ if (t.isDisabled() || t.items.length === 0)\r
return;\r
\r
if (t.menu && t.menu.isMenuVisible)\r
m = t.settings.control_manager.createDropMenu(t.id + '_menu', {\r
menu_line : 1,\r
'class' : t.classPrefix + 'Menu mceNoIcons',\r
- max_width : 150,\r
+ max_width : 250,\r
max_height : 150\r
});\r
\r
\r
each(t.items, function(o) {\r
// No value then treat it as a title\r
- if (o.value === undefined) {\r
+ if (o.value === undef) {\r
m.add({\r
title : o.title,\r
role : "option",\r
})(tinymce);\r
\r
(function(tinymce) {\r
- var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher;\r
+ var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, undef;\r
\r
tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox', {\r
NativeListBox : function(id, s) {\r
select : function(va) {\r
var t = this, fv, f;\r
\r
- if (va == undefined)\r
+ if (va == undef)\r
return t.selectByIndex(-1);\r
\r
// Is string or number make function selector\r
m.settings.vp_offset_x = p2.x;\r
m.settings.vp_offset_y = p2.y;\r
m.settings.keyboard_focus = t._focused;\r
- m.showMenu(0, e.clientHeight);\r
+ m.showMenu(0, e.firstChild.clientHeight);\r
\r
Event.add(DOM.doc, 'mousedown', t.hideMenu, t);\r
t.setState('Selected', 1);\r
p2 = DOM.getPos(e);\r
DOM.setStyles(t.id + '_menu', {\r
left : p2.x,\r
- top : p2.y + e.clientHeight,\r
+ top : p2.y + e.firstChild.clientHeight,\r
zIndex : 200000\r
});\r
e = 0;\r
renderMenu : function() {\r
var t = this, m, i = 0, s = t.settings, n, tb, tr, w, context;\r
\r
- w = DOM.add(s.menu_container, 'div', {role: 'listbox', id : t.id + '_menu', 'class' : s['menu_class'] + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'});\r
+ w = DOM.add(s.menu_container, 'div', {role: 'listbox', id : t.id + '_menu', 'class' : s.menu_class + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'});\r
m = DOM.add(w, 'div', {'class' : s['class'] + ' mceSplitButtonMenu'});\r
DOM.add(m, 'span', {'class' : 'mceMenuLine'});\r
\r
\r
// adding a proper ARIA role = button causes JAWS to read things incorrectly on IE.\r
if (!tinymce.isIE ) {\r
- settings['role']= 'option';\r
+ settings.role = 'option';\r
}\r
\r
n = DOM.add(n, 'a', settings);\r
if (typeof u === "object")\r
url = u.prefix + u.resource + u.suffix;\r
\r
- if (url.indexOf('/') != 0 && url.indexOf('://') == -1)\r
+ if (url.indexOf('/') !== 0 && url.indexOf('://') == -1)\r
url = tinymce.baseURL + '/' + url;\r
\r
t.urls[n] = url.substring(0, url.lastIndexOf('/'));\r
DOM = tinymce.DOM, Event = tinymce.dom.Event,\r
ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager,\r
explode = tinymce.explode,\r
- Dispatcher = tinymce.util.Dispatcher, undefined, instanceCounter = 0;\r
+ Dispatcher = tinymce.util.Dispatcher, undef, instanceCounter = 0;\r
\r
// Setup some URLs where the editor API is located and where the document is\r
tinymce.documentBaseURL = window.location.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');\r
return f.apply(s || this, Array.prototype.slice.call(arguments, 2));\r
};\r
\r
+ function hasClass(n, c) {\r
+ return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c);\r
+ };\r
+\r
s = extend({\r
theme : "simple",\r
language : "en"\r
\r
case "textareas":\r
case "specific_textareas":\r
- function hasClass(n, c) {\r
- return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c);\r
- };\r
-\r
each(DOM.select('textarea'), function(elm) {\r
if (s.editor_deselector && hasClass(elm, s.editor_deselector))\r
return;\r
},\r
\r
get : function(id) {\r
- if (id === undefined)\r
+ if (id === undef)\r
return this.editors;\r
\r
return this.editors[id];\r
execCommand : function(c, u, v) {\r
var t = this, ed = t.get(v), w;\r
\r
+ function clr() {\r
+ ed.destroy();\r
+ w.detachEvent('onunload', clr);\r
+ w = w.tinyMCE = w.tinymce = null; // IE leak\r
+ };\r
+\r
// Manager commands\r
switch (c) {\r
case "mceFocus":\r
\r
// Fix IE memory leaks\r
if (tinymce.isIE) {\r
- function clr() {\r
- ed.destroy();\r
- w.detachEvent('onunload', clr);\r
- w = w.tinyMCE = w.tinymce = null; // IE leak\r
- };\r
-\r
w.attachEvent('onunload', clr);\r
}\r
\r
(function(tinymce) {\r
// Shorten these names\r
var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend,\r
- Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isGecko = tinymce.isGecko,\r
+ each = tinymce.each, isGecko = tinymce.isGecko,\r
isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, is = tinymce.is,\r
ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager,\r
- inArray = tinymce.inArray, grep = tinymce.grep, explode = tinymce.explode, VK = tinymce.VK;\r
+ explode = tinymce.explode;\r
\r
tinymce.create('tinymce.Editor', {\r
- Editor : function(id, s) {\r
- var t = this;\r
-\r
- t.id = t.editorId = id;\r
-\r
- t.execCommands = {};\r
- t.queryStateCommands = {};\r
- t.queryValueCommands = {};\r
-\r
- t.isNotDirty = false;\r
-\r
- t.plugins = {};\r
-\r
- // Add events to the editor\r
- each([\r
- 'onPreInit',\r
-\r
- 'onBeforeRenderUI',\r
+ Editor : function(id, settings) {\r
+ var self = this, TRUE = true;\r
\r
- 'onPostRender',\r
-\r
- 'onLoad',\r
-\r
- 'onInit',\r
-\r
- 'onRemove',\r
-\r
- 'onActivate',\r
-\r
- 'onDeactivate',\r
-\r
- 'onClick',\r
-\r
- 'onEvent',\r
-\r
- 'onMouseUp',\r
-\r
- 'onMouseDown',\r
-\r
- 'onDblClick',\r
-\r
- 'onKeyDown',\r
-\r
- 'onKeyUp',\r
-\r
- 'onKeyPress',\r
-\r
- 'onContextMenu',\r
-\r
- 'onSubmit',\r
-\r
- 'onReset',\r
-\r
- 'onPaste',\r
-\r
- 'onPreProcess',\r
-\r
- 'onPostProcess',\r
-\r
- 'onBeforeSetContent',\r
-\r
- 'onBeforeGetContent',\r
-\r
- 'onSetContent',\r
-\r
- 'onGetContent',\r
-\r
- 'onLoadContent',\r
-\r
- 'onSaveContent',\r
-\r
- 'onNodeChange',\r
-\r
- 'onChange',\r
-\r
- 'onBeforeExecCommand',\r
-\r
- 'onExecCommand',\r
-\r
- 'onUndo',\r
-\r
- 'onRedo',\r
-\r
- 'onVisualAid',\r
-\r
- 'onSetProgressState',\r
-\r
- 'onSetAttrib'\r
- ], function(e) {\r
- t[e] = new Dispatcher(t);\r
- });\r
-\r
- t.settings = s = extend({\r
+ self.settings = settings = extend({\r
id : id,\r
language : 'en',\r
- docs_language : 'en',\r
theme : 'simple',\r
skin : 'default',\r
delta_width : 0,\r
popup_css : '',\r
plugins : '',\r
document_base_url : tinymce.documentBaseURL,\r
- add_form_submit_trigger : 1,\r
- submit_patch : 1,\r
- add_unload_trigger : 1,\r
- convert_urls : 1,\r
- relative_urls : 1,\r
- remove_script_host : 1,\r
- table_inline_editing : 0,\r
- object_resizing : 1,\r
- cleanup : 1,\r
- accessibility_focus : 1,\r
- custom_shortcuts : 1,\r
- custom_undo_redo_keyboard_shortcuts : 1,\r
- custom_undo_redo_restore_selection : 1,\r
- custom_undo_redo : 1,\r
+ add_form_submit_trigger : TRUE,\r
+ submit_patch : TRUE,\r
+ add_unload_trigger : TRUE,\r
+ convert_urls : TRUE,\r
+ relative_urls : TRUE,\r
+ remove_script_host : TRUE,\r
+ table_inline_editing : false,\r
+ object_resizing : TRUE,\r
+ accessibility_focus : TRUE,\r
doctype : tinymce.isIE6 ? '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' : '<!DOCTYPE>', // Use old doctype on IE 6 to avoid horizontal scroll\r
- visual_table_class : 'mceItemTable',\r
- visual : 1,\r
+ visual : TRUE,\r
font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large',\r
font_size_legacy_values : 'xx-small,small,medium,large,x-large,xx-large,300%', // See: http://www.w3.org/TR/CSS2/fonts.html#propdef-font-size\r
- apply_source_formatting : 1,\r
+ apply_source_formatting : TRUE,\r
directionality : 'ltr',\r
forced_root_block : 'p',\r
- hidden_input : 1,\r
- padd_empty_editor : 1,\r
- render_ui : 1,\r
- init_theme : 1,\r
- force_p_newlines : 1,\r
+ hidden_input : TRUE,\r
+ padd_empty_editor : TRUE,\r
+ render_ui : TRUE,\r
indentation : '30px',\r
- keep_styles : 1,\r
- fix_table_elements : 1,\r
- inline_styles : 1,\r
- convert_fonts_to_spans : true,\r
+ fix_table_elements : TRUE,\r
+ inline_styles : TRUE,\r
+ convert_fonts_to_spans : TRUE,\r
indent : 'simple',\r
- 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',\r
- 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',\r
- validate : true,\r
+ 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',\r
+ 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',\r
+ validate : TRUE,\r
entity_encoding : 'named',\r
- url_converter : t.convertURL,\r
- url_converter_scope : t,\r
- ie7_compat : true\r
- }, s);\r
+ url_converter : self.convertURL,\r
+ url_converter_scope : self,\r
+ ie7_compat : TRUE\r
+ }, settings);\r
+\r
+ self.id = self.editorId = id;\r
\r
- t.documentBaseURI = new tinymce.util.URI(s.document_base_url || tinymce.documentBaseURL, {\r
+ self.isNotDirty = false;\r
+\r
+ self.plugins = {};\r
+\r
+ self.documentBaseURI = new tinymce.util.URI(settings.document_base_url || tinymce.documentBaseURL, {\r
base_uri : tinyMCE.baseURI\r
});\r
\r
- t.baseURI = tinymce.baseURI;\r
+ self.baseURI = tinymce.baseURI;\r
\r
- t.contentCSS = [];\r
+ self.contentCSS = [];\r
+\r
+ // Creates all events like onClick, onSetContent etc see Editor.Events.js for the actual logic\r
+ self.setupEvents();\r
+\r
+ // Internal command handler objects\r
+ self.execCommands = {};\r
+ self.queryStateCommands = {};\r
+ self.queryValueCommands = {};\r
\r
// Call setup\r
- t.execCallback('setup', t);\r
+ self.execCallback('setup', self);\r
},\r
\r
render : function(nst) {\r
return;\r
\r
// Is a iPad/iPhone and not on iOS5, then skip initialization. We need to sniff \r
- // here since the browser says it has contentEditable support but there is no visible\r
- // caret We will remove this check ones Apple implements full contentEditable support\r
+ // here since the browser says it has contentEditable support but there is no visible caret.\r
if (tinymce.isIDevice && !tinymce.isIOS5)\r
return;\r
\r
var dependencies = PluginManager.dependencies(p);\r
each(dependencies, function(dep) {\r
var defaultSettings = {prefix:'plugins/', resource: dep, suffix:'/editor_plugin' + tinymce.suffix + '.js'};\r
- var dep = PluginManager.createUrl(defaultSettings, dep);\r
+ dep = PluginManager.createUrl(defaultSettings, dep);\r
PluginManager.load(dep.resource, dep);\r
- \r
});\r
} else {\r
// Skip safari plugin, since it is removed as of 3.3b1\r
o = ThemeManager.get(s.theme);\r
t.theme = new o();\r
\r
- if (t.theme.init && s.init_theme)\r
+ if (t.theme.init)\r
t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, ''));\r
}\r
function initPlugin(p) {\r
\r
t.controlManager = new tinymce.ControlManager(t);\r
\r
- if (s.custom_undo_redo) {\r
- t.onBeforeExecCommand.add(function(ed, cmd, ui, val, a) {\r
- if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo))\r
- t.undoManager.beforeChange();\r
- });\r
-\r
- t.onExecCommand.add(function(ed, cmd, ui, val, a) {\r
- if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo))\r
- t.undoManager.add();\r
- });\r
- }\r
-\r
t.onExecCommand.add(function(ed, c) {\r
// Don't refresh the select lists until caret move\r
if (!/^(FontName|FontSize)$/.test(c))\r
t.nodeChanged();\r
});\r
\r
- // Remove ghost selections on images and tables in Gecko\r
- if (isGecko) {\r
- function repaint(a, o) {\r
- if (!o || !o.initial)\r
- t.execCommand('mceRepaint');\r
- };\r
-\r
- t.onUndo.add(repaint);\r
- t.onRedo.add(repaint);\r
- t.onSetContent.add(repaint);\r
- }\r
-\r
// Enables users to override the control factory\r
t.onBeforeRenderUI.dispatch(t, t.controlManager);\r
\r
// Measure box\r
- if (s.render_ui) {\r
+ if (s.render_ui && t.theme) {\r
w = s.width || e.style.width || e.offsetWidth;\r
h = s.height || e.style.height || e.offsetHeight;\r
t.orgDisplay = e.style.display;\r
re = /^[0-9\.]+(|px)$/i;\r
\r
if (re.test('' + w))\r
- w = Math.max(parseInt(w) + (o.deltaWidth || 0), 100);\r
+ w = Math.max(parseInt(w, 10) + (o.deltaWidth || 0), 100);\r
\r
if (re.test('' + h))\r
- h = Math.max(parseInt(h) + (o.deltaHeight || 0), 100);\r
+ h = Math.max(parseInt(h, 10) + (o.deltaHeight || 0), 100);\r
\r
// Render UI\r
o = t.theme.renderUI({\r
t.editorContainer = o.editorContainer;\r
}\r
\r
+ // Load specified content CSS last\r
+ if (s.content_css) {\r
+ each(explode(s.content_css), function(u) {\r
+ t.contentCSS.push(t.documentBaseURI.toAbsolute(u));\r
+ });\r
+ }\r
+\r
+ // Content editable mode ends here\r
+ if (s.content_editable) {\r
+ e = n = o = null; // Fix IE leak\r
+ return t.initContentBody();\r
+ }\r
\r
// User specified a document.domain value\r
if (document.domain && location.hostname != document.domain)\r
height : h\r
});\r
\r
- // Load specified content CSS last\r
- if (s.content_css) {\r
- tinymce.each(explode(s.content_css), function(u) {\r
- t.contentCSS.push(t.documentBaseURI.toAbsolute(u));\r
- });\r
- }\r
-\r
h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : '');\r
if (h < 100)\r
h = 100;\r
// Domain relaxing enabled, then set document domain\r
if (tinymce.relaxedDomain && (isIE || (tinymce.isOpera && parseFloat(opera.version()) < 11))) {\r
// We need to write the contents here in IE since multiple writes messes up refresh button and back button\r
- u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()';\r
+ u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.initContentBody();})()';\r
}\r
\r
// Create iframe\r
DOM.setAttrib(t.id, 'aria-hidden', true);\r
\r
if (!tinymce.relaxedDomain || !u)\r
- t.setupIframe();\r
+ t.initContentBody();\r
\r
e = n = o = null; // Cleanup\r
},\r
\r
- setupIframe : function() {\r
- var t = this, s = t.settings, e = DOM.get(t.id), d = t.getDoc(), h, b;\r
+ initContentBody : function() {\r
+ var self = this, settings = self.settings, targetElm = DOM.get(self.id), doc = self.getDoc(), html, body;\r
\r
// Setup iframe body\r
- if (!isIE || !tinymce.relaxedDomain) {\r
- d.open();\r
- d.write(t.iframeHTML);\r
- d.close();\r
+ if ((!isIE || !tinymce.relaxedDomain) && !settings.content_editable) {\r
+ doc.open();\r
+ doc.write(self.iframeHTML);\r
+ doc.close();\r
\r
if (tinymce.relaxedDomain)\r
- d.domain = tinymce.relaxedDomain;\r
+ doc.domain = tinymce.relaxedDomain;\r
+ }\r
+\r
+ if (settings.content_editable) {\r
+ DOM.addClass(targetElm, 'mceContentBody');\r
+ self.contentDocument = doc = settings.content_document || document;\r
+ self.contentWindow = settings.content_window || window;\r
+ self.bodyElement = targetElm;\r
+\r
+ // Prevent leak in IE\r
+ settings.content_document = settings.content_window = null;\r
}\r
\r
// It will not steal focus while setting contentEditable\r
- b = t.getBody();\r
- b.disabled = true;\r
+ body = self.getBody();\r
+ body.disabled = true;\r
\r
- if (!s.readonly)\r
- b.contentEditable = true;\r
+ if (!settings.readonly)\r
+ body.contentEditable = self.getParam('content_editable_state', true);\r
\r
- b.disabled = false;\r
+ body.disabled = false;\r
\r
- t.schema = new tinymce.html.Schema(s);\r
+ self.schema = new tinymce.html.Schema(settings);\r
\r
- t.dom = new tinymce.dom.DOMUtils(t.getDoc(), {\r
+ self.dom = new tinymce.dom.DOMUtils(doc, {\r
keep_values : true,\r
- url_converter : t.convertURL,\r
- url_converter_scope : t,\r
- hex_colors : s.force_hex_style_colors,\r
- class_filter : s.class_filter,\r
- update_styles : 1,\r
- fix_ie_paragraphs : 1,\r
- schema : t.schema\r
+ url_converter : self.convertURL,\r
+ url_converter_scope : self,\r
+ hex_colors : settings.force_hex_style_colors,\r
+ class_filter : settings.class_filter,\r
+ update_styles : true,\r
+ root_element : settings.content_editable ? self.id : null,\r
+ schema : self.schema\r
});\r
\r
- t.parser = new tinymce.html.DomParser(s, t.schema);\r
-\r
- // Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included.\r
- if (!t.settings.allow_html_in_named_anchor) {\r
- t.parser.addAttributeFilter('name', function(nodes, name) {\r
- var i = nodes.length, sibling, prevSibling, parent, node;\r
- \r
- while (i--) {\r
- node = nodes[i];\r
- if (node.name === 'a' && node.firstChild) {\r
- parent = node.parent;\r
- \r
- // Move children after current node\r
- sibling = node.lastChild;\r
- do {\r
- prevSibling = sibling.prev;\r
- parent.insert(sibling, node);\r
- sibling = prevSibling;\r
- } while (sibling);\r
- }\r
- }\r
- });\r
- }\r
+ self.parser = new tinymce.html.DomParser(settings, self.schema);\r
\r
// Convert src and href into data-mce-src, data-mce-href and data-mce-style\r
- t.parser.addAttributeFilter('src,href,style', function(nodes, name) {\r
- var i = nodes.length, node, dom = t.dom, value, internalName;\r
+ self.parser.addAttributeFilter('src,href,style', function(nodes, name) {\r
+ var i = nodes.length, node, dom = self.dom, value, internalName;\r
\r
while (i--) {\r
node = nodes[i];\r
if (name === "style")\r
node.attr(internalName, dom.serializeStyle(dom.parseStyle(value), node.name));\r
else\r
- node.attr(internalName, t.convertURL(value, name, node.name));\r
+ node.attr(internalName, self.convertURL(value, name, node.name));\r
}\r
}\r
});\r
\r
// Keep scripts from executing\r
- t.parser.addNodeFilter('script', function(nodes, name) {\r
+ self.parser.addNodeFilter('script', function(nodes, name) {\r
var i = nodes.length, node;\r
\r
while (i--) {\r
}\r
});\r
\r
- t.parser.addNodeFilter('#cdata', function(nodes, name) {\r
+ self.parser.addNodeFilter('#cdata', function(nodes, name) {\r
var i = nodes.length, node;\r
\r
while (i--) {\r
}\r
});\r
\r
- t.parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function(nodes, name) {\r
- var i = nodes.length, node, nonEmptyElements = t.schema.getNonEmptyElements();\r
+ self.parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function(nodes, name) {\r
+ var i = nodes.length, node, nonEmptyElements = self.schema.getNonEmptyElements();\r
\r
while (i--) {\r
node = nodes[i];\r
}\r
});\r
\r
- t.serializer = new tinymce.dom.Serializer(s, t.dom, t.schema);\r
+ self.serializer = new tinymce.dom.Serializer(settings, self.dom, self.schema);\r
\r
- t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer);\r
+ self.selection = new tinymce.dom.Selection(self.dom, self.getWin(), self.serializer);\r
\r
- t.formatter = new tinymce.Formatter(this);\r
+ self.formatter = new tinymce.Formatter(self);\r
\r
- // Register default formats\r
- t.formatter.register({\r
- alignleft : [\r
- {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}, defaultBlock: 'div'},\r
- {selector : 'img,table', collapsed : false, styles : {'float' : 'left'}}\r
- ],\r
-\r
- aligncenter : [\r
- {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}, defaultBlock: 'div'},\r
- {selector : 'img', collapsed : false, styles : {display : 'block', marginLeft : 'auto', marginRight : 'auto'}},\r
- {selector : 'table', collapsed : false, styles : {marginLeft : 'auto', marginRight : 'auto'}}\r
- ],\r
-\r
- alignright : [\r
- {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}, defaultBlock: 'div'},\r
- {selector : 'img,table', collapsed : false, styles : {'float' : 'right'}}\r
- ],\r
+ self.undoManager = new tinymce.UndoManager(self);\r
\r
- alignfull : [\r
- {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'justify'}, defaultBlock: 'div'}\r
- ],\r
-\r
- bold : [\r
- {inline : 'strong', remove : 'all'},\r
- {inline : 'span', styles : {fontWeight : 'bold'}},\r
- {inline : 'b', remove : 'all'}\r
- ],\r
-\r
- italic : [\r
- {inline : 'em', remove : 'all'},\r
- {inline : 'span', styles : {fontStyle : 'italic'}},\r
- {inline : 'i', remove : 'all'}\r
- ],\r
-\r
- underline : [\r
- {inline : 'span', styles : {textDecoration : 'underline'}, exact : true},\r
- {inline : 'u', remove : 'all'}\r
- ],\r
-\r
- strikethrough : [\r
- {inline : 'span', styles : {textDecoration : 'line-through'}, exact : true},\r
- {inline : 'strike', remove : 'all'}\r
- ],\r
-\r
- forecolor : {inline : 'span', styles : {color : '%value'}, wrap_links : false},\r
- hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}, wrap_links : false},\r
- fontname : {inline : 'span', styles : {fontFamily : '%value'}},\r
- fontsize : {inline : 'span', styles : {fontSize : '%value'}},\r
- fontsize_class : {inline : 'span', attributes : {'class' : '%value'}},\r
- blockquote : {block : 'blockquote', wrapper : 1, remove : 'all'},\r
- subscript : {inline : 'sub'},\r
- superscript : {inline : 'sup'},\r
-\r
- link : {inline : 'a', selector : 'a', remove : 'all', split : true, deep : true,\r
- onmatch : function(node) {\r
- return true;\r
- },\r
-\r
- onformat : function(elm, fmt, vars) {\r
- each(vars, function(value, key) {\r
- t.dom.setAttrib(elm, key, value);\r
- });\r
- }\r
- },\r
-\r
- removeformat : [\r
- {selector : 'b,strong,em,i,font,u,strike', remove : 'all', split : true, expand : false, block_expand : true, deep : true},\r
- {selector : 'span', attributes : ['style', 'class'], remove : 'empty', split : true, expand : false, deep : true},\r
- {selector : '*', attributes : ['style', 'class'], split : false, expand : false, deep : true}\r
- ]\r
- });\r
-\r
- // Register default block formats\r
- each('p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp'.split(/\s/), function(name) {\r
- t.formatter.register(name, {block : name, remove : 'all'});\r
- });\r
-\r
- // Register user defined formats\r
- t.formatter.register(t.settings.formats);\r
-\r
- t.undoManager = new tinymce.UndoManager(t);\r
-\r
- // Pass through\r
- t.undoManager.onAdd.add(function(um, l) {\r
- if (um.hasUndo())\r
- return t.onChange.dispatch(t, l, um);\r
- });\r
-\r
- t.undoManager.onUndo.add(function(um, l) {\r
- return t.onUndo.dispatch(t, l, um);\r
- });\r
-\r
- t.undoManager.onRedo.add(function(um, l) {\r
- return t.onRedo.dispatch(t, l, um);\r
- });\r
-\r
- t.forceBlocks = new tinymce.ForceBlocks(t);\r
- t.enterKey = new tinymce.EnterKey(t);\r
-\r
- t.editorCommands = new tinymce.EditorCommands(t);\r
+ self.forceBlocks = new tinymce.ForceBlocks(self);\r
+ self.enterKey = new tinymce.EnterKey(self);\r
+ self.editorCommands = new tinymce.EditorCommands(self);\r
\r
// Pass through\r
- t.serializer.onPreProcess.add(function(se, o) {\r
- return t.onPreProcess.dispatch(t, o, se);\r
+ self.serializer.onPreProcess.add(function(se, o) {\r
+ return self.onPreProcess.dispatch(self, o, se);\r
});\r
\r
- t.serializer.onPostProcess.add(function(se, o) {\r
- return t.onPostProcess.dispatch(t, o, se);\r
+ self.serializer.onPostProcess.add(function(se, o) {\r
+ return self.onPostProcess.dispatch(self, o, se);\r
});\r
\r
- t.onPreInit.dispatch(t);\r
-\r
- if (!s.gecko_spellcheck)\r
- t.getBody().spellcheck = 0;\r
-\r
- if (!s.readonly)\r
- t._addEvents();\r
-\r
- t.controlManager.onPostRender.dispatch(t, t.controlManager);\r
- t.onPostRender.dispatch(t);\r
+ self.onPreInit.dispatch(self);\r
\r
- t.quirks = new tinymce.util.Quirks(this);\r
+ if (!settings.gecko_spellcheck)\r
+ doc.body.spellcheck = false;\r
\r
- if (s.directionality)\r
- t.getBody().dir = s.directionality;\r
-\r
- if (s.nowrap)\r
- t.getBody().style.whiteSpace = "nowrap";\r
-\r
- if (s.handle_node_change_callback) {\r
- t.onNodeChange.add(function(ed, cm, n) {\r
- t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed());\r
- });\r
+ if (!settings.readonly) {\r
+ self.bindNativeEvents();\r
}\r
\r
- if (s.save_callback) {\r
- t.onSaveContent.add(function(ed, o) {\r
- var h = t.execCallback('save_callback', t.id, o.content, t.getBody());\r
+ self.controlManager.onPostRender.dispatch(self, self.controlManager);\r
+ self.onPostRender.dispatch(self);\r
\r
- if (h)\r
- o.content = h;\r
- });\r
- }\r
-\r
- if (s.onchange_callback) {\r
- t.onChange.add(function(ed, l) {\r
- t.execCallback('onchange_callback', t, l);\r
- });\r
- }\r
-\r
- if (s.protect) {\r
- t.onBeforeSetContent.add(function(ed, o) {\r
- if (s.protect) {\r
- each(s.protect, function(pattern) {\r
- o.content = o.content.replace(pattern, function(str) {\r
- return '<!--mce:protected ' + escape(str) + '-->';\r
- });\r
- });\r
- }\r
- });\r
- }\r
-\r
- if (s.convert_newlines_to_brs) {\r
- t.onBeforeSetContent.add(function(ed, o) {\r
- if (o.initial)\r
- o.content = o.content.replace(/\r?\n/g, '<br />');\r
- });\r
- }\r
+ self.quirks = tinymce.util.Quirks(self);\r
\r
- if (s.preformatted) {\r
- t.onPostProcess.add(function(ed, o) {\r
- o.content = o.content.replace(/^\s*<pre.*?>/, '');\r
- o.content = o.content.replace(/<\/pre>\s*$/, '');\r
+ if (settings.directionality)\r
+ body.dir = settings.directionality;\r
\r
- if (o.set)\r
- o.content = '<pre class="mceItemHidden">' + o.content + '</pre>';\r
- });\r
- }\r
-\r
- if (s.verify_css_classes) {\r
- t.serializer.attribValueFilter = function(n, v) {\r
- var s, cl;\r
-\r
- if (n == 'class') {\r
- // Build regexp for classes\r
- if (!t.classesRE) {\r
- cl = t.dom.getClasses();\r
-\r
- if (cl.length > 0) {\r
- s = '';\r
-\r
- each (cl, function(o) {\r
- s += (s ? '|' : '') + o['class'];\r
- });\r
+ if (settings.nowrap)\r
+ body.style.whiteSpace = "nowrap";\r
\r
- t.classesRE = new RegExp('(' + s + ')', 'gi');\r
- }\r
- }\r
-\r
- return !t.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v) || t.classesRE.test(v) ? v : '';\r
- }\r
-\r
- return v;\r
- };\r
- }\r
-\r
- if (s.cleanup_callback) {\r
- t.onBeforeSetContent.add(function(ed, o) {\r
- o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);\r
- });\r
-\r
- t.onPreProcess.add(function(ed, o) {\r
- if (o.set)\r
- t.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o);\r
-\r
- if (o.get)\r
- t.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o);\r
- });\r
-\r
- t.onPostProcess.add(function(ed, o) {\r
- if (o.set)\r
- o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);\r
-\r
- if (o.get) \r
- o.content = t.execCallback('cleanup_callback', 'get_from_editor', o.content, o);\r
- });\r
- }\r
-\r
- if (s.save_callback) {\r
- t.onGetContent.add(function(ed, o) {\r
- if (o.save)\r
- o.content = t.execCallback('save_callback', t.id, o.content, t.getBody());\r
- });\r
- }\r
-\r
- if (s.handle_event_callback) {\r
- t.onEvent.add(function(ed, e, o) {\r
- if (t.execCallback('handle_event_callback', e, ed, o) === false)\r
- Event.cancel(e);\r
+ if (settings.protect) {\r
+ self.onBeforeSetContent.add(function(ed, o) {\r
+ each(settings.protect, function(pattern) {\r
+ o.content = o.content.replace(pattern, function(str) {\r
+ return '<!--mce:protected ' + escape(str) + '-->';\r
+ });\r
+ });\r
});\r
}\r
\r
// Add visual aids when new contents is added\r
- t.onSetContent.add(function() {\r
- t.addVisual(t.getBody());\r
+ self.onSetContent.add(function() {\r
+ self.addVisual(self.getBody());\r
});\r
\r
// Remove empty contents\r
- if (s.padd_empty_editor) {\r
- t.onPostProcess.add(function(ed, o) {\r
+ if (settings.padd_empty_editor) {\r
+ self.onPostProcess.add(function(ed, o) {\r
o.content = o.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/, '');\r
});\r
}\r
\r
- if (isGecko) {\r
- // Fix gecko link bug, when a link is placed at the end of block elements there is\r
- // no way to move the caret behind the link. This fix adds a bogus br element after the link\r
- function fixLinks(ed, o) {\r
- each(ed.dom.select('a'), function(n) {\r
- var pn = n.parentNode;\r
-\r
- if (ed.dom.isBlock(pn) && pn.lastChild === n)\r
- ed.dom.add(pn, 'br', {'data-mce-bogus' : 1});\r
- });\r
- };\r
+ self.load({initial : true, format : 'html'});\r
+ self.startContent = self.getContent({format : 'raw'});\r
\r
- t.onExecCommand.add(function(ed, cmd) {\r
- if (cmd === 'CreateLink')\r
- fixLinks(ed);\r
- });\r
-\r
- t.onSetContent.add(t.selection.onSetContent.add(fixLinks));\r
- }\r
+ self.initialized = true;\r
\r
- t.load({initial : true, format : 'html'});\r
- t.startContent = t.getContent({format : 'raw'});\r
- t.undoManager.add();\r
- t.initialized = true;\r
-\r
- t.onInit.dispatch(t);\r
- t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc());\r
- t.execCallback('init_instance_callback', t);\r
- t.focus(true);\r
- t.nodeChanged({initial : 1});\r
+ self.onInit.dispatch(self);\r
+ self.execCallback('setupcontent_callback', self.id, body, doc);\r
+ self.execCallback('init_instance_callback', self);\r
+ self.focus(true);\r
+ self.nodeChanged({initial : true});\r
\r
// Load specified content CSS last\r
- each(t.contentCSS, function(u) {\r
- t.dom.loadCSS(u);\r
+ each(self.contentCSS, function(url) {\r
+ self.dom.loadCSS(url);\r
});\r
\r
// Handle auto focus\r
- if (s.auto_focus) {\r
+ if (settings.auto_focus) {\r
setTimeout(function () {\r
- var ed = tinymce.get(s.auto_focus);\r
+ var ed = tinymce.get(settings.auto_focus);\r
\r
ed.selection.select(ed.getBody(), 1);\r
ed.selection.collapse(1);\r
}, 100);\r
}\r
\r
- e = null;\r
+ // Clean up references for IE\r
+ targetElm = doc = body = null;\r
},\r
\r
+ focus : function(skip_focus) {\r
+ var oed, self = this, selection = self.selection, contentEditable = self.settings.content_editable, ieRng, controlElm, doc = self.getDoc(), body;\r
\r
- focus : function(sf) {\r
- var oed, t = this, selection = t.selection, ce = t.settings.content_editable, ieRng, controlElm, doc = t.getDoc();\r
-\r
- if (!sf) {\r
+ if (!skip_focus) {\r
// Get selected control element\r
ieRng = selection.getRng();\r
if (ieRng.item) {\r
controlElm = ieRng.item(0);\r
}\r
\r
- t._refreshContentEditable();\r
+ self._refreshContentEditable();\r
\r
- // Is not content editable\r
- if (!ce)\r
- t.getWin().focus();\r
+ // Focus the window iframe\r
+ if (!contentEditable) {\r
+ self.getWin().focus();\r
+ }\r
\r
// Focus the body as well since it's contentEditable\r
- if (tinymce.isGecko) {\r
- t.getBody().focus();\r
+ if (tinymce.isGecko || contentEditable) {\r
+ body = self.getBody();\r
+\r
+ // Check for setActive since it doesn't scroll to the element\r
+ if (body.setActive) {\r
+ body.setActive();\r
+ } else {\r
+ body.focus();\r
+ }\r
+\r
+ if (contentEditable) {\r
+ selection.normalize();\r
+ }\r
}\r
\r
// Restore selected control element\r
ieRng.addElement(controlElm);\r
ieRng.select();\r
}\r
-\r
}\r
\r
- if (tinymce.activeEditor != t) {\r
+ if (tinymce.activeEditor != self) {\r
if ((oed = tinymce.activeEditor) != null)\r
- oed.onDeactivate.dispatch(oed, t);\r
+ oed.onDeactivate.dispatch(oed, self);\r
\r
- t.onActivate.dispatch(t, oed);\r
+ self.onActivate.dispatch(self, oed);\r
}\r
\r
- tinymce._setActive(t);\r
+ tinymce._setActive(self);\r
},\r
\r
execCallback : function(n) {\r
if (!s)\r
return '';\r
\r
- return i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) {\r
+ return i18n[c + '.' + s] || s.replace(/\{\#([^\}]+)\}/g, function(a, b) {\r
return i18n[c + '.' + b] || '{#' + b + '}';\r
});\r
},\r
},\r
\r
nodeChanged : function(o) {\r
- var t = this, s = t.selection, n = s.getStart() || t.getBody();\r
+ var self = this, selection = self.selection, node;\r
\r
// Fix for bug #1896577 it seems that this can not be fired while the editor is loading\r
- if (t.initialized) {\r
+ if (self.initialized) {\r
o = o || {};\r
- n = isIE && n.ownerDocument != t.getDoc() ? t.getBody() : n; // Fix for IE initial state\r
+\r
+ // Get start node\r
+ node = selection.getStart() || self.getBody();\r
+ node = isIE && node.ownerDocument != self.getDoc() ? self.getBody() : node; // Fix for IE initial state\r
\r
// Get parents and add them to object\r
o.parents = [];\r
- t.dom.getParent(n, function(node) {\r
+ self.dom.getParent(node, function(node) {\r
if (node.nodeName == 'BODY')\r
return true;\r
\r
o.parents.push(node);\r
});\r
\r
- t.onNodeChange.dispatch(\r
- t,\r
- o ? o.controlManager || t.controlManager : t.controlManager,\r
- n,\r
- s.isCollapsed(),\r
+ self.onNodeChange.dispatch(\r
+ self,\r
+ o ? o.controlManager || self.controlManager : self.controlManager,\r
+ node,\r
+ selection.isCollapsed(),\r
o\r
);\r
}\r
},\r
\r
- addButton : function(n, s) {\r
- var t = this;\r
+ addButton : function(name, settings) {\r
+ var self = this;\r
\r
- t.buttons = t.buttons || {};\r
- t.buttons[n] = s;\r
+ self.buttons = self.buttons || {};\r
+ self.buttons[name] = settings;\r
},\r
\r
addCommand : function(name, callback, scope) {\r
addShortcut : function(pa, desc, cmd_func, sc) {\r
var t = this, c;\r
\r
- if (!t.settings.custom_shortcuts)\r
+ if (t.settings.custom_shortcuts === false)\r
return false;\r
\r
t.shortcuts = t.shortcuts || {};\r
var o = {\r
func : cmd_func,\r
scope : sc || this,\r
- desc : desc,\r
+ desc : t.translate(desc),\r
alt : false,\r
ctrl : false,\r
shift : false\r
},\r
\r
show : function() {\r
- var t = this;\r
+ var self = this;\r
\r
- DOM.show(t.getContainer());\r
- DOM.hide(t.id);\r
- t.load();\r
+ DOM.show(self.getContainer());\r
+ DOM.hide(self.id);\r
+ self.load();\r
},\r
\r
hide : function() {\r
- var t = this, d = t.getDoc();\r
+ var self = this, doc = self.getDoc();\r
\r
// Fixed bug where IE has a blinking cursor left from the editor\r
- if (isIE && d)\r
- d.execCommand('SelectAll');\r
+ if (isIE && doc)\r
+ doc.execCommand('SelectAll');\r
\r
// We must save before we hide so Safari doesn't crash\r
- t.save();\r
- DOM.hide(t.getContainer());\r
- DOM.setStyle(t.id, 'display', t.orgDisplay);\r
+ self.save();\r
+ DOM.hide(self.getContainer());\r
+ DOM.setStyle(self.id, 'display', self.orgDisplay);\r
},\r
\r
isHidden : function() {\r
o = o || {};\r
o.save = true;\r
\r
- // Add undo level will trigger onchange event\r
- if (!o.no_events) {\r
- t.undoManager.typing = false;\r
- t.undoManager.add();\r
- }\r
-\r
o.element = e;\r
h = o.content = t.getContent(o);\r
\r
args = args || {};\r
args.format = args.format || 'html';\r
args.get = true;\r
+ args.getInner = true;\r
\r
// Do preprocessing\r
if (!args.no_events)\r
},\r
\r
getContainer : function() {\r
- var t = this;\r
+ var self = this;\r
\r
- if (!t.container)\r
- t.container = DOM.get(t.editorContainer || t.id + '_parent');\r
+ if (!self.container)\r
+ self.container = DOM.get(self.editorContainer || self.id + '_parent');\r
\r
- return t.container;\r
+ return self.container;\r
},\r
\r
getContentAreaContainer : function() {\r
},\r
\r
getWin : function() {\r
- var t = this, e;\r
+ var self = this, elm;\r
\r
- if (!t.contentWindow) {\r
- e = DOM.get(t.id + "_ifr");\r
+ if (!self.contentWindow) {\r
+ elm = DOM.get(self.id + "_ifr");\r
\r
- if (e)\r
- t.contentWindow = e.contentWindow;\r
+ if (elm)\r
+ self.contentWindow = elm.contentWindow;\r
}\r
\r
- return t.contentWindow;\r
+ return self.contentWindow;\r
},\r
\r
getDoc : function() {\r
- var t = this, w;\r
+ var self = this, win;\r
\r
- if (!t.contentDocument) {\r
- w = t.getWin();\r
+ if (!self.contentDocument) {\r
+ win = self.getWin();\r
\r
- if (w)\r
- t.contentDocument = w.document;\r
+ if (win)\r
+ self.contentDocument = win.document;\r
}\r
\r
- return t.contentDocument;\r
+ return self.contentDocument;\r
},\r
\r
getBody : function() {\r
return this.bodyElement || this.getDoc().body;\r
},\r
\r
- convertURL : function(u, n, e) {\r
- var t = this, s = t.settings;\r
+ convertURL : function(url, name, elm) {\r
+ var self = this, settings = self.settings;\r
\r
// Use callback instead\r
- if (s.urlconverter_callback)\r
- return t.execCallback('urlconverter_callback', u, e, true, n);\r
+ if (settings.urlconverter_callback)\r
+ return self.execCallback('urlconverter_callback', url, elm, true, name);\r
\r
// Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs\r
- if (!s.convert_urls || (e && e.nodeName == 'LINK') || u.indexOf('file:') === 0)\r
- return u;\r
+ if (!settings.convert_urls || (elm && elm.nodeName == 'LINK') || url.indexOf('file:') === 0)\r
+ return url;\r
\r
// Convert to relative\r
- if (s.relative_urls)\r
- return t.documentBaseURI.toRelative(u);\r
+ if (settings.relative_urls)\r
+ return self.documentBaseURI.toRelative(url);\r
\r
// Convert to absolute\r
- u = t.documentBaseURI.toAbsolute(u, s.remove_script_host);\r
+ url = self.documentBaseURI.toAbsolute(url, settings.remove_script_host);\r
\r
- return u;\r
+ return url;\r
},\r
\r
- addVisual : function(e) {\r
- var t = this, s = t.settings;\r
+ addVisual : function(elm) {\r
+ var self = this, settings = self.settings, dom = self.dom, cls;\r
\r
- e = e || t.getBody();\r
+ elm = elm || self.getBody();\r
\r
- if (!is(t.hasVisual))\r
- t.hasVisual = s.visual;\r
+ if (!is(self.hasVisual))\r
+ self.hasVisual = settings.visual;\r
\r
- each(t.dom.select('table,a', e), function(e) {\r
- var v;\r
+ each(dom.select('table,a', elm), function(elm) {\r
+ var value;\r
\r
- switch (e.nodeName) {\r
+ switch (elm.nodeName) {\r
case 'TABLE':\r
- v = t.dom.getAttrib(e, 'border');\r
+ cls = settings.visual_table_class || 'mceItemTable';\r
+ value = dom.getAttrib(elm, 'border');\r
\r
- if (!v || v == '0') {\r
- if (t.hasVisual)\r
- t.dom.addClass(e, s.visual_table_class);\r
+ if (!value || value == '0') {\r
+ if (self.hasVisual)\r
+ dom.addClass(elm, cls);\r
else\r
- t.dom.removeClass(e, s.visual_table_class);\r
+ dom.removeClass(elm, cls);\r
}\r
\r
return;\r
\r
case 'A':\r
- v = t.dom.getAttrib(e, 'name');\r
+ value = dom.getAttrib(elm, 'name');\r
+ cls = 'mceItemAnchor';\r
\r
- if (v) {\r
- if (t.hasVisual)\r
- t.dom.addClass(e, 'mceItemAnchor');\r
+ if (value) {\r
+ if (self.hasVisual)\r
+ dom.addClass(elm, cls);\r
else\r
- t.dom.removeClass(e, 'mceItemAnchor');\r
+ dom.removeClass(elm, cls);\r
}\r
\r
return;\r
}\r
});\r
\r
- t.onVisualAid.dispatch(t, e, t.hasVisual);\r
+ self.onVisualAid.dispatch(self, elm, self.hasVisual);\r
},\r
\r
remove : function() {\r
- var t = this, e = t.getContainer();\r
+ var self = this, elm = self.getContainer();\r
\r
- if (!t.removed) {\r
- t.removed = 1; // Cancels post remove event execution\r
- t.hide();\r
-\r
- // Remove all events\r
+ if (!self.removed) {\r
+ self.removed = 1; // Cancels post remove event execution\r
+ self.hide();\r
\r
// Don't clear the window or document if content editable\r
// is enabled since other instances might still be present\r
- if (!t.settings.content_editable) {\r
- Event.clear(t.getWin());\r
- Event.clear(t.getDoc());\r
+ if (!self.settings.content_editable) {\r
+ Event.clear(self.getWin());\r
+ Event.clear(self.getDoc());\r
}\r
\r
- Event.clear(t.getBody());\r
- Event.clear(t.formElement);\r
- Event.unbind(e);\r
+ Event.clear(self.getBody());\r
+ Event.clear(self.formElement);\r
+ Event.unbind(elm);\r
\r
- t.execCallback('remove_instance_callback', t);\r
- t.onRemove.dispatch(t);\r
+ self.execCallback('remove_instance_callback', self);\r
+ self.onRemove.dispatch(self);\r
\r
// Clear all execCommand listeners this is required to avoid errors if the editor was removed inside another command\r
- t.onExecCommand.listeners = [];\r
+ self.onExecCommand.listeners = [];\r
\r
- tinymce.remove(t);\r
- DOM.remove(e);\r
+ tinymce.remove(self);\r
+ DOM.remove(elm);\r
}\r
},\r
\r
\r
// Internal functions\r
\r
- _addEvents : function() {\r
- // 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset\r
- var t = this, i, s = t.settings, dom = t.dom, lo = {\r
- mouseup : 'onMouseUp',\r
- mousedown : 'onMouseDown',\r
- click : 'onClick',\r
- keyup : 'onKeyUp',\r
- keydown : 'onKeyDown',\r
- keypress : 'onKeyPress',\r
- submit : 'onSubmit',\r
- reset : 'onReset',\r
- contextmenu : 'onContextMenu',\r
- dblclick : 'onDblClick',\r
- paste : 'onPaste' // Doesn't work in all browsers yet\r
- };\r
+ _refreshContentEditable : function() {\r
+ var self = this, body, parent;\r
\r
- function eventHandler(e, o) {\r
- var ty = e.type;\r
+ // Check if the editor was hidden and the re-initalize contentEditable mode by removing and adding the body again\r
+ if (self._isHidden()) {\r
+ body = self.getBody();\r
+ parent = body.parentNode;\r
\r
- // Don't fire events when it's removed\r
- if (t.removed)\r
- return;\r
+ parent.removeChild(body);\r
+ parent.appendChild(body);\r
\r
- // Generic event handler\r
- if (t.onEvent.dispatch(t, e, o) !== false) {\r
- // Specific event handler\r
- t[lo[e.fakeType || e.type]].dispatch(t, e, o);\r
- }\r
- };\r
+ body.focus();\r
+ }\r
+ },\r
\r
- // Add DOM events\r
- each(lo, function(v, k) {\r
- switch (k) {\r
- case 'contextmenu':\r
- dom.bind(t.getDoc(), k, eventHandler);\r
- break;\r
+ _isHidden : function() {\r
+ var s;\r
\r
- case 'paste':\r
- dom.bind(t.getBody(), k, function(e) {\r
- eventHandler(e);\r
- });\r
- break;\r
+ if (!isGecko)\r
+ return 0;\r
\r
- case 'submit':\r
- case 'reset':\r
- dom.bind(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler);\r
- break;\r
+ // Weird, wheres that cursor selection?\r
+ s = this.selection.getSel();\r
+ return (!s || !s.rangeCount || s.rangeCount === 0);\r
+ }\r
+ });\r
+})(tinymce);\r
+(function(tinymce) {\r
+ var each = tinymce.each;\r
\r
- default:\r
- dom.bind(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler);\r
- }\r
- });\r
+ tinymce.Editor.prototype.setupEvents = function() {\r
+ var self = this, settings = self.settings;\r
\r
- dom.bind(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) {\r
- t.focus(true);\r
- });\r
+ // Add events to the editor\r
+ each([\r
+ 'onPreInit',\r
\r
+ 'onBeforeRenderUI',\r
\r
- // Fixes bug where a specified document_base_uri could result in broken images\r
- // This will also fix drag drop of images in Gecko\r
- if (tinymce.isGecko) {\r
- dom.bind(t.getDoc(), 'DOMNodeInserted', function(e) {\r
- var v;\r
+ 'onPostRender',\r
\r
- e = e.target;\r
+ 'onLoad',\r
\r
- if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('data-mce-src')))\r
- e.src = t.documentBaseURI.toAbsolute(v);\r
- });\r
- }\r
+ 'onInit',\r
\r
- // Set various midas options in Gecko\r
- if (isGecko) {\r
- function setOpts() {\r
- var t = this, d = t.getDoc(), s = t.settings;\r
+ 'onRemove',\r
\r
- if (isGecko && !s.readonly) {\r
- t._refreshContentEditable();\r
+ 'onActivate',\r
\r
- try {\r
- // Try new Gecko method\r
- d.execCommand("styleWithCSS", 0, false);\r
- } catch (ex) {\r
- // Use old method\r
- if (!t._isHidden())\r
- try {d.execCommand("useCSS", 0, true);} catch (ex) {}\r
- }\r
+ 'onDeactivate',\r
\r
- if (!s.table_inline_editing)\r
- try {d.execCommand('enableInlineTableEditing', false, false);} catch (ex) {}\r
+ 'onClick',\r
\r
- if (!s.object_resizing)\r
- try {d.execCommand('enableObjectResizing', false, false);} catch (ex) {}\r
- }\r
- };\r
+ 'onEvent',\r
\r
- t.onBeforeExecCommand.add(setOpts);\r
- t.onMouseDown.add(setOpts);\r
- }\r
+ 'onMouseUp',\r
\r
- // Add node change handlers\r
- t.onMouseUp.add(t.nodeChanged);\r
- //t.onClick.add(t.nodeChanged);\r
- t.onKeyUp.add(function(ed, e) {\r
- var c = e.keyCode;\r
+ 'onMouseDown',\r
\r
- if ((c >= 33 && c <= 36) || (c >= 37 && c <= 40) || c == 13 || c == 45 || c == 46 || c == 8 || (tinymce.isMac && (c == 91 || c == 93)) || e.ctrlKey)\r
- t.nodeChanged();\r
- });\r
+ 'onDblClick',\r
\r
+ 'onKeyDown',\r
\r
- // Add block quote deletion handler\r
- t.onKeyDown.add(function(ed, e) {\r
- if (e.keyCode != VK.BACKSPACE)\r
- return;\r
+ 'onKeyUp',\r
\r
- var rng = ed.selection.getRng();\r
- if (!rng.collapsed)\r
- return;\r
+ 'onKeyPress',\r
\r
- var n = rng.startContainer;\r
- var offset = rng.startOffset;\r
+ 'onContextMenu',\r
\r
- while (n && n.nodeType && n.nodeType != 1 && n.parentNode)\r
- n = n.parentNode;\r
+ 'onSubmit',\r
\r
- // Is the cursor at the beginning of a blockquote?\r
- if (n && n.parentNode && n.parentNode.tagName === 'BLOCKQUOTE' && n.parentNode.firstChild == n && offset == 0) {\r
- // Remove the blockquote\r
- ed.formatter.toggle('blockquote', null, n.parentNode);\r
+ 'onReset',\r
\r
- // Move the caret to the beginning of n\r
- rng.setStart(n, 0);\r
- rng.setEnd(n, 0);\r
- ed.selection.setRng(rng);\r
- ed.selection.collapse(false);\r
- }\r
- });\r
+ 'onPaste',\r
\r
+ 'onPreProcess',\r
\r
+ 'onPostProcess',\r
\r
- // Add reset handler\r
- t.onReset.add(function() {\r
- t.setContent(t.startContent, {format : 'raw'});\r
- });\r
+ 'onBeforeSetContent',\r
\r
- // Add shortcuts\r
- if (s.custom_shortcuts) {\r
- if (s.custom_undo_redo_keyboard_shortcuts) {\r
- t.addShortcut('ctrl+z', t.getLang('undo_desc'), 'Undo');\r
- t.addShortcut('ctrl+y', t.getLang('redo_desc'), 'Redo');\r
- }\r
+ 'onBeforeGetContent',\r
\r
- // Add default shortcuts for gecko\r
- t.addShortcut('ctrl+b', t.getLang('bold_desc'), 'Bold');\r
- t.addShortcut('ctrl+i', t.getLang('italic_desc'), 'Italic');\r
- t.addShortcut('ctrl+u', t.getLang('underline_desc'), 'Underline');\r
+ 'onSetContent',\r
\r
- // BlockFormat shortcuts keys\r
- for (i=1; i<=6; i++)\r
- t.addShortcut('ctrl+' + i, '', ['FormatBlock', false, 'h' + i]);\r
+ 'onGetContent',\r
\r
- t.addShortcut('ctrl+7', '', ['FormatBlock', false, 'p']);\r
- t.addShortcut('ctrl+8', '', ['FormatBlock', false, 'div']);\r
- t.addShortcut('ctrl+9', '', ['FormatBlock', false, 'address']);\r
+ 'onLoadContent',\r
\r
- function find(e) {\r
- var v = null;\r
+ 'onSaveContent',\r
\r
- if (!e.altKey && !e.ctrlKey && !e.metaKey)\r
- return v;\r
+ 'onNodeChange',\r
\r
- each(t.shortcuts, function(o) {\r
- if (tinymce.isMac && o.ctrl != e.metaKey)\r
- return;\r
- else if (!tinymce.isMac && o.ctrl != e.ctrlKey)\r
- return;\r
+ 'onChange',\r
\r
- if (o.alt != e.altKey)\r
- return;\r
+ 'onBeforeExecCommand',\r
\r
- if (o.shift != e.shiftKey)\r
- return;\r
+ 'onExecCommand',\r
\r
- if (e.keyCode == o.keyCode || (e.charCode && e.charCode == o.charCode)) {\r
- v = o;\r
- return false;\r
- }\r
- });\r
+ 'onUndo',\r
\r
- return v;\r
- };\r
+ 'onRedo',\r
\r
- t.onKeyUp.add(function(ed, e) {\r
- var o = find(e);\r
+ 'onVisualAid',\r
\r
- if (o)\r
- return Event.cancel(e);\r
- });\r
+ 'onSetProgressState',\r
+\r
+ 'onSetAttrib'\r
+ ], function(name) {\r
+ self[name] = new tinymce.util.Dispatcher(self);\r
+ });\r
+\r
+ // Handle legacy cleanup_callback option\r
+ if (settings.cleanup_callback) {\r
+ self.onBeforeSetContent.add(function(ed, o) {\r
+ o.content = ed.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);\r
+ });\r
+\r
+ self.onPreProcess.add(function(ed, o) {\r
+ if (o.set)\r
+ ed.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o);\r
+\r
+ if (o.get)\r
+ ed.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o);\r
+ });\r
\r
- t.onKeyPress.add(function(ed, e) {\r
- var o = find(e);\r
+ self.onPostProcess.add(function(ed, o) {\r
+ if (o.set)\r
+ o.content = ed.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);\r
+\r
+ if (o.get) \r
+ o.content = ed.execCallback('cleanup_callback', 'get_from_editor', o.content, o);\r
+ });\r
+ }\r
+\r
+ // Handle legacy save_callback option\r
+ if (settings.save_callback) {\r
+ self.onGetContent.add(function(ed, o) {\r
+ if (o.save)\r
+ o.content = ed.execCallback('save_callback', ed.id, o.content, ed.getBody());\r
+ });\r
+ }\r
+\r
+ // Handle legacy handle_event_callback option\r
+ if (settings.handle_event_callback) {\r
+ self.onEvent.add(function(ed, e, o) {\r
+ if (self.execCallback('handle_event_callback', e, ed, o) === false)\r
+ Event.cancel(e);\r
+ });\r
+ }\r
+\r
+ // Handle legacy handle_node_change_callback option\r
+ if (settings.handle_node_change_callback) {\r
+ self.onNodeChange.add(function(ed, cm, n) {\r
+ ed.execCallback('handle_node_change_callback', ed.id, n, -1, -1, true, ed.selection.isCollapsed());\r
+ });\r
+ }\r
+\r
+ // Handle legacy save_callback option\r
+ if (settings.save_callback) {\r
+ self.onSaveContent.add(function(ed, o) {\r
+ var h = ed.execCallback('save_callback', ed.id, o.content, ed.getBody());\r
+\r
+ if (h)\r
+ o.content = h;\r
+ });\r
+ }\r
\r
- if (o)\r
- return Event.cancel(e);\r
- });\r
+ // Handle legacy onchange_callback option\r
+ if (settings.onchange_callback) {\r
+ self.onChange.add(function(ed, l) {\r
+ ed.execCallback('onchange_callback', ed, l);\r
+ });\r
+ }\r
+ };\r
\r
- t.onKeyDown.add(function(ed, e) {\r
- var o = find(e);\r
+ tinymce.Editor.prototype.bindNativeEvents = function() {\r
+ // 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset\r
+ var self = this, i, settings = self.settings, dom = self.dom, nativeToDispatcherMap;\r
+\r
+ nativeToDispatcherMap = {\r
+ mouseup : 'onMouseUp',\r
+ mousedown : 'onMouseDown',\r
+ click : 'onClick',\r
+ keyup : 'onKeyUp',\r
+ keydown : 'onKeyDown',\r
+ keypress : 'onKeyPress',\r
+ submit : 'onSubmit',\r
+ reset : 'onReset',\r
+ contextmenu : 'onContextMenu',\r
+ dblclick : 'onDblClick',\r
+ paste : 'onPaste' // Doesn't work in all browsers yet\r
+ };\r
\r
- if (o) {\r
- o.func.call(o.scope);\r
- return Event.cancel(e);\r
- }\r
- });\r
- }\r
+ // Handler that takes a native event and sends it out to a dispatcher like onKeyDown\r
+ function eventHandler(evt, args) {\r
+ var type = evt.type;\r
\r
- if (tinymce.isIE) {\r
- // Fix so resize will only update the width and height attributes not the styles of an image\r
- // It will also block mceItemNoResize items\r
- dom.bind(t.getDoc(), 'controlselect', function(e) {\r
- var re = t.resizeInfo, cb;\r
+ // Don't fire events when it's removed\r
+ if (self.removed)\r
+ return;\r
\r
- e = e.target;\r
+ // Sends the native event out to a global dispatcher then to the specific event dispatcher\r
+ if (self.onEvent.dispatch(self, evt, args) !== false) {\r
+ self[nativeToDispatcherMap[evt.fakeType || evt.type]].dispatch(self, evt, args);\r
+ }\r
+ };\r
\r
- // Don't do this action for non image elements\r
- if (e.nodeName !== 'IMG')\r
- return;\r
+ // Opera doesn't support focus event for contentEditable elements so we need to fake it\r
+ function doOperaFocus(e) {\r
+ self.focus(true);\r
+ };\r
\r
- if (re)\r
- dom.unbind(re.node, re.ev, re.cb);\r
+ function nodeChanged() {\r
+ // Normalize selection for example <b>a</b><i>|a</i> becomes <b>a|</b><i>a</i>\r
+ self.selection.normalize();\r
+ self.nodeChanged();\r
+ }\r
\r
- if (!dom.hasClass(e, 'mceItemNoResize')) {\r
- ev = 'resizeend';\r
- cb = dom.bind(e, ev, function(e) {\r
- var v;\r
+ // Add DOM events\r
+ each(nativeToDispatcherMap, function(dispatcherName, nativeName) {\r
+ var root = settings.content_editable ? self.getBody() : self.getDoc();\r
\r
- e = e.target;\r
+ switch (nativeName) {\r
+ case 'contextmenu':\r
+ dom.bind(root, nativeName, eventHandler);\r
+ break;\r
\r
- if (v = dom.getStyle(e, 'width')) {\r
- dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, ''));\r
- dom.setStyle(e, 'width', '');\r
- }\r
+ case 'paste':\r
+ dom.bind(self.getBody(), nativeName, eventHandler);\r
+ break;\r
\r
- if (v = dom.getStyle(e, 'height')) {\r
- dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, ''));\r
- dom.setStyle(e, 'height', '');\r
- }\r
- });\r
- } else {\r
- ev = 'resizestart';\r
- cb = dom.bind(e, 'resizestart', Event.cancel, Event);\r
- }\r
+ case 'submit':\r
+ case 'reset':\r
+ dom.bind(self.getElement().form || tinymce.DOM.getParent(self.id, 'form'), nativeName, eventHandler);\r
+ break;\r
\r
- re = t.resizeInfo = {\r
- node : e,\r
- ev : ev,\r
- cb : cb\r
- };\r
- });\r
+ default:\r
+ dom.bind(root, nativeName, eventHandler);\r
}\r
+ });\r
\r
- if (tinymce.isOpera) {\r
- t.onClick.add(function(ed, e) {\r
- Event.prevent(e);\r
- });\r
- }\r
+ // Set the editor as active when focused\r
+ dom.bind(settings.content_editable ? self.getBody() : (tinymce.isGecko ? self.getDoc() : self.getWin()), 'focus', function(e) {\r
+ self.focus(true);\r
+ });\r
\r
- // Add custom undo/redo handlers\r
- if (s.custom_undo_redo) {\r
- function addUndo() {\r
- t.undoManager.typing = false;\r
- t.undoManager.add();\r
- };\r
+ if (settings.content_editable && tinymce.isOpera) {\r
+ dom.bind(self.getBody(), 'click', doOperaFocus);\r
+ dom.bind(self.getBody(), 'keydown', doOperaFocus);\r
+ }\r
\r
- var focusLostFunc = tinymce.isGecko ? 'blur' : 'focusout';\r
- dom.bind(t.getDoc(), focusLostFunc, function(e){\r
- if (!t.removed && t.undoManager.typing)\r
- addUndo();\r
- });\r
+ // Add node change handler\r
+ self.onMouseUp.add(nodeChanged);\r
\r
- // Add undo level when contents is drag/dropped within the editor\r
- t.dom.bind(t.dom.getRoot(), 'dragend', function(e) {\r
- addUndo();\r
- });\r
+ self.onKeyUp.add(function(ed, e) {\r
+ var keyCode = e.keyCode;\r
\r
- t.onKeyUp.add(function(ed, e) {\r
- var keyCode = e.keyCode;\r
+ if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45 || keyCode == 46 || keyCode == 8 || (tinymce.isMac && (keyCode == 91 || keyCode == 93)) || e.ctrlKey)\r
+ nodeChanged();\r
+ });\r
\r
- if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45 || e.ctrlKey)\r
- addUndo();\r
- });\r
+ // Add reset handler\r
+ self.onReset.add(function() {\r
+ self.setContent(self.startContent, {format : 'raw'});\r
+ });\r
\r
- t.onKeyDown.add(function(ed, e) {\r
- var keyCode = e.keyCode, sel;\r
+ // Add shortcuts\r
+ function handleShortcut(e, execute) {\r
+ if (e.altKey || e.ctrlKey || e.metaKey) {\r
+ each(self.shortcuts, function(shortcut) {\r
+ var ctrlState = tinymce.isMac ? e.metaKey : e.ctrlKey;\r
\r
- if (keyCode == 8) {\r
- sel = t.getDoc().selection;\r
+ if (shortcut.ctrl != ctrlState || shortcut.alt != e.altKey || shortcut.shift != e.shiftKey)\r
+ return;\r
\r
- // Fix IE control + backspace browser bug\r
- if (sel && sel.createRange && sel.createRange().item) {\r
- t.undoManager.beforeChange();\r
- ed.dom.remove(sel.createRange().item(0));\r
- addUndo();\r
+ if (e.keyCode == shortcut.keyCode || (e.charCode && e.charCode == shortcut.charCode)) {\r
+ e.preventDefault();\r
\r
- return Event.cancel(e);\r
+ if (execute) {\r
+ shortcut.func.call(shortcut.scope);\r
}\r
- }\r
-\r
- // Is caracter positon keys left,right,up,down,home,end,pgdown,pgup,enter\r
- if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45) {\r
- // Add position before enter key is pressed, used by IE since it still uses the default browser behavior\r
- // Todo: Remove this once we normalize enter behavior on IE\r
- if (tinymce.isIE && keyCode == 13)\r
- t.undoManager.beforeChange();\r
-\r
- if (t.undoManager.typing)\r
- addUndo();\r
\r
- return;\r
- }\r
-\r
- // If key isn't shift,ctrl,alt,capslock,metakey\r
- if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !t.undoManager.typing) {\r
- t.undoManager.beforeChange();\r
- t.undoManager.typing = true;\r
- t.undoManager.add();\r
+ return true;\r
}\r
});\r
-\r
- t.onMouseDown.add(function() {\r
- if (t.undoManager.typing)\r
- addUndo();\r
- });\r
}\r
- },\r
-\r
- _refreshContentEditable : function() {\r
- var self = this, body, parent;\r
-\r
- // Check if the editor was hidden and the re-initalize contentEditable mode by removing and adding the body again\r
- if (self._isHidden()) {\r
- body = self.getBody();\r
- parent = body.parentNode;\r
-\r
- parent.removeChild(body);\r
- parent.appendChild(body);\r
+ };\r
\r
- body.focus();\r
- }\r
- },\r
+ self.onKeyUp.add(function(ed, e) {\r
+ handleShortcut(e);\r
+ });\r
\r
- _isHidden : function() {\r
- var s;\r
+ self.onKeyPress.add(function(ed, e) {\r
+ handleShortcut(e);\r
+ });\r
\r
- if (!isGecko)\r
- return 0;\r
+ self.onKeyDown.add(function(ed, e) {\r
+ handleShortcut(e, true);\r
+ });\r
\r
- // Weird, wheres that cursor selection?\r
- s = this.selection.getSel();\r
- return (!s || !s.rangeCount || s.rangeCount == 0);\r
+ if (tinymce.isOpera) {\r
+ self.onClick.add(function(ed, e) {\r
+ e.preventDefault();\r
+ });\r
}\r
- });\r
+ };\r
})(tinymce);\r
-\r
(function(tinymce) {\r
// Added for compression purposes\r
- var each = tinymce.each, undefined, TRUE = true, FALSE = false;\r
+ var each = tinymce.each, undef, TRUE = true, FALSE = false;\r
\r
tinymce.EditorCommands = function(editor) {\r
var dom = editor.dom,\r
// Private methods\r
\r
function execNativeCommand(command, ui, value) {\r
- if (ui === undefined)\r
+ if (ui === undef)\r
ui = FALSE;\r
\r
- if (value === undefined)\r
+ if (value === undef)\r
value = null;\r
\r
return editor.getDoc().execCommand(command, ui, value);\r
};\r
\r
function toggleFormat(name, value) {\r
- formatter.toggle(name, value ? {value : value} : undefined);\r
+ formatter.toggle(name, value ? {value : value} : undef);\r
};\r
\r
function storeSelection(type) {\r
// Override justify commands\r
'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) {\r
var name = 'align' + command.substring(7);\r
- // Use Formatter.matchNode instead of Formatter.match so that we don't match on parent node. This fixes bug where for both left\r
- // and right align buttons can be active. This could occur when selected nodes have align right and the parent has align left.\r
- var nodes = selection.isCollapsed() ? [selection.getNode()] : selection.getSelectedBlocks();\r
+ var nodes = selection.isCollapsed() ? [dom.getParent(selection.getNode(), dom.isBlock)] : selection.getSelectedBlocks();\r
var matches = tinymce.map(nodes, function(node) {\r
return !!formatter.matchNode(node, name);\r
});\r
}, 'value');\r
\r
// Add undo manager logic\r
- if (settings.custom_undo_redo) {\r
- addCommands({\r
- Undo : function() {\r
- editor.undoManager.undo();\r
- },\r
+ addCommands({\r
+ Undo : function() {\r
+ editor.undoManager.undo();\r
+ },\r
\r
- Redo : function() {\r
- editor.undoManager.redo();\r
- }\r
- });\r
- }\r
+ Redo : function() {\r
+ editor.undoManager.redo();\r
+ }\r
+ });\r
};\r
})(tinymce);\r
\r
var Dispatcher = tinymce.util.Dispatcher;\r
\r
tinymce.UndoManager = function(editor) {\r
- var self, index = 0, data = [], beforeBookmark;\r
+ var self, index = 0, data = [], beforeBookmark, onAdd, onUndo, onRedo;\r
\r
function getContent() {\r
// Remove whitespace before/after and remove pure bogus nodes\r
return tinymce.trim(editor.getContent({format : 'raw', no_events : 1}).replace(/<span[^>]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g, ''));\r
};\r
\r
- return self = {\r
+ function addNonTypingUndoLevel() {\r
+ self.typing = false;\r
+ self.add();\r
+ };\r
+\r
+ // Create event instances\r
+ onAdd = new Dispatcher(self);\r
+ onUndo = new Dispatcher(self);\r
+ onRedo = new Dispatcher(self);\r
+\r
+ // Pass though onAdd event from UndoManager to Editor as onChange\r
+ onAdd.add(function(undoman, level) {\r
+ if (undoman.hasUndo())\r
+ return editor.onChange.dispatch(editor, level, undoman);\r
+ });\r
+\r
+ // Pass though onUndo event from UndoManager to Editor\r
+ onUndo.add(function(undoman, level) {\r
+ return editor.onUndo.dispatch(editor, level, undoman);\r
+ });\r
+\r
+ // Pass though onRedo event from UndoManager to Editor\r
+ onRedo.add(function(undoman, level) {\r
+ return editor.onRedo.dispatch(editor, level, undoman);\r
+ });\r
+\r
+ // Add initial undo level when the editor is initialized\r
+ editor.onInit.add(function() {\r
+ self.add();\r
+ });\r
+\r
+ // Get position before an execCommand is processed\r
+ editor.onBeforeExecCommand.add(function(ed, cmd, ui, val, args) {\r
+ if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!args || !args.skip_undo)) {\r
+ self.beforeChange();\r
+ }\r
+ });\r
+\r
+ // Add undo level after an execCommand call was made\r
+ editor.onExecCommand.add(function(ed, cmd, ui, val, args) {\r
+ if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!args || !args.skip_undo)) {\r
+ self.add();\r
+ }\r
+ });\r
+\r
+ // Add undo level on save contents, drag end and blur/focusout\r
+ editor.onSaveContent.add(addNonTypingUndoLevel);\r
+ editor.dom.bind(editor.dom.getRoot(), 'dragend', addNonTypingUndoLevel);\r
+ editor.dom.bind(editor.getDoc(), tinymce.isGecko ? 'blur' : 'focusout', function(e) {\r
+ if (!editor.removed && self.typing) {\r
+ addNonTypingUndoLevel();\r
+ }\r
+ });\r
+\r
+ editor.onKeyUp.add(function(editor, e) {\r
+ var keyCode = e.keyCode;\r
+\r
+ if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45 || keyCode == 13 || e.ctrlKey) {\r
+ addNonTypingUndoLevel();\r
+ }\r
+ });\r
+\r
+ editor.onKeyDown.add(function(editor, e) {\r
+ var keyCode = e.keyCode;\r
+\r
+ // Is caracter positon keys left,right,up,down,home,end,pgdown,pgup,enter\r
+ if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45) {\r
+ if (self.typing) {\r
+ addNonTypingUndoLevel();\r
+ }\r
+\r
+ return;\r
+ }\r
+\r
+ // If key isn't shift,ctrl,alt,capslock,metakey\r
+ if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !self.typing) {\r
+ self.beforeChange();\r
+ self.typing = true;\r
+ self.add();\r
+ }\r
+ });\r
+\r
+ editor.onMouseDown.add(function(editor, e) {\r
+ if (self.typing) {\r
+ addNonTypingUndoLevel();\r
+ }\r
+ });\r
+\r
+ // Add keyboard shortcuts for undo/redo keys\r
+ editor.addShortcut('ctrl+z', 'undo_desc', 'Undo');\r
+ editor.addShortcut('ctrl+y', 'redo_desc', 'Redo');\r
+\r
+ self = {\r
+ // Explose for debugging reasons\r
+ data : data,\r
+\r
typing : false,\r
\r
- onAdd : new Dispatcher(self),\r
+ onAdd : onAdd,\r
\r
- onUndo : new Dispatcher(self),\r
+ onUndo : onUndo,\r
\r
- onRedo : new Dispatcher(self),\r
+ onRedo : onRedo,\r
\r
beforeChange : function() {\r
beforeBookmark = editor.selection.getBookmark(2, true);\r
return index < data.length - 1 && !this.typing;\r
}\r
};\r
+\r
+ return self;\r
};\r
})(tinymce);\r
\r
tinymce.ForceBlocks = function(editor) {\r
var settings = editor.settings, dom = editor.dom, selection = editor.selection, blockElements = editor.schema.getBlockElements();\r
\r
- // Force root blocks\r
- if (settings.forced_root_block) {\r
- function addRootBlocks() {\r
- var node = selection.getStart(), rootNode = editor.getBody(), rng, startContainer, startOffset, endContainer, endOffset, rootBlockNode, tempNode, offset = -0xFFFFFF;\r
+ function addRootBlocks() {\r
+ var node = selection.getStart(), rootNode = editor.getBody(), rng, startContainer, startOffset, endContainer, endOffset, rootBlockNode, tempNode, offset = -0xFFFFFF, wrapped;\r
\r
- if (!node || node.nodeType !== 1 || !settings.forced_root_block)\r
+ if (!node || node.nodeType !== 1 || !settings.forced_root_block)\r
+ return;\r
+\r
+ // Check if node is wrapped in block\r
+ while (node && node != rootNode) {\r
+ if (blockElements[node.nodeName])\r
return;\r
\r
- // Check if node is wrapped in block\r
- while (node != rootNode) {\r
- if (blockElements[node.nodeName])\r
- return;\r
+ node = node.parentNode;\r
+ }\r
\r
- node = node.parentNode;\r
+ // Get current selection\r
+ rng = selection.getRng();\r
+ if (rng.setStart) {\r
+ startContainer = rng.startContainer;\r
+ startOffset = rng.startOffset;\r
+ endContainer = rng.endContainer;\r
+ endOffset = rng.endOffset;\r
+ } else {\r
+ // Force control range into text range\r
+ if (rng.item) {\r
+ node = rng.item(0);\r
+ rng = editor.getDoc().body.createTextRange();\r
+ rng.moveToElementText(node);\r
}\r
\r
- // Get current selection\r
- rng = selection.getRng();\r
- if (rng.setStart) {\r
- startContainer = rng.startContainer;\r
- startOffset = rng.startOffset;\r
- endContainer = rng.endContainer;\r
- endOffset = rng.endOffset;\r
- } else {\r
- // Force control range into text range\r
- if (rng.item) {\r
- node = rng.item(0);\r
- rng = editor.getDoc().body.createTextRange();\r
- rng.moveToElementText(node);\r
- }\r
+ tmpRng = rng.duplicate();\r
+ tmpRng.collapse(true);\r
+ startOffset = tmpRng.move('character', offset) * -1;\r
\r
+ if (!tmpRng.collapsed) {\r
tmpRng = rng.duplicate();\r
- tmpRng.collapse(true);\r
- startOffset = tmpRng.move('character', offset) * -1;\r
-\r
- if (!tmpRng.collapsed) {\r
- tmpRng = rng.duplicate();\r
- tmpRng.collapse(false);\r
- endOffset = (tmpRng.move('character', offset) * -1) - startOffset;\r
- }\r
+ tmpRng.collapse(false);\r
+ endOffset = (tmpRng.move('character', offset) * -1) - startOffset;\r
}\r
+ }\r
\r
- // Wrap non block elements and text nodes\r
- for (node = rootNode.firstChild; node; node) {\r
- if (node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName])) {\r
- if (!rootBlockNode) {\r
- rootBlockNode = dom.create(settings.forced_root_block);\r
- node.parentNode.insertBefore(rootBlockNode, node);\r
- }\r
-\r
- tempNode = node;\r
- node = node.nextSibling;\r
- rootBlockNode.appendChild(tempNode);\r
- } else {\r
- rootBlockNode = null;\r
- node = node.nextSibling;\r
+ // Wrap non block elements and text nodes\r
+ node = rootNode.firstChild;\r
+ while (node) {\r
+ if (node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName])) {\r
+ if (!rootBlockNode) {\r
+ rootBlockNode = dom.create(settings.forced_root_block);\r
+ node.parentNode.insertBefore(rootBlockNode, node);\r
+ wrapped = true;\r
}\r
- }\r
\r
- if (rng.setStart) {\r
- rng.setStart(startContainer, startOffset);\r
- rng.setEnd(endContainer, endOffset);\r
- selection.setRng(rng);\r
+ tempNode = node;\r
+ node = node.nextSibling;\r
+ rootBlockNode.appendChild(tempNode);\r
} else {\r
- try {\r
- rng = editor.getDoc().body.createTextRange();\r
- rng.moveToElementText(rootNode);\r
- rng.collapse(true);\r
- rng.moveStart('character', startOffset);\r
+ rootBlockNode = null;\r
+ node = node.nextSibling;\r
+ }\r
+ }\r
+\r
+ if (rng.setStart) {\r
+ rng.setStart(startContainer, startOffset);\r
+ rng.setEnd(endContainer, endOffset);\r
+ selection.setRng(rng);\r
+ } else {\r
+ try {\r
+ rng = editor.getDoc().body.createTextRange();\r
+ rng.moveToElementText(rootNode);\r
+ rng.collapse(true);\r
+ rng.moveStart('character', startOffset);\r
\r
- if (endOffset > 0)\r
- rng.moveEnd('character', endOffset);\r
+ if (endOffset > 0)\r
+ rng.moveEnd('character', endOffset);\r
\r
- rng.select();\r
- } catch (ex) {\r
- // Ignore\r
- }\r
+ rng.select();\r
+ } catch (ex) {\r
+ // Ignore\r
}\r
+ }\r
\r
+ // Only trigger nodeChange when we wrapped nodes to prevent a forever loop\r
+ if (wrapped) {\r
editor.nodeChanged();\r
- };\r
+ }\r
+ };\r
\r
+ // Force root blocks\r
+ if (settings.forced_root_block) {\r
editor.onKeyUp.add(addRootBlocks);\r
- editor.onClick.add(addRootBlocks);\r
+ editor.onNodeChange.add(addRootBlocks);\r
}\r
};\r
\r
if (v = ed.getParam('skin_variant'))\r
s['class'] += ' ' + ed.getParam('skin') + 'Skin' + v.substring(0, 1).toUpperCase() + v.substring(1);\r
\r
+ s['class'] += ed.settings.directionality == "rtl" ? ' mceRtl' : '';\r
+\r
id = t.prefix + id;\r
cls = cc || t._cls.dropmenu || tinymce.ui.DropMenu;\r
c = t.controls[id] = new cls(id, s);\r
win.resizeBy(dw, dh);\r
},\r
\r
- // Internal functions\r
+ // Internal functions\r
+\r
+ _decode : function(s) {\r
+ return tinymce.DOM.decode(s).replace(/\\n/g, '\n');\r
+ }\r
+ });\r
+}(tinymce));\r
+(function(tinymce) {\r
+ tinymce.Formatter = function(ed) {\r
+ var formats = {},\r
+ each = tinymce.each,\r
+ dom = ed.dom,\r
+ selection = ed.selection,\r
+ TreeWalker = tinymce.dom.TreeWalker,\r
+ rangeUtils = new tinymce.dom.RangeUtils(dom),\r
+ isValid = ed.schema.isValidChild,\r
+ isBlock = dom.isBlock,\r
+ forcedRootBlock = ed.settings.forced_root_block,\r
+ nodeIndex = dom.nodeIndex,\r
+ INVISIBLE_CHAR = tinymce.isGecko ? '\u200B' : '\uFEFF',\r
+ MCE_ATTR_RE = /^(src|href|style)$/,\r
+ FALSE = false,\r
+ TRUE = true,\r
+ undef,\r
+ getContentEditable = dom.getContentEditable;\r
+\r
+ function isArray(obj) {\r
+ return obj instanceof Array;\r
+ };\r
+\r
+ function getParents(node, selector) {\r
+ return dom.getParents(node, selector, dom.getRoot());\r
+ };\r
+\r
+ function isCaretNode(node) {\r
+ return node.nodeType === 1 && node.id === '_mce_caret';\r
+ };\r
+\r
+ function defaultFormats() {\r
+ register({\r
+ alignleft : [\r
+ {selector : 'figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}, defaultBlock: 'div'},\r
+ {selector : 'img,table', collapsed : false, styles : {'float' : 'left'}}\r
+ ],\r
+\r
+ aligncenter : [\r
+ {selector : 'figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}, defaultBlock: 'div'},\r
+ {selector : 'img', collapsed : false, styles : {display : 'block', marginLeft : 'auto', marginRight : 'auto'}},\r
+ {selector : 'table', collapsed : false, styles : {marginLeft : 'auto', marginRight : 'auto'}}\r
+ ],\r
+\r
+ alignright : [\r
+ {selector : 'figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}, defaultBlock: 'div'},\r
+ {selector : 'img,table', collapsed : false, styles : {'float' : 'right'}}\r
+ ],\r
+\r
+ alignfull : [\r
+ {selector : 'figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'justify'}, defaultBlock: 'div'}\r
+ ],\r
+\r
+ bold : [\r
+ {inline : 'strong', remove : 'all'},\r
+ {inline : 'span', styles : {fontWeight : 'bold'}},\r
+ {inline : 'b', remove : 'all'}\r
+ ],\r
+\r
+ italic : [\r
+ {inline : 'em', remove : 'all'},\r
+ {inline : 'span', styles : {fontStyle : 'italic'}},\r
+ {inline : 'i', remove : 'all'}\r
+ ],\r
+\r
+ underline : [\r
+ {inline : 'span', styles : {textDecoration : 'underline'}, exact : true},\r
+ {inline : 'u', remove : 'all'}\r
+ ],\r
+\r
+ strikethrough : [\r
+ {inline : 'span', styles : {textDecoration : 'line-through'}, exact : true},\r
+ {inline : 'strike', remove : 'all'}\r
+ ],\r
+\r
+ forecolor : {inline : 'span', styles : {color : '%value'}, wrap_links : false},\r
+ hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}, wrap_links : false},\r
+ fontname : {inline : 'span', styles : {fontFamily : '%value'}},\r
+ fontsize : {inline : 'span', styles : {fontSize : '%value'}},\r
+ fontsize_class : {inline : 'span', attributes : {'class' : '%value'}},\r
+ blockquote : {block : 'blockquote', wrapper : 1, remove : 'all'},\r
+ subscript : {inline : 'sub'},\r
+ superscript : {inline : 'sup'},\r
+\r
+ link : {inline : 'a', selector : 'a', remove : 'all', split : true, deep : true,\r
+ onmatch : function(node) {\r
+ return true;\r
+ },\r
\r
- _decode : function(s) {\r
- return tinymce.DOM.decode(s).replace(/\\n/g, '\n');\r
- }\r
- });\r
-}(tinymce));\r
-(function(tinymce) {\r
- tinymce.Formatter = function(ed) {\r
- var formats = {},\r
- each = tinymce.each,\r
- dom = ed.dom,\r
- selection = ed.selection,\r
- TreeWalker = tinymce.dom.TreeWalker,\r
- rangeUtils = new tinymce.dom.RangeUtils(dom),\r
- isValid = ed.schema.isValidChild,\r
- isBlock = dom.isBlock,\r
- forcedRootBlock = ed.settings.forced_root_block,\r
- nodeIndex = dom.nodeIndex,\r
- INVISIBLE_CHAR = tinymce.isGecko ? '\u200B' : '\uFEFF',\r
- MCE_ATTR_RE = /^(src|href|style)$/,\r
- FALSE = false,\r
- TRUE = true,\r
- undefined;\r
+ onformat : function(elm, fmt, vars) {\r
+ each(vars, function(value, key) {\r
+ dom.setAttrib(elm, key, value);\r
+ });\r
+ }\r
+ },\r
\r
- // Returns the content editable state of a node\r
- function getContentEditable(node) {\r
- var contentEditable = node.getAttribute("data-mce-contenteditable");\r
+ removeformat : [\r
+ {selector : 'b,strong,em,i,font,u,strike', remove : 'all', split : true, expand : false, block_expand : true, deep : true},\r
+ {selector : 'span', attributes : ['style', 'class'], remove : 'empty', split : true, expand : false, deep : true},\r
+ {selector : '*', attributes : ['style', 'class'], split : false, expand : false, deep : true}\r
+ ]\r
+ });\r
\r
- // Check for fake content editable\r
- if (contentEditable && contentEditable !== "inherit") {\r
- return contentEditable;\r
- }\r
+ // Register default block formats\r
+ each('p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp'.split(/\s/), function(name) {\r
+ register(name, {block : name, remove : 'all'});\r
+ });\r
\r
- // Check for real content editable\r
- return node.contentEditable !== "inherit" ? node.contentEditable : null;\r
+ // Register user defined formats\r
+ register(ed.settings.formats);\r
};\r
\r
- function isArray(obj) {\r
- return obj instanceof Array;\r
- };\r
+ function addKeyboardShortcuts() {\r
+ // Add some inline shortcuts\r
+ ed.addShortcut('ctrl+b', 'bold_desc', 'Bold');\r
+ ed.addShortcut('ctrl+i', 'italic_desc', 'Italic');\r
+ ed.addShortcut('ctrl+u', 'underline_desc', 'Underline');\r
\r
- function getParents(node, selector) {\r
- return dom.getParents(node, selector, dom.getRoot());\r
- };\r
+ // BlockFormat shortcuts keys\r
+ for (var i = 1; i <= 6; i++) {\r
+ ed.addShortcut('ctrl+' + i, '', ['FormatBlock', false, 'h' + i]);\r
+ }\r
\r
- function isCaretNode(node) {\r
- return node.nodeType === 1 && node.id === '_mce_caret';\r
+ ed.addShortcut('ctrl+7', '', ['FormatBlock', false, 'p']);\r
+ ed.addShortcut('ctrl+8', '', ['FormatBlock', false, 'div']);\r
+ ed.addShortcut('ctrl+9', '', ['FormatBlock', false, 'address']);\r
};\r
\r
// Public functions\r
each(format, function(format) {\r
// Set deep to false by default on selector formats this to avoid removing\r
// alignment on images inside paragraphs when alignment is changed on paragraphs\r
- if (format.deep === undefined)\r
+ if (format.deep === undef)\r
format.deep = !format.selector;\r
\r
// Default to true\r
- if (format.split === undefined)\r
+ if (format.split === undef)\r
format.split = !format.selector || format.inline;\r
\r
// Default to true\r
- if (format.remove === undefined && format.selector && !format.inline)\r
+ if (format.remove === undef && format.selector && !format.inline)\r
format.remove = 'none';\r
\r
// Mark format as a mixed format inline + block level\r
function findSelectionEnd(start, end) {\r
var walker = new TreeWalker(end);\r
for (node = walker.current(); node; node = walker.prev()) {\r
- if (node.childNodes.length > 1 || node == start) {\r
+ if (node.childNodes.length > 1 || node == start || node.tagName == 'BR') {\r
return node;\r
}\r
}\r
var start = rng.startContainer;\r
var end = rng.endContainer;\r
\r
- if (start != end && rng.endOffset == 0) {\r
+ if (start != end && rng.endOffset === 0) {\r
var newEnd = findSelectionEnd(start, end);\r
var endOffset = newEnd.nodeType == 3 ? newEnd.length : newEnd.childNodes.length;\r
\r
};\r
\r
function removeRngStyle(rng) {\r
- var startContainer, endContainer;\r
+ var startContainer, endContainer, node;\r
\r
rng = expandRng(rng, formatList, TRUE);\r
\r
endContainer = getContainer(rng);\r
\r
if (startContainer != endContainer) {\r
+ // 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\r
+ // This will happen if you tripple click a table cell and use remove formatting\r
+ if (/^(TR|TD)$/.test(startContainer.nodeName) && startContainer.firstChild) {\r
+ startContainer = (startContainer.nodeName == "TD" ? startContainer.firstChild : startContainer.firstChild.firstChild) || startContainer;\r
+ }\r
+\r
// Wrap start/end nodes in span element since these might be cloned/moved\r
startContainer = wrap(startContainer, 'span', {id : '_start', 'data-mce-type' : 'bookmark'});\r
endContainer = wrap(endContainer, 'span', {id : '_end', 'data-mce-type' : 'bookmark'});\r
ed.nodeChanged();\r
} else\r
performCaretAction('remove', name, vars);\r
-\r
- // Removed this logic since it breaks unit tests and produces empty caret elements since they will be destroyed in the cleanup process\r
- // Also there must be a better way to rerender a table and I couldn't reproduce the case causing this might be some old WebKit\r
- /*\r
- // When you remove formatting from a table cell in WebKit (cell, not the contents of a cell) there is a rendering issue with column width\r
- if (tinymce.isWebKit) {\r
- ed.execCommand('mceCleanup');\r
- }*/\r
};\r
\r
function toggle(name, vars, node) {\r
var fmt = get(name);\r
\r
- if (match(name, vars, node) && (!('toggle' in fmt[0]) || fmt[0]['toggle']))\r
+ if (match(name, vars, node) && (!('toggle' in fmt[0]) || fmt[0].toggle))\r
remove(name, vars, node);\r
else\r
apply(name, vars, node);\r
// Check all items\r
if (items) {\r
// Non indexed object\r
- if (items.length === undefined) {\r
+ if (items.length === undef) {\r
for (key in items) {\r
if (items.hasOwnProperty(key)) {\r
if (item_name === 'attributes')\r
canApply : canApply\r
});\r
\r
+ // Initialize\r
+ defaultFormats();\r
+ addKeyboardShortcuts();\r
+\r
// Private functions\r
\r
function matchName(node, format) {\r
};\r
\r
function expandRng(rng, format, remove) {\r
- var sibling, lastIdx, leaf,\r
+ var sibling, lastIdx, leaf, endPoint,\r
startContainer = rng.startContainer,\r
startOffset = rng.startOffset,\r
endContainer = rng.endContainer,\r
- endOffset = rng.endOffset, sibling, lastIdx, leaf, endPoint;\r
+ endOffset = rng.endOffset;\r
\r
// This function walks up the tree if there is no siblings before/after the node\r
function findParentContainer(start) {\r
- var container, parent, child, sibling, siblingName;\r
+ var container, parent, child, sibling, siblingName, root;\r
\r
container = parent = start ? startContainer : endContainer;\r
siblingName = start ? 'previousSibling' : 'nextSibling';\r
// This function walks down the tree to find the leaf at the selection.\r
// The offset is also returned as if node initially a leaf, the offset may be in the middle of the text node.\r
function findLeaf(node, offset) {\r
- if (offset === undefined)\r
+ if (offset === undef)\r
offset = node.nodeType === 3 ? node.length : node.childNodes.length;\r
while (node && node.hasChildNodes()) {\r
node = node.childNodes[offset];\r
return node;\r
};\r
\r
+ function findWordEndPoint(container, offset, start) {\r
+ var walker, node, pos, lastTextNode;\r
+\r
+ function findSpace(node, offset) {\r
+ var pos, pos2, str = node.nodeValue;\r
+\r
+ if (typeof(offset) == "undefined") {\r
+ offset = start ? str.length : 0;\r
+ }\r
+\r
+ if (start) {\r
+ pos = str.lastIndexOf(' ', offset);\r
+ pos2 = str.lastIndexOf('\u00a0', offset);\r
+ pos = pos > pos2 ? pos : pos2;\r
+\r
+ // Include the space on remove to avoid tag soup\r
+ if (pos !== -1 && !remove) {\r
+ pos++;\r
+ }\r
+ } else {\r
+ pos = str.indexOf(' ', offset);\r
+ pos2 = str.indexOf('\u00a0', offset);\r
+ pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2;\r
+ }\r
+\r
+ return pos;\r
+ };\r
+\r
+ if (container.nodeType === 3) {\r
+ pos = findSpace(container, offset);\r
+\r
+ if (pos !== -1) {\r
+ return {container : container, offset : pos};\r
+ }\r
+\r
+ lastTextNode = container;\r
+ }\r
+\r
+ // Walk the nodes inside the block\r
+ walker = new TreeWalker(container, dom.getParent(container, isBlock) || ed.getBody());\r
+ while (node = walker[start ? 'prev' : 'next']()) {\r
+ if (node.nodeType === 3) {\r
+ lastTextNode = node;\r
+ pos = findSpace(node);\r
+\r
+ if (pos !== -1) {\r
+ return {container : node, offset : pos};\r
+ }\r
+ } else if (isBlock(node)) {\r
+ break;\r
+ }\r
+ }\r
+\r
+ if (lastTextNode) {\r
+ if (start) {\r
+ offset = 0;\r
+ } else {\r
+ offset = lastTextNode.length;\r
+ }\r
+\r
+ return {container: lastTextNode, offset: offset};\r
+ }\r
+ };\r
+\r
+ function findSelectorEndPoint(container, sibling_name) {\r
+ var parents, i, y, curFormat;\r
+\r
+ if (container.nodeType == 3 && container.nodeValue.length === 0 && container[sibling_name])\r
+ container = container[sibling_name];\r
+\r
+ parents = getParents(container);\r
+ for (i = 0; i < parents.length; i++) {\r
+ for (y = 0; y < format.length; y++) {\r
+ curFormat = format[y];\r
+\r
+ // If collapsed state is set then skip formats that doesn't match that\r
+ if ("collapsed" in curFormat && curFormat.collapsed !== rng.collapsed)\r
+ continue;\r
+\r
+ if (dom.is(parents[i], curFormat.selector))\r
+ return parents[i];\r
+ }\r
+ }\r
+\r
+ return container;\r
+ };\r
+\r
+ function findBlockEndPoint(container, sibling_name, sibling_name2) {\r
+ var node;\r
+\r
+ // Expand to block of similar type\r
+ if (!format[0].wrapper)\r
+ node = dom.getParent(container, format[0].block);\r
+\r
+ // Expand to first wrappable block element or any block element\r
+ if (!node)\r
+ node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, isBlock);\r
+\r
+ // Exclude inner lists from wrapping\r
+ if (node && format[0].wrapper)\r
+ node = getParents(node, 'ul,ol').reverse()[0] || node;\r
+\r
+ // Didn't find a block element look for first/last wrappable element\r
+ if (!node) {\r
+ node = container;\r
+\r
+ while (node[sibling_name] && !isBlock(node[sibling_name])) {\r
+ node = node[sibling_name];\r
+\r
+ // Break on BR but include it will be removed later on\r
+ // we can't remove it now since we need to check if it can be wrapped\r
+ if (isEq(node, 'br'))\r
+ break;\r
+ }\r
+ }\r
+\r
+ return node || container;\r
+ };\r
+\r
// Expand to closest contentEditable element\r
startContainer = findParentContentEditable(startContainer);\r
endContainer = findParentContentEditable(endContainer);\r
\r
if (format[0].inline) {\r
if (rng.collapsed) {\r
- function findWordEndPoint(container, offset, start) {\r
- var walker, node, pos, lastTextNode;\r
-\r
- function findSpace(node, offset) {\r
- var pos, pos2, str = node.nodeValue;\r
-\r
- if (typeof(offset) == "undefined") {\r
- offset = start ? str.length : 0;\r
- }\r
-\r
- if (start) {\r
- pos = str.lastIndexOf(' ', offset);\r
- pos2 = str.lastIndexOf('\u00a0', offset);\r
- pos = pos > pos2 ? pos : pos2;\r
-\r
- // Include the space on remove to avoid tag soup\r
- if (pos !== -1 && !remove) {\r
- pos++;\r
- }\r
- } else {\r
- pos = str.indexOf(' ', offset);\r
- pos2 = str.indexOf('\u00a0', offset);\r
- pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2;\r
- }\r
-\r
- return pos;\r
- };\r
-\r
- if (container.nodeType === 3) {\r
- pos = findSpace(container, offset);\r
-\r
- if (pos !== -1) {\r
- return {container : container, offset : pos};\r
- }\r
-\r
- lastTextNode = container;\r
- }\r
-\r
- // Walk the nodes inside the block\r
- walker = new TreeWalker(container, dom.getParent(container, isBlock) || ed.getBody());\r
- while (node = walker[start ? 'prev' : 'next']()) {\r
- if (node.nodeType === 3) {\r
- lastTextNode = node;\r
- pos = findSpace(node);\r
-\r
- if (pos !== -1) {\r
- return {container : node, offset : pos};\r
- }\r
- } else if (isBlock(node)) {\r
- break;\r
- }\r
- }\r
-\r
- if (lastTextNode) {\r
- if (start) {\r
- offset = 0;\r
- } else {\r
- offset = lastTextNode.length;\r
- }\r
-\r
- return {container: lastTextNode, offset: offset};\r
- }\r
- }\r
-\r
// Expand left to closest word boundery\r
endPoint = findWordEndPoint(startContainer, startOffset, true);\r
if (endPoint) {\r
if (leaf.offset > 1) {\r
endContainer = leaf.node;\r
endContainer.splitText(leaf.offset - 1);\r
- } else if (leaf.node.previousSibling) {\r
- // TODO: Figure out why this is in here\r
- //endContainer = leaf.node.previousSibling;\r
}\r
}\r
}\r
\r
// Expand start/end container to matching selector\r
if (format[0].selector && format[0].expand !== FALSE && !format[0].inline) {\r
- function findSelectorEndPoint(container, sibling_name) {\r
- var parents, i, y, curFormat;\r
-\r
- if (container.nodeType == 3 && container.nodeValue.length == 0 && container[sibling_name])\r
- container = container[sibling_name];\r
-\r
- parents = getParents(container);\r
- for (i = 0; i < parents.length; i++) {\r
- for (y = 0; y < format.length; y++) {\r
- curFormat = format[y];\r
-\r
- // If collapsed state is set then skip formats that doesn't match that\r
- if ("collapsed" in curFormat && curFormat.collapsed !== rng.collapsed)\r
- continue;\r
-\r
- if (dom.is(parents[i], curFormat.selector))\r
- return parents[i];\r
- }\r
- }\r
-\r
- return container;\r
- };\r
-\r
// Find new startContainer/endContainer if there is better one\r
startContainer = findSelectorEndPoint(startContainer, 'previousSibling');\r
endContainer = findSelectorEndPoint(endContainer, 'nextSibling');\r
\r
// Expand start/end container to matching block element or text node\r
if (format[0].block || format[0].selector) {\r
- function findBlockEndPoint(container, sibling_name, sibling_name2) {\r
- var node;\r
-\r
- // Expand to block of similar type\r
- if (!format[0].wrapper)\r
- node = dom.getParent(container, format[0].block);\r
-\r
- // Expand to first wrappable block element or any block element\r
- if (!node)\r
- node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, isBlock);\r
-\r
- // Exclude inner lists from wrapping\r
- if (node && format[0].wrapper)\r
- node = getParents(node, 'ul,ol').reverse()[0] || node;\r
-\r
- // Didn't find a block element look for first/last wrappable element\r
- if (!node) {\r
- node = container;\r
-\r
- while (node[sibling_name] && !isBlock(node[sibling_name])) {\r
- node = node[sibling_name];\r
-\r
- // Break on BR but include it will be removed later on\r
- // we can't remove it now since we need to check if it can be wrapped\r
- if (isEq(node, 'br'))\r
- break;\r
- }\r
- }\r
-\r
- return node || container;\r
- };\r
-\r
// Find new startContainer/endContainer if there is better one\r
startContainer = findBlockEndPoint(startContainer, 'previousSibling');\r
endContainer = findBlockEndPoint(endContainer, 'nextSibling');\r
function removeNode(node, format) {\r
var parentNode = node.parentNode, rootBlockElm;\r
\r
- if (format.block) {\r
- if (!forcedRootBlock) {\r
- function find(node, next, inc) {\r
- node = getNonWhiteSpaceSibling(node, next, inc);\r
+ function find(node, next, inc) {\r
+ node = getNonWhiteSpaceSibling(node, next, inc);\r
\r
- return !node || (node.nodeName == 'BR' || isBlock(node));\r
- };\r
+ return !node || (node.nodeName == 'BR' || isBlock(node));\r
+ };\r
\r
+ if (format.block) {\r
+ if (!forcedRootBlock) {\r
// Append BR elements if needed before we remove the block\r
if (isBlock(node) && !isBlock(parentNode)) {\r
if (!find(node, FALSE) && !find(node.firstChild, TRUE, 1))\r
value = obj2[name];\r
\r
// Obj2 doesn't have obj1 item\r
- if (value === undefined)\r
+ if (value === undef)\r
return FALSE;\r
\r
// Obj2 item has a different value\r
return TRUE;\r
};\r
\r
- // Check if next/prev exists and that they are elements\r
- if (prev && next) {\r
- function findElementSibling(node, sibling_name) {\r
- for (sibling = node; sibling; sibling = sibling[sibling_name]) {\r
- if (sibling.nodeType == 3 && sibling.nodeValue.length !== 0)\r
- return node;\r
+ function findElementSibling(node, sibling_name) {\r
+ for (sibling = node; sibling; sibling = sibling[sibling_name]) {\r
+ if (sibling.nodeType == 3 && sibling.nodeValue.length !== 0)\r
+ return node;\r
\r
- if (sibling.nodeType == 1 && !isBookmarkNode(sibling))\r
- return sibling;\r
- }\r
+ if (sibling.nodeType == 1 && !isBookmarkNode(sibling))\r
+ return sibling;\r
+ }\r
\r
- return node;\r
- };\r
+ return node;\r
+ };\r
\r
+ // Check if next/prev exists and that they are elements\r
+ if (prev && next) {\r
// If previous sibling is empty then jump over it\r
prev = findElementSibling(prev, 'previousSibling');\r
next = findElementSibling(next, 'nextSibling');\r
}\r
\r
// If end text node is excluded then walk to the previous node\r
- if (container.nodeType === 3 && !start && offset == 0) {\r
+ if (container.nodeType === 3 && !start && offset === 0) {\r
container = new TreeWalker(container, ed.getBody()).prev() || container;\r
}\r
\r
}\r
});\r
\r
+ // Remove bogus state if they got filled by contents using editor.selection.setContent\r
+ selection.onSetContent.add(function() {\r
+ dom.getParent(selection.getStart(), function(node) {\r
+ if (node.id !== caretContainerId && dom.getAttrib(node, 'data-mce-bogus') && !dom.isEmpty(node)) {\r
+ dom.setAttrib(node, 'data-mce-bogus', null);\r
+ }\r
+ });\r
+ });\r
+\r
self._hasCaretEvents = true;\r
}\r
\r
\r
function moveStart(rng) {\r
var container = rng.startContainer,\r
- offset = rng.startOffset,\r
+ offset = rng.startOffset, isAtEndOfText,\r
walker, node, nodes, tmpNode;\r
\r
// Convert text node into index if possible\r
if (container.nodeType == 3 && offset >= container.nodeValue.length) {\r
// Get the parent container location and walk from there\r
+ offset = nodeIndex(container);\r
container = container.parentNode;\r
- offset = nodeIndex(container) + 1;\r
+ isAtEndOfText = true;\r
}\r
\r
// Move startContainer/startOffset in to a suitable node\r
walker = new TreeWalker(container, dom.getParent(container, dom.isBlock));\r
\r
// If offset is at end of the parent node walk to the next one\r
- if (offset > nodes.length - 1)\r
+ if (offset > nodes.length - 1 || isAtEndOfText)\r
walker.next();\r
\r
for (node = walker.current(); node; node = walker.next()) {\r
tinymce.onAddEditor.add(function(tinymce, ed) {\r
var filters, fontSizes, dom, settings = ed.settings;\r
\r
- if (settings.inline_styles) {\r
- fontSizes = tinymce.explode(settings.font_size_legacy_values);\r
+ function replaceWithSpan(node, styles) {\r
+ tinymce.each(styles, function(value, name) {\r
+ if (value)\r
+ dom.setStyle(node, name, value);\r
+ });\r
\r
- function replaceWithSpan(node, styles) {\r
- tinymce.each(styles, function(value, name) {\r
- if (value)\r
- dom.setStyle(node, name, value);\r
+ dom.rename(node, 'span');\r
+ };\r
+\r
+ function convert(editor, params) {\r
+ dom = editor.dom;\r
+\r
+ if (settings.convert_fonts_to_spans) {\r
+ tinymce.each(dom.select('font,u,strike', params.node), function(node) {\r
+ filters[node.nodeName.toLowerCase()](ed.dom, node);\r
});\r
+ }\r
+ };\r
\r
- dom.rename(node, 'span');\r
- };\r
+ if (settings.inline_styles) {\r
+ fontSizes = tinymce.explode(settings.font_size_legacy_values);\r
\r
filters = {\r
font : function(dom, node) {\r
backgroundColor : node.style.backgroundColor,\r
color : node.color,\r
fontFamily : node.face,\r
- fontSize : fontSizes[parseInt(node.size) - 1]\r
+ fontSize : fontSizes[parseInt(node.size, 10) - 1]\r
});\r
},\r
\r
}\r
};\r
\r
- function convert(editor, params) {\r
- dom = editor.dom;\r
-\r
- if (settings.convert_fonts_to_spans) {\r
- tinymce.each(dom.select('font,u,strike', params.node), function(node) {\r
- filters[node.nodeName.toLowerCase()](ed.dom, node);\r
- });\r
- }\r
- };\r
-\r
ed.onPreProcess.add(convert);\r
ed.onSetContent.add(convert);\r
\r
var dom = editor.dom, selection = editor.selection, settings = editor.settings, undoManager = editor.undoManager;\r
\r
function handleEnterKey(evt) {\r
- var rng = selection.getRng(true), tmpRng, container, offset, parentBlock, newBlock, fragment, containerBlock, parentBlockName, containerBlockName, newBlockName;\r
+ var rng = selection.getRng(true), tmpRng, editableRoot, container, offset, parentBlock, documentMode,\r
+ newBlock, fragment, containerBlock, parentBlockName, containerBlockName, newBlockName, isAfterLastNodeInContainer;\r
\r
// Returns true if the block can be split into two blocks or not\r
function canSplitBlock(node) {\r
- return node && dom.isBlock(node) && !/^(TD|TH|CAPTION)$/.test(node.nodeName) && !/^(fixed|absolute)/i.test(node.style.position);\r
+ return node &&\r
+ dom.isBlock(node) &&\r
+ !/^(TD|TH|CAPTION)$/.test(node.nodeName) &&\r
+ !/^(fixed|absolute)/i.test(node.style.position) && \r
+ dom.getContentEditable(node) !== "true";\r
};\r
\r
// Moves the caret to a suitable position within the root for example in the first non pure whitespace text node or before an image\r
function moveToCaretPosition(root) {\r
- var walker, node, rng, y, viewPort, lastNode = root;\r
+ var walker, node, rng, y, viewPort, lastNode = root, tempElm;\r
\r
rng = dom.createRng();\r
\r
}\r
} else {\r
if (root.nodeName == 'BR') {\r
- rng.setStartAfter(root);\r
- rng.setEndAfter(root);\r
+ if (root.nextSibling && dom.isBlock(root.nextSibling)) {\r
+ // Trick on older IE versions to render the caret before the BR between two lists\r
+ if (!documentMode || documentMode < 9) {\r
+ tempElm = dom.create('br');\r
+ root.parentNode.insertBefore(tempElm, root);\r
+ }\r
+\r
+ rng.setStartBefore(root);\r
+ rng.setEndBefore(root);\r
+ } else {\r
+ rng.setStartAfter(root);\r
+ rng.setEndAfter(root);\r
+ }\r
} else {\r
rng.setStart(root, 0);\r
rng.setEnd(root, 0);\r
\r
selection.setRng(rng);\r
\r
+ // Remove tempElm created for old IE:s\r
+ dom.remove(tempElm);\r
+\r
viewPort = dom.getViewPort(editor.getWin());\r
\r
// scrollIntoView seems to scroll the parent window in most browsers now including FF 3.0b4 so it's time to stop using it and do it our selfs\r
function createNewBlock(name) {\r
var node = container, block, clonedNode, caretNode;\r
\r
- block = name ? dom.create(name) : parentBlock.cloneNode(false);\r
+ block = name || parentBlockName == "TABLE" ? dom.create(name || newBlockName) : parentBlock.cloneNode(false);\r
caretNode = block;\r
\r
// Clone any parent styles\r
- do {\r
- if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(node.nodeName)) {\r
- clonedNode = node.cloneNode(false);\r
- dom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique\r
-\r
- if (block.hasChildNodes()) {\r
- clonedNode.appendChild(block.firstChild);\r
- block.appendChild(clonedNode);\r
- } else {\r
- caretNode = clonedNode;\r
- block.appendChild(clonedNode);\r
+ if (settings.keep_styles !== false) {\r
+ do {\r
+ if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(node.nodeName)) {\r
+ clonedNode = node.cloneNode(false);\r
+ dom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique\r
+\r
+ if (block.hasChildNodes()) {\r
+ clonedNode.appendChild(block.firstChild);\r
+ block.appendChild(clonedNode);\r
+ } else {\r
+ caretNode = clonedNode;\r
+ block.appendChild(clonedNode);\r
+ }\r
}\r
- }\r
- } while (node = node.parentNode);\r
+ } while (node = node.parentNode);\r
+ }\r
\r
// BR is needed in empty blocks on non IE browsers\r
if (!tinymce.isIE) {\r
\r
// Returns true/false if the caret is at the start/end of the parent block element\r
function isCaretAtStartOrEndOfBlock(start) {\r
- var walker, node;\r
+ var walker, node, name;\r
\r
// Caret is in the middle of a text node like "a|b"\r
if (container.nodeType == 3 && (start ? offset > 0 : offset < container.nodeValue.length)) {\r
return false;\r
}\r
\r
+ // If after the last element in block node edge case for #5091\r
+ if (container.parentNode == parentBlock && isAfterLastNodeInContainer && !start) {\r
+ return true;\r
+ }\r
+\r
+ // Caret can be before/after a table\r
+ if (container.nodeName === "TABLE" || (container.previousSibling && container.previousSibling.nodeName == "TABLE")) {\r
+ return (isAfterLastNodeInContainer && !start) || (!isAfterLastNodeInContainer && start);\r
+ }\r
+\r
// Walk the DOM and look for text nodes or non empty elements\r
walker = new TreeWalker(container, parentBlock);\r
while (node = (start ? walker.prev() : walker.next())) {\r
\r
// Wraps any text nodes or inline elements in the specified forced root block name\r
function wrapSelfAndSiblingsInDefaultBlock(container, offset) {\r
- var newBlock, parentBlock, startNode, node, next;\r
+ var newBlock, parentBlock, startNode, node, next, blockName = newBlockName || 'P';\r
\r
// Not in a block element or in a table cell or caption\r
parentBlock = dom.getParent(container, dom.isBlock);\r
- if (newBlockName && !evt.shiftKey && (!parentBlock || !canSplitBlock(parentBlock))) {\r
- parentBlock = parentBlock || dom.getRoot();\r
+ if (!parentBlock || !canSplitBlock(parentBlock)) {\r
+ parentBlock = parentBlock || editableRoot;\r
\r
if (!parentBlock.hasChildNodes()) {\r
- newBlock = dom.create(newBlockName);\r
+ newBlock = dom.create(blockName);\r
parentBlock.appendChild(newBlock);\r
rng.setStart(newBlock, 0);\r
rng.setEnd(newBlock, 0);\r
}\r
\r
if (startNode) {\r
- newBlock = dom.create(newBlockName);\r
+ newBlock = dom.create(blockName);\r
startNode.parentNode.insertBefore(newBlock, startNode);\r
\r
// Start wrapping until we hit a block\r
\r
// Inserts a BR element if the forced_root_block option is set to false or empty string\r
function insertBr() {\r
- var brElm, extraBr, documentMode;\r
+ var brElm, extraBr;\r
\r
if (container && container.nodeType == 3 && offset >= container.nodeValue.length) {\r
// Insert extra BR element at the end block elements\r
rng.insertNode(brElm);\r
\r
// Rendering modes below IE8 doesn't display BR elements in PRE unless we have a \n before it\r
- documentMode = dom.doc.documentMode;\r
if (tinymce.isIE && parentBlockName == 'PRE' && (!documentMode || documentMode < 8)) {\r
brElm.parentNode.insertBefore(dom.doc.createTextNode('\r'), brElm);\r
}\r
node = node.firstChild;\r
} while (node);\r
};\r
- \r
+\r
+ function getEditableRoot(node) {\r
+ var root = dom.getRoot(), parent, editableRoot;\r
+\r
+ // Get all parents until we hit a non editable parent or the root\r
+ parent = node;\r
+ while (parent !== root && dom.getContentEditable(parent) !== "false") {\r
+ if (dom.getContentEditable(parent) === "true") {\r
+ editableRoot = parent;\r
+ }\r
+\r
+ parent = parent.parentNode;\r
+ }\r
+ \r
+ return parent !== root ? editableRoot : root;\r
+ };\r
+\r
// Delete any selected contents\r
if (!rng.collapsed) {\r
editor.execCommand('Delete');\r
offset = rng.startOffset;\r
newBlockName = settings.forced_root_block;\r
newBlockName = newBlockName ? newBlockName.toUpperCase() : '';\r
+ documentMode = dom.doc.documentMode;\r
\r
// Resolve node index\r
if (container.nodeType == 1 && container.hasChildNodes()) {\r
+ isAfterLastNodeInContainer = offset > container.childNodes.length - 1;\r
container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;\r
offset = 0;\r
}\r
\r
+ // Get editable root node normaly the body element but sometimes a div or span\r
+ editableRoot = getEditableRoot(container);\r
+\r
+ // If there is no editable root then enter is done inside a contentEditable false element\r
+ if (!editableRoot) {\r
+ return;\r
+ }\r
+\r
undoManager.beforeChange();\r
\r
+ // If editable root isn't block nor the root of the editor\r
+ if (!dom.isBlock(editableRoot) && editableRoot != dom.getRoot()) {\r
+ if (!newBlockName || evt.shiftKey) {\r
+ insertBr();\r
+ }\r
+\r
+ return;\r
+ }\r
+\r
// Wrap the current node and it's sibling in a default block if it's needed.\r
// for example this <td>text|<b>text2</b></td> will become this <td><p>text|<b>text2</p></b></td>\r
- container = wrapSelfAndSiblingsInDefaultBlock(container, offset);\r
+ // This won't happen if root blocks are disabled or the shiftKey is pressed\r
+ if ((newBlockName && !evt.shiftKey) || (!newBlockName && evt.shiftKey)) {\r
+ container = wrapSelfAndSiblingsInDefaultBlock(container, offset);\r
+ }\r
\r
// Find parent block and setup empty block paddings\r
parentBlock = dom.getParent(container, dom.isBlock);\r
});\r
};\r
})(tinymce);\r
+\r