TinyMCE 3.5.8 update; some fixes
This commit is contained in:
parent
c9cce9873d
commit
d39a2e8a9d
48 changed files with 2213 additions and 2054 deletions
|
@ -1,3 +1,116 @@
|
|||
Version 3.5.8 (2012-11-20)
|
||||
Fixed bug where html5 data attributes where stripped from contents.
|
||||
Fixed bug where toolbar was annouced multiple times with JAWS on Firefox.
|
||||
Fixed bug where the editor view whouldn't scroll to BR elements when using shift+enter or br enter mode.
|
||||
Fixed bug where a JS error would be thrown when trying to paste table rows then the rows clipboard was empty.
|
||||
Fixed bug with auto detection logic for youtube urls in the media plugin.
|
||||
Fixed bug where the formatter would throw errors if you used the jQuery version of TinyMCE and the latest jQuery.
|
||||
Fixed bug where the latest WebKit versions would produce span elements when deleting text between blocks.
|
||||
Fixed bug where the autolink plugin would produce DOM exceptions when pressing shift+enter inside a block element.
|
||||
Fixed bug where toggling of blockquotes when using br enter mode would produce an exception.
|
||||
Fixed bug where focusing out of the body of the editor wouldn't properly add an undo level.
|
||||
Fixed issue with warning message being displayed on IE 9+ about the meta header fix for IE 8.
|
||||
Version 3.5.7 (2012-09-20)
|
||||
Changed table row properties dialog to not update multiple rows when row type is header or footer.
|
||||
Fixed bug in hyperlink dialog for IE9 where links with no target attr set had target value of --
|
||||
Changing toolbars to have a toolbar role for FF keyboard navigation works correctly.
|
||||
Fixed bug where applying formatting to an empty block element would produce redundant spans.
|
||||
Fixed bug where caret formatting on IE wouldn't properly apply if you pressed enter/return.
|
||||
Fixed bug where loading TinyMCE using an async script wouldn't properly initialize editors.
|
||||
Fixed bug where some white space would be removed after inline elements before block elements.
|
||||
Fixed bug where it wouldn't properly parse attributes with a single backslash as it's contents.
|
||||
Fixed bug where noscript elements would loose it's contents on older IE versions.
|
||||
Fixed bug where backspace inside empty blockquote wouldn't delete it properly.
|
||||
Fixed bug where custom elements with . in their names wouldn't work properly.
|
||||
Fixed bug where the custom_elements option didn't properly setup the block elements schema structure.
|
||||
Fixed bug where the custom_elements option didn't auto populate the extended_valid_elements.
|
||||
Fixed bug where the whole TD element would get blcok formatted when there where BR elements in it.
|
||||
Fixed bug where IE 9 might crash if the editor was hidden and specific styles where applied to surrounding contents.
|
||||
Fixed bug where shift+enter inside a table cell on Gecko would produce an zero width non breaking space between tr:s.
|
||||
Fixed bug where the advlink dialog wouldn't properly populate the anchors dropdown if the HTML5 schema was used.
|
||||
Fixed issue with missing autofocus attribute on input element when using the HTML5 schema.
|
||||
Fixed issue where enter inside a block contained within an LI element wouldn't produce a new LI.
|
||||
Version 3.5.6 (2012-07-26)
|
||||
Added "text" as a valid option to the editor.getContent format option. Makes it easier to get a text representation of the editor contents.
|
||||
Fixed bug where resizing an image to less that 0x0 pixels would display the ghost image at an incorrect position.
|
||||
Fixed bug where the remove format button would produce extra paragraphs on WebKit if all of the contents was selected.
|
||||
Fixed issue where edge resize handles on images of wouldn't scale it with the same aspect ratio.
|
||||
Fixed so force_p_newlines option works again since some users want mixed mode paragraphs.
|
||||
Fixed so directionality plugin modifies the dir attribute of all selected blocks in the editor.
|
||||
Fixed bug where backspace/delete of a custom element would move it's attributes to the parent block on Gecko.
|
||||
Version 3.5.5 (2012-07-19)
|
||||
Added full resize support for images and tables on WebKit/Opera. It now behaves just like Gecko.
|
||||
Added automatic embed support for Vimeo, Stream.cz and Google Maps in media plugin. Patch contributed by Jakub Matas.
|
||||
Fixed bug where the lists plugin wouldn't properly remove all li elements when toggling selected items of. Patched by Taku AMANO.
|
||||
Fixed bug where the lists plugin would remove the entire list if you pressed deleted at the beginning of the first element. Patched by Taku AMANO.
|
||||
Fixed bug where the ordered/unordered list buttons could both be enabled if you nested lists. Patch contributed by Craig Petchell.
|
||||
Fixed bug where shift+enter wouldn't produce a BR in a LI when having forced_root_blocks set to false.
|
||||
Fixed bug where scrollbars aren't visible in fullscreen when window is resized.
|
||||
Fixed bug with updating the border size using the advimage dialog on IE 9.
|
||||
Fixed bug where the selection of inner elements on IE 8 in contentEditable mode would select the whole parent element.
|
||||
Fixed bug where the enter key would produce an empty anchor if you pressed it at the space after a link on IE.
|
||||
Fixed bug where autolink plugin would produce an exception for specific html see bug #5365
|
||||
Fixed so the formatChanged function takes an optional "similar" parameter to use while matching the format.
|
||||
Version 3.5.4.1 (2012-06-24)
|
||||
Fixed issue with Shift+A selecting all contents on Chrome.
|
||||
Version 3.5.4 (2012-06-21)
|
||||
Added missing mouse events to HTML5 schema. Some events needs to be manually defined though since the spec is huge.
|
||||
Added image resizing for WebKit browsers by faking the whole resize behavior.
|
||||
Fixed bug in context menu plugin where listener to hide menu wasn't removed correctly.
|
||||
Fixed bug where media plugin wouldn't use placeholder size for the object/video elements.
|
||||
Fixed bug where jQuery plugin would break attr function in jQuery 1.7.2.
|
||||
Fixed bug where jQuery plugin would throw an error if you used the tinymce pseudo selector when TinyMCE wasn't loaded.
|
||||
Fixed so encoding option gets applied when using jQuery val() or attr() to extract the contents.
|
||||
Fixed so any non valid width/height passed to media plugin would get parsed to proper integer or percent values.
|
||||
Version 3.5.3 (2012-06-19)
|
||||
Added missing wbr element to HTML5 schema.
|
||||
Added new mceToggleFormat command. Enabled you to toggle a specific format on/off.
|
||||
Fixed bug where undo/redo state didn't update correctly after executing an execCommand call.
|
||||
Fixed bug where the editor would get auto focused on IE running in quirks mode.
|
||||
Fixed bug where pressing enter before an IMG or INPUT element wouldn't properly split the block.
|
||||
Fixed bug where backspace would navigate back when selecting control types on IE.
|
||||
Fixed bug where the editor remove method would unbind events for controls outside the editor instance UI.
|
||||
Fixed bug where the autosave plugin would try to store a draft copy of editors that where removed.
|
||||
Fixed bug where floated elements wouldn't expand the block created when pressing enter on non IE browsers.
|
||||
Fixed bug where the caret would be placed in the wrong location when pressing enter at the beginning of a block.
|
||||
Fixed bug where it wasn't possible to block events using the handle_event_callback option.
|
||||
Fixed bug where keyboard navigation of the ColorSplitButton.js didn't work correctly.
|
||||
Fixed bug where keyboard navigation didn't work correctly on split buttons.
|
||||
Fixed bug where the legacy Event.add function didn't properly handle multiple id:s passed in.
|
||||
Fixed bug where the caret would disappear on IE when selecting all contents and pressing backspace/delete.
|
||||
Fixed bug where the getStart/getEnd methods would sometimes return elements from the wrong document on IE.
|
||||
Fixed so paragraphs gets created if you press enter inside a form element.
|
||||
Version 3.5.2 (2012-05-31)
|
||||
Added new formatChanged method to tinymce.Formatter class. Enables easier state change handling of formats.
|
||||
Added new selectorChanged method to tinymce.dom.Selection class. Enables easier state change handling of matching CSS selectors.
|
||||
Changed the default theme to be advanced instead of simple since most users uses the advanced theme.
|
||||
Changed so the theme_advanced_buttons doesn't have a default set if one button row is specified.
|
||||
Changed the theme_advanced_toolbar_align default value to "left".
|
||||
Changed the theme_advanced_toolbar_location default value to "top".
|
||||
Changed the theme_advanced_statusbar_location default value to "bottom".
|
||||
Fixed bug where the simple link dialog would remove class and target attributes from links when updating them if the drop downs wasn't visible.
|
||||
Fixed bug where the link/unlink buttons wouldn't get disabled once a link was created by the autolink plugin logic.
|
||||
Fixed bug where the border attribute was missing in the HTML5 schema.
|
||||
Fixed bug where the legacyoutput plugin would use inline styles for font color.
|
||||
Fixed bug where editing of anchor names wouldn't produce an undo level.
|
||||
Fixed bug where the table plugin would delete the last empty block element in the editor.
|
||||
Fixed bug where pasting table rows when they where selected would make it impossible to editor that table row.
|
||||
Fixed bug with pressing enter in IE while having a select list focused would produce a JS error.
|
||||
Fixed bug where it wasn't possible to merge table cells by selecting them and using merge from context menu.
|
||||
Removed summary from HTML5 table attributes and fixed so this and other deprecated table fields gets hidden in the table dialog.
|
||||
Version 3.5.1.1 (2012-05-25)
|
||||
Fixed bug with control creation where plugin specific controls didn't work as expected.
|
||||
Version 3.5.1 (2012-05-25)
|
||||
Added new onBeforeAdd event to UndoManager patch contributed by Dan Rumney.
|
||||
Added support for overriding the theme rendering logic by using a custom function.
|
||||
Fixed bug where links wasn't automatically created by the autolink plugin on old IE versions when pressing enter in BR mode.
|
||||
Fixed bug where enter on older IE versions wouldn't produce a new paragraph if the previous sibling paragraph was empty.
|
||||
Fixed bug where toString on a faked DOM range on older IE versions wouldn't return a proper string.
|
||||
Fixed bug where named anchors wouldn't work properly when schema was set to HTML5.
|
||||
Fixed bug where HTML5 datalist options wasn't correctly parsed or indented.
|
||||
Fixed bug where linking would add anchors around block elements when the HTML5 schema was used.
|
||||
Fixed issue where the autolink plugin wouldn't properly handle mailto:user@domain.com.
|
||||
Optimized initialization and reduced rendering flicker by hiding the target element while initializing.
|
||||
Version 3.5.0.1 (2012-05-10)
|
||||
Fixed bug where selection normalization logic would break the selections of parent elements using the element path.
|
||||
Fixed bug where the autolink plugin would include trailing dots in domain names in the link creation.
|
||||
|
@ -362,1201 +475,3 @@ Version 3.4 (2011-03-10)
|
|||
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.
|
||||
|
|
|
@ -395,12 +395,14 @@ var ImageDialog = {
|
|||
if (v == '0')
|
||||
img.style.border = isIE ? '0' : '0 none none';
|
||||
else {
|
||||
if (b.length == 3 && b[isIE ? 2 : 1])
|
||||
bStyle = b[isIE ? 2 : 1];
|
||||
var isOldIE = tinymce.isIE && (!document.documentMode || document.documentMode < 9);
|
||||
|
||||
if (b.length == 3 && b[isOldIE ? 2 : 1])
|
||||
bStyle = b[isOldIE ? 2 : 1];
|
||||
else if (!bStyle || bStyle == 'none')
|
||||
bStyle = 'solid';
|
||||
if (b.length == 3 && b[isIE ? 0 : 2])
|
||||
bColor = b[isIE ? 0 : 2];
|
||||
bColor = b[isOldIE ? 0 : 2];
|
||||
else if (!bColor || bColor == 'none')
|
||||
bColor = 'black';
|
||||
img.style.border = v + 'px ' + bStyle + ' ' + bColor;
|
||||
|
|
|
@ -64,13 +64,14 @@ function init() {
|
|||
if (elm != null && elm.nodeName == "A")
|
||||
action = "update";
|
||||
|
||||
formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true);
|
||||
formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true);
|
||||
|
||||
setPopupControlsDisabled(true);
|
||||
|
||||
if (action == "update") {
|
||||
var href = inst.dom.getAttrib(elm, 'href');
|
||||
var onclick = inst.dom.getAttrib(elm, 'onclick');
|
||||
var linkTarget = inst.dom.getAttrib(elm, 'target') ? inst.dom.getAttrib(elm, 'target') : "_self";
|
||||
|
||||
// Setup form data
|
||||
setFormValue('href', href);
|
||||
|
@ -98,7 +99,7 @@ function init() {
|
|||
setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress'));
|
||||
setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown'));
|
||||
setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup'));
|
||||
setFormValue('target', inst.dom.getAttrib(elm, 'target'));
|
||||
setFormValue('target', linkTarget);
|
||||
setFormValue('classes', inst.dom.getAttrib(elm, 'class'));
|
||||
|
||||
// Parse onclick data
|
||||
|
@ -119,7 +120,7 @@ function init() {
|
|||
addClassesToList('classlist', 'advlink_styles');
|
||||
|
||||
selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true);
|
||||
selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true);
|
||||
selectByValue(formObj, 'targetlist', linkTarget, true);
|
||||
} else
|
||||
addClassesToList('classlist', 'advlink_styles');
|
||||
}
|
||||
|
@ -377,6 +378,9 @@ function getAnchorListHTML(id, target) {
|
|||
for (i=0, len=nodes.length; i<len; i++) {
|
||||
if ((name = ed.dom.getAttrib(nodes[i], "name")) != "")
|
||||
html += '<option value="#' + name + '">' + name + '</option>';
|
||||
|
||||
if ((name = nodes[i].id) != "" && !nodes[i].href)
|
||||
html += '<option value="#' + name + '">' + name + '</option>';
|
||||
}
|
||||
|
||||
if (html == "")
|
||||
|
|
|
@ -1 +1 @@
|
|||
(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)})();
|
||||
(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}if(n.nodeType==3){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?f-2:0);a.setEnd(n,f>=1?f-1:0);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\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])&&!/^mailto:/.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);i.nodeChanged();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)})();
|
|
@ -89,8 +89,11 @@
|
|||
while (endContainer.nodeType != 3 && endContainer.firstChild)
|
||||
endContainer = endContainer.firstChild;
|
||||
|
||||
r.setStart(endContainer, 0);
|
||||
r.setEnd(endContainer, endContainer.nodeValue.length);
|
||||
// Move range to text node
|
||||
if (endContainer.nodeType == 3) {
|
||||
r.setStart(endContainer, 0);
|
||||
r.setEnd(endContainer, endContainer.nodeValue.length);
|
||||
}
|
||||
}
|
||||
|
||||
if (r.endOffset == 1)
|
||||
|
@ -104,8 +107,8 @@
|
|||
do
|
||||
{
|
||||
// Move the selection one character backwards.
|
||||
r.setStart(endContainer, end - 2);
|
||||
r.setEnd(endContainer, end - 1);
|
||||
r.setStart(endContainer, end >= 2 ? end - 2 : 0);
|
||||
r.setEnd(endContainer, end >= 1 ? end - 1 : 0);
|
||||
end -= 1;
|
||||
|
||||
// Loop until one of the following is found: a blank space, , delimeter, (end-2) >= 0
|
||||
|
@ -131,12 +134,12 @@
|
|||
}
|
||||
|
||||
text = r.toString();
|
||||
matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|[A-Z0-9._%+-]+@)(.+)$/i);
|
||||
matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);
|
||||
|
||||
if (matches) {
|
||||
if (matches[1] == 'www.') {
|
||||
matches[1] = 'http://www.';
|
||||
} else if (/@$/.test(matches[1])) {
|
||||
} else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
|
||||
matches[1] = 'mailto:' + matches[1];
|
||||
}
|
||||
|
||||
|
@ -145,6 +148,7 @@
|
|||
ed.selection.setRng(r);
|
||||
tinyMCE.execCommand('createlink',false, matches[1] + matches[2]);
|
||||
ed.selection.moveToBookmark(bookmark);
|
||||
ed.nodeChanged();
|
||||
|
||||
// TODO: Determine if this is still needed.
|
||||
if (tinyMCE.isWebKit) {
|
||||
|
|
|
@ -1 +1 @@
|
|||
(function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){h.storeDraft();i.nodeChanged()},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();try{m.save("TinyMCE")}catch(o){}},getItem:function(l){var m=i.getElement();try{m.load("TinyMCE");return m.getAttribute(l)}catch(n){return null}},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,j=h.storage,i;if(j){i=j.getItem(h.key);if(i){h.editor.setContent(i);h.onRestoreDraft.dispatch(h,{content:i})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()<i.getTime()){return b}h.removeDraft()}else{return b}}}return false},removeDraft:function(){var h=this,k=h.storage,i=h.key,j;if(k){j=k.getItem(i);k.removeItem(i);k.removeItem(i+"_expires");if(j){h.onRemoveDraft.dispatch(h,{content:j})}}},"static":{_beforeUnloadHandler:function(h){var i;e.each(tinyMCE.editors,function(j){if(j.plugins.autosave){j.plugins.autosave.storeDraft()}if(j.getParam("fullscreen_is_enabled")){return}if(!i&&j.isDirty()&&j.getParam("autosave_ask_before_unload")){i=j.getLang("autosave.unload_msg")}});return i}}});e.PluginManager.add("autosave",e.plugins.AutoSave)})(tinymce);
|
||||
(function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){if(!i.removed){h.storeDraft();i.nodeChanged()}},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();try{m.save("TinyMCE")}catch(o){}},getItem:function(l){var m=i.getElement();try{m.load("TinyMCE");return m.getAttribute(l)}catch(n){return null}},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,j=h.storage,i;if(j){i=j.getItem(h.key);if(i){h.editor.setContent(i);h.onRestoreDraft.dispatch(h,{content:i})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()<i.getTime()){return b}h.removeDraft()}else{return b}}}return false},removeDraft:function(){var h=this,k=h.storage,i=h.key,j;if(k){j=k.getItem(i);k.removeItem(i);k.removeItem(i+"_expires");if(j){h.onRemoveDraft.dispatch(h,{content:j})}}},"static":{_beforeUnloadHandler:function(h){var i;e.each(tinyMCE.editors,function(j){if(j.plugins.autosave){j.plugins.autosave.storeDraft()}if(j.getParam("fullscreen_is_enabled")){return}if(!i&&j.isDirty()&&j.getParam("autosave_ask_before_unload")){i=j.getLang("autosave.unload_msg")}});return i}}});e.PluginManager.add("autosave",e.plugins.AutoSave)})(tinymce);
|
|
@ -136,8 +136,10 @@
|
|||
|
||||
// Auto save contents each interval time
|
||||
setInterval(function() {
|
||||
self.storeDraft();
|
||||
ed.nodeChanged();
|
||||
if (!ed.removed) {
|
||||
self.storeDraft();
|
||||
ed.nodeChanged();
|
||||
}
|
||||
}, settings.autosave_interval);
|
||||
}
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,268 +1,311 @@
|
|||
/**
|
||||
* editor_plugin_src.js
|
||||
*
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
/* Macgirvin Aug-2010 changed from punbb to dfrn dialect */
|
||||
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.BBCodePlugin', {
|
||||
init : function(ed, url) {
|
||||
var t = this, dialect = ed.getParam('bbcode_dialect', 'dfrn').toLowerCase();
|
||||
|
||||
ed.onBeforeSetContent.add(function(ed, o) {
|
||||
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
||||
});
|
||||
|
||||
ed.onPostProcess.add(function(ed, o) {
|
||||
if (o.set)
|
||||
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
||||
|
||||
if (o.get)
|
||||
o.content = t['_' + dialect + '_html2bbcode'](o.content);
|
||||
});
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'BBCode Plugin',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
},
|
||||
|
||||
// Private methods
|
||||
|
||||
// HTML -> BBCode in DFRN dialect
|
||||
_dfrn_html2bbcode : function(s) {
|
||||
s = tinymce.trim(s);
|
||||
|
||||
function rep(re, str) {
|
||||
|
||||
|
||||
s = s.replace(re,str);
|
||||
|
||||
//modify code to keep stuff intact within [code][/code] blocks
|
||||
//Waitman Gobble NO WARRANTY
|
||||
|
||||
/* This doesn't seem to work well with
|
||||
[code]line1
|
||||
line2[/code]
|
||||
commenting out for now
|
||||
*/
|
||||
|
||||
/*
|
||||
var o = new Array();
|
||||
var x = s.split("[code]");
|
||||
var i = 0;
|
||||
|
||||
var si = "";
|
||||
si = x.shift();
|
||||
si = si.replace(re,str);
|
||||
o.push(si);
|
||||
|
||||
for (i = 0; i < x.length; i++) {
|
||||
var no = new Array();
|
||||
var j = x.shift();
|
||||
var g = j.split("[/code]");
|
||||
no.push(g.shift());
|
||||
si = g.shift();
|
||||
si = si.replace(re,str);
|
||||
no.push(si);
|
||||
o.push(no.join("[/code]"));
|
||||
}
|
||||
|
||||
s = o.join("[code]");
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/* oembed */
|
||||
function _h2b_cb(match) {
|
||||
/*
|
||||
function s_h2b(data) {
|
||||
match = data;
|
||||
}
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url: 'oembed/h2b',
|
||||
data: {text: match},
|
||||
async: false,
|
||||
success: s_h2b,
|
||||
dataType: 'html'
|
||||
});
|
||||
*/
|
||||
|
||||
var f, g, tof = [], tor = [];
|
||||
var find_spanc = /<span [^>]*class *= *[\"'](?:[^\"']* )*oembed(?: [^\"']*)*[\"'][^>]*>(.*?(?:<span[^>]*>(.*?)<\/span *>)*.*?)<\/span *>/ig;
|
||||
while (f = find_spanc.exec(match)) {
|
||||
var find_a = /<a([^>]* rel=[\"']oembed[\"'][^>]*)>.*?<\/a *>/ig;
|
||||
if (g = find_a.exec(f[1])) {
|
||||
var find_href = /href=[\"']([^\"']*)[\"']/ig;
|
||||
var m2 = find_href.exec(g[1]);
|
||||
if (m2[1]) {
|
||||
tof.push(f[0]);
|
||||
tor.push("[EMBED]" + m2[1] + "[/EMBED]");
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < tof.length; i++) match = match.replace(tof[i], tor[i]);
|
||||
|
||||
return match;
|
||||
}
|
||||
if (s.indexOf('class="oembed')>=0){
|
||||
//alert("request oembed html2bbcode");
|
||||
s = _h2b_cb(s);
|
||||
}
|
||||
|
||||
/* /oembed */
|
||||
|
||||
|
||||
// example: <strong> to [b]
|
||||
rep(/<a class=\"bookmark\" href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[bookmark=$1]$2[/bookmark]");
|
||||
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
|
||||
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
|
||||
rep(/<span style=\"color:(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
|
||||
rep(/<font>(.*?)<\/font>/gi,"$1");
|
||||
rep(/<img.*?width=\"(.*?)\".*?height=\"(.*?)\".*?src=\"(.*?)\".*?\/>/gi,"[img=$1x$2]$3[/img]");
|
||||
rep(/<img.*?height=\"(.*?)\".*?width=\"(.*?)\".*?src=\"(.*?)\".*?\/>/gi,"[img=$2x$1]$3[/img]");
|
||||
rep(/<img.*?src=\"(.*?)\".*?height=\"(.*?)\".*?width=\"(.*?)\".*?\/>/gi,"[img=$3x$2]$1[/img]");
|
||||
rep(/<img.*?src=\"(.*?)\".*?width=\"(.*?)\".*?height=\"(.*?)\".*?\/>/gi,"[img=$2x$3]$1[/img]");
|
||||
rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
|
||||
|
||||
rep(/<ul class=\"listbullet\" style=\"list-style-type\: circle\;\">(.*?)<\/ul>/gi,"[list]$1[/list]");
|
||||
rep(/<ul class=\"listnone\" style=\"list-style-type\: none\;\">(.*?)<\/ul>/gi,"[list=]$1[/list]");
|
||||
rep(/<ul class=\"listdecimal\" style=\"list-style-type\: decimal\;\">(.*?)<\/ul>/gi,"[list=1]$1[/list]");
|
||||
rep(/<ul class=\"listlowerroman\" style=\"list-style-type\: lower-roman\;\">(.*?)<\/ul>/gi,"[list=i]$1[/list]");
|
||||
rep(/<ul class=\"listupperroman\" style=\"list-style-type\: upper-roman\;\">(.*?)<\/ul>/gi,"[list=I]$1[/list]");
|
||||
rep(/<ul class=\"listloweralpha\" style=\"list-style-type\: lower-alpha\;\">(.*?)<\/ul>/gi,"[list=a]$1[/list]");
|
||||
rep(/<ul class=\"listupperalpha\" style=\"list-style-type\: upper-alpha\;\">(.*?)<\/ul>/gi,"[list=A]$1[/list]");
|
||||
rep(/<li>(.*?)<\/li>/gi,'[li]$1[/li]');
|
||||
|
||||
rep(/<code>(.*?)<\/code>/gi,"[code]$1[/code]");
|
||||
rep(/<\/(strong|b)>/gi,"[/b]");
|
||||
rep(/<(strong|b)>/gi,"[b]");
|
||||
rep(/<\/(em|i)>/gi,"[/i]");
|
||||
rep(/<(em|i)>/gi,"[i]");
|
||||
rep(/<\/u>/gi,"[/u]");
|
||||
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
|
||||
rep(/<u>/gi,"[u]");
|
||||
rep(/<blockquote[^>]*>/gi,"[quote]");
|
||||
rep(/<\/blockquote>/gi,"[/quote]");
|
||||
rep(/<hr \/>/gi,"[hr]");
|
||||
rep(/<br (.*?)\/>/gi,"\n");
|
||||
rep(/<br\/>/gi,"\n");
|
||||
rep(/<br>/gi,"\n");
|
||||
rep(/<p>/gi,"");
|
||||
rep(/<\/p>/gi,"\n");
|
||||
rep(/ /gi," ");
|
||||
rep(/"/gi,"\"");
|
||||
rep(/</gi,"<");
|
||||
rep(/>/gi,">");
|
||||
rep(/&/gi,"&");
|
||||
|
||||
return s;
|
||||
},
|
||||
|
||||
// BBCode -> HTML from DFRN dialect
|
||||
_dfrn_bbcode2html : function(s) {
|
||||
s = tinymce.trim(s);
|
||||
|
||||
|
||||
function rep(re, str) {
|
||||
|
||||
|
||||
//modify code to keep stuff intact within [code][/code] blocks
|
||||
//Waitman Gobble NO WARRANTY
|
||||
|
||||
|
||||
var o = new Array();
|
||||
var x = s.split("[code]");
|
||||
var i = 0;
|
||||
|
||||
var si = "";
|
||||
si = x.shift();
|
||||
si = si.replace(re,str);
|
||||
o.push(si);
|
||||
|
||||
for (i = 0; i < x.length; i++) {
|
||||
var no = new Array();
|
||||
var j = x.shift();
|
||||
var g = j.split("[/code]");
|
||||
no.push(g.shift());
|
||||
si = g.shift();
|
||||
si = si.replace(re,str);
|
||||
no.push(si);
|
||||
o.push(no.join("[/code]"));
|
||||
}
|
||||
|
||||
s = o.join("[code]");
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// example: [b] to <strong>
|
||||
rep(/\n/gi,"<br />");
|
||||
rep(/\[b\]/gi,"<strong>");
|
||||
rep(/\[\/b\]/gi,"</strong>");
|
||||
rep(/\[i\]/gi,"<em>");
|
||||
rep(/\[\/i\]/gi,"</em>");
|
||||
rep(/\[u\]/gi,"<u>");
|
||||
rep(/\[\/u\]/gi,"</u>");
|
||||
rep(/\[hr\]/gi,"<hr />");
|
||||
rep(/\[bookmark=([^\]]+)\](.*?)\[\/bookmark\]/gi,"<a class=\"bookmark\" href=\"$1\">$2</a>");
|
||||
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");
|
||||
rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
|
||||
rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,"<img width=\"$1\" height=\"$2\" src=\"$3\" />");
|
||||
rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
|
||||
|
||||
rep(/\[list\](.*?)\[\/list\]/gi, '<ul class="listbullet" style="list-style-type: circle;">$1</ul>');
|
||||
rep(/\[list=\](.*?)\[\/list\]/gi, '<ul class="listnone" style="list-style-type: none;">$1</ul>');
|
||||
rep(/\[list=1\](.*?)\[\/list\]/gi, '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>');
|
||||
rep(/\[list=i\](.*?)\[\/list\]/gi,'<ul class="listlowerroman" style="list-style-type: lower-roman;">$1</ul>');
|
||||
rep(/\[list=I\](.*?)\[\/list\]/gi, '<ul class="listupperroman" style="list-style-type: upper-roman;">$1</ul>');
|
||||
rep(/\[list=a\](.*?)\[\/list\]/gi, '<ul class="listloweralpha" style="list-style-type: lower-alpha;">$1</ul>');
|
||||
rep(/\[list=A\](.*?)\[\/list\]/gi, '<ul class="listupperalpha" style="list-style-type: upper-alpha;">$1</ul>');
|
||||
rep(/\[li\](.*?)\[\/li\]/gi, '<li>$1</li>');
|
||||
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<span style=\"color: $1;\">$2</span>");
|
||||
rep(/\[size=(.*?)\](.*?)\[\/size\]/gi,"<span style=\"font-size: $1;\">$2</span>");
|
||||
rep(/\[code\](.*?)\[\/code\]/gi,"<code>$1</code>");
|
||||
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<blockquote>$1</blockquote>");
|
||||
|
||||
/* oembed */
|
||||
function _b2h_cb(match, url) {
|
||||
url = bin2hex(url);
|
||||
function s_b2h(data) {
|
||||
match = data;
|
||||
}
|
||||
$.ajax({
|
||||
url: 'oembed/b2h?url=' + url,
|
||||
async: false,
|
||||
success: s_b2h,
|
||||
dataType: 'html'
|
||||
});
|
||||
return match;
|
||||
}
|
||||
s = s.replace(/\[embed\](.*?)\[\/embed\]/gi, _b2h_cb);
|
||||
|
||||
/* /oembed */
|
||||
|
||||
return s;
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
|
||||
})();
|
||||
/**
|
||||
* editor_plugin_src.js
|
||||
*
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
/* Macgirvin Aug-2010 changed from punbb to dfrn dialect */
|
||||
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.BBCodePlugin', {
|
||||
init : function(ed, url) {
|
||||
var t = this, dialect = ed.getParam('bbcode_dialect', 'dfrn').toLowerCase();
|
||||
|
||||
ed.onBeforeSetContent.add(function(ed, o) {
|
||||
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
||||
});
|
||||
|
||||
ed.onPostProcess.add(function(ed, o) {
|
||||
if (o.set)
|
||||
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
||||
|
||||
if (o.get)
|
||||
o.content = t['_' + dialect + '_html2bbcode'](o.content);
|
||||
});
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'BBCode Plugin',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
},
|
||||
|
||||
// Private methods
|
||||
|
||||
// HTML -> BBCode in DFRN dialect
|
||||
_dfrn_html2bbcode : function(s) {
|
||||
s = tinymce.trim(s);
|
||||
|
||||
function rep(re, str) {
|
||||
|
||||
|
||||
s = s.replace(re,str);
|
||||
|
||||
//modify code to keep stuff intact within [code][/code] blocks
|
||||
//Waitman Gobble NO WARRANTY
|
||||
|
||||
/* This doesn't seem to work well with
|
||||
[code]line1
|
||||
line2[/code]
|
||||
commenting out for now
|
||||
*/
|
||||
|
||||
/*
|
||||
var o = new Array();
|
||||
var x = s.split("[code]");
|
||||
var i = 0;
|
||||
|
||||
var si = "";
|
||||
si = x.shift();
|
||||
si = si.replace(re,str);
|
||||
o.push(si);
|
||||
|
||||
for (i = 0; i < x.length; i++) {
|
||||
var no = new Array();
|
||||
var j = x.shift();
|
||||
var g = j.split("[/code]");
|
||||
no.push(g.shift());
|
||||
si = g.shift();
|
||||
si = si.replace(re,str);
|
||||
no.push(si);
|
||||
o.push(no.join("[/code]"));
|
||||
}
|
||||
|
||||
s = o.join("[code]");
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
function get(re) {
|
||||
return s.match(re);
|
||||
}
|
||||
|
||||
|
||||
/* oembed */
|
||||
function _h2b_cb(match) {
|
||||
/*
|
||||
function s_h2b(data) {
|
||||
match = data;
|
||||
}
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url: 'oembed/h2b',
|
||||
data: {text: match},
|
||||
async: false,
|
||||
success: s_h2b,
|
||||
dataType: 'html'
|
||||
});
|
||||
*/
|
||||
|
||||
var f, g, tof = [], tor = [];
|
||||
var find_spanc = /<span [^>]*class *= *[\"'](?:[^\"']* )*oembed(?: [^\"']*)*[\"'][^>]*>(.*?(?:<span[^>]*>(.*?)<\/span *>)*.*?)<\/span *>/ig;
|
||||
while (f = find_spanc.exec(match)) {
|
||||
var find_a = /<a([^>]* rel=[\"']oembed[\"'][^>]*)>.*?<\/a *>/ig;
|
||||
if (g = find_a.exec(f[1])) {
|
||||
var find_href = /href=[\"']([^\"']*)[\"']/ig;
|
||||
var m2 = find_href.exec(g[1]);
|
||||
if (m2[1]) {
|
||||
tof.push(f[0]);
|
||||
tor.push("[EMBED]" + m2[1] + "[/EMBED]");
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < tof.length; i++) match = match.replace(tof[i], tor[i]);
|
||||
|
||||
return match;
|
||||
}
|
||||
|
||||
if (s.indexOf('class="oembed')>=0){
|
||||
//alert("request oembed html2bbcode");
|
||||
s = _h2b_cb(s);
|
||||
}
|
||||
|
||||
/* /oembed */
|
||||
|
||||
|
||||
// Preserve HTML tags inside code blocks
|
||||
var codes = get(/<code>(.*?)<\/code>/gi);
|
||||
rep(/<code>(.*?)<\/code>/gi,"[$!$!CODEBLOCK!$!$]");
|
||||
|
||||
// example: <strong> to [b]
|
||||
rep(/<a class=\"bookmark\" href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[bookmark=$1]$2[/bookmark]");
|
||||
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
|
||||
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
|
||||
rep(/<span style=\"color:(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
|
||||
rep(/<font>(.*?)<\/font>/gi,"$1");
|
||||
|
||||
// Use [^>]* instead of .* to prevent a match against two separate <img> tags
|
||||
rep(/<img[^>]*?width=\"([^>]*?)\"[^>]*?height=\"([^>]*?)\"[^>]*?src=\"([^>]*?)\"[^>]*?\/>/gi,"[img=$1x$2]$3[/img]");
|
||||
rep(/<img[^>]*?height=\"([^>]*?)\"[^>]*?width=\"([^>]*?)\"[^>]*?src=\"([^>]*?)\"[^>]*?\/>/gi,"[img=$2x$1]$3[/img]");
|
||||
rep(/<img[^>]*?src=\"([^>]*?)\"[^>]*?height=\"([^>]*?)\"[^>]*?width=\"([^>]*?)\"[^>]*?\/>/gi,"[img=$3x$2]$1[/img]");
|
||||
rep(/<img[^>]*?src=\"([^>]*?)\"[^>]*?width=\"([^>]*?)\"[^>]*?height=\"([^>]*?)\"[^>]*?\/>/gi,"[img=$2x$3]$1[/img]");
|
||||
rep(/<img[^>]*?src=\"([^>]*?)\"[^>]*?\/>/gi,"[img]$1[/img]");
|
||||
|
||||
rep(/<ul class=\"listbullet\" style=\"list-style-type\: circle\;\">(.*?)<\/ul>/gi,"[list]$1[/list]");
|
||||
rep(/<ul class=\"listnone\" style=\"list-style-type\: none\;\">(.*?)<\/ul>/gi,"[list=]$1[/list]");
|
||||
rep(/<ul class=\"listdecimal\" style=\"list-style-type\: decimal\;\">(.*?)<\/ul>/gi,"[list=1]$1[/list]");
|
||||
rep(/<ul class=\"listlowerroman\" style=\"list-style-type\: lower-roman\;\">(.*?)<\/ul>/gi,"[list=i]$1[/list]");
|
||||
rep(/<ul class=\"listupperroman\" style=\"list-style-type\: upper-roman\;\">(.*?)<\/ul>/gi,"[list=I]$1[/list]");
|
||||
rep(/<ul class=\"listloweralpha\" style=\"list-style-type\: lower-alpha\;\">(.*?)<\/ul>/gi,"[list=a]$1[/list]");
|
||||
rep(/<ul class=\"listupperalpha\" style=\"list-style-type\: upper-alpha\;\">(.*?)<\/ul>/gi,"[list=A]$1[/list]");
|
||||
rep(/<li>(.*?)<\/li>/gi,'[li]$1[/li]');
|
||||
|
||||
//rep(/<code>(.*?)<\/code>/gi,"[code]$1[/code]");
|
||||
rep(/<\/(strong|b)>/gi,"[/b]");
|
||||
rep(/<(strong|b)>/gi,"[b]");
|
||||
rep(/<\/(em|i)>/gi,"[/i]");
|
||||
rep(/<(em|i)>/gi,"[i]");
|
||||
rep(/<\/u>/gi,"[/u]");
|
||||
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
|
||||
rep(/<u>/gi,"[u]");
|
||||
rep(/<blockquote[^>]*>/gi,"[quote]");
|
||||
rep(/<\/blockquote>/gi,"[/quote]");
|
||||
rep(/<hr \/>/gi,"[hr]");
|
||||
rep(/<br (.*?)\/>/gi,"\n");
|
||||
rep(/<br\/>/gi,"\n");
|
||||
rep(/<br>/gi,"\n");
|
||||
rep(/<p>/gi,"");
|
||||
rep(/<\/p>/gi,"\n");
|
||||
rep(/ |\u00a0/gi," ");
|
||||
rep(/"/gi,"\"");
|
||||
rep(/</gi,"<");
|
||||
rep(/>/gi,">");
|
||||
rep(/&/gi,"&");
|
||||
|
||||
// Hack to fix an annoying bug of TinyMCE where block formats don't
|
||||
// work when forced_root_block = ''. So set forced_root_block = 'div'
|
||||
// and then strip out the divs manually
|
||||
rep(/<div>/gi,"");
|
||||
rep(/<\/div>/gi,"");
|
||||
|
||||
if(codes != null) {
|
||||
for(var i=0; i<codes.length; i++) {
|
||||
codes[i] = codes[i].replace("<code>","");
|
||||
codes[i] = codes[i].replace("</code>","");
|
||||
rep(/\[\$!\$!CODEBLOCK!\$!\$\]/i,"[code]"+codes[i]+"[/code]");
|
||||
}
|
||||
}
|
||||
|
||||
return s;
|
||||
},
|
||||
|
||||
// BBCode -> HTML from DFRN dialect
|
||||
_dfrn_bbcode2html : function(s) {
|
||||
s = tinymce.trim(s);
|
||||
|
||||
|
||||
function rep(re, str) {
|
||||
|
||||
|
||||
/*//modify code to keep stuff intact within [code][/code] blocks
|
||||
//Waitman Gobble NO WARRANTY
|
||||
|
||||
|
||||
var o = new Array();
|
||||
var x = s.split("[code]");
|
||||
var i = 0;
|
||||
|
||||
var si = "";
|
||||
si = x.shift();
|
||||
si = si.replace(re,str);
|
||||
o.push(si);
|
||||
|
||||
for (i = 0; i < x.length; i++) {
|
||||
var no = new Array();
|
||||
var j = x.shift();
|
||||
var g = j.split("[/code]");
|
||||
no.push(g.shift());
|
||||
si = g.shift();
|
||||
si = si.replace(re,str);
|
||||
no.push(si);
|
||||
o.push(no.join("[/code]"));
|
||||
}
|
||||
|
||||
s = o.join("[code]");*/
|
||||
|
||||
s = s.replace(re, str);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
function get(re) {
|
||||
return s.match(re);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Preserve HTML tags inside code blocks
|
||||
var codes = get(/\[code\](.*?)\[\/code\]/gi);
|
||||
rep(/\[code\](.*?)\[\/code\]/gi,"[$!$!CODEBLOCK!$!$]");
|
||||
|
||||
// example: [b] to <strong>
|
||||
rep(/\n/gi,"<br />");
|
||||
rep(/\[b\]/gi,"<strong>");
|
||||
rep(/\[\/b\]/gi,"</strong>");
|
||||
rep(/\[i\]/gi,"<em>");
|
||||
rep(/\[\/i\]/gi,"</em>");
|
||||
rep(/\[u\]/gi,"<u>");
|
||||
rep(/\[\/u\]/gi,"</u>");
|
||||
rep(/\[hr\]/gi,"<hr />");
|
||||
rep(/\[bookmark=([^\]]+)\](.*?)\[\/bookmark\]/gi,"<a class=\"bookmark\" href=\"$1\">$2</a>");
|
||||
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");
|
||||
rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
|
||||
rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,"<img width=\"$1\" height=\"$2\" src=\"$3\" />");
|
||||
rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
|
||||
|
||||
rep(/\[list\](.*?)\[\/list\]/gi, '<ul class="listbullet" style="list-style-type: circle;">$1</ul>');
|
||||
rep(/\[list=\](.*?)\[\/list\]/gi, '<ul class="listnone" style="list-style-type: none;">$1</ul>');
|
||||
rep(/\[list=1\](.*?)\[\/list\]/gi, '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>');
|
||||
rep(/\[list=i\](.*?)\[\/list\]/gi,'<ul class="listlowerroman" style="list-style-type: lower-roman;">$1</ul>');
|
||||
rep(/\[list=I\](.*?)\[\/list\]/gi, '<ul class="listupperroman" style="list-style-type: upper-roman;">$1</ul>');
|
||||
rep(/\[list=a\](.*?)\[\/list\]/gi, '<ul class="listloweralpha" style="list-style-type: lower-alpha;">$1</ul>');
|
||||
rep(/\[list=A\](.*?)\[\/list\]/gi, '<ul class="listupperalpha" style="list-style-type: upper-alpha;">$1</ul>');
|
||||
rep(/\[li\](.*?)\[\/li\]/gi, '<li>$1</li>');
|
||||
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<span style=\"color: $1;\">$2</span>");
|
||||
rep(/\[size=(.*?)\](.*?)\[\/size\]/gi,"<span style=\"font-size: $1;\">$2</span>");
|
||||
//rep(/\[code\](.*?)\[\/code\]/gi,"<code>$1</code>");
|
||||
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<blockquote>$1</blockquote>");
|
||||
|
||||
/* oembed */
|
||||
function _b2h_cb(match, url) {
|
||||
url = bin2hex(url);
|
||||
function s_b2h(data) {
|
||||
match = data;
|
||||
}
|
||||
$.ajax({
|
||||
url: 'oembed/b2h?url=' + url,
|
||||
async: false,
|
||||
success: s_b2h,
|
||||
dataType: 'html'
|
||||
});
|
||||
return match;
|
||||
}
|
||||
|
||||
s = s.replace(/\[embed\](.*?)\[\/embed\]/gi, _b2h_cb);
|
||||
|
||||
/* /oembed */
|
||||
|
||||
if(codes != null) {
|
||||
for(var i=0; i<codes.length; i++) {
|
||||
codes[i] = codes[i].replace("[code]","");
|
||||
codes[i] = codes[i].replace("[/code]","");
|
||||
rep(/\[\$!\$!CODEBLOCK!\$!\$\]/i,"<code>"+codes[i]+"</code>");
|
||||
}
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
|
||||
})();
|
||||
|
|
1
library/tinymce/jscripts/tiny_mce/plugins/bbcode/orig/editor_plugin.js
vendored
Normal file
1
library/tinymce/jscripts/tiny_mce/plugins/bbcode/orig/editor_plugin.js
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/<font>(.*?)<\/font>/gi,"$1");b(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");b(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");b(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");b(/<u>/gi,"[u]");b(/<blockquote[^>]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/<br \/>/gi,"\n");b(/<br\/>/gi,"\n");b(/<br>/gi,"\n");b(/<p>/gi,"");b(/<\/p>/gi,"\n");b(/ |\u00a0/gi," ");b(/"/gi,'"');b(/</gi,"<");b(/>/gi,">");b(/&/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"<br />");b(/\[b\]/gi,"<strong>");b(/\[\/b\]/gi,"</strong>");b(/\[i\]/gi,"<em>");b(/\[\/i\]/gi,"</em>");b(/\[u\]/gi,"<u>");b(/\[\/u\]/gi,"</u>");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>');b(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>');b(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>');b(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span> ');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span> ');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})();
|
120
library/tinymce/jscripts/tiny_mce/plugins/bbcode/orig/editor_plugin_src.js
vendored
Normal file
120
library/tinymce/jscripts/tiny_mce/plugins/bbcode/orig/editor_plugin_src.js
vendored
Normal file
|
@ -0,0 +1,120 @@
|
|||
/**
|
||||
* editor_plugin_src.js
|
||||
*
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.BBCodePlugin', {
|
||||
init : function(ed, url) {
|
||||
var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();
|
||||
|
||||
ed.onBeforeSetContent.add(function(ed, o) {
|
||||
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
||||
});
|
||||
|
||||
ed.onPostProcess.add(function(ed, o) {
|
||||
if (o.set)
|
||||
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
||||
|
||||
if (o.get)
|
||||
o.content = t['_' + dialect + '_html2bbcode'](o.content);
|
||||
});
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'BBCode Plugin',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
},
|
||||
|
||||
// Private methods
|
||||
|
||||
// HTML -> BBCode in PunBB dialect
|
||||
_punbb_html2bbcode : function(s) {
|
||||
s = tinymce.trim(s);
|
||||
|
||||
function rep(re, str) {
|
||||
s = s.replace(re, str);
|
||||
};
|
||||
|
||||
// example: <strong> to [b]
|
||||
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
|
||||
rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
|
||||
rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
|
||||
rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
|
||||
rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
|
||||
rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
|
||||
rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");
|
||||
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
|
||||
rep(/<font>(.*?)<\/font>/gi,"$1");
|
||||
rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
|
||||
rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");
|
||||
rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");
|
||||
rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");
|
||||
rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");
|
||||
rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");
|
||||
rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");
|
||||
rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");
|
||||
rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");
|
||||
rep(/<\/(strong|b)>/gi,"[/b]");
|
||||
rep(/<(strong|b)>/gi,"[b]");
|
||||
rep(/<\/(em|i)>/gi,"[/i]");
|
||||
rep(/<(em|i)>/gi,"[i]");
|
||||
rep(/<\/u>/gi,"[/u]");
|
||||
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
|
||||
rep(/<u>/gi,"[u]");
|
||||
rep(/<blockquote[^>]*>/gi,"[quote]");
|
||||
rep(/<\/blockquote>/gi,"[/quote]");
|
||||
rep(/<br \/>/gi,"\n");
|
||||
rep(/<br\/>/gi,"\n");
|
||||
rep(/<br>/gi,"\n");
|
||||
rep(/<p>/gi,"");
|
||||
rep(/<\/p>/gi,"\n");
|
||||
rep(/ |\u00a0/gi," ");
|
||||
rep(/"/gi,"\"");
|
||||
rep(/</gi,"<");
|
||||
rep(/>/gi,">");
|
||||
rep(/&/gi,"&");
|
||||
|
||||
return s;
|
||||
},
|
||||
|
||||
// BBCode -> HTML from PunBB dialect
|
||||
_punbb_bbcode2html : function(s) {
|
||||
s = tinymce.trim(s);
|
||||
|
||||
function rep(re, str) {
|
||||
s = s.replace(re, str);
|
||||
};
|
||||
|
||||
// example: [b] to <strong>
|
||||
rep(/\n/gi,"<br />");
|
||||
rep(/\[b\]/gi,"<strong>");
|
||||
rep(/\[\/b\]/gi,"</strong>");
|
||||
rep(/\[i\]/gi,"<em>");
|
||||
rep(/\[\/i\]/gi,"</em>");
|
||||
rep(/\[u\]/gi,"<u>");
|
||||
rep(/\[\/u\]/gi,"</u>");
|
||||
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");
|
||||
rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
|
||||
rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
|
||||
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");
|
||||
rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span> ");
|
||||
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span> ");
|
||||
|
||||
return s;
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
|
||||
})();
|
|
@ -1 +1 @@
|
|||
(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(e){var h=this,f,d,i;h.editor=e;d=e.settings.contextmenu_never_use_native;h.onContextMenu=new tinymce.util.Dispatcher(this);f=e.onContextMenu.add(function(j,k){if((i!==0?i:k.ctrlKey)&&!d){return}a.cancel(k);if(k.target.nodeName=="IMG"){j.selection.select(k.target)}h._getMenu(j).showMenu(k.clientX||k.pageX,k.clientY||k.pageY);a.add(j.getDoc(),"click",function(l){g(j,l)});j.nodeChanged()});e.onRemove.add(function(){if(h._menu){h._menu.removeAll()}});function g(j,k){i=0;if(k&&k.button==2){i=k.ctrlKey;return}if(h._menu){h._menu.removeAll();h._menu.destroy();a.remove(j.getDoc(),"click",g);h._menu=null}}e.onMouseDown.add(g);e.onKeyDown.add(g);e.onKeyDown.add(function(j,k){if(k.shiftKey&&!k.ctrlKey&&!k.altKey&&k.keyCode===121){a.cancel(k);f(j,k)}})},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(e){var g=this,d=g._menu,j=e.selection,f=j.isCollapsed(),h=j.getNode()||e.getBody(),i,k;if(d){d.removeAll();d.destroy()}k=b.getPos(e.getContentAreaContainer());d=e.controlManager.createDropMenu("contextmenu",{offset_x:k.x+e.getParam("contextmenu_offset_x",0),offset_y:k.y+e.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});g._menu=d;d.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(f);d.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(f);d.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((h.nodeName=="A"&&!e.dom.getAttrib(h,"name"))||!f){d.addSeparator();d.add({title:"advanced.link_desc",icon:"link",cmd:e.plugins.advlink?"mceAdvLink":"mceLink",ui:true});d.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}d.addSeparator();d.add({title:"advanced.image_desc",icon:"image",cmd:e.plugins.advimage?"mceAdvImage":"mceImage",ui:true});d.addSeparator();i=d.addMenu({title:"contextmenu.align"});i.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});i.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});i.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});i.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});g.onContextMenu.dispatch(g,d,h,f);return d}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();
|
||||
(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(f){var i=this,g,d,j,e;i.editor=f;d=f.settings.contextmenu_never_use_native;i.onContextMenu=new tinymce.util.Dispatcher(this);e=function(k){h(f,k)};g=f.onContextMenu.add(function(k,l){if((j!==0?j:l.ctrlKey)&&!d){return}a.cancel(l);if(l.target.nodeName=="IMG"){k.selection.select(l.target)}i._getMenu(k).showMenu(l.clientX||l.pageX,l.clientY||l.pageY);a.add(k.getDoc(),"click",e);k.nodeChanged()});f.onRemove.add(function(){if(i._menu){i._menu.removeAll()}});function h(k,l){j=0;if(l&&l.button==2){j=l.ctrlKey;return}if(i._menu){i._menu.removeAll();i._menu.destroy();a.remove(k.getDoc(),"click",e);i._menu=null}}f.onMouseDown.add(h);f.onKeyDown.add(h);f.onKeyDown.add(function(k,l){if(l.shiftKey&&!l.ctrlKey&&!l.altKey&&l.keyCode===121){a.cancel(l);g(k,l)}})},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(e){var g=this,d=g._menu,j=e.selection,f=j.isCollapsed(),h=j.getNode()||e.getBody(),i,k;if(d){d.removeAll();d.destroy()}k=b.getPos(e.getContentAreaContainer());d=e.controlManager.createDropMenu("contextmenu",{offset_x:k.x+e.getParam("contextmenu_offset_x",0),offset_y:k.y+e.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});g._menu=d;d.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(f);d.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(f);d.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((h.nodeName=="A"&&!e.dom.getAttrib(h,"name"))||!f){d.addSeparator();d.add({title:"advanced.link_desc",icon:"link",cmd:e.plugins.advlink?"mceAdvLink":"mceLink",ui:true});d.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}d.addSeparator();d.add({title:"advanced.image_desc",icon:"image",cmd:e.plugins.advimage?"mceAdvImage":"mceImage",ui:true});d.addSeparator();i=d.addMenu({title:"contextmenu.align"});i.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});i.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});i.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});i.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});g.onContextMenu.dispatch(g,d,h,f);return d}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();
|
|
@ -27,7 +27,7 @@
|
|||
* @param {string} url Absolute URL to where the plugin is located.
|
||||
*/
|
||||
init : function(ed) {
|
||||
var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey;
|
||||
var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey, hideMenu;
|
||||
|
||||
t.editor = ed;
|
||||
|
||||
|
@ -42,6 +42,10 @@
|
|||
*/
|
||||
t.onContextMenu = new tinymce.util.Dispatcher(this);
|
||||
|
||||
hideMenu = function(e) {
|
||||
hide(ed, e);
|
||||
};
|
||||
|
||||
showMenu = ed.onContextMenu.add(function(ed, e) {
|
||||
// Block TinyMCE menu on ctrlKey and work around Safari issue
|
||||
if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative)
|
||||
|
@ -54,13 +58,11 @@
|
|||
ed.selection.select(e.target);
|
||||
|
||||
t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY);
|
||||
Event.add(ed.getDoc(), 'click', function(e) {
|
||||
hide(ed, e);
|
||||
});
|
||||
Event.add(ed.getDoc(), 'click', hideMenu);
|
||||
|
||||
ed.nodeChanged();
|
||||
});
|
||||
|
||||
|
||||
ed.onRemove.add(function() {
|
||||
if (t._menu)
|
||||
t._menu.removeAll();
|
||||
|
@ -78,8 +80,8 @@
|
|||
|
||||
if (t._menu) {
|
||||
t._menu.removeAll();
|
||||
t._menu.destroy();
|
||||
Event.remove(ed.getDoc(), 'click', hide);
|
||||
t._menu.destroy();
|
||||
Event.remove(ed.getDoc(), 'click', hideMenu);
|
||||
t._menu = null;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1 +1 @@
|
|||
(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceDirectionLTR",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="ltr"){a.dom.setAttrib(d,"dir","ltr")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addCommand("mceDirectionRTL",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="rtl"){a.dom.setAttrib(d,"dir","rtl")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});a.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});a.onNodeChange.add(c._nodeChange,c)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();
|
||||
(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(b,c){var d=this;d.editor=b;function a(e){var h=b.dom,g,f=b.selection.getSelectedBlocks();if(f.length){g=h.getAttrib(f[0],"dir");tinymce.each(f,function(i){if(!h.getParent(i.parentNode,"*[dir='"+e+"']",h.getRoot())){if(g!=e){h.setAttrib(i,"dir",e)}else{h.setAttrib(i,"dir",null)}}});b.nodeChanged()}}b.addCommand("mceDirectionLTR",function(){a("ltr")});b.addCommand("mceDirectionRTL",function(){a("rtl")});b.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});b.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});b.onNodeChange.add(d._nodeChange,d)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();
|
|
@ -15,30 +15,33 @@
|
|||
|
||||
t.editor = ed;
|
||||
|
||||
ed.addCommand('mceDirectionLTR', function() {
|
||||
var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
|
||||
function setDir(dir) {
|
||||
var dom = ed.dom, curDir, blocks = ed.selection.getSelectedBlocks();
|
||||
|
||||
if (e) {
|
||||
if (ed.dom.getAttrib(e, "dir") != "ltr")
|
||||
ed.dom.setAttrib(e, "dir", "ltr");
|
||||
else
|
||||
ed.dom.setAttrib(e, "dir", "");
|
||||
if (blocks.length) {
|
||||
curDir = dom.getAttrib(blocks[0], "dir");
|
||||
|
||||
tinymce.each(blocks, function(block) {
|
||||
// Add dir to block if the parent block doesn't already have that dir
|
||||
if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) {
|
||||
if (curDir != dir) {
|
||||
dom.setAttrib(block, "dir", dir);
|
||||
} else {
|
||||
dom.setAttrib(block, "dir", null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ed.nodeChanged();
|
||||
}
|
||||
}
|
||||
|
||||
ed.nodeChanged();
|
||||
ed.addCommand('mceDirectionLTR', function() {
|
||||
setDir("ltr");
|
||||
});
|
||||
|
||||
ed.addCommand('mceDirectionRTL', function() {
|
||||
var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
|
||||
|
||||
if (e) {
|
||||
if (ed.dom.getAttrib(e, "dir") != "rtl")
|
||||
ed.dom.setAttrib(e, "dir", "rtl");
|
||||
else
|
||||
ed.dom.setAttrib(e, "dir", "");
|
||||
}
|
||||
|
||||
ed.nodeChanged();
|
||||
setDir("rtl");
|
||||
});
|
||||
|
||||
ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});
|
||||
|
|
|
@ -1 +1 @@
|
|||
(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)})();
|
||||
(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().getElementsByTagName("table")[0]);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)})();
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
// Fixes an IE bug where the scrollbars doesn't reappear
|
||||
if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll'))
|
||||
s.fullscreen_html_overflow = 'auto';
|
||||
s.fullscreen_html_overflow = 'auto';
|
||||
|
||||
if (s.fullscreen_overflow == '0px')
|
||||
s.fullscreen_overflow = '';
|
||||
|
@ -85,7 +85,7 @@
|
|||
posCss = 'fixed;top:0';
|
||||
|
||||
n = DOM.add(DOM.doc.body, 'div', {
|
||||
id : 'mce_fullscreen_container',
|
||||
id : 'mce_fullscreen_container',
|
||||
style : 'position:' + posCss + ';left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'});
|
||||
DOM.add(n, 'div', {id : 'mce_fullscreen'});
|
||||
|
||||
|
@ -127,7 +127,7 @@
|
|||
var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize;
|
||||
|
||||
// Get outer/inner size to get a delta size that can be used to calc the new iframe size
|
||||
outerSize = fed.dom.getSize(fed.getContainer().firstChild);
|
||||
outerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('table')[0]);
|
||||
innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]);
|
||||
|
||||
fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h);
|
||||
|
@ -156,4 +156,4 @@
|
|||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin);
|
||||
})();
|
||||
})();
|
||||
|
|
|
@ -1 +1 @@
|
|||
(function(a){a.onAddEditor.addToTop(function(c,b){b.settings.inline_styles=false});a.create("tinymce.plugins.LegacyOutput",{init:function(b){b.onInit.add(function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",e=a.explode(b.settings.font_size_style_values),d=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignfull:{selector:c,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:true}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:true}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(f){return a.inArray(e,f.value)+1}}},forecolor:{inline:"font",styles:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}});a.each("b,i,u,strike".split(","),function(f){d.addValidElements(f+"[*]")});if(!d.getElementRule("font")){d.addValidElements("font[face|size|color|style]")}a.each(c.split(","),function(f){var h=d.getElementRule(f),g;if(h){if(!h.attributes.align){h.attributes.align={};h.attributesOrder.push("align")}}});b.onNodeChange.add(function(g,k){var j,f,h,i;f=g.dom.getParent(g.selection.getNode(),"font");if(f){h=f.face;i=f.size}if(j=k.get("fontselect")){j.select(function(l){return l==h})}if(j=k.get("fontsizeselect")){j.select(function(m){var l=a.inArray(e,m.fontSize);return l+1==i})}})})},getInfo:function(){return{longname:"LegacyOutput",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("legacyoutput",a.plugins.LegacyOutput)})(tinymce);
|
||||
(function(a){a.onAddEditor.addToTop(function(c,b){b.settings.inline_styles=false});a.create("tinymce.plugins.LegacyOutput",{init:function(b){b.onInit.add(function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",e=a.explode(b.settings.font_size_style_values),d=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignfull:{selector:c,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:true}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:true}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(f){return a.inArray(e,f.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}});a.each("b,i,u,strike".split(","),function(f){d.addValidElements(f+"[*]")});if(!d.getElementRule("font")){d.addValidElements("font[face|size|color|style]")}a.each(c.split(","),function(f){var h=d.getElementRule(f),g;if(h){if(!h.attributes.align){h.attributes.align={};h.attributesOrder.push("align")}}});b.onNodeChange.add(function(g,k){var j,f,h,i;f=g.dom.getParent(g.selection.getNode(),"font");if(f){h=f.face;i=f.size}if(j=k.get("fontselect")){j.select(function(l){return l==h})}if(j=k.get("fontsizeselect")){j.select(function(m){var l=a.inArray(e,m.fontSize);return l+1==i})}})})},getInfo:function(){return{longname:"LegacyOutput",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("legacyoutput",a.plugins.LegacyOutput)})(tinymce);
|
|
@ -68,7 +68,7 @@
|
|||
},
|
||||
|
||||
// Setup font elements for colors as well
|
||||
forecolor : {inline : 'font', styles : {color : '%value'}},
|
||||
forecolor : {inline : 'font', attributes : {color : '%value'}},
|
||||
hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}}
|
||||
});
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -440,9 +440,9 @@
|
|||
}
|
||||
|
||||
function fixDeletingFirstCharOfList(ed, e) {
|
||||
function listElements(list, li) {
|
||||
function listElements(li) {
|
||||
var elements = [];
|
||||
var walker = new tinymce.dom.TreeWalker(li, list);
|
||||
var walker = new tinymce.dom.TreeWalker(li.firstChild, li);
|
||||
for (var node = walker.current(); node; node = walker.next()) {
|
||||
if (ed.dom.is(node, 'ol,ul,li')) {
|
||||
elements.push(node);
|
||||
|
@ -454,9 +454,11 @@
|
|||
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);
|
||||
var list = ed.dom.getParent(li, 'ol,ul'),
|
||||
rng = ed.selection.getRng();
|
||||
if (list && list.firstChild === li && rng.startOffset == 0) {
|
||||
var elements = listElements(li);
|
||||
elements.unshift(li);
|
||||
ed.execCommand("Outdent", false, elements);
|
||||
ed.undoManager.add();
|
||||
return Event.cancel(e);
|
||||
|
@ -474,7 +476,7 @@
|
|||
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]
|
||||
var textNode = textNodes[0];
|
||||
ed.selection.setCursorLocation(textNode, textNode.length);
|
||||
}
|
||||
ed.undoManager.add();
|
||||
|
@ -722,7 +724,8 @@
|
|||
} else {
|
||||
actions = {
|
||||
defaultAction: convertListItemToParagraph,
|
||||
elements: this.selectedBlocks()
|
||||
elements: this.selectedBlocks(),
|
||||
processEvenIfEmpty: true
|
||||
};
|
||||
}
|
||||
this.process(actions);
|
||||
|
@ -826,7 +829,7 @@
|
|||
|
||||
function processElement(element) {
|
||||
dom.removeClass(element, '_mce_act_on');
|
||||
if (!element || element.nodeType !== 1 || selectedBlocks.length > 1 && isEmptyElement(element)) {
|
||||
if (!element || element.nodeType !== 1 || ! actions.processEvenIfEmpty && selectedBlocks.length > 1 && isEmptyElement(element)) {
|
||||
return;
|
||||
}
|
||||
element = findItemToOperateOn(element, dom);
|
||||
|
@ -838,7 +841,7 @@
|
|||
}
|
||||
|
||||
function recurse(element) {
|
||||
t.splitSafeEach(element.childNodes, processElement);
|
||||
t.splitSafeEach(element.childNodes, processElement, true);
|
||||
}
|
||||
|
||||
function brAtEdgeOfSelection(container, offset) {
|
||||
|
@ -889,9 +892,11 @@
|
|||
}
|
||||
},
|
||||
|
||||
splitSafeEach: function(elements, f) {
|
||||
if (tinymce.isGecko && (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) ||
|
||||
/Firefox\/3\.[0-4]/.test(navigator.userAgent))) {
|
||||
splitSafeEach: function(elements, f, forceClassBase) {
|
||||
if (forceClassBase ||
|
||||
(tinymce.isGecko &&
|
||||
(/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) ||
|
||||
/Firefox\/3\.[0-4]/.test(navigator.userAgent)))) {
|
||||
this.classBasedEach(elements, f);
|
||||
} else {
|
||||
each(elements, f);
|
||||
|
@ -932,8 +937,7 @@
|
|||
},
|
||||
|
||||
selectedBlocks: function() {
|
||||
var ed = this.ed
|
||||
var selectedBlocks = ed.selection.getSelectedBlocks();
|
||||
var ed = this.ed, selectedBlocks = ed.selection.getSelectedBlocks();
|
||||
return selectedBlocks.length == 0 ? [ ed.dom.getRoot() ] : selectedBlocks;
|
||||
},
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -28,6 +28,10 @@
|
|||
["Audio"]
|
||||
];
|
||||
|
||||
function normalizeSize(size) {
|
||||
return typeof(size) == "string" ? size.replace(/[^0-9%]/g, '') : size;
|
||||
}
|
||||
|
||||
function toArray(obj) {
|
||||
var undef, out, i;
|
||||
|
||||
|
@ -258,8 +262,8 @@
|
|||
'data-mce-json' : JSON.serialize(data, "'")
|
||||
});
|
||||
|
||||
img.width = data.width || (data.type == 'audio' ? "300" : "320");
|
||||
img.height = data.height || (data.type == 'audio' ? "32" : "240");
|
||||
img.width = data.width = normalizeSize(data.width || (data.type == 'audio' ? "300" : "320"));
|
||||
img.height = data.height = normalizeSize(data.height || (data.type == 'audio' ? "32" : "240"));
|
||||
|
||||
return img;
|
||||
},
|
||||
|
@ -378,7 +382,7 @@
|
|||
data = JSON.parse(data);
|
||||
typeItem = this.getType(node.attr('class'));
|
||||
|
||||
style = node.attr('data-mce-style')
|
||||
style = node.attr('data-mce-style');
|
||||
if (!style) {
|
||||
style = node.attr('style');
|
||||
|
||||
|
@ -386,6 +390,10 @@
|
|||
style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img'));
|
||||
}
|
||||
|
||||
// Use node width/height to override the data width/height when the placeholder is resized
|
||||
data.width = node.attr('width') || data.width;
|
||||
data.height = node.attr('height') || data.height;
|
||||
|
||||
// Handle iframe
|
||||
if (typeItem.name === 'Iframe') {
|
||||
replacement = new Node('iframe', 1);
|
||||
|
@ -434,8 +442,8 @@
|
|||
// Create new object element
|
||||
video = new Node('video', 1).attr(tinymce.extend({
|
||||
id : node.attr('id'),
|
||||
width: node.attr('width'),
|
||||
height: node.attr('height'),
|
||||
width: normalizeSize(node.attr('width')),
|
||||
height: normalizeSize(node.attr('height')),
|
||||
style : style
|
||||
}, data.video.attrs));
|
||||
|
||||
|
@ -473,8 +481,8 @@
|
|||
// Create new object element
|
||||
audio = new Node('audio', 1).attr(tinymce.extend({
|
||||
id : node.attr('id'),
|
||||
width: node.attr('width'),
|
||||
height: node.attr('height'),
|
||||
width: normalizeSize(node.attr('width')),
|
||||
height: normalizeSize(node.attr('height')),
|
||||
style : style
|
||||
}, data.video.attrs));
|
||||
|
||||
|
@ -502,8 +510,8 @@
|
|||
embed.shortEnded = true;
|
||||
embed.attr({
|
||||
id: node.attr('id'),
|
||||
width: node.attr('width'),
|
||||
height: node.attr('height'),
|
||||
width: normalizeSize(node.attr('width')),
|
||||
height: normalizeSize(node.attr('height')),
|
||||
style : style,
|
||||
type: node.attr('type')
|
||||
});
|
||||
|
@ -531,8 +539,8 @@
|
|||
// Create new object element
|
||||
object = new Node('object', 1).attr({
|
||||
id : node.attr('id'),
|
||||
width: node.attr('width'),
|
||||
height: node.attr('height'),
|
||||
width: normalizeSize(node.attr('width')),
|
||||
height: normalizeSize(node.attr('height')),
|
||||
style : style
|
||||
});
|
||||
|
||||
|
@ -576,8 +584,8 @@
|
|||
embed.shortEnded = true;
|
||||
embed.attr({
|
||||
id: node.attr('id'),
|
||||
width: node.attr('width'),
|
||||
height: node.attr('height'),
|
||||
width: normalizeSize(node.attr('width')),
|
||||
height: normalizeSize(node.attr('height')),
|
||||
style : style,
|
||||
type: typeItem.mimes[0]
|
||||
});
|
||||
|
@ -793,8 +801,8 @@
|
|||
|
||||
if (iframe) {
|
||||
// Get width/height
|
||||
width = iframe.attr('width');
|
||||
height = iframe.attr('height');
|
||||
width = normalizeSize(iframe.attr('width'));
|
||||
height = normalizeSize(iframe.attr('height'));
|
||||
style = style || iframe.attr('style');
|
||||
id = iframe.attr('id');
|
||||
hspace = iframe.attr('hspace');
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media');
|
||||
get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media');
|
||||
get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media');
|
||||
get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','media','image');
|
||||
get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','image','media');
|
||||
|
||||
html = self.getMediaListHTML('medialist', 'src', 'media', 'media');
|
||||
if (html == "")
|
||||
|
@ -295,30 +295,40 @@
|
|||
} else {
|
||||
src = getVal("src");
|
||||
|
||||
// YouTube *NEW*
|
||||
if (src.match(/youtu.be\/[a-z1-9.-_]+/)) {
|
||||
// YouTube Embed
|
||||
if (src.match(/youtube\.com\/embed\/\w+/)) {
|
||||
data.width = 425;
|
||||
data.height = 350;
|
||||
data.params.frameborder = '0';
|
||||
data.type = 'iframe';
|
||||
src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1];
|
||||
setVal('src', src);
|
||||
setVal('media_type', data.type);
|
||||
}
|
||||
} else {
|
||||
// YouTube *NEW*
|
||||
if (src.match(/youtu\.be\/[a-z1-9.-_]+/)) {
|
||||
data.width = 425;
|
||||
data.height = 350;
|
||||
data.params.frameborder = '0';
|
||||
data.type = 'iframe';
|
||||
src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1];
|
||||
setVal('src', src);
|
||||
setVal('media_type', data.type);
|
||||
}
|
||||
|
||||
// YouTube
|
||||
if (src.match(/youtube.com(.+)v=([^&]+)/)) {
|
||||
data.width = 425;
|
||||
data.height = 350;
|
||||
data.params.frameborder = '0';
|
||||
data.type = 'iframe';
|
||||
src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1];
|
||||
setVal('src', src);
|
||||
setVal('media_type', data.type);
|
||||
// YouTube
|
||||
if (src.match(/youtube\.com(.+)v=([^&]+)/)) {
|
||||
data.width = 425;
|
||||
data.height = 350;
|
||||
data.params.frameborder = '0';
|
||||
data.type = 'iframe';
|
||||
src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1];
|
||||
setVal('src', src);
|
||||
setVal('media_type', data.type);
|
||||
}
|
||||
}
|
||||
|
||||
// Google video
|
||||
if (src.match(/video.google.com(.+)docid=([^&]+)/)) {
|
||||
if (src.match(/video\.google\.com(.+)docid=([^&]+)/)) {
|
||||
data.width = 425;
|
||||
data.height = 326;
|
||||
data.type = 'flash';
|
||||
|
@ -326,6 +336,39 @@
|
|||
setVal('src', src);
|
||||
setVal('media_type', data.type);
|
||||
}
|
||||
|
||||
// Vimeo
|
||||
if (src.match(/vimeo\.com\/([0-9]+)/)) {
|
||||
data.width = 425;
|
||||
data.height = 350;
|
||||
data.params.frameborder = '0';
|
||||
data.type = 'iframe';
|
||||
src = 'http://player.vimeo.com/video/' + src.match(/vimeo.com\/([0-9]+)/)[1];
|
||||
setVal('src', src);
|
||||
setVal('media_type', data.type);
|
||||
}
|
||||
|
||||
// stream.cz
|
||||
if (src.match(/stream\.cz\/((?!object).)*\/([0-9]+)/)) {
|
||||
data.width = 425;
|
||||
data.height = 350;
|
||||
data.params.frameborder = '0';
|
||||
data.type = 'iframe';
|
||||
src = 'http://www.stream.cz/object/' + src.match(/stream.cz\/[^/]+\/([0-9]+)/)[1];
|
||||
setVal('src', src);
|
||||
setVal('media_type', data.type);
|
||||
}
|
||||
|
||||
// Google maps
|
||||
if (src.match(/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/)) {
|
||||
data.width = 425;
|
||||
data.height = 350;
|
||||
data.params.frameborder = '0';
|
||||
data.type = 'iframe';
|
||||
src = 'http://maps.google.com/maps/ms?msid=' + src.match(/msid=(.+)/)[1] + "&output=embed";
|
||||
setVal('src', src);
|
||||
setVal('media_type', data.type);
|
||||
}
|
||||
|
||||
if (data.type == 'video') {
|
||||
if (!data.video.sources)
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -14,10 +14,7 @@
|
|||
var VK = tinymce.VK;
|
||||
|
||||
function handleContentEditableSelection(ed) {
|
||||
var dom = ed.dom, selection = ed.selection, invisibleChar, caretContainerId = 'mce_noneditablecaret';
|
||||
|
||||
// Setup invisible character use zero width space on Gecko since it doesn't change the height of the container
|
||||
invisibleChar = tinymce.isGecko ? '\u200B' : '\uFEFF';
|
||||
var dom = ed.dom, selection = ed.selection, invisibleChar, caretContainerId = 'mce_noneditablecaret', invisibleChar = '\uFEFF';
|
||||
|
||||
// Returns the content editable state of a node "true/false" or null
|
||||
function getContentEditable(node) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -23,6 +23,7 @@
|
|||
paste_convert_headers_to_strong : false,
|
||||
paste_dialog_width : "450",
|
||||
paste_dialog_height : "400",
|
||||
paste_max_consecutive_linebreaks: 2,
|
||||
paste_text_use_dialog : false,
|
||||
paste_text_sticky : false,
|
||||
paste_text_sticky_default : false,
|
||||
|
@ -790,10 +791,23 @@
|
|||
[/<\/t[dh]>\s*<t[dh][^>]*>/gi, "\t"], // Table cells get tabs betweem them
|
||||
/<[a-z!\/?][^>]*>/gi, // Delete all remaining tags
|
||||
[/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*)
|
||||
[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"],// Cool little RegExp deletes whitespace around linebreak chars.
|
||||
[/\n{3,}/g, "\n\n"] // Max. 2 consecutive linebreaks
|
||||
[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"] // Cool little RegExp deletes whitespace around linebreak chars.
|
||||
]);
|
||||
|
||||
var maxLinebreaks = Number(getParam(ed, "paste_max_consecutive_linebreaks"));
|
||||
if (maxLinebreaks > -1) {
|
||||
var maxLinebreaksRegex = new RegExp("\n{" + (maxLinebreaks + 1) + ",}", "g");
|
||||
var linebreakReplacement = "";
|
||||
|
||||
while (linebreakReplacement.length < maxLinebreaks) {
|
||||
linebreakReplacement += "\n";
|
||||
}
|
||||
|
||||
process([
|
||||
[maxLinebreaksRegex, linebreakReplacement] // Limit max consecutive linebreaks
|
||||
]);
|
||||
}
|
||||
|
||||
content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content));
|
||||
|
||||
// Perform default or custom replacements
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
<input type="submit" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" />
|
||||
<input type="button" class="button" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" />
|
||||
<input type="button" class="button" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" />
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
<input type="button" id="cancel" name="close" value="{#close}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -287,6 +287,21 @@
|
|||
endX = startX + (cols - 1);
|
||||
endY = startY + (rows - 1);
|
||||
} else {
|
||||
startPos = endPos = null;
|
||||
|
||||
// Calculate start/end pos by checking for selected cells in grid works better with context menu
|
||||
each(grid, function(row, y) {
|
||||
each(row, function(cell, x) {
|
||||
if (isCellSelected(cell)) {
|
||||
if (!startPos) {
|
||||
startPos = {x: x, y: y};
|
||||
}
|
||||
|
||||
endPos = {x: x, y: y};
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Use selection
|
||||
startX = startPos.x;
|
||||
startY = startPos.y;
|
||||
|
@ -551,6 +566,10 @@
|
|||
};
|
||||
|
||||
function pasteRows(rows, before) {
|
||||
// If we don't have any rows in the clipboard, return immediately
|
||||
if(!rows)
|
||||
return;
|
||||
|
||||
var selectedRows = getSelectedRows(),
|
||||
targetRow = selectedRows[before ? 0 : selectedRows.length - 1],
|
||||
targetCellCount = targetRow.cells.length;
|
||||
|
@ -599,6 +618,9 @@
|
|||
else
|
||||
dom.insertAfter(row, targetRow);
|
||||
});
|
||||
|
||||
// Remove current selection
|
||||
dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
|
||||
};
|
||||
|
||||
function getPos(target) {
|
||||
|
@ -1216,80 +1238,86 @@
|
|||
|
||||
ed.onKeyDown.add(moveSelection);
|
||||
}
|
||||
|
||||
|
||||
// Fixes an issue on Gecko where it's impossible to place the caret behind a table
|
||||
// This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled
|
||||
if (!tinymce.isIE) {
|
||||
function fixTableCaretPos() {
|
||||
var last;
|
||||
function fixTableCaretPos() {
|
||||
var last;
|
||||
|
||||
// Skip empty text nodes form the end
|
||||
for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;
|
||||
// Skip empty text nodes form the end
|
||||
for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;
|
||||
|
||||
if (last && last.nodeName == 'TABLE')
|
||||
ed.dom.add(ed.getBody(), 'p', null, '<br mce_bogus="1" />');
|
||||
};
|
||||
if (last && last.nodeName == 'TABLE') {
|
||||
if (ed.settings.forced_root_block)
|
||||
ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE ? ' ' : '<br data-mce-bogus="1" />');
|
||||
else
|
||||
ed.dom.add(ed.getBody(), 'br', {'data-mce-bogus': '1'});
|
||||
}
|
||||
};
|
||||
|
||||
// Fixes an bug where it's impossible to place the caret before a table in Gecko
|
||||
// this fix solves it by detecting when the caret is at the beginning of such a table
|
||||
// and then manually moves the caret infront of the table
|
||||
if (tinymce.isGecko) {
|
||||
ed.onKeyDown.add(function(ed, e) {
|
||||
var rng, table, dom = ed.dom;
|
||||
// Fixes an bug where it's impossible to place the caret before a table in Gecko
|
||||
// this fix solves it by detecting when the caret is at the beginning of such a table
|
||||
// and then manually moves the caret infront of the table
|
||||
if (tinymce.isGecko) {
|
||||
ed.onKeyDown.add(function(ed, e) {
|
||||
var rng, table, dom = ed.dom;
|
||||
|
||||
// On gecko it's not possible to place the caret before a table
|
||||
if (e.keyCode == 37 || e.keyCode == 38) {
|
||||
rng = ed.selection.getRng();
|
||||
table = dom.getParent(rng.startContainer, 'table');
|
||||
// On gecko it's not possible to place the caret before a table
|
||||
if (e.keyCode == 37 || e.keyCode == 38) {
|
||||
rng = ed.selection.getRng();
|
||||
table = dom.getParent(rng.startContainer, 'table');
|
||||
|
||||
if (table && ed.getBody().firstChild == table) {
|
||||
if (isAtStart(rng, table)) {
|
||||
rng = dom.createRng();
|
||||
if (table && ed.getBody().firstChild == table) {
|
||||
if (isAtStart(rng, table)) {
|
||||
rng = dom.createRng();
|
||||
|
||||
rng.setStartBefore(table);
|
||||
rng.setEndBefore(table);
|
||||
rng.setStartBefore(table);
|
||||
rng.setEndBefore(table);
|
||||
|
||||
ed.selection.setRng(rng);
|
||||
ed.selection.setRng(rng);
|
||||
|
||||
e.preventDefault();
|
||||
}
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ed.onKeyUp.add(fixTableCaretPos);
|
||||
ed.onSetContent.add(fixTableCaretPos);
|
||||
ed.onVisualAid.add(fixTableCaretPos);
|
||||
|
||||
ed.onPreProcess.add(function(ed, o) {
|
||||
var last = o.node.lastChild;
|
||||
|
||||
if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR')
|
||||
ed.dom.remove(last);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Fixes bug in Gecko where shift-enter in table cell does not place caret on new line
|
||||
*/
|
||||
if (tinymce.isGecko) {
|
||||
ed.onKeyDown.add(function(ed, e) {
|
||||
if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) {
|
||||
var node = ed.selection.getRng().startContainer;
|
||||
var tableCell = dom.getParent(node, 'td,th');
|
||||
if (tableCell) {
|
||||
var zeroSizedNbsp = ed.getDoc().createTextNode("\uFEFF");
|
||||
dom.insertAfter(zeroSizedNbsp, node);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
fixTableCaretPos();
|
||||
ed.startContent = ed.getContent({format : 'raw'});
|
||||
}
|
||||
|
||||
ed.onKeyUp.add(fixTableCaretPos);
|
||||
ed.onSetContent.add(fixTableCaretPos);
|
||||
ed.onVisualAid.add(fixTableCaretPos);
|
||||
|
||||
ed.onPreProcess.add(function(ed, o) {
|
||||
var last = o.node.lastChild;
|
||||
|
||||
if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 && (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) && last.previousSibling && last.previousSibling.nodeName == "TABLE") {
|
||||
ed.dom.remove(last);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Fixes bug in Gecko where shift-enter in table cell does not place caret on new line
|
||||
*
|
||||
* Removed: Since the new enter logic seems to fix this one.
|
||||
*/
|
||||
/*
|
||||
if (tinymce.isGecko) {
|
||||
ed.onKeyDown.add(function(ed, e) {
|
||||
if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) {
|
||||
var node = ed.selection.getRng().startContainer;
|
||||
var tableCell = dom.getParent(node, 'td,th');
|
||||
if (tableCell) {
|
||||
var zeroSizedNbsp = ed.getDoc().createTextNode("\uFEFF");
|
||||
dom.insertAfter(zeroSizedNbsp, node);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
fixTableCaretPos();
|
||||
ed.startContent = ed.getContent({format : 'raw'});
|
||||
});
|
||||
|
||||
// Register action commands
|
||||
|
|
|
@ -25,6 +25,7 @@ function init() {
|
|||
var dir = dom.getAttrib(trElm, 'dir');
|
||||
|
||||
selectByValue(formObj, 'rowtype', rowtype);
|
||||
setActionforRowType(formObj, rowtype);
|
||||
|
||||
// Any cells selected
|
||||
if (dom.select('td.mceSelected,th.mceSelected', trElm).length == 0) {
|
||||
|
@ -234,4 +235,20 @@ function changedColor() {
|
|||
formObj.style.value = dom.serializeStyle(st);
|
||||
}
|
||||
|
||||
function changedRowType() {
|
||||
var formObj = document.forms[0];
|
||||
var rowtype = getSelectValue(formObj, 'rowtype');
|
||||
|
||||
setActionforRowType(formObj, rowtype);
|
||||
|
||||
}
|
||||
|
||||
function setActionforRowType(formObj, rowtype) {
|
||||
if (rowtype === "tbody") {
|
||||
formObj.action.disabled = false;
|
||||
} else {
|
||||
selectByValue(formObj, 'action', "row");
|
||||
formObj.action.disabled = true;
|
||||
}
|
||||
}
|
||||
tinyMCEPopup.onInit.add(init);
|
||||
|
|
|
@ -247,7 +247,10 @@ function insertTable() {
|
|||
|
||||
// Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document
|
||||
if (tinymce.isIE && node.nextSibling == null) {
|
||||
dom.insertAfter(dom.create('p'), node);
|
||||
if (inst.settings.forced_root_block)
|
||||
dom.insertAfter(dom.create(inst.settings.forced_root_block), node);
|
||||
else
|
||||
dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node);
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -304,6 +307,15 @@ function init() {
|
|||
var formObj = document.forms[0];
|
||||
var elm = dom.getParent(inst.selection.getNode(), "table");
|
||||
|
||||
// Hide advanced fields that isn't available in the schema
|
||||
tinymce.each("summary id rules dir style frame".split(" "), function(name) {
|
||||
var tr = tinyMCEPopup.dom.getParent(name, "tr") || tinyMCEPopup.dom.getParent("t" + name, "tr");
|
||||
|
||||
if (tr && !tinyMCEPopup.editor.schema.isValid("table", name)) {
|
||||
tr.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
action = tinyMCEPopup.getWindowArg('action');
|
||||
|
||||
if (!action)
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<tr>
|
||||
<td><label for="rowtype">{#table_dlg.rowtype}</label></td>
|
||||
<td class="col2">
|
||||
<select id="rowtype" name="rowtype" class="mceFocus">
|
||||
<select id="rowtype" name="rowtype" class="mceFocus" onChange="changedRowType();">
|
||||
<option value="thead">{#table_dlg.thead}</option>
|
||||
<option value="tbody">{#table_dlg.tbody}</option>
|
||||
<option value="tfoot">{#table_dlg.tfoot}</option>
|
||||
|
@ -83,8 +83,8 @@
|
|||
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="4">
|
||||
<tr>
|
||||
<td class="column1"><label for="id">{#table_dlg.id}</label></td>
|
||||
<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
|
||||
<td class="column1"><label for="id">{#table_dlg.id}</label></td>
|
||||
<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
@ -93,25 +93,25 @@
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
|
||||
<td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
|
||||
<td>
|
||||
<select id="dir" name="dir" style="width: 200px">
|
||||
<option value="">{#not_set}</option>
|
||||
<option value="ltr">{#table_dlg.ltr}</option>
|
||||
<option value="rtl">{#table_dlg.rtl}</option>
|
||||
<select id="dir" name="dir" style="width: 200px">
|
||||
<option value="">{#not_set}</option>
|
||||
<option value="ltr">{#table_dlg.ltr}</option>
|
||||
<option value="rtl">{#table_dlg.rtl}</option>
|
||||
</select>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="lang">{#table_dlg.langcode}</label></td>
|
||||
<td class="column1"><label for="lang">{#table_dlg.langcode}</label></td>
|
||||
<td>
|
||||
<input id="lang" name="lang" type="text" value="" style="width: 200px" />
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
|
||||
<td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
|
||||
<td>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
|
@ -119,11 +119,11 @@
|
|||
<td id="backgroundimagebrowsercontainer"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="bgcolor" id="bgcolor_label">{#table_dlg.bgcolor}</label></td>
|
||||
<td class="column1"><label for="bgcolor" id="bgcolor_label">{#table_dlg.bgcolor}</label></td>
|
||||
<td>
|
||||
<span role="group" aria-labelledby="bgcolor_label">
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||
|
@ -133,7 +133,7 @@
|
|||
</tr>
|
||||
</table>
|
||||
</span>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -13,7 +13,7 @@
|
|||
|
||||
// Generates a preview for a format
|
||||
function getPreviewCss(ed, fmt) {
|
||||
var previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName;
|
||||
var name, previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName;
|
||||
|
||||
previewStyles = ed.settings.preview_styles;
|
||||
|
||||
|
@ -150,23 +150,31 @@
|
|||
|
||||
init : function(ed, url) {
|
||||
var t = this, s, v, o;
|
||||
|
||||
|
||||
t.editor = ed;
|
||||
t.url = url;
|
||||
t.onResolveName = new tinymce.util.Dispatcher(this);
|
||||
s = ed.settings;
|
||||
|
||||
ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast();
|
||||
ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin;
|
||||
|
||||
// Setup default buttons
|
||||
if (!s.theme_advanced_buttons1) {
|
||||
s = extend({
|
||||
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"
|
||||
}, s);
|
||||
}
|
||||
|
||||
// Default settings
|
||||
t.settings = s = extend({
|
||||
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_toolbar_location : 'top',
|
||||
theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",
|
||||
theme_advanced_toolbar_align : "center",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_statusbar_location : "bottom",
|
||||
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,
|
||||
|
@ -176,7 +184,7 @@
|
|||
theme_advanced_font_selector : "span",
|
||||
theme_advanced_show_current_color: 0,
|
||||
readonly : ed.settings.readonly
|
||||
}, ed.settings);
|
||||
}, s);
|
||||
|
||||
// Setup default font_size_style_values
|
||||
if (!s.font_size_style_values)
|
||||
|
@ -670,7 +678,7 @@
|
|||
if (DOM.get(ed.id + '_path_row')) {
|
||||
Event.add(ed.id + '_tbl', 'mouseover', function(e) {
|
||||
var re;
|
||||
|
||||
|
||||
e = e.target;
|
||||
|
||||
if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) {
|
||||
|
@ -823,6 +831,7 @@
|
|||
var f = Event.add(ed.id + '_external_close', 'click', function() {
|
||||
DOM.hide(ed.id + '_external');
|
||||
Event.remove(ed.id + '_external_close', 'click', f);
|
||||
return false;
|
||||
});
|
||||
|
||||
DOM.show(e);
|
||||
|
@ -947,7 +956,7 @@
|
|||
a = s.theme_advanced_toolbar_align.toLowerCase();
|
||||
a = 'mce' + t._ufirst(a);
|
||||
|
||||
n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"presentation"});
|
||||
n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"toolbar"});
|
||||
|
||||
// Create toolbar and add the controls
|
||||
for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {
|
||||
|
@ -977,7 +986,7 @@
|
|||
var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td;
|
||||
|
||||
n = DOM.add(tb, 'tr');
|
||||
n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});
|
||||
n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});
|
||||
n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'});
|
||||
if (s.theme_advanced_path) {
|
||||
DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path'));
|
||||
|
@ -985,7 +994,7 @@
|
|||
} else {
|
||||
DOM.add(n, 'span', {}, ' ');
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (s.theme_advanced_resizing) {
|
||||
DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"});
|
||||
|
@ -1030,6 +1039,8 @@
|
|||
width = startWidth + (e.screenX - startX);
|
||||
height = startHeight + (e.screenY - startY);
|
||||
t.resizeTo(width, height, true);
|
||||
|
||||
ed.nodeChanged();
|
||||
};
|
||||
|
||||
e.preventDefault();
|
||||
|
@ -1089,19 +1100,17 @@
|
|||
|
||||
p = getParent('A');
|
||||
if (c = cm.get('link')) {
|
||||
if (!p || !p.name) {
|
||||
c.setDisabled(!p && co);
|
||||
c.setActive(!!p);
|
||||
}
|
||||
c.setDisabled((!p && co) || (p && !p.href));
|
||||
c.setActive(!!p && (!p.name && !p.id));
|
||||
}
|
||||
|
||||
if (c = cm.get('unlink')) {
|
||||
c.setDisabled(!p && co);
|
||||
c.setActive(!!p && !p.name);
|
||||
c.setActive(!!p && !p.name && !p.id);
|
||||
}
|
||||
|
||||
if (c = cm.get('anchor')) {
|
||||
c.setActive(!co && !!p && p.name);
|
||||
c.setActive(!co && !!p && (p.name || (p.id && !p.href)));
|
||||
}
|
||||
|
||||
p = getParent('IMG');
|
||||
|
@ -1145,7 +1154,7 @@
|
|||
|
||||
if (!fn && n.style.fontFamily)
|
||||
fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();
|
||||
|
||||
|
||||
if (!fc && n.style.color)
|
||||
fc = n.style.color;
|
||||
|
||||
|
@ -1176,7 +1185,7 @@
|
|||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (s.theme_advanced_show_current_color) {
|
||||
function updateColor(controlId, color) {
|
||||
if (c = cm.get(controlId)) {
|
||||
|
@ -1280,7 +1289,7 @@
|
|||
ti += 'id: ' + v + ' ';
|
||||
|
||||
if (v = n.className) {
|
||||
v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '')
|
||||
v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '');
|
||||
|
||||
if (v) {
|
||||
ti += 'class: ' + v + ' ';
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
@ -6,7 +6,7 @@ var AnchorDialog = {
|
|||
|
||||
this.editor = ed;
|
||||
elm = ed.dom.getParent(ed.selection.getNode(), 'A');
|
||||
v = ed.dom.getAttrib(elm, 'name');
|
||||
v = ed.dom.getAttrib(elm, 'name') || ed.dom.getAttrib(elm, 'id');
|
||||
|
||||
if (v) {
|
||||
this.action = 'update';
|
||||
|
@ -17,7 +17,7 @@ var AnchorDialog = {
|
|||
},
|
||||
|
||||
update : function() {
|
||||
var ed = this.editor, elm, name = document.forms[0].anchorName.value;
|
||||
var ed = this.editor, elm, name = document.forms[0].anchorName.value, attribName;
|
||||
|
||||
if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) {
|
||||
tinyMCEPopup.alert('advanced_dlg.anchor_invalid');
|
||||
|
@ -29,13 +29,25 @@ var AnchorDialog = {
|
|||
if (this.action != 'update')
|
||||
ed.selection.collapse(1);
|
||||
|
||||
var aRule = ed.schema.getElementRule('a');
|
||||
if (!aRule || aRule.attributes.name) {
|
||||
attribName = 'name';
|
||||
} else {
|
||||
attribName = 'id';
|
||||
}
|
||||
|
||||
elm = ed.dom.getParent(ed.selection.getNode(), 'A');
|
||||
if (elm) {
|
||||
elm.setAttribute('name', name);
|
||||
elm.name = name;
|
||||
} else
|
||||
elm.setAttribute(attribName, name);
|
||||
elm[attribName] = name;
|
||||
ed.undoManager.add();
|
||||
} else {
|
||||
// create with zero-sized nbsp so that in Webkit where anchor is on last line by itself caret cannot be placed after it
|
||||
ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, '\uFEFF'));
|
||||
var attrs = {'class' : 'mceItemAnchor'};
|
||||
attrs[attribName] = name;
|
||||
ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', attrs, '\uFEFF'));
|
||||
ed.nodeChanged();
|
||||
}
|
||||
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
|
|
@ -68,10 +68,16 @@ var LinkDialog = {
|
|||
} else {
|
||||
ed.dom.setAttribs(e, {
|
||||
href : href,
|
||||
title : f.linktitle.value,
|
||||
target : f.target_list ? getSelectValue(f, "target_list") : null,
|
||||
'class' : f.class_list ? getSelectValue(f, "class_list") : null
|
||||
title : f.linktitle.value
|
||||
});
|
||||
|
||||
if (f.target_list) {
|
||||
ed.dom.setAttrib(e, 'target', getSelectValue(f, "target_list"));
|
||||
}
|
||||
|
||||
if (f.class_list) {
|
||||
ed.dom.setAttrib(e, 'class', getSelectValue(f, "class_list"));
|
||||
}
|
||||
}
|
||||
|
||||
// Don't move caret if selection was image
|
||||
|
|
|
@ -48,4 +48,3 @@ font[face=mceinline] {font-family:inherit !important}
|
|||
.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)}
|
||||
.mceItemIframe {background-image:url(../../img/iframe.gif)}
|
||||
.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}
|
||||
.mceHideBrInPre pre br {display: none}
|
||||
|
|
|
@ -105,11 +105,12 @@ h3 {font-size:14px;}
|
|||
#plugintable, #about #plugintable td {border:1px solid #919B9C;}
|
||||
#plugintable {width:96%; margin-top:10px;}
|
||||
#pluginscontainer {height:290px; overflow:auto;}
|
||||
#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}
|
||||
#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px}
|
||||
#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline}
|
||||
#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap}
|
||||
#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
|
||||
#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
|
||||
#colorpicker #light div {overflow:hidden;}
|
||||
#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}
|
||||
#colorpicker .panel_wrapper div.current {height:175px;}
|
||||
#colorpicker #namedcolors {width:150px;}
|
||||
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
.defaultSkin table td {vertical-align:middle}
|
||||
|
||||
/* Containers */
|
||||
.defaultSkin table {direction:ltr; background:#FFF}
|
||||
.defaultSkin iframe {display:block; background:#FFF}
|
||||
.defaultSkin table {direction:ltr;background:transparent}
|
||||
.defaultSkin iframe {display:block;}
|
||||
.defaultSkin .mceToolbar {height:26px}
|
||||
.defaultSkin .mceLeft {text-align:left}
|
||||
.defaultSkin .mceRight {text-align:right}
|
||||
|
||||
/* External */
|
||||
.defaultSkin .mceExternalToolbar {position:absolute; border:2px solid #CCC; border-bottom:0; display:none;}
|
||||
.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;}
|
||||
.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;}
|
||||
.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}
|
||||
|
||||
|
@ -20,9 +20,9 @@
|
|||
.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC}
|
||||
.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC}
|
||||
.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;}
|
||||
.defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top}
|
||||
.defaultSkin .mceIframeContainer { /*border-top:1px solid #CCC; border-bottom:1px solid #CCC */ border: none;}
|
||||
.defaultSkin .mceStatusbar {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px}
|
||||
.defaultSkin td.mceToolbar {background:#F0F0EE; padding-top:1px; vertical-align:top}
|
||||
.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC}
|
||||
.defaultSkin .mceStatusbar {background:#F0F0EE; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px}
|
||||
.defaultSkin .mceStatusbar div {float:left; margin:2px}
|
||||
.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}
|
||||
.defaultSkin .mceStatusbar a:hover {text-decoration:underline}
|
||||
|
@ -34,7 +34,7 @@
|
|||
.defaultSkin td.mceRight table {margin:0 0 0 auto;}
|
||||
|
||||
/* Button */
|
||||
.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:10px}
|
||||
.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px}
|
||||
.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}
|
||||
.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0}
|
||||
.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
|
||||
|
@ -83,7 +83,7 @@
|
|||
.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px}
|
||||
|
||||
/* Menu */
|
||||
.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8}
|
||||
.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8; direction:ltr}
|
||||
.defaultSkin .mceNoIcons span.mceIcon {width:0;}
|
||||
.defaultSkin .mceNoIcons a .mceText {padding-left:10px}
|
||||
.defaultSkin .mceMenu table {background:#FFF}
|
||||
|
@ -103,11 +103,16 @@
|
|||
.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center}
|
||||
.defaultSkin .mceMenu span.mceMenuLine {display:none}
|
||||
.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;}
|
||||
.defaultSkin .mceMenuItem td, .defaultSkin .mceMenuItem th {line-height: normal}
|
||||
|
||||
/* Progress,Resize */
|
||||
.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF}
|
||||
.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
|
||||
|
||||
/* Rtl */
|
||||
.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0}
|
||||
.mceRtl .mceMenuItem .mceText {text-align: right}
|
||||
|
||||
/* Formats */
|
||||
.defaultSkin .mce_formatPreview a {font-size:10px}
|
||||
.defaultSkin .mce_p span.mceText {}
|
||||
|
@ -211,3 +216,4 @@
|
|||
.defaultSkin span.mce_pagebreak {background-position:0 -40px}
|
||||
.defaultSkin span.mce_restoredraft {background-position:-20px -40px}
|
||||
.defaultSkin span.mce_spellchecker {background-position:-540px -20px}
|
||||
.defaultSkin span.mce_visualblocks {background-position: -40px -40px}
|
||||
|
|
|
@ -22,4 +22,3 @@ abbr {border-bottom:1px dashed #CCC; cursor:help}
|
|||
img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
|
||||
font[face=mceinline] {font-family:inherit !important}
|
||||
*[contentEditable]:focus {outline:0}
|
||||
.mceHideBrInPre pre br {display: none}
|
||||
|
|
|
@ -46,4 +46,3 @@ font[face=mceinline] {font-family:inherit !important}
|
|||
.mceItemAudio {background-image:url(../../img/video.gif)}
|
||||
.mceItemIframe {background-image:url(../../img/iframe.gif)}
|
||||
.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}
|
||||
.mceHideBrInPre pre br {display: none}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script type="text/javascript" src="js/source_editor.js"></script>
|
||||
</head>
|
||||
<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
|
||||
<body onresize="resizeInputs();" style="display:none; overflow:hidden;" spellcheck="false">
|
||||
<form name="source" onsubmit="saveContent();return false;" action="#">
|
||||
<div style="float: left" class="title"><label for="htmlSource">{#advanced_dlg.code_title}</label></div>
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2,4 +2,4 @@
|
|||
// Uncomment and change this document.domain value if you are loading the script cross subdomains
|
||||
// document.domain = 'moxiecode.com';
|
||||
|
||||
var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){b.dom.bind(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init();
|
||||
var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){b.dom.bind(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){var b=a.target||a.srcElement;if(b.onchange){b.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init();
|
1625
library/tinymce/jscripts/tiny_mce/tiny_mce_src.js
vendored
1625
library/tinymce/jscripts/tiny_mce/tiny_mce_src.js
vendored
|
@ -6,9 +6,9 @@
|
|||
var tinymce = {
|
||||
majorVersion : '3',
|
||||
|
||||
minorVersion : '5.0.1',
|
||||
minorVersion : '5.8',
|
||||
|
||||
releaseDate : '2012-05-10',
|
||||
releaseDate : '2012-11-20',
|
||||
|
||||
_init : function() {
|
||||
var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v;
|
||||
|
@ -107,12 +107,16 @@
|
|||
if (!t)
|
||||
return o !== undef;
|
||||
|
||||
if (t == 'array' && (o.hasOwnProperty && o instanceof Array))
|
||||
if (t == 'array' && tinymce.isArray(o))
|
||||
return true;
|
||||
|
||||
return typeof(o) == t;
|
||||
},
|
||||
|
||||
isArray: Array.isArray || function(obj) {
|
||||
return Object.prototype.toString.call(obj) === "[object Array]";
|
||||
},
|
||||
|
||||
makeMap : function(items, delim, map) {
|
||||
var i;
|
||||
|
||||
|
@ -880,12 +884,12 @@ tinymce.create('tinymce.util.Dispatcher', {
|
|||
((s) ? "; secure" : "");
|
||||
},
|
||||
|
||||
remove : function(n, p) {
|
||||
var d = new Date();
|
||||
remove : function(name, path, domain) {
|
||||
var date = new Date();
|
||||
|
||||
d.setTime(d.getTime() - 1000);
|
||||
date.setTime(date.getTime() - 1000);
|
||||
|
||||
this.set(n, '', d, p, d);
|
||||
this.set(name, '', date, path, domain);
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
@ -921,7 +925,7 @@ tinymce.create('tinymce.util.Dispatcher', {
|
|||
}
|
||||
|
||||
if (t == 'object') {
|
||||
if (o.hasOwnProperty && o instanceof Array) {
|
||||
if (o.hasOwnProperty && Object.prototype.toString.call(o) === '[object Array]') {
|
||||
for (i=0, v = '['; i<o.length; i++)
|
||||
v += (i > 0 ? ',' : '') + serialize(o[i], quote);
|
||||
|
||||
|
@ -1083,12 +1087,18 @@ tinymce.create('static tinymce.util.XHR', {
|
|||
|
||||
modifierPressed: function (e) {
|
||||
return e.shiftKey || e.ctrlKey || e.altKey;
|
||||
},
|
||||
|
||||
metaKeyPressed: function(e) {
|
||||
// Check if ctrl or meta key is pressed also check if alt is false for Polish users
|
||||
return tinymce.isMac ? e.metaKey : e.ctrlKey && !e.altKey;
|
||||
}
|
||||
};
|
||||
})(tinymce);
|
||||
|
||||
tinymce.util.Quirks = function(editor) {
|
||||
var VK = tinymce.VK, BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection, settings = editor.settings;
|
||||
var VK = tinymce.VK, BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection,
|
||||
settings = editor.settings, parser = editor.parser, serializer = editor.serializer, each = tinymce.each;
|
||||
|
||||
function setEditorCommandState(cmd, state) {
|
||||
try {
|
||||
|
@ -1098,6 +1108,16 @@ tinymce.util.Quirks = function(editor) {
|
|||
}
|
||||
}
|
||||
|
||||
function getDocumentMode() {
|
||||
var documentMode = editor.getDoc().documentMode;
|
||||
|
||||
return documentMode ? documentMode : 6;
|
||||
};
|
||||
|
||||
function isDefaultPrevented(e) {
|
||||
return e.isDefaultPrevented();
|
||||
};
|
||||
|
||||
function cleanupStylesWhenDeleting() {
|
||||
function removeMergedFormatSpans(isDelete) {
|
||||
var rng, blockElm, node, clonedSpan;
|
||||
|
@ -1108,46 +1128,54 @@ tinymce.util.Quirks = function(editor) {
|
|||
blockElm = dom.getParent(rng.startContainer, dom.isBlock);
|
||||
|
||||
// On delete clone the root span of the next block element
|
||||
if (isDelete)
|
||||
if (isDelete) {
|
||||
blockElm = dom.getNext(blockElm, dom.isBlock);
|
||||
}
|
||||
|
||||
// Locate root span element and clone it since it would otherwise get merged by the "apple-style-span" on delete/backspace
|
||||
if (blockElm) {
|
||||
node = blockElm.firstChild;
|
||||
|
||||
// Ignore empty text nodes
|
||||
while (node && node.nodeType == 3 && node.nodeValue.length === 0)
|
||||
while (node && node.nodeType == 3 && node.nodeValue.length === 0) {
|
||||
node = node.nextSibling;
|
||||
}
|
||||
|
||||
if (node && node.nodeName === 'SPAN') {
|
||||
clonedSpan = node.cloneNode(false);
|
||||
}
|
||||
}
|
||||
|
||||
each(dom.select('span', blockElm), function(span) {
|
||||
span.setAttribute('data-mce-mark', '1');
|
||||
});
|
||||
|
||||
// Do the backspace/delete action
|
||||
editor.getDoc().execCommand(isDelete ? 'ForwardDelete' : 'Delete', false, null);
|
||||
|
||||
// Find all odd apple-style-spans
|
||||
blockElm = dom.getParent(rng.startContainer, dom.isBlock);
|
||||
tinymce.each(dom.select('span.Apple-style-span,font.Apple-style-span', blockElm), function(span) {
|
||||
each(dom.select('span', blockElm), function(span) {
|
||||
var bm = selection.getBookmark();
|
||||
|
||||
if (clonedSpan) {
|
||||
dom.replace(clonedSpan.cloneNode(false), span, true);
|
||||
} else {
|
||||
} else if (!span.getAttribute('data-mce-mark')) {
|
||||
dom.remove(span, true);
|
||||
} else {
|
||||
span.removeAttribute('data-mce-mark');
|
||||
}
|
||||
|
||||
// Restore the selection
|
||||
selection.moveToBookmark(bm);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
editor.onKeyDown.add(function(editor, e) {
|
||||
var isDelete;
|
||||
|
||||
isDelete = e.keyCode == DELETE;
|
||||
if (!e.isDefaultPrevented() && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {
|
||||
if (!isDefaultPrevented(e) && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {
|
||||
e.preventDefault();
|
||||
removeMergedFormatSpans(isDelete);
|
||||
}
|
||||
|
@ -1157,74 +1185,58 @@ tinymce.util.Quirks = function(editor) {
|
|||
};
|
||||
|
||||
function emptyEditorWhenDeleting() {
|
||||
function getEndPointNode(rng, start) {
|
||||
var container, offset, prefix = start ? 'start' : 'end';
|
||||
function serializeRng(rng) {
|
||||
var body = dom.create("body");
|
||||
var contents = rng.cloneContents();
|
||||
body.appendChild(contents);
|
||||
return selection.serializer.serialize(body, {format: 'html'});
|
||||
}
|
||||
|
||||
container = rng[prefix + 'Container'];
|
||||
offset = rng[prefix + 'Offset'];
|
||||
function allContentsSelected(rng) {
|
||||
var selection = serializeRng(rng);
|
||||
|
||||
// Resolve indexed container
|
||||
if (container.nodeType == 1 && container.hasChildNodes()) {
|
||||
container = container.childNodes[Math.min(start ? offset : (offset > 0 ? offset - 1 : 0), container.childNodes.length - 1)]
|
||||
}
|
||||
var allRng = dom.createRng();
|
||||
allRng.selectNode(editor.getBody());
|
||||
|
||||
return container;
|
||||
};
|
||||
var allSelection = serializeRng(allRng);
|
||||
return selection === allSelection;
|
||||
}
|
||||
|
||||
function isAtStartEndOfBody(rng, start) {
|
||||
var container, offset, root, childNode, prefix = start ? 'start' : 'end', isAfter;
|
||||
editor.onKeyDown.add(function(editor, e) {
|
||||
var keyCode = e.keyCode, isCollapsed;
|
||||
|
||||
container = rng[prefix + 'Container'];
|
||||
offset = rng[prefix + 'Offset'];
|
||||
root = dom.getRoot();
|
||||
// Empty the editor if it's needed for example backspace at <p><b>|</b></p>
|
||||
if (!isDefaultPrevented(e) && (keyCode == DELETE || keyCode == BACKSPACE)) {
|
||||
isCollapsed = editor.selection.isCollapsed();
|
||||
|
||||
// Resolve indexed container
|
||||
if (container.nodeType == 1) {
|
||||
isAfter = offset >= container.childNodes.length;
|
||||
container = getEndPointNode(rng, start);
|
||||
|
||||
if (container.nodeType == 3) {
|
||||
offset = start && !isAfter ? 0 : container.nodeValue.length;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if start/end is in the middle of text
|
||||
if (container.nodeType == 3 && ((start && offset > 0) || (!start && offset < container.nodeValue.length))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Walk up the DOM tree to see if the endpoint is at the beginning/end of body
|
||||
while (container !== root) {
|
||||
childNode = container.parentNode[start ? 'firstChild' : 'lastChild'];
|
||||
|
||||
// If first/last element is a BR then jump to it's sibling in case: <p>x<br></p>
|
||||
if (childNode.nodeName == "BR") {
|
||||
childNode = childNode[start ? 'nextSibling' : 'previousSibling'] || childNode;
|
||||
// Selection is collapsed but the editor isn't empty
|
||||
if (isCollapsed && !dom.isEmpty(editor.getBody())) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If the childNode isn't the container node then break in case <p><span>A</span>[X]</p>
|
||||
if (childNode !== container) {
|
||||
return false;
|
||||
// IE deletes all contents correctly when everything is selected
|
||||
if (tinymce.isIE && !isCollapsed) {
|
||||
return;
|
||||
}
|
||||
|
||||
container = container.parentNode;
|
||||
// Selection isn't collapsed but not all the contents is selected
|
||||
if (!isCollapsed && !allContentsSelected(editor.selection.getRng())) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Manually empty the editor
|
||||
editor.setContent('');
|
||||
editor.selection.setCursorLocation(editor.getBody(), 0);
|
||||
editor.nodeChanged();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
editor.onKeyDown.addToTop(function(editor, e) {
|
||||
var rng, keyCode = e.keyCode;
|
||||
|
||||
if (!e.isDefaultPrevented() && (keyCode == DELETE || keyCode == BACKSPACE)) {
|
||||
rng = selection.getRng(true);
|
||||
|
||||
if (isAtStartEndOfBody(rng, true) && isAtStartEndOfBody(rng, false) &&
|
||||
(rng.collapsed || dom.findCommonAncestor(getEndPointNode(rng, true), getEndPointNode(rng)) === dom.getRoot())) {
|
||||
editor.setContent('');
|
||||
editor.nodeChanged();
|
||||
e.preventDefault();
|
||||
}
|
||||
function selectAll() {
|
||||
editor.onKeyDown.add(function(editor, e) {
|
||||
if (!isDefaultPrevented(e) && e.keyCode == 65 && VK.metaKeyPressed(e)) {
|
||||
e.preventDefault();
|
||||
editor.execCommand('SelectAll');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -1248,7 +1260,7 @@ tinymce.util.Quirks = function(editor) {
|
|||
|
||||
function removeHrOnBackspace() {
|
||||
editor.onKeyDown.add(function(editor, e) {
|
||||
if (!e.isDefaultPrevented() && e.keyCode === BACKSPACE) {
|
||||
if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
|
||||
if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
|
||||
var node = selection.getNode();
|
||||
var previousSibling = node.previousSibling;
|
||||
|
@ -1267,7 +1279,7 @@ tinymce.util.Quirks = function(editor) {
|
|||
// wouldn't get proper focus if the user clicked on the HTML element
|
||||
if (!Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4
|
||||
editor.onMouseDown.add(function(editor, e) {
|
||||
if (e.target.nodeName === "HTML") {
|
||||
if (!isDefaultPrevented(e) && e.target.nodeName === "HTML") {
|
||||
var body = editor.getBody();
|
||||
|
||||
// Blur the body it's focused but not correctly focused
|
||||
|
@ -1311,7 +1323,7 @@ tinymce.util.Quirks = function(editor) {
|
|||
if (target !== editor.getBody()) {
|
||||
dom.setAttrib(target, "style", null);
|
||||
|
||||
tinymce.each(template, function(attr) {
|
||||
each(template, function(attr) {
|
||||
target.setAttributeNode(attr.cloneNode(true));
|
||||
});
|
||||
}
|
||||
|
@ -1319,7 +1331,7 @@ tinymce.util.Quirks = function(editor) {
|
|||
}
|
||||
|
||||
function isSelectionAcrossElements() {
|
||||
return !selection.isCollapsed() && selection.getStart() != selection.getEnd();
|
||||
return !selection.isCollapsed() && dom.getParent(selection.getStart(), dom.isBlock) != dom.getParent(selection.getEnd(), dom.isBlock);
|
||||
}
|
||||
|
||||
function blockEvent(editor, e) {
|
||||
|
@ -1330,7 +1342,7 @@ tinymce.util.Quirks = function(editor) {
|
|||
editor.onKeyPress.add(function(editor, e) {
|
||||
var applyAttributes;
|
||||
|
||||
if ((e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) {
|
||||
if (!isDefaultPrevented(e) && (e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) {
|
||||
applyAttributes = getAttributeApplyFunction();
|
||||
editor.getDoc().execCommand('delete', false, null);
|
||||
applyAttributes();
|
||||
|
@ -1342,7 +1354,7 @@ tinymce.util.Quirks = function(editor) {
|
|||
dom.bind(editor.getDoc(), 'cut', function(e) {
|
||||
var applyAttributes;
|
||||
|
||||
if (isSelectionAcrossElements()) {
|
||||
if (!isDefaultPrevented(e) && isSelectionAcrossElements()) {
|
||||
applyAttributes = getAttributeApplyFunction();
|
||||
editor.onKeyUp.addToTop(blockEvent);
|
||||
|
||||
|
@ -1381,7 +1393,7 @@ tinymce.util.Quirks = function(editor) {
|
|||
|
||||
function disableBackspaceIntoATable() {
|
||||
editor.onKeyDown.add(function(editor, e) {
|
||||
if (!e.isDefaultPrevented() && e.keyCode === BACKSPACE) {
|
||||
if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
|
||||
if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
|
||||
var previousSibling = selection.getNode().previousSibling;
|
||||
if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "table") {
|
||||
|
@ -1393,20 +1405,19 @@ tinymce.util.Quirks = function(editor) {
|
|||
}
|
||||
|
||||
function addNewLinesBeforeBrInPre() {
|
||||
var documentMode = editor.getDoc().documentMode;
|
||||
|
||||
// IE8+ rendering mode does the right thing with BR in PRE
|
||||
if (documentMode && documentMode > 7) {
|
||||
if (getDocumentMode() > 7) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Enable display: none in area and add a specific class that hides all BR elements in PRE to
|
||||
// avoid the caret from getting stuck at the BR elements while pressing the right arrow key
|
||||
setEditorCommandState('RespectVisibilityInDesign', true);
|
||||
editor.contentStyles.push('.mceHideBrInPre pre br {display: none}');
|
||||
dom.addClass(editor.getBody(), 'mceHideBrInPre');
|
||||
|
||||
// Adds a \n before all BR elements in PRE to get them visual
|
||||
editor.parser.addNodeFilter('pre', function(nodes, name) {
|
||||
parser.addNodeFilter('pre', function(nodes, name) {
|
||||
var i = nodes.length, brNodes, j, brElm, sibling;
|
||||
|
||||
while (i--) {
|
||||
|
@ -1427,7 +1438,7 @@ tinymce.util.Quirks = function(editor) {
|
|||
});
|
||||
|
||||
// Removes any \n before BR elements in PRE since other browsers and in contentEditable=false mode they will be visible
|
||||
editor.serializer.addNodeFilter('pre', function(nodes, name) {
|
||||
serializer.addNodeFilter('pre', function(nodes, name) {
|
||||
var i = nodes.length, brNodes, j, brElm, sibling;
|
||||
|
||||
while (i--) {
|
||||
|
@ -1470,7 +1481,7 @@ tinymce.util.Quirks = function(editor) {
|
|||
var isDelete, rng, container, offset, brElm, sibling, collapsed;
|
||||
|
||||
isDelete = e.keyCode == DELETE;
|
||||
if (!e.isDefaultPrevented() && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {
|
||||
if (!isDefaultPrevented(e) && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {
|
||||
rng = selection.getRng();
|
||||
container = rng.startContainer;
|
||||
offset = rng.startOffset;
|
||||
|
@ -1510,7 +1521,7 @@ tinymce.util.Quirks = function(editor) {
|
|||
editor.onKeyDown.add(function(editor, e) {
|
||||
var rng, container, offset, root, parent;
|
||||
|
||||
if (e.isDefaultPrevented() || e.keyCode != VK.BACKSPACE) {
|
||||
if (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1534,10 +1545,10 @@ tinymce.util.Quirks = function(editor) {
|
|||
editor.formatter.toggle('blockquote', null, parent);
|
||||
|
||||
// Move the caret to the beginning of container
|
||||
rng = dom.createRng();
|
||||
rng.setStart(container, 0);
|
||||
rng.setEnd(container, 0);
|
||||
selection.setRng(rng);
|
||||
selection.collapse(false);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -1562,7 +1573,7 @@ tinymce.util.Quirks = function(editor) {
|
|||
|
||||
function addBrAfterLastLinks() {
|
||||
function fixLinks(editor, o) {
|
||||
tinymce.each(dom.select('a'), function(node) {
|
||||
each(dom.select('a'), function(node) {
|
||||
var parentNode = node.parentNode, root = dom.getRoot();
|
||||
|
||||
if (parentNode.lastChild === node) {
|
||||
|
@ -1588,6 +1599,14 @@ tinymce.util.Quirks = function(editor) {
|
|||
editor.onSetContent.add(selection.onSetContent.add(fixLinks));
|
||||
};
|
||||
|
||||
function setDefaultBlockType() {
|
||||
if (settings.forced_root_block) {
|
||||
editor.onInit.add(function() {
|
||||
setEditorCommandState('DefaultParagraphSeparator', settings.forced_root_block);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function removeGhostSelection() {
|
||||
function repaint(sender, args) {
|
||||
if (!sender || !args.initial) {
|
||||
|
@ -1600,17 +1619,309 @@ tinymce.util.Quirks = function(editor) {
|
|||
editor.onSetContent.add(repaint);
|
||||
};
|
||||
|
||||
function deleteImageOnBackSpace() {
|
||||
function deleteControlItemOnBackSpace() {
|
||||
editor.onKeyDown.add(function(editor, e) {
|
||||
if (!e.isDefaultPrevented() && e.keyCode == 8 && selection.getNode().nodeName == 'IMG') {
|
||||
e.preventDefault();
|
||||
editor.undoManager.beforeChange();
|
||||
dom.remove(selection.getNode());
|
||||
editor.undoManager.add();
|
||||
var rng;
|
||||
|
||||
if (!isDefaultPrevented(e) && e.keyCode == BACKSPACE) {
|
||||
rng = editor.getDoc().selection.createRange();
|
||||
if (rng && rng.item) {
|
||||
e.preventDefault();
|
||||
editor.undoManager.beforeChange();
|
||||
dom.remove(rng.item(0));
|
||||
editor.undoManager.add();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function renderEmptyBlocksFix() {
|
||||
var emptyBlocksCSS;
|
||||
|
||||
// IE10+
|
||||
if (getDocumentMode() >= 10) {
|
||||
emptyBlocksCSS = '';
|
||||
each('p div h1 h2 h3 h4 h5 h6'.split(' '), function(name, i) {
|
||||
emptyBlocksCSS += (i > 0 ? ',' : '') + name + ':empty';
|
||||
});
|
||||
|
||||
editor.contentStyles.push(emptyBlocksCSS + '{padding-right: 1px !important}');
|
||||
}
|
||||
};
|
||||
|
||||
function fakeImageResize() {
|
||||
var selectedElmX, selectedElmY, selectedElm, selectedElmGhost, selectedHandle, startX, startY, startW, startH, ratio,
|
||||
resizeHandles, width, height, rootDocument = document, editableDoc = editor.getDoc();
|
||||
|
||||
if (!settings.object_resizing || settings.webkit_fake_resize === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Try disabling object resizing if WebKit implements resizing in the future
|
||||
setEditorCommandState("enableObjectResizing", false);
|
||||
|
||||
// Details about each resize handle how to scale etc
|
||||
resizeHandles = {
|
||||
// Name: x multiplier, y multiplier, delta size x, delta size y
|
||||
n: [.5, 0, 0, -1],
|
||||
e: [1, .5, 1, 0],
|
||||
s: [.5, 1, 0, 1],
|
||||
w: [0, .5, -1, 0],
|
||||
nw: [0, 0, -1, -1],
|
||||
ne: [1, 0, 1, -1],
|
||||
se: [1, 1, 1, 1],
|
||||
sw : [0, 1, -1, 1]
|
||||
};
|
||||
|
||||
function resizeElement(e) {
|
||||
var deltaX, deltaY;
|
||||
|
||||
// Calc new width/height
|
||||
deltaX = e.screenX - startX;
|
||||
deltaY = e.screenY - startY;
|
||||
|
||||
// Calc new size
|
||||
width = deltaX * selectedHandle[2] + startW;
|
||||
height = deltaY * selectedHandle[3] + startH;
|
||||
|
||||
// Never scale down lower than 5 pixels
|
||||
width = width < 5 ? 5 : width;
|
||||
height = height < 5 ? 5 : height;
|
||||
|
||||
// Constrain proportions when modifier key is pressed or if the nw, ne, sw, se corners are moved on an image
|
||||
if (VK.modifierPressed(e) || (selectedElm.nodeName == "IMG" && selectedHandle[2] * selectedHandle[3] !== 0)) {
|
||||
width = Math.round(height / ratio);
|
||||
height = Math.round(width * ratio);
|
||||
}
|
||||
|
||||
// Update ghost size
|
||||
dom.setStyles(selectedElmGhost, {
|
||||
width: width,
|
||||
height: height
|
||||
});
|
||||
|
||||
// Update ghost X position if needed
|
||||
if (selectedHandle[2] < 0 && selectedElmGhost.clientWidth <= width) {
|
||||
dom.setStyle(selectedElmGhost, 'left', selectedElmX + (startW - width));
|
||||
}
|
||||
|
||||
// Update ghost Y position if needed
|
||||
if (selectedHandle[3] < 0 && selectedElmGhost.clientHeight <= height) {
|
||||
dom.setStyle(selectedElmGhost, 'top', selectedElmY + (startH - height));
|
||||
}
|
||||
}
|
||||
|
||||
function endResize() {
|
||||
function setSizeProp(name, value) {
|
||||
if (value) {
|
||||
// Resize by using style or attribute
|
||||
if (selectedElm.style[name] || !editor.schema.isValid(selectedElm.nodeName.toLowerCase(), name)) {
|
||||
dom.setStyle(selectedElm, name, value);
|
||||
} else {
|
||||
dom.setAttrib(selectedElm, name, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set width/height properties
|
||||
setSizeProp('width', width);
|
||||
setSizeProp('height', height);
|
||||
|
||||
dom.unbind(editableDoc, 'mousemove', resizeElement);
|
||||
dom.unbind(editableDoc, 'mouseup', endResize);
|
||||
|
||||
if (rootDocument != editableDoc) {
|
||||
dom.unbind(rootDocument, 'mousemove', resizeElement);
|
||||
dom.unbind(rootDocument, 'mouseup', endResize);
|
||||
}
|
||||
|
||||
// Remove ghost and update resize handle positions
|
||||
dom.remove(selectedElmGhost);
|
||||
showResizeRect(selectedElm);
|
||||
}
|
||||
|
||||
function showResizeRect(targetElm) {
|
||||
var position, targetWidth, targetHeight;
|
||||
|
||||
hideResizeRect();
|
||||
|
||||
// Get position and size of target
|
||||
position = dom.getPos(targetElm);
|
||||
selectedElmX = position.x;
|
||||
selectedElmY = position.y;
|
||||
targetWidth = targetElm.offsetWidth;
|
||||
targetHeight = targetElm.offsetHeight;
|
||||
|
||||
// Reset width/height if user selects a new image/table
|
||||
if (selectedElm != targetElm) {
|
||||
selectedElm = targetElm;
|
||||
width = height = 0;
|
||||
}
|
||||
|
||||
each(resizeHandles, function(handle, name) {
|
||||
var handleElm;
|
||||
|
||||
// Get existing or render resize handle
|
||||
handleElm = dom.get('mceResizeHandle' + name);
|
||||
if (!handleElm) {
|
||||
handleElm = dom.add(editableDoc.documentElement, 'div', {
|
||||
id: 'mceResizeHandle' + name,
|
||||
'class': 'mceResizeHandle',
|
||||
style: 'cursor:' + name + '-resize; margin:0; padding:0'
|
||||
});
|
||||
|
||||
dom.bind(handleElm, 'mousedown', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
endResize();
|
||||
|
||||
startX = e.screenX;
|
||||
startY = e.screenY;
|
||||
startW = selectedElm.clientWidth;
|
||||
startH = selectedElm.clientHeight;
|
||||
ratio = startH / startW;
|
||||
selectedHandle = handle;
|
||||
|
||||
selectedElmGhost = selectedElm.cloneNode(true);
|
||||
dom.addClass(selectedElmGhost, 'mceClonedResizable');
|
||||
dom.setStyles(selectedElmGhost, {
|
||||
left: selectedElmX,
|
||||
top: selectedElmY,
|
||||
margin: 0
|
||||
});
|
||||
|
||||
editableDoc.documentElement.appendChild(selectedElmGhost);
|
||||
|
||||
dom.bind(editableDoc, 'mousemove', resizeElement);
|
||||
dom.bind(editableDoc, 'mouseup', endResize);
|
||||
|
||||
if (rootDocument != editableDoc) {
|
||||
dom.bind(rootDocument, 'mousemove', resizeElement);
|
||||
dom.bind(rootDocument, 'mouseup', endResize);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
dom.show(handleElm);
|
||||
}
|
||||
|
||||
// Position element
|
||||
dom.setStyles(handleElm, {
|
||||
left: (targetWidth * handle[0] + selectedElmX) - (handleElm.offsetWidth / 2),
|
||||
top: (targetHeight * handle[1] + selectedElmY) - (handleElm.offsetHeight / 2)
|
||||
});
|
||||
});
|
||||
|
||||
// Only add resize rectangle on WebKit and only on images
|
||||
if (!tinymce.isOpera && selectedElm.nodeName == "IMG") {
|
||||
selectedElm.setAttribute('data-mce-selected', '1');
|
||||
}
|
||||
}
|
||||
|
||||
function hideResizeRect() {
|
||||
if (selectedElm) {
|
||||
selectedElm.removeAttribute('data-mce-selected');
|
||||
}
|
||||
|
||||
for (var name in resizeHandles) {
|
||||
dom.hide('mceResizeHandle' + name);
|
||||
}
|
||||
}
|
||||
|
||||
// Add CSS for resize handles, cloned element and selected
|
||||
editor.contentStyles.push(
|
||||
'.mceResizeHandle {' +
|
||||
'position: absolute;' +
|
||||
'border: 1px solid black;' +
|
||||
'background: #FFF;' +
|
||||
'width: 5px;' +
|
||||
'height: 5px;' +
|
||||
'z-index: 10000' +
|
||||
'}' +
|
||||
'.mceResizeHandle:hover {' +
|
||||
'background: #000' +
|
||||
'}' +
|
||||
'img[data-mce-selected] {' +
|
||||
'outline: 1px solid black' +
|
||||
'}' +
|
||||
'img.mceClonedResizable, table.mceClonedResizable {' +
|
||||
'position: absolute;' +
|
||||
'outline: 1px dashed black;' +
|
||||
'opacity: .5;' +
|
||||
'z-index: 10000' +
|
||||
'}'
|
||||
);
|
||||
|
||||
function updateResizeRect() {
|
||||
var controlElm = dom.getParent(selection.getNode(), 'table,img');
|
||||
|
||||
// Remove data-mce-selected from all elements since they might have been copied using Ctrl+c/v
|
||||
each(dom.select('img[data-mce-selected]'), function(img) {
|
||||
img.removeAttribute('data-mce-selected');
|
||||
});
|
||||
|
||||
if (controlElm) {
|
||||
showResizeRect(controlElm);
|
||||
} else {
|
||||
hideResizeRect();
|
||||
}
|
||||
}
|
||||
|
||||
// Show/hide resize rect when image is selected
|
||||
editor.onNodeChange.add(updateResizeRect);
|
||||
|
||||
// Fixes WebKit quirk where it returns IMG on getNode if caret is after last image in container
|
||||
dom.bind(editableDoc, 'selectionchange', updateResizeRect);
|
||||
|
||||
// Remove the internal attribute when serializing the DOM
|
||||
editor.serializer.addAttributeFilter('data-mce-selected', function(nodes, name) {
|
||||
var i = nodes.length;
|
||||
|
||||
while (i--) {
|
||||
nodes[i].attr(name, null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function keepNoScriptContents() {
|
||||
if (getDocumentMode() < 9) {
|
||||
parser.addNodeFilter('noscript', function(nodes) {
|
||||
var i = nodes.length, node, textNode;
|
||||
|
||||
while (i--) {
|
||||
node = nodes[i];
|
||||
textNode = node.firstChild;
|
||||
|
||||
if (textNode) {
|
||||
node.attr('data-mce-innertext', textNode.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
serializer.addNodeFilter('noscript', function(nodes) {
|
||||
var i = nodes.length, node, textNode, value;
|
||||
|
||||
while (i--) {
|
||||
node = nodes[i];
|
||||
textNode = nodes[i].firstChild;
|
||||
|
||||
if (textNode) {
|
||||
textNode.value = tinymce.html.Entities.decode(textNode.value);
|
||||
} else {
|
||||
// Old IE can't retain noscript value so an attribute is used to store it
|
||||
value = node.attributes.map['data-mce-innertext'];
|
||||
if (value) {
|
||||
node.attr('data-mce-innertext', null);
|
||||
textNode = new tinymce.html.Node('#text', 3);
|
||||
textNode.value = value;
|
||||
textNode.raw = true;
|
||||
node.append(textNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// All browsers
|
||||
disableBackspaceIntoATable();
|
||||
removeBlockQuoteOnBackSpace();
|
||||
|
@ -1622,10 +1933,14 @@ tinymce.util.Quirks = function(editor) {
|
|||
cleanupStylesWhenDeleting();
|
||||
inputMethodFocus();
|
||||
selectControlElements();
|
||||
setDefaultBlockType();
|
||||
|
||||
// iOS
|
||||
if (tinymce.isIDevice) {
|
||||
selectionChangeNodeChanged();
|
||||
} else {
|
||||
fakeImageResize();
|
||||
selectAll();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1635,7 +1950,9 @@ tinymce.util.Quirks = function(editor) {
|
|||
ensureBodyHasRoleApplication();
|
||||
addNewLinesBeforeBrInPre();
|
||||
removePreSerializedStylesWhenSelectingControls();
|
||||
deleteImageOnBackSpace();
|
||||
deleteControlItemOnBackSpace();
|
||||
renderEmptyBlocksFix();
|
||||
keepNoScriptContents();
|
||||
}
|
||||
|
||||
// Gecko
|
||||
|
@ -1647,6 +1964,11 @@ tinymce.util.Quirks = function(editor) {
|
|||
addBrAfterLastLinks();
|
||||
removeGhostSelection();
|
||||
}
|
||||
|
||||
// Opera
|
||||
if (tinymce.isOpera) {
|
||||
fakeImageResize();
|
||||
}
|
||||
};
|
||||
(function(tinymce) {
|
||||
var namedEntities, baseEntities, reverseEntities,
|
||||
|
@ -2098,9 +2420,12 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
|
||||
if (!html5) {
|
||||
html5 = mapCache.html5 = unpack({
|
||||
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'
|
||||
A : 'id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup',
|
||||
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|wbr',
|
||||
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][#]' +
|
||||
|
@ -2136,7 +2461,7 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
'dl[A][dd|dt]' +
|
||||
'dt[A][B]' +
|
||||
'dd[A][C]' +
|
||||
'a[A|href|target|ping|rel|media|type][C]' +
|
||||
'a[A|href|target|ping|rel|media|type][B]' +
|
||||
'em[A][B]' +
|
||||
'strong[A][B]' +
|
||||
'small[A][B]' +
|
||||
|
@ -2182,7 +2507,8 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
'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][]' +
|
||||
'input[A|type|accept|alt|autocomplete|autofocus|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|' +
|
||||
'multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]' +
|
||||
'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]' +
|
||||
|
@ -2196,7 +2522,7 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
'area[A|shape|coords|href|alt|target|media|rel|ping|type][]' +
|
||||
'mathml[A][]' +
|
||||
'svg[A][]' +
|
||||
'table[A|summary][caption|colgroup|thead|tfoot|tbody|tr]' +
|
||||
'table[A|border][caption|colgroup|thead|tfoot|tbody|tr]' +
|
||||
'caption[A][C]' +
|
||||
'colgroup[A|span][col]' +
|
||||
'col[A|span][]' +
|
||||
|
@ -2205,7 +2531,8 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
'tbody[A][tr]' +
|
||||
'tr[A][th|td]' +
|
||||
'th[A|headers|rowspan|colspan|scope][B]' +
|
||||
'td[A|headers|rowspan|colspan][C]'
|
||||
'td[A|headers|rowspan|colspan][C]' +
|
||||
'wbr[A][]'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -2384,14 +2711,15 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
}
|
||||
|
||||
// Setup map objects
|
||||
whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script style textarea');
|
||||
selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li options p td tfoot th thead tr');
|
||||
shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link meta param embed source');
|
||||
whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script noscript style textarea');
|
||||
selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr');
|
||||
shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link meta param embed source wbr');
|
||||
boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls');
|
||||
nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object', shortEndedElementsMap);
|
||||
blockElementsMap = createLookupTable('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');
|
||||
textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' +
|
||||
'blockquote center dir fieldset header footer article section hgroup aside nav figure');
|
||||
blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' +
|
||||
'th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup', textBlockElementsMap);
|
||||
|
||||
// Converts a wildcard expression string to a regexp for example *a will become /.*a/.
|
||||
function patternToRegExp(str) {
|
||||
|
@ -2565,8 +2893,15 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
customElementsMap[name] = cloneName;
|
||||
|
||||
// If it's not marked as inline then add it to valid block elements
|
||||
if (!inline)
|
||||
if (!inline) {
|
||||
blockElementsMap[name.toUpperCase()] = {};
|
||||
blockElementsMap[name] = {};
|
||||
}
|
||||
|
||||
// Add elements clone if needed
|
||||
if (!elements[name]) {
|
||||
elements[name] = elements[cloneName];
|
||||
}
|
||||
|
||||
// Add custom elements at span/div positions
|
||||
each(children, function(element, child) {
|
||||
|
@ -2691,6 +3026,10 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
return blockElementsMap;
|
||||
};
|
||||
|
||||
self.getTextBlockElements = function() {
|
||||
return textBlockElementsMap;
|
||||
};
|
||||
|
||||
self.getShortEndedElements = function() {
|
||||
return shortEndedElementsMap;
|
||||
};
|
||||
|
@ -2713,6 +3052,36 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
return !!(parent && parent[child]);
|
||||
};
|
||||
|
||||
self.isValid = function(name, attr) {
|
||||
var attrPatterns, i, rule = getElementRule(name);
|
||||
|
||||
// Check if it's a valid element
|
||||
if (rule) {
|
||||
if (attr) {
|
||||
// Check if attribute name exists
|
||||
if (rule.attributes[attr]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if attribute matches a regexp pattern
|
||||
attrPatterns = rule.attributePatterns;
|
||||
if (attrPatterns) {
|
||||
i = attrPatterns.length;
|
||||
while (i--) {
|
||||
if (attrPatterns[i].pattern.test(name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// No match
|
||||
return false;
|
||||
};
|
||||
|
||||
self.getElementRule = getElementRule;
|
||||
|
||||
self.getCustomElements = function() {
|
||||
|
@ -2726,6 +3095,8 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
self.addCustomElements = addCustomElements;
|
||||
|
||||
self.addValidChildren = addValidChildren;
|
||||
|
||||
self.elements = elements;
|
||||
};
|
||||
})(tinymce);
|
||||
|
||||
|
@ -2824,10 +3195,10 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
'(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE
|
||||
'(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI
|
||||
'(?:\\/([^>]+)>)|' + // End element
|
||||
'(?:([A-Za-z0-9\\-\\:]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + // Start element
|
||||
'(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + // Start element
|
||||
')', 'g');
|
||||
|
||||
attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;
|
||||
attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;
|
||||
specialElements = {
|
||||
'script' : /<\/script[^>]*>/gi,
|
||||
'style' : /<\/style[^>]*>/gi,
|
||||
|
@ -2836,7 +3207,7 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
|
||||
// Setup lookup tables for empty elements and boolean attributes
|
||||
shortEndedElements = schema.getShortEndedElements();
|
||||
selfClosing = schema.getSelfClosingElements();
|
||||
selfClosing = settings.self_closing_elements || schema.getSelfClosingElements();
|
||||
fillAttrsMap = schema.getBoolAttrs();
|
||||
validate = settings.validate;
|
||||
removeInternalElements = settings.remove_internals;
|
||||
|
@ -3310,7 +3681,7 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
i = node.attributes.length;
|
||||
while (i--) {
|
||||
name = node.attributes[i].name;
|
||||
if (name === "name" || name.indexOf('data-') === 0)
|
||||
if (name === "name" || name.indexOf('data-mce-') === 0)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -3366,18 +3737,41 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
|
||||
function fixInvalidChildren(nodes) {
|
||||
var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i,
|
||||
childClone, nonEmptyElements, nonSplitableElements, sibling, nextNode;
|
||||
childClone, nonEmptyElements, nonSplitableElements, textBlockElements, sibling, nextNode;
|
||||
|
||||
nonSplitableElements = tinymce.makeMap('tr,td,th,tbody,thead,tfoot,table');
|
||||
nonEmptyElements = schema.getNonEmptyElements();
|
||||
textBlockElements = schema.getTextBlockElements();
|
||||
|
||||
for (ni = 0; ni < nodes.length; ni++) {
|
||||
node = nodes[ni];
|
||||
|
||||
// Already removed
|
||||
if (!node.parent)
|
||||
// Already removed or fixed
|
||||
if (!node.parent || node.fixed)
|
||||
continue;
|
||||
|
||||
// If the invalid element is a text block and the text block is within a parent LI element
|
||||
// Then unwrap the first text block and convert other sibling text blocks to LI elements similar to Word/Open Office
|
||||
if (textBlockElements[node.name] && node.parent.name == 'li') {
|
||||
// Move sibling text blocks after LI element
|
||||
sibling = node.next;
|
||||
while (sibling) {
|
||||
if (textBlockElements[sibling.name]) {
|
||||
sibling.name = 'li';
|
||||
sibling.fixed = true;
|
||||
node.parent.insert(sibling, node.parent);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
sibling = sibling.next;
|
||||
}
|
||||
|
||||
// Unwrap current text block
|
||||
node.unwrap(node);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get list of all parent nodes until we find a valid parent to stick the child into
|
||||
parents = [node];
|
||||
for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) && !nonSplitableElements[parent.name]; parent = parent.parent)
|
||||
|
@ -3584,9 +3978,23 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
}
|
||||
};
|
||||
|
||||
function cloneAndExcludeBlocks(input) {
|
||||
var name, output = {};
|
||||
|
||||
for (name in input) {
|
||||
if (name !== 'li' && name != 'p') {
|
||||
output[name] = input[name];
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
};
|
||||
|
||||
parser = new tinymce.html.SaxParser({
|
||||
validate : validate,
|
||||
fix_self_closing : !validate, // Let the DOM parser handle <li> in <li> or <p> in <p> for better results
|
||||
|
||||
// Exclude P and LI from DOM parsing since it's treated better by the DOM parser
|
||||
self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()),
|
||||
|
||||
cdata: function(text) {
|
||||
node.append(createNode('#cdata', 4)).value = text;
|
||||
|
@ -3741,7 +4149,8 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
}
|
||||
|
||||
// Trim start white space
|
||||
textNode = node.prev;
|
||||
// Removed due to: #5424
|
||||
/*textNode = node.prev;
|
||||
if (textNode && textNode.type === 3) {
|
||||
text = textNode.value.replace(startWhiteSpaceRegExp, '');
|
||||
|
||||
|
@ -3749,7 +4158,7 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
textNode.value = text;
|
||||
else
|
||||
textNode.remove();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
// Check if we exited a whitespace preserved element
|
||||
|
@ -3764,7 +4173,7 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
node.empty().append(new Node('#text', '3')).value = '\u00a0';
|
||||
else {
|
||||
// Leave nodes that have a name like <a name="name">
|
||||
if (!node.attributes.map.name) {
|
||||
if (!node.attributes.map.name && !node.attributes.map.id) {
|
||||
tempNode = node.parent;
|
||||
node.empty().remove();
|
||||
node = tempNode;
|
||||
|
@ -3916,12 +4325,12 @@ tinymce.html.Styles = function(settings, schema) {
|
|||
|
||||
// Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included.
|
||||
if (!settings.allow_html_in_named_anchor) {
|
||||
self.addAttributeFilter('name', function(nodes, name) {
|
||||
self.addAttributeFilter('id,name', function(nodes, name) {
|
||||
var i = nodes.length, sibling, prevSibling, parent, node;
|
||||
|
||||
while (i--) {
|
||||
node = nodes[i];
|
||||
if (node.name === 'a' && node.firstChild) {
|
||||
if (node.name === 'a' && node.firstChild && !node.attr('href')) {
|
||||
parent = node.parent;
|
||||
|
||||
// Move children after current node
|
||||
|
@ -4259,6 +4668,12 @@ tinymce.dom = {};
|
|||
}
|
||||
}
|
||||
|
||||
// Page already loaded then fire it directly
|
||||
if (doc.readyState == "complete") {
|
||||
readyHandler();
|
||||
return;
|
||||
}
|
||||
|
||||
// Use W3C method
|
||||
if (w3cEventModel) {
|
||||
addEvent(win, 'DOMContentLoaded', readyHandler);
|
||||
|
@ -4600,7 +5015,7 @@ tinymce.dom = {};
|
|||
|
||||
// Old API supported multiple targets
|
||||
if (target && target instanceof Array) {
|
||||
var i = target;
|
||||
var i = target.length;
|
||||
|
||||
while (i--) {
|
||||
self.add(target[i], events, func, scope);
|
||||
|
@ -4660,12 +5075,20 @@ tinymce.dom = {};
|
|||
};
|
||||
|
||||
self.prevent = function(e) {
|
||||
if (!e.preventDefault) {
|
||||
e = fix(e);
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
self.stop = function(e) {
|
||||
if (!e.stopPropagation) {
|
||||
e = fix(e);
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
|
||||
return false;
|
||||
|
@ -4794,6 +5217,11 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
|
|||
blockElementsMap = s.schema ? s.schema.getBlockElements() : {};
|
||||
|
||||
t.isBlock = function(node) {
|
||||
// Fix for #5446
|
||||
if (!node) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// This function is called in module pattern style since it might be executed with the wrong this scope
|
||||
var type = node.nodeType;
|
||||
|
||||
|
@ -5434,6 +5862,32 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
|
|||
return this.styles.serialize(o, name);
|
||||
},
|
||||
|
||||
addStyle: function(cssText) {
|
||||
var doc = this.doc, head;
|
||||
|
||||
// Create style element if needed
|
||||
styleElm = doc.getElementById('mceDefaultStyles');
|
||||
if (!styleElm) {
|
||||
styleElm = doc.createElement('style'),
|
||||
styleElm.id = 'mceDefaultStyles';
|
||||
styleElm.type = 'text/css';
|
||||
|
||||
head = doc.getElementsByTagName('head')[0];
|
||||
if (head.firstChild) {
|
||||
head.insertBefore(styleElm, head.firstChild);
|
||||
} else {
|
||||
head.appendChild(styleElm);
|
||||
}
|
||||
}
|
||||
|
||||
// Append style data to old or new style element
|
||||
if (styleElm.styleSheet) {
|
||||
styleElm.styleSheet.cssText += cssText;
|
||||
} else {
|
||||
styleElm.appendChild(doc.createTextNode(cssText));
|
||||
}
|
||||
},
|
||||
|
||||
loadCSS : function(u) {
|
||||
var t = this, d = t.doc, head;
|
||||
|
||||
|
@ -5557,13 +6011,13 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
|
|||
// This seems to fix this problem
|
||||
|
||||
// Create new div with HTML contents and a BR infront to keep comments
|
||||
element = self.create('div');
|
||||
element.innerHTML = '<br />' + html;
|
||||
var newElement = self.create('div');
|
||||
newElement.innerHTML = '<br />' + html;
|
||||
|
||||
// Add all children from div to target
|
||||
each (element.childNodes, function(node, i) {
|
||||
each (tinymce.grep(newElement.childNodes), function(node, i) {
|
||||
// Skip br element
|
||||
if (i)
|
||||
if (i && element.canHaveHTML)
|
||||
element.appendChild(node);
|
||||
});
|
||||
}
|
||||
|
@ -6158,7 +6612,8 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
|
|||
cloneContents : cloneContents,
|
||||
insertNode : insertNode,
|
||||
surroundContents : surroundContents,
|
||||
cloneRange : cloneRange
|
||||
cloneRange : cloneRange,
|
||||
toStringIE : toStringIE
|
||||
});
|
||||
|
||||
function createDocumentFragment() {
|
||||
|
@ -6798,9 +7253,20 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
|
|||
|
||||
n.parentNode.removeChild(n);
|
||||
};
|
||||
|
||||
function toStringIE() {
|
||||
return dom.create('body', null, cloneContents()).outerText;
|
||||
}
|
||||
|
||||
return t;
|
||||
};
|
||||
|
||||
ns.Range = Range;
|
||||
|
||||
// Older IE versions doesn't let you override toString by it's constructor so we have to stick it in the prototype
|
||||
Range.prototype.toString = function() {
|
||||
return this.toStringIE();
|
||||
};
|
||||
})(tinymce.dom);
|
||||
|
||||
(function() {
|
||||
|
@ -7156,7 +7622,8 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
|
|||
};
|
||||
|
||||
this.addRange = function(rng) {
|
||||
var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, doc = selection.dom.doc, body = doc.body;
|
||||
var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, sibling,
|
||||
doc = selection.dom.doc, body = doc.body, nativeRng, ctrlElm;
|
||||
|
||||
function setEndPoint(start) {
|
||||
var container, offset, marker, tmpRng, nodes;
|
||||
|
@ -7214,11 +7681,25 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
|
|||
// Trick to place the caret inside an empty block element like <p></p>
|
||||
if (startOffset == endOffset && !startContainer.hasChildNodes()) {
|
||||
if (startContainer.canHaveHTML) {
|
||||
// Check if previous sibling is an empty block if it is then we need to render it
|
||||
// IE would otherwise move the caret into the sibling instead of the empty startContainer see: #5236
|
||||
// Example this: <p></p><p>|</p> would become this: <p>|</p><p></p>
|
||||
sibling = startContainer.previousSibling;
|
||||
if (sibling && !sibling.hasChildNodes() && dom.isBlock(sibling)) {
|
||||
sibling.innerHTML = '\uFEFF';
|
||||
} else {
|
||||
sibling = null;
|
||||
}
|
||||
|
||||
startContainer.innerHTML = '<span>\uFEFF</span><span>\uFEFF</span>';
|
||||
ieRng.moveToElementText(startContainer.lastChild);
|
||||
ieRng.select();
|
||||
dom.doc.selection.clear();
|
||||
startContainer.innerHTML = '';
|
||||
|
||||
if (sibling) {
|
||||
sibling.innerHTML = '';
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
startOffset = dom.nodeIndex(startContainer);
|
||||
|
@ -7228,10 +7709,17 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
|
|||
|
||||
if (startOffset == endOffset - 1) {
|
||||
try {
|
||||
ctrlElm = startContainer.childNodes[startOffset];
|
||||
ctrlRng = body.createControlRange();
|
||||
ctrlRng.addElement(startContainer.childNodes[startOffset]);
|
||||
ctrlRng.addElement(ctrlElm);
|
||||
ctrlRng.select();
|
||||
return;
|
||||
|
||||
// Check if the range produced is on the correct element and is a control range
|
||||
// On IE 8 it will select the parent contentEditable container if you select an inner element see: #5398
|
||||
nativeRng = selection.getRng();
|
||||
if (nativeRng.item && ctrlElm === nativeRng.item(0)) {
|
||||
return;
|
||||
}
|
||||
} catch (ex) {
|
||||
// Ignore
|
||||
}
|
||||
|
@ -8816,12 +9304,13 @@ window.tinymce.dom.Sizzle = Sizzle;
|
|||
var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each, TreeWalker = tinymce.dom.TreeWalker;
|
||||
|
||||
tinymce.create('tinymce.dom.Selection', {
|
||||
Selection : function(dom, win, serializer) {
|
||||
Selection : function(dom, win, serializer, editor) {
|
||||
var t = this;
|
||||
|
||||
t.dom = dom;
|
||||
t.win = win;
|
||||
t.serializer = serializer;
|
||||
t.editor = editor;
|
||||
|
||||
// Add events
|
||||
each([
|
||||
|
@ -8977,7 +9466,7 @@ window.tinymce.dom.Sizzle = Sizzle;
|
|||
},
|
||||
|
||||
getStart : function() {
|
||||
var rng = this.getRng(), startElement, parentElement, checkRng, node;
|
||||
var self = this, rng = self.getRng(), startElement, parentElement, checkRng, node;
|
||||
|
||||
if (rng.duplicate || rng.item) {
|
||||
// Control selection, return first item
|
||||
|
@ -8988,6 +9477,9 @@ window.tinymce.dom.Sizzle = Sizzle;
|
|||
checkRng = rng.duplicate();
|
||||
checkRng.collapse(1);
|
||||
startElement = checkRng.parentElement();
|
||||
if (startElement.ownerDocument !== self.dom.doc) {
|
||||
startElement = self.dom.getRoot();
|
||||
}
|
||||
|
||||
// Check if range parent is inside the start element, then return the inner parent element
|
||||
// This will fix issues when a single element is selected, IE would otherwise return the wrong start element
|
||||
|
@ -9014,31 +9506,34 @@ window.tinymce.dom.Sizzle = Sizzle;
|
|||
},
|
||||
|
||||
getEnd : function() {
|
||||
var t = this, r = t.getRng(), e, eo;
|
||||
var self = this, rng = self.getRng(), endElement, endOffset;
|
||||
|
||||
if (r.duplicate || r.item) {
|
||||
if (r.item)
|
||||
return r.item(0);
|
||||
if (rng.duplicate || rng.item) {
|
||||
if (rng.item)
|
||||
return rng.item(0);
|
||||
|
||||
r = r.duplicate();
|
||||
r.collapse(0);
|
||||
e = r.parentElement();
|
||||
rng = rng.duplicate();
|
||||
rng.collapse(0);
|
||||
endElement = rng.parentElement();
|
||||
if (endElement.ownerDocument !== self.dom.doc) {
|
||||
endElement = self.dom.getRoot();
|
||||
}
|
||||
|
||||
if (e && e.nodeName == 'BODY')
|
||||
return e.lastChild || e;
|
||||
if (endElement && endElement.nodeName == 'BODY')
|
||||
return endElement.lastChild || endElement;
|
||||
|
||||
return e;
|
||||
return endElement;
|
||||
} else {
|
||||
e = r.endContainer;
|
||||
eo = r.endOffset;
|
||||
endElement = rng.endContainer;
|
||||
endOffset = rng.endOffset;
|
||||
|
||||
if (e.nodeType == 1 && e.hasChildNodes())
|
||||
e = e.childNodes[eo > 0 ? eo - 1 : eo];
|
||||
if (endElement.nodeType == 1 && endElement.hasChildNodes())
|
||||
endElement = endElement.childNodes[endOffset > 0 ? endOffset - 1 : endOffset];
|
||||
|
||||
if (e && e.nodeType == 3)
|
||||
return e.parentNode;
|
||||
if (endElement && endElement.nodeType == 3)
|
||||
return endElement.parentNode;
|
||||
|
||||
return e;
|
||||
return endElement;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -9784,14 +10279,76 @@ window.tinymce.dom.Sizzle = Sizzle;
|
|||
}
|
||||
},
|
||||
|
||||
destroy : function(s) {
|
||||
var t = this;
|
||||
selectorChanged: function(selector, callback) {
|
||||
var self = this, currentSelectors;
|
||||
|
||||
t.win = null;
|
||||
if (!self.selectorChangedData) {
|
||||
self.selectorChangedData = {};
|
||||
currentSelectors = {};
|
||||
|
||||
self.editor.onNodeChange.addToTop(function(ed, cm, node) {
|
||||
var dom = self.dom, parents = dom.getParents(node, null, dom.getRoot()), matchedSelectors = {};
|
||||
|
||||
// Check for new matching selectors
|
||||
each(self.selectorChangedData, function(callbacks, selector) {
|
||||
each(parents, function(node) {
|
||||
if (dom.is(node, selector)) {
|
||||
if (!currentSelectors[selector]) {
|
||||
// Execute callbacks
|
||||
each(callbacks, function(callback) {
|
||||
callback(true, {node: node, selector: selector, parents: parents});
|
||||
});
|
||||
|
||||
currentSelectors[selector] = callbacks;
|
||||
}
|
||||
|
||||
matchedSelectors[selector] = callbacks;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Check if current selectors still match
|
||||
each(currentSelectors, function(callbacks, selector) {
|
||||
if (!matchedSelectors[selector]) {
|
||||
delete currentSelectors[selector];
|
||||
|
||||
each(callbacks, function(callback) {
|
||||
callback(false, {node: node, selector: selector, parents: parents});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Add selector listeners
|
||||
if (!self.selectorChangedData[selector]) {
|
||||
self.selectorChangedData[selector] = [];
|
||||
}
|
||||
|
||||
self.selectorChangedData[selector].push(callback);
|
||||
|
||||
return self;
|
||||
},
|
||||
|
||||
scrollIntoView: function(elm) {
|
||||
var y, viewPort, self = this, dom = self.dom;
|
||||
|
||||
viewPort = dom.getViewPort(self.editor.getWin());
|
||||
y = dom.getPos(elm).y;
|
||||
if (y < viewPort.y || y + 25 > viewPort.y + viewPort.h) {
|
||||
self.editor.getWin().scrollTo(0, y < viewPort.y ? y : y - viewPort.h + 25);
|
||||
}
|
||||
},
|
||||
|
||||
destroy : function(manual) {
|
||||
var self = this;
|
||||
|
||||
self.win = null;
|
||||
|
||||
// Manual destroy then remove unload handler
|
||||
if (!s)
|
||||
tinymce.removeUnload(t.destroy);
|
||||
if (!manual)
|
||||
tinymce.removeUnload(self.destroy);
|
||||
},
|
||||
|
||||
// IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode
|
||||
|
@ -9956,6 +10513,18 @@ window.tinymce.dom.Sizzle = Sizzle;
|
|||
}
|
||||
});
|
||||
|
||||
htmlParser.addNodeFilter('noscript', function(nodes) {
|
||||
var i = nodes.length, node;
|
||||
|
||||
while (i--) {
|
||||
node = nodes[i].firstChild;
|
||||
|
||||
if (node) {
|
||||
node.value = tinymce.html.Entities.decode(node.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Force script into CDATA sections and remove the mce- prefix also add comments around styles
|
||||
htmlParser.addNodeFilter('script,style', function(nodes, name) {
|
||||
var i = nodes.length, node, value;
|
||||
|
@ -10113,7 +10682,7 @@ window.tinymce.dom.Sizzle = Sizzle;
|
|||
|
||||
// Replace all BOM characters for now until we can find a better solution
|
||||
if (!args.cleanup)
|
||||
args.content = args.content.replace(/\uFEFF|\u200B/g, '');
|
||||
args.content = args.content.replace(/\uFEFF/g, '');
|
||||
|
||||
// Post process
|
||||
if (!args.no_events)
|
||||
|
@ -10207,11 +10776,10 @@ window.tinymce.dom.Sizzle = Sizzle;
|
|||
}
|
||||
|
||||
// Create new script element
|
||||
elm = dom.create('script', {
|
||||
id : id,
|
||||
type : 'text/javascript',
|
||||
src : tinymce._addVer(url)
|
||||
});
|
||||
elm = document.createElement('script');
|
||||
elm.id = id;
|
||||
elm.type = 'text/javascript';
|
||||
elm.src = tinymce._addVer(url);
|
||||
|
||||
// Add onload listener for non IE browsers since IE9
|
||||
// fires onload event before the script is parsed and executed
|
||||
|
@ -10575,12 +11143,15 @@ window.tinymce.dom.Sizzle = Sizzle;
|
|||
|
||||
t.destroy = function() {
|
||||
each(items, function(item) {
|
||||
dom.unbind(dom.get(item.id), 'focus', itemFocussed);
|
||||
dom.unbind(dom.get(item.id), 'blur', itemBlurred);
|
||||
var elm = dom.get(item.id);
|
||||
|
||||
dom.unbind(elm, 'focus', itemFocussed);
|
||||
dom.unbind(elm, 'blur', itemBlurred);
|
||||
});
|
||||
|
||||
dom.unbind(dom.get(root), 'focus', rootFocussed);
|
||||
dom.unbind(dom.get(root), 'keydown', rootKeydown);
|
||||
var rootElm = dom.get(root);
|
||||
dom.unbind(rootElm, 'focus', rootFocussed);
|
||||
dom.unbind(rootElm, 'keydown', rootKeydown);
|
||||
|
||||
items = dom = root = t.focus = itemFocussed = itemBlurred = rootKeydown = rootFocussed = null;
|
||||
t.destroy = function() {};
|
||||
|
@ -10659,21 +11230,23 @@ window.tinymce.dom.Sizzle = Sizzle;
|
|||
|
||||
// Set up state and listeners for each item.
|
||||
each(items, function(item, idx) {
|
||||
var tabindex;
|
||||
var tabindex, elm;
|
||||
|
||||
if (!item.id) {
|
||||
item.id = dom.uniqueId('_mce_item_');
|
||||
}
|
||||
|
||||
elm = dom.get(item.id);
|
||||
|
||||
if (excludeFromTabOrder) {
|
||||
dom.bind(item.id, 'blur', itemBlurred);
|
||||
dom.bind(elm, 'blur', itemBlurred);
|
||||
tabindex = '-1';
|
||||
} else {
|
||||
tabindex = (idx === 0 ? '0' : '-1');
|
||||
}
|
||||
|
||||
dom.setAttrib(item.id, 'tabindex', tabindex);
|
||||
dom.bind(dom.get(item.id), 'focus', itemFocussed);
|
||||
elm.setAttribute('tabindex', tabindex);
|
||||
dom.bind(elm, 'focus', itemFocussed);
|
||||
});
|
||||
|
||||
// Setup initial state for root element.
|
||||
|
@ -10682,10 +11255,11 @@ window.tinymce.dom.Sizzle = Sizzle;
|
|||
}
|
||||
|
||||
dom.setAttrib(root, 'tabindex', '-1');
|
||||
|
||||
|
||||
// Setup listeners for root element.
|
||||
dom.bind(dom.get(root), 'focus', rootFocussed);
|
||||
dom.bind(dom.get(root), 'keydown', rootKeydown);
|
||||
var rootElm = dom.get(root);
|
||||
dom.bind(rootElm, 'focus', rootFocussed);
|
||||
dom.bind(rootElm, 'keydown', rootKeydown);
|
||||
}
|
||||
});
|
||||
})(tinymce);
|
||||
|
@ -11326,7 +11900,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
|||
l = DOM.encode(s.label || '');
|
||||
h = '<a role="button" id="' + this.id + '" href="javascript:;" class="' + cp + ' ' + cp + 'Enabled ' + s['class'] + (l ? ' ' + cp + 'Labeled' : '') +'" onmousedown="return false;" onclick="return false;" aria-labelledby="' + this.id + '_voice" title="' + DOM.encode(s.title) + '">';
|
||||
if (s.image && !(this.editor &&this.editor.forcedHighContrastMode) )
|
||||
h += '<img class="mceIcon" src="' + s.image + '" alt="' + DOM.encode(s.title) + '" />' + l;
|
||||
h += '<span class="mceIcon ' + s['class'] + '"><img class="mceIcon" src="' + s.image + '" alt="' + DOM.encode(s.title) + '" /></span>' + (l ? '<span class="' + cp + 'Label">' + l + '</span>' : '');
|
||||
else
|
||||
h += '<span class="mceIcon ' + s['class'] + '"></span>' + (l ? '<span class="' + cp + 'Label">' + l + '</span>' : '');
|
||||
|
||||
|
@ -12034,6 +12608,16 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
|||
DOM.select('a', t.id + '_menu')[0].focus(); // Select first link
|
||||
}
|
||||
|
||||
t.keyboardNav = new tinymce.ui.KeyboardNavigation({
|
||||
root: t.id + '_menu',
|
||||
items: DOM.select('a', t.id + '_menu'),
|
||||
onCancel: function() {
|
||||
t.hideMenu();
|
||||
t.focus();
|
||||
}
|
||||
});
|
||||
|
||||
t.keyboardNav.focus();
|
||||
t.isMenuVisible = 1;
|
||||
},
|
||||
|
||||
|
@ -12054,6 +12638,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
|||
|
||||
t.isMenuVisible = 0;
|
||||
t.onHideMenu.dispatch();
|
||||
t.keyboardNav.destroy();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -12118,15 +12703,6 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
|||
}
|
||||
|
||||
DOM.addClass(m, 'mceColorSplitMenu');
|
||||
|
||||
new tinymce.ui.KeyboardNavigation({
|
||||
root: t.id + '_menu',
|
||||
items: DOM.select('a', t.id + '_menu'),
|
||||
onCancel: function() {
|
||||
t.hideMenu();
|
||||
t.focus();
|
||||
}
|
||||
});
|
||||
|
||||
// Prevent IE from scrolling and hindering click to occur #4019
|
||||
Event.add(t.id + '_menu', 'mousedown', function(e) {return Event.cancel(e);});
|
||||
|
@ -12168,11 +12744,17 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
|
|||
},
|
||||
|
||||
destroy : function() {
|
||||
this.parent();
|
||||
var self = this;
|
||||
|
||||
Event.clear(this.id + '_menu');
|
||||
Event.clear(this.id + '_more');
|
||||
DOM.remove(this.id + '_menu');
|
||||
self.parent();
|
||||
|
||||
Event.clear(self.id + '_menu');
|
||||
Event.clear(self.id + '_more');
|
||||
DOM.remove(self.id + '_menu');
|
||||
|
||||
if (self.keyboardNav) {
|
||||
self.keyboardNav.destroy();
|
||||
}
|
||||
}
|
||||
});
|
||||
})(tinymce);
|
||||
|
@ -12483,11 +13065,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c);
|
||||
};
|
||||
|
||||
s = extend({
|
||||
theme : "simple",
|
||||
language : "en"
|
||||
}, s);
|
||||
|
||||
t.settings = s;
|
||||
|
||||
// Legacy call
|
||||
|
@ -12589,6 +13166,9 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
if (id === undef)
|
||||
return this.editors;
|
||||
|
||||
if (!this.editors.hasOwnProperty(id))
|
||||
return undef;
|
||||
|
||||
return this.editors[id];
|
||||
},
|
||||
|
||||
|
@ -12767,7 +13347,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
self.settings = settings = extend({
|
||||
id : id,
|
||||
language : 'en',
|
||||
theme : 'simple',
|
||||
theme : 'advanced',
|
||||
skin : 'default',
|
||||
delta_width : 0,
|
||||
delta_height : 0,
|
||||
|
@ -12798,8 +13378,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
inline_styles : TRUE,
|
||||
convert_fonts_to_spans : TRUE,
|
||||
indent : 'simple',
|
||||
indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure',
|
||||
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',
|
||||
indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist',
|
||||
indent_after : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist',
|
||||
validate : TRUE,
|
||||
entity_encoding : 'named',
|
||||
url_converter : self.convertURL,
|
||||
|
@ -12821,6 +13401,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
|
||||
self.contentCSS = [];
|
||||
|
||||
self.contentStyles = [];
|
||||
|
||||
// Creates all events like onClick, onSetContent etc see Editor.Events.js for the actual logic
|
||||
self.setupEvents();
|
||||
|
||||
|
@ -12859,6 +13441,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form'))
|
||||
DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id);
|
||||
|
||||
// Hide target element early to prevent content flashing
|
||||
if (!s.content_editable) {
|
||||
t.orgVisibility = t.getElement().style.visibility;
|
||||
t.getElement().style.visibility = 'hidden';
|
||||
}
|
||||
|
||||
if (tinymce.WindowManager)
|
||||
t.windowManager = new tinymce.WindowManager(t);
|
||||
|
||||
|
@ -12920,7 +13508,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
if (s.language && s.language_load !== false)
|
||||
sl.add(tinymce.baseURL + '/langs/' + s.language + '.js');
|
||||
|
||||
if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme])
|
||||
if (s.theme && typeof s.theme != "function" && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme])
|
||||
ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js');
|
||||
|
||||
each(explode(s.plugins), function(p) {
|
||||
|
@ -12954,20 +13542,25 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
},
|
||||
|
||||
init : function() {
|
||||
var n, t = this, s = t.settings, w, h, e = t.getElement(), o, ti, u, bi, bc, re, i, initializedPlugins = [];
|
||||
var n, t = this, s = t.settings, w, h, mh, e = t.getElement(), o, ti, u, bi, bc, re, i, initializedPlugins = [];
|
||||
|
||||
tinymce.add(t);
|
||||
|
||||
s.aria_label = s.aria_label || DOM.getAttrib(e, 'aria-label', t.getLang('aria.rich_text_area'));
|
||||
|
||||
if (s.theme) {
|
||||
s.theme = s.theme.replace(/-/, '');
|
||||
o = ThemeManager.get(s.theme);
|
||||
t.theme = new o();
|
||||
if (typeof s.theme != "function") {
|
||||
s.theme = s.theme.replace(/-/, '');
|
||||
o = ThemeManager.get(s.theme);
|
||||
t.theme = new o();
|
||||
|
||||
if (t.theme.init)
|
||||
t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, ''));
|
||||
if (t.theme.init)
|
||||
t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, ''));
|
||||
} else {
|
||||
t.theme = s.theme;
|
||||
}
|
||||
}
|
||||
|
||||
function initPlugin(p) {
|
||||
var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po;
|
||||
if (c && tinymce.inArray(initializedPlugins,p) === -1) {
|
||||
|
@ -13001,36 +13594,68 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
|
||||
t.controlManager = new tinymce.ControlManager(t);
|
||||
|
||||
t.onExecCommand.add(function(ed, c) {
|
||||
// Don't refresh the select lists until caret move
|
||||
if (!/^(FontName|FontSize)$/.test(c))
|
||||
t.nodeChanged();
|
||||
});
|
||||
|
||||
// Enables users to override the control factory
|
||||
t.onBeforeRenderUI.dispatch(t, t.controlManager);
|
||||
|
||||
// Measure box
|
||||
if (s.render_ui && t.theme) {
|
||||
w = s.width || e.style.width || e.offsetWidth;
|
||||
h = s.height || e.style.height || e.offsetHeight;
|
||||
t.orgDisplay = e.style.display;
|
||||
re = /^[0-9\.]+(|px)$/i;
|
||||
|
||||
if (re.test('' + w))
|
||||
w = Math.max(parseInt(w, 10) + (o.deltaWidth || 0), 100);
|
||||
if (typeof s.theme != "function") {
|
||||
w = s.width || e.style.width || e.offsetWidth;
|
||||
h = s.height || e.style.height || e.offsetHeight;
|
||||
mh = s.min_height || 100;
|
||||
re = /^[0-9\.]+(|px)$/i;
|
||||
|
||||
if (re.test('' + h))
|
||||
h = Math.max(parseInt(h, 10) + (o.deltaHeight || 0), 100);
|
||||
if (re.test('' + w))
|
||||
w = Math.max(parseInt(w, 10) + (o.deltaWidth || 0), 100);
|
||||
|
||||
// Render UI
|
||||
o = t.theme.renderUI({
|
||||
targetNode : e,
|
||||
width : w,
|
||||
height : h,
|
||||
deltaWidth : s.delta_width,
|
||||
deltaHeight : s.delta_height
|
||||
});
|
||||
if (re.test('' + h))
|
||||
h = Math.max(parseInt(h, 10) + (o.deltaHeight || 0), mh);
|
||||
|
||||
// Render UI
|
||||
o = t.theme.renderUI({
|
||||
targetNode : e,
|
||||
width : w,
|
||||
height : h,
|
||||
deltaWidth : s.delta_width,
|
||||
deltaHeight : s.delta_height
|
||||
});
|
||||
|
||||
// Resize editor
|
||||
DOM.setStyles(o.sizeContainer || o.editorContainer, {
|
||||
width : w,
|
||||
height : h
|
||||
});
|
||||
|
||||
h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : '');
|
||||
if (h < mh)
|
||||
h = mh;
|
||||
} else {
|
||||
o = s.theme(t, e);
|
||||
|
||||
// Convert element type to id:s
|
||||
if (o.editorContainer.nodeType) {
|
||||
o.editorContainer = o.editorContainer.id = o.editorContainer.id || t.id + "_parent";
|
||||
}
|
||||
|
||||
// Convert element type to id:s
|
||||
if (o.iframeContainer.nodeType) {
|
||||
o.iframeContainer = o.iframeContainer.id = o.iframeContainer.id || t.id + "_iframecontainer";
|
||||
}
|
||||
|
||||
// Use specified iframe height or the targets offsetHeight
|
||||
h = o.iframeHeight || e.offsetHeight;
|
||||
|
||||
// Store away the selection when it's changed to it can be restored later with a editor.focus() call
|
||||
if (isIE) {
|
||||
t.onInit.add(function(ed) {
|
||||
ed.dom.bind(ed.getBody(), 'beforedeactivate keydown', function() {
|
||||
ed.lastIERng = ed.selection.getRng();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
t.editorContainer = o.editorContainer;
|
||||
}
|
||||
|
@ -13042,6 +13667,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
});
|
||||
}
|
||||
|
||||
// Load specified content CSS last
|
||||
if (s.content_style) {
|
||||
t.contentStyles.push(s.content_style);
|
||||
}
|
||||
|
||||
// Content editable mode ends here
|
||||
if (s.content_editable) {
|
||||
e = n = o = null; // Fix IE leak
|
||||
|
@ -13052,16 +13682,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
if (document.domain && location.hostname != document.domain)
|
||||
tinymce.relaxedDomain = document.domain;
|
||||
|
||||
// Resize editor
|
||||
DOM.setStyles(o.sizeContainer || o.editorContainer, {
|
||||
width : w,
|
||||
height : h
|
||||
});
|
||||
|
||||
h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : '');
|
||||
if (h < 100)
|
||||
h = 100;
|
||||
|
||||
t.iframeHTML = s.doctype + '<html><head xmlns="http://www.w3.org/1999/xhtml">';
|
||||
|
||||
// We only need to override paths if we have to
|
||||
|
@ -13070,10 +13690,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
t.iframeHTML += '<base href="' + t.documentBaseURI.getURI() + '" />';
|
||||
|
||||
// IE8 doesn't support carets behind images setting ie7_compat would force IE8+ to run in IE7 compat mode.
|
||||
if (s.ie7_compat)
|
||||
t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=7" />';
|
||||
else
|
||||
t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=edge" />';
|
||||
if (tinymce.isIE8) {
|
||||
if (s.ie7_compat)
|
||||
t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=7" />';
|
||||
else
|
||||
t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=edge" />';
|
||||
}
|
||||
|
||||
t.iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
|
||||
|
||||
|
@ -13120,7 +13742,14 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
});
|
||||
|
||||
t.contentAreaContainer = o.iframeContainer;
|
||||
DOM.get(o.editorContainer).style.display = t.orgDisplay;
|
||||
|
||||
if (o.editorContainer) {
|
||||
DOM.get(o.editorContainer).style.display = t.orgDisplay;
|
||||
}
|
||||
|
||||
// Restore visibility on target element
|
||||
e.style.visibility = t.orgVisibility;
|
||||
|
||||
DOM.get(t.id).style.display = 'none';
|
||||
DOM.setAttrib(t.id, 'aria-hidden', true);
|
||||
|
||||
|
@ -13131,7 +13760,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
},
|
||||
|
||||
initContentBody : function() {
|
||||
var self = this, settings = self.settings, targetElm = DOM.get(self.id), doc = self.getDoc(), html, body;
|
||||
var self = this, settings = self.settings, targetElm = DOM.get(self.id), doc = self.getDoc(), html, body, contentCssText;
|
||||
|
||||
// Setup iframe body
|
||||
if ((!isIE || !tinymce.relaxedDomain) && !settings.content_editable) {
|
||||
|
@ -13230,7 +13859,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
|
||||
self.serializer = new tinymce.dom.Serializer(settings, self.dom, self.schema);
|
||||
|
||||
self.selection = new tinymce.dom.Selection(self.dom, self.getWin(), self.serializer);
|
||||
self.selection = new tinymce.dom.Selection(self.dom, self.getWin(), self.serializer, self);
|
||||
|
||||
self.formatter = new tinymce.Formatter(self);
|
||||
|
||||
|
@ -13240,6 +13869,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
self.enterKey = new tinymce.EnterKey(self);
|
||||
self.editorCommands = new tinymce.EditorCommands(self);
|
||||
|
||||
self.onExecCommand.add(function(editor, command) {
|
||||
// Don't refresh the select lists until caret move
|
||||
if (!/^(FontName|FontSize)$/.test(command))
|
||||
self.nodeChanged();
|
||||
});
|
||||
|
||||
// Pass through
|
||||
self.serializer.onPreProcess.add(function(se, o) {
|
||||
return self.onPreProcess.dispatch(self, o, se);
|
||||
|
@ -13251,7 +13886,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
|
||||
self.onPreInit.dispatch(self);
|
||||
|
||||
if (!settings.gecko_spellcheck)
|
||||
if (!settings.browser_spellcheck && !settings.gecko_spellcheck)
|
||||
doc.body.spellcheck = false;
|
||||
|
||||
if (!settings.readonly) {
|
||||
|
@ -13302,6 +13937,17 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
self.focus(true);
|
||||
self.nodeChanged({initial : true});
|
||||
|
||||
// Add editor specific CSS styles
|
||||
if (self.contentStyles.length > 0) {
|
||||
contentCssText = '';
|
||||
|
||||
each(self.contentStyles, function(style) {
|
||||
contentCssText += style + "\r\n";
|
||||
});
|
||||
|
||||
self.dom.addStyle(contentCssText);
|
||||
}
|
||||
|
||||
// Load specified content CSS last
|
||||
each(self.contentCSS, function(url) {
|
||||
self.dom.loadCSS(url);
|
||||
|
@ -13327,6 +13973,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
var oed, self = this, selection = self.selection, contentEditable = self.settings.content_editable, ieRng, controlElm, doc = self.getDoc(), body;
|
||||
|
||||
if (!skip_focus) {
|
||||
if (self.lastIERng) {
|
||||
selection.setRng(self.lastIERng);
|
||||
}
|
||||
|
||||
// Get selected control element
|
||||
ieRng = selection.getRng();
|
||||
if (ieRng.item) {
|
||||
|
@ -13673,6 +14323,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
|
||||
// We must save before we hide so Safari doesn't crash
|
||||
self.save();
|
||||
|
||||
// defer the call to hide to prevent an IE9 crash #4921
|
||||
DOM.hide(self.getContainer());
|
||||
DOM.setStyle(self.id, 'display', self.orgDisplay);
|
||||
},
|
||||
|
@ -13789,13 +14441,16 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
if (!args.no_events)
|
||||
self.onSetContent.dispatch(self, args);
|
||||
|
||||
self.selection.normalize();
|
||||
// Don't normalize selection if the focused element isn't the body in content editable mode since it will steal focus otherwise
|
||||
if (!self.settings.content_editable || document.activeElement === self.getBody()) {
|
||||
self.selection.normalize();
|
||||
}
|
||||
|
||||
return args.content;
|
||||
},
|
||||
|
||||
getContent : function(args) {
|
||||
var self = this, content;
|
||||
var self = this, content, body = self.getBody();
|
||||
|
||||
// Setup args object
|
||||
args = args || {};
|
||||
|
@ -13809,11 +14464,18 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
|
||||
// Get raw contents or by default the cleaned contents
|
||||
if (args.format == 'raw')
|
||||
content = self.getBody().innerHTML;
|
||||
content = body.innerHTML;
|
||||
else if (args.format == 'text')
|
||||
content = body.innerText || body.textContent;
|
||||
else
|
||||
content = self.serializer.serialize(self.getBody(), args);
|
||||
content = self.serializer.serialize(body, args);
|
||||
|
||||
args.content = tinymce.trim(content);
|
||||
// Trim whitespace in beginning/end of HTML
|
||||
if (args.format != 'text') {
|
||||
args.content = tinymce.trim(content);
|
||||
} else {
|
||||
args.content = content;
|
||||
}
|
||||
|
||||
// Do post processing
|
||||
if (!args.no_events)
|
||||
|
@ -13922,14 +14584,16 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
return;
|
||||
|
||||
case 'A':
|
||||
value = dom.getAttrib(elm, 'name');
|
||||
cls = 'mceItemAnchor';
|
||||
if (!dom.getAttrib(elm, 'href', false)) {
|
||||
value = dom.getAttrib(elm, 'name') || elm.id;
|
||||
cls = 'mceItemAnchor';
|
||||
|
||||
if (value) {
|
||||
if (self.hasVisual)
|
||||
dom.addClass(elm, cls);
|
||||
else
|
||||
dom.removeClass(elm, cls);
|
||||
if (value) {
|
||||
if (self.hasVisual)
|
||||
dom.addClass(elm, cls);
|
||||
else
|
||||
dom.removeClass(elm, cls);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -13940,22 +14604,29 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
},
|
||||
|
||||
remove : function() {
|
||||
var self = this, elm = self.getContainer();
|
||||
var self = this, elm = self.getContainer(), doc = self.getDoc();
|
||||
|
||||
if (!self.removed) {
|
||||
self.removed = 1; // Cancels post remove event execution
|
||||
self.hide();
|
||||
|
||||
// Fixed bug where IE has a blinking cursor left from the editor
|
||||
if (isIE && doc)
|
||||
doc.execCommand('SelectAll');
|
||||
|
||||
// We must save before we hide so Safari doesn't crash
|
||||
self.save();
|
||||
|
||||
DOM.setStyle(self.id, 'display', self.orgDisplay);
|
||||
|
||||
// Don't clear the window or document if content editable
|
||||
// is enabled since other instances might still be present
|
||||
if (!self.settings.content_editable) {
|
||||
Event.clear(self.getWin());
|
||||
Event.clear(self.getDoc());
|
||||
Event.unbind(self.getWin());
|
||||
Event.unbind(self.getDoc());
|
||||
}
|
||||
|
||||
Event.clear(self.getBody());
|
||||
Event.clear(self.formElement);
|
||||
Event.unbind(elm);
|
||||
Event.unbind(self.getBody());
|
||||
Event.clear(elm);
|
||||
|
||||
self.execCallback('remove_instance_callback', self);
|
||||
self.onRemove.dispatch(self);
|
||||
|
@ -14157,8 +14828,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
// Handle legacy handle_event_callback option
|
||||
if (settings.handle_event_callback) {
|
||||
self.onEvent.add(function(ed, e, o) {
|
||||
if (self.execCallback('handle_event_callback', e, ed, o) === false)
|
||||
Event.cancel(e);
|
||||
if (self.execCallback('handle_event_callback', e, ed, o) === false) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -14224,9 +14897,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
self.focus(true);
|
||||
};
|
||||
|
||||
function nodeChanged() {
|
||||
// Normalize selection for example <b>a</b><i>|a</i> becomes <b>a|</b><i>a</i>
|
||||
self.selection.normalize();
|
||||
function nodeChanged(ed, e) {
|
||||
// Normalize selection for example <b>a</b><i>|a</i> becomes <b>a|</b><i>a</i> except for Ctrl+A since it selects everything
|
||||
if (e.keyCode != 65 || !tinymce.VK.metaKeyPressed(e)) {
|
||||
self.selection.normalize();
|
||||
}
|
||||
|
||||
self.nodeChanged();
|
||||
}
|
||||
|
||||
|
@ -14270,7 +14946,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
var keyCode = e.keyCode;
|
||||
|
||||
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)
|
||||
nodeChanged();
|
||||
nodeChanged(ed, e);
|
||||
});
|
||||
|
||||
// Add reset handler
|
||||
|
@ -14623,7 +15299,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
|
||||
// Insert bookmark node and get the parent
|
||||
selection.setContent(bookmarkHtml);
|
||||
parentNode = editor.selection.getNode();
|
||||
parentNode = selection.getNode();
|
||||
rootNode = editor.getBody();
|
||||
|
||||
// Opera will return the document node when selection is in root
|
||||
|
@ -14697,6 +15373,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
editor.setContent(editor.getContent().replace(/tiny_mce_marker/g, function() { return value }));
|
||||
},
|
||||
|
||||
mceToggleFormat : function(command, ui, value) {
|
||||
toggleFormat(value);
|
||||
},
|
||||
|
||||
mceSetContent : function(command, ui, value) {
|
||||
editor.setContent(value);
|
||||
},
|
||||
|
@ -14786,10 +15466,15 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
selectAll : function() {
|
||||
var root = dom.getRoot(), rng = dom.createRng();
|
||||
|
||||
rng.setStart(root, 0);
|
||||
rng.setEnd(root, root.childNodes.length);
|
||||
// Old IE does a better job with selectall than new versions
|
||||
if (selection.getRng().setStart) {
|
||||
rng.setStart(root, 0);
|
||||
rng.setEnd(root, root.childNodes.length);
|
||||
|
||||
editor.selection.setRng(rng);
|
||||
selection.setRng(rng);
|
||||
} else {
|
||||
execNativeCommand('SelectAll');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -14828,7 +15513,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
},
|
||||
|
||||
'InsertUnorderedList,InsertOrderedList' : function(command) {
|
||||
return dom.getParent(selection.getNode(), command == 'insertunorderedlist' ? 'UL' : 'OL');
|
||||
var list = dom.getParent(selection.getNode(), 'ul,ol');
|
||||
return list &&
|
||||
(command === 'insertunorderedlist' && list.tagName === 'UL'
|
||||
|| command === 'insertorderedlist' && list.tagName === 'OL');
|
||||
}
|
||||
}, 'state');
|
||||
|
||||
|
@ -14878,9 +15566,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
};
|
||||
|
||||
// Create event instances
|
||||
onAdd = new Dispatcher(self);
|
||||
onUndo = new Dispatcher(self);
|
||||
onRedo = new Dispatcher(self);
|
||||
onBeforeAdd = new Dispatcher(self);
|
||||
onAdd = new Dispatcher(self);
|
||||
onUndo = new Dispatcher(self);
|
||||
onRedo = new Dispatcher(self);
|
||||
|
||||
// Pass though onAdd event from UndoManager to Editor as onChange
|
||||
onAdd.add(function(undoman, level) {
|
||||
|
@ -14920,7 +15609,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
// Add undo level on save contents, drag end and blur/focusout
|
||||
editor.onSaveContent.add(addNonTypingUndoLevel);
|
||||
editor.dom.bind(editor.dom.getRoot(), 'dragend', addNonTypingUndoLevel);
|
||||
editor.dom.bind(editor.getDoc(), tinymce.isGecko ? 'blur' : 'focusout', function(e) {
|
||||
editor.dom.bind(editor.getBody(), 'focusout', function(e) {
|
||||
if (!editor.removed && self.typing) {
|
||||
addNonTypingUndoLevel();
|
||||
}
|
||||
|
@ -14969,6 +15658,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
data : data,
|
||||
|
||||
typing : false,
|
||||
|
||||
onBeforeAdd: onBeforeAdd,
|
||||
|
||||
onAdd : onAdd,
|
||||
|
||||
|
@ -14985,6 +15676,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
|
|||
|
||||
level = level || {};
|
||||
level.content = getContent();
|
||||
|
||||
self.onBeforeAdd.dispatch(self, level);
|
||||
|
||||
// Add undo level if needed
|
||||
lastLevel = data[index];
|
||||
|
@ -15080,7 +15773,7 @@ tinymce.ForceBlocks = function(editor) {
|
|||
var settings = editor.settings, dom = editor.dom, selection = editor.selection, blockElements = editor.schema.getBlockElements();
|
||||
|
||||
function addRootBlocks() {
|
||||
var node = selection.getStart(), rootNode = editor.getBody(), rng, startContainer, startOffset, endContainer, endOffset, rootBlockNode, tempNode, offset = -0xFFFFFF, wrapped;
|
||||
var node = selection.getStart(), rootNode = editor.getBody(), rng, startContainer, startOffset, endContainer, endOffset, rootBlockNode, tempNode, offset = -0xFFFFFF, wrapped, isInEditorDocument;
|
||||
|
||||
if (!node || node.nodeType !== 1 || !settings.forced_root_block)
|
||||
return;
|
||||
|
@ -15108,6 +15801,7 @@ tinymce.ForceBlocks = function(editor) {
|
|||
rng.moveToElementText(node);
|
||||
}
|
||||
|
||||
isInEditorDocument = rng.parentElement().ownerDocument === editor.getDoc();
|
||||
tmpRng = rng.duplicate();
|
||||
tmpRng.collapse(true);
|
||||
startOffset = tmpRng.move('character', offset) * -1;
|
||||
|
@ -15123,6 +15817,14 @@ tinymce.ForceBlocks = function(editor) {
|
|||
node = rootNode.firstChild;
|
||||
while (node) {
|
||||
if (node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName])) {
|
||||
// Remove empty text nodes
|
||||
if (node.nodeType === 3 && node.nodeValue.length == 0) {
|
||||
tempNode = node;
|
||||
node = node.nextSibling;
|
||||
dom.remove(tempNode);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!rootBlockNode) {
|
||||
rootBlockNode = dom.create(settings.forced_root_block);
|
||||
node.parentNode.insertBefore(rootBlockNode, node);
|
||||
|
@ -15138,28 +15840,30 @@ tinymce.ForceBlocks = function(editor) {
|
|||
}
|
||||
}
|
||||
|
||||
if (rng.setStart) {
|
||||
rng.setStart(startContainer, startOffset);
|
||||
rng.setEnd(endContainer, endOffset);
|
||||
selection.setRng(rng);
|
||||
} else {
|
||||
try {
|
||||
rng = editor.getDoc().body.createTextRange();
|
||||
rng.moveToElementText(rootNode);
|
||||
rng.collapse(true);
|
||||
rng.moveStart('character', startOffset);
|
||||
|
||||
if (endOffset > 0)
|
||||
rng.moveEnd('character', endOffset);
|
||||
|
||||
rng.select();
|
||||
} catch (ex) {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
|
||||
// Only trigger nodeChange when we wrapped nodes to prevent a forever loop
|
||||
if (wrapped) {
|
||||
if (rng.setStart) {
|
||||
rng.setStart(startContainer, startOffset);
|
||||
rng.setEnd(endContainer, endOffset);
|
||||
selection.setRng(rng);
|
||||
} else {
|
||||
// Only select if the previous selection was inside the document to prevent auto focus in quirks mode
|
||||
if (isInEditorDocument) {
|
||||
try {
|
||||
rng = editor.getDoc().body.createTextRange();
|
||||
rng.moveToElementText(rootNode);
|
||||
rng.collapse(true);
|
||||
rng.moveStart('character', startOffset);
|
||||
|
||||
if (endOffset > 0)
|
||||
rng.moveEnd('character', endOffset);
|
||||
|
||||
rng.select();
|
||||
} catch (ex) {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
editor.nodeChanged();
|
||||
}
|
||||
};
|
||||
|
@ -15227,28 +15931,40 @@ tinymce.ForceBlocks = function(editor) {
|
|||
return c;
|
||||
},
|
||||
|
||||
createControl : function(n) {
|
||||
var c, t = this, ed = t.editor;
|
||||
createControl : function(name) {
|
||||
var ctrl, i, l, self = this, editor = self.editor, factories, ctrlName;
|
||||
|
||||
each(ed.plugins, function(p) {
|
||||
if (p.createControl) {
|
||||
c = p.createControl(n, t);
|
||||
|
||||
if (c)
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
switch (n) {
|
||||
case "|":
|
||||
case "separator":
|
||||
return t.createSeparator();
|
||||
// Build control factory cache
|
||||
if (!self.controlFactories) {
|
||||
self.controlFactories = [];
|
||||
each(editor.plugins, function(plugin) {
|
||||
if (plugin.createControl) {
|
||||
self.controlFactories.push(plugin);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!c && ed.buttons && (c = ed.buttons[n]))
|
||||
return t.createButton(n, c);
|
||||
// Create controls by asking cached factories
|
||||
factories = self.controlFactories;
|
||||
for (i = 0, l = factories.length; i < l; i++) {
|
||||
ctrl = factories[i].createControl(name, self);
|
||||
|
||||
return t.add(c);
|
||||
if (ctrl) {
|
||||
return self.add(ctrl);
|
||||
}
|
||||
}
|
||||
|
||||
// Create sepearator
|
||||
if (name === "|" || name === "separator") {
|
||||
return self.createSeparator();
|
||||
}
|
||||
|
||||
// Create control from button collection
|
||||
if (editor.buttons && (ctrl = editor.buttons[name])) {
|
||||
return self.createButton(name, ctrl);
|
||||
}
|
||||
|
||||
return self.add(ctrl);
|
||||
},
|
||||
|
||||
createDropMenu : function(id, s, cc) {
|
||||
|
@ -15676,19 +16392,21 @@ tinymce.ForceBlocks = function(editor) {
|
|||
TreeWalker = tinymce.dom.TreeWalker,
|
||||
rangeUtils = new tinymce.dom.RangeUtils(dom),
|
||||
isValid = ed.schema.isValidChild,
|
||||
isArray = tinymce.isArray,
|
||||
isBlock = dom.isBlock,
|
||||
forcedRootBlock = ed.settings.forced_root_block,
|
||||
nodeIndex = dom.nodeIndex,
|
||||
INVISIBLE_CHAR = tinymce.isGecko ? '\u200B' : '\uFEFF',
|
||||
INVISIBLE_CHAR = '\uFEFF',
|
||||
MCE_ATTR_RE = /^(src|href|style)$/,
|
||||
FALSE = false,
|
||||
TRUE = true,
|
||||
formatChangeData,
|
||||
undef,
|
||||
getContentEditable = dom.getContentEditable;
|
||||
|
||||
function isArray(obj) {
|
||||
return obj instanceof Array;
|
||||
};
|
||||
function isTextBlock(name) {
|
||||
return !!ed.schema.getTextBlocks()[name.toLowerCase()];
|
||||
}
|
||||
|
||||
function getParents(node, selector) {
|
||||
return dom.getParents(node, selector, dom.getRoot());
|
||||
|
@ -16254,6 +16972,11 @@ tinymce.ForceBlocks = function(editor) {
|
|||
function process(node) {
|
||||
var children, i, l, localContentEditable, lastContentEditable, hasContentEditableState;
|
||||
|
||||
// Skip on text nodes as they have neither format to remove nor children
|
||||
if (node.nodeType === 3) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Node has a contentEditable value
|
||||
if (node.nodeType === 1 && getContentEditable(node)) {
|
||||
lastContentEditable = contentEditable;
|
||||
|
@ -16564,7 +17287,7 @@ tinymce.ForceBlocks = function(editor) {
|
|||
matchedFormatNames.push(name);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, dom.getRoot());
|
||||
|
||||
return matchedFormatNames;
|
||||
};
|
||||
|
@ -16593,6 +17316,62 @@ tinymce.ForceBlocks = function(editor) {
|
|||
return FALSE;
|
||||
};
|
||||
|
||||
function formatChanged(formats, callback, similar) {
|
||||
var currentFormats;
|
||||
|
||||
// Setup format node change logic
|
||||
if (!formatChangeData) {
|
||||
formatChangeData = {};
|
||||
currentFormats = {};
|
||||
|
||||
ed.onNodeChange.addToTop(function(ed, cm, node) {
|
||||
var parents = getParents(node), matchedFormats = {};
|
||||
|
||||
// Check for new formats
|
||||
each(formatChangeData, function(callbacks, format) {
|
||||
each(parents, function(node) {
|
||||
if (matchNode(node, format, {}, callbacks.similar)) {
|
||||
if (!currentFormats[format]) {
|
||||
// Execute callbacks
|
||||
each(callbacks, function(callback) {
|
||||
callback(true, {node: node, format: format, parents: parents});
|
||||
});
|
||||
|
||||
currentFormats[format] = callbacks;
|
||||
}
|
||||
|
||||
matchedFormats[format] = callbacks;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Check if current formats still match
|
||||
each(currentFormats, function(callbacks, format) {
|
||||
if (!matchedFormats[format]) {
|
||||
delete currentFormats[format];
|
||||
|
||||
each(callbacks, function(callback) {
|
||||
callback(false, {node: node, format: format, parents: parents});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Add format listeners
|
||||
each(formats.split(','), function(format) {
|
||||
if (!formatChangeData[format]) {
|
||||
formatChangeData[format] = [];
|
||||
formatChangeData[format].similar = similar;
|
||||
}
|
||||
|
||||
formatChangeData[format].push(callback);
|
||||
});
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
// Expose to public
|
||||
tinymce.extend(this, {
|
||||
get : get,
|
||||
|
@ -16603,7 +17382,8 @@ tinymce.ForceBlocks = function(editor) {
|
|||
match : match,
|
||||
matchAll : matchAll,
|
||||
matchNode : matchNode,
|
||||
canApply : canApply
|
||||
canApply : canApply,
|
||||
formatChanged: formatChanged
|
||||
});
|
||||
|
||||
// Initialize
|
||||
|
@ -16690,6 +17470,10 @@ tinymce.ForceBlocks = function(editor) {
|
|||
siblingName = start ? 'previousSibling' : 'nextSibling';
|
||||
root = dom.getRoot();
|
||||
|
||||
function isBogusBr(node) {
|
||||
return node.nodeName == "BR" && node.getAttribute('data-mce-bogus') && !node.nextSibling;
|
||||
};
|
||||
|
||||
// If it's a text node and the offset is inside the text
|
||||
if (container.nodeType == 3 && !isWhiteSpaceNode(container)) {
|
||||
if (start ? startOffset > 0 : endOffset < container.nodeValue.length) {
|
||||
|
@ -16704,7 +17488,7 @@ tinymce.ForceBlocks = function(editor) {
|
|||
|
||||
// Walk left/right
|
||||
for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) {
|
||||
if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling)) {
|
||||
if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling) && !isBogusBr(sibling)) {
|
||||
return parent;
|
||||
}
|
||||
}
|
||||
|
@ -16863,7 +17647,7 @@ tinymce.ForceBlocks = function(editor) {
|
|||
|
||||
// Expand to first wrappable block element or any block element
|
||||
if (!node)
|
||||
node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, isBlock);
|
||||
node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, isTextBlock);
|
||||
|
||||
// Exclude inner lists from wrapping
|
||||
if (node && format[0].wrapper)
|
||||
|
@ -17509,6 +18293,21 @@ tinymce.ForceBlocks = function(editor) {
|
|||
}
|
||||
};
|
||||
|
||||
// Checks if the parent caret container node isn't empty if that is the case it
|
||||
// will remove the bogus state on all children that isn't empty
|
||||
function unmarkBogusCaretParents() {
|
||||
var i, caretContainer, node;
|
||||
|
||||
caretContainer = getParentCaretContainer(selection.getStart());
|
||||
if (caretContainer && !dom.isEmpty(caretContainer)) {
|
||||
tinymce.walk(caretContainer, function(node) {
|
||||
if (node.nodeType == 1 && node.id !== caretContainerId && !dom.isEmpty(node)) {
|
||||
dom.setAttrib(node, 'data-mce-bogus', null);
|
||||
}
|
||||
}, 'childNodes');
|
||||
}
|
||||
};
|
||||
|
||||
// Only bind the caret events once
|
||||
if (!self._hasCaretEvents) {
|
||||
// Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements
|
||||
|
@ -17528,6 +18327,7 @@ tinymce.ForceBlocks = function(editor) {
|
|||
tinymce.each('onMouseUp onKeyUp'.split(' '), function(name) {
|
||||
ed[name].addToTop(function() {
|
||||
removeCaretContainer();
|
||||
unmarkBogusCaretParents();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -17538,16 +18338,12 @@ tinymce.ForceBlocks = function(editor) {
|
|||
if (keyCode == 8 || keyCode == 37 || keyCode == 39) {
|
||||
removeCaretContainer(getParentCaretContainer(selection.getStart()));
|
||||
}
|
||||
|
||||
unmarkBogusCaretParents();
|
||||
});
|
||||
|
||||
// Remove bogus state if they got filled by contents using editor.selection.setContent
|
||||
selection.onSetContent.add(function() {
|
||||
dom.getParent(selection.getStart(), function(node) {
|
||||
if (node.id !== caretContainerId && dom.getAttrib(node, 'data-mce-bogus') && !dom.isEmpty(node)) {
|
||||
dom.setAttrib(node, 'data-mce-bogus', null);
|
||||
}
|
||||
});
|
||||
});
|
||||
selection.onSetContent.add(unmarkBogusCaretParents);
|
||||
|
||||
self._hasCaretEvents = true;
|
||||
}
|
||||
|
@ -17664,21 +18460,63 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
|
|||
var TreeWalker = tinymce.dom.TreeWalker;
|
||||
|
||||
tinymce.EnterKey = function(editor) {
|
||||
var dom = editor.dom, selection = editor.selection, settings = editor.settings, undoManager = editor.undoManager;
|
||||
var dom = editor.dom, selection = editor.selection, settings = editor.settings, undoManager = editor.undoManager, nonEmptyElementsMap = editor.schema.getNonEmptyElements();
|
||||
|
||||
function handleEnterKey(evt) {
|
||||
var rng = selection.getRng(true), tmpRng, editableRoot, container, offset, parentBlock, documentMode,
|
||||
var rng = selection.getRng(true), tmpRng, editableRoot, container, offset, parentBlock, documentMode, shiftKey,
|
||||
newBlock, fragment, containerBlock, parentBlockName, containerBlockName, newBlockName, isAfterLastNodeInContainer;
|
||||
|
||||
// Returns true if the block can be split into two blocks or not
|
||||
function canSplitBlock(node) {
|
||||
return node &&
|
||||
dom.isBlock(node) &&
|
||||
!/^(TD|TH|CAPTION)$/.test(node.nodeName) &&
|
||||
!/^(TD|TH|CAPTION|FORM)$/.test(node.nodeName) &&
|
||||
!/^(fixed|absolute)/i.test(node.style.position) &&
|
||||
dom.getContentEditable(node) !== "true";
|
||||
};
|
||||
|
||||
// Renders empty block on IE
|
||||
function renderBlockOnIE(block) {
|
||||
var oldRng;
|
||||
|
||||
if (tinymce.isIE && dom.isBlock(block)) {
|
||||
oldRng = selection.getRng();
|
||||
block.appendChild(dom.create('span', null, '\u00a0'));
|
||||
selection.select(block);
|
||||
block.lastChild.outerHTML = '';
|
||||
selection.setRng(oldRng);
|
||||
}
|
||||
};
|
||||
|
||||
// Remove the first empty inline element of the block so this: <p><b><em></em></b>x</p> becomes this: <p>x</p>
|
||||
function trimInlineElementsOnLeftSideOfBlock(block) {
|
||||
var node = block, firstChilds = [], i;
|
||||
|
||||
// Find inner most first child ex: <p><i><b>*</b></i></p>
|
||||
while (node = node.firstChild) {
|
||||
if (dom.isBlock(node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.nodeType == 1 && !nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
|
||||
firstChilds.push(node);
|
||||
}
|
||||
}
|
||||
|
||||
i = firstChilds.length;
|
||||
while (i--) {
|
||||
node = firstChilds[i];
|
||||
if (!node.hasChildNodes() || (node.firstChild == node.lastChild && node.firstChild.nodeValue === '')) {
|
||||
dom.remove(node);
|
||||
} else {
|
||||
// Remove <a> </a> see #5381
|
||||
if (node.nodeName == "A" && (node.innerText || node.textContent) === ' ') {
|
||||
dom.remove(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Moves the caret to a suitable position within the root for example in the first non pure whitespace text node or before an image
|
||||
function moveToCaretPosition(root) {
|
||||
var walker, node, rng, y, viewPort, lastNode = root, tempElm;
|
||||
|
@ -17695,7 +18533,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (/^(BR|IMG)$/.test(node.nodeName)) {
|
||||
if (nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
|
||||
rng.setStartBefore(node);
|
||||
rng.setEndBefore(node);
|
||||
break;
|
||||
|
@ -17756,6 +18594,11 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
|
|||
if (settings.keep_styles !== false) {
|
||||
do {
|
||||
if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(node.nodeName)) {
|
||||
// Never clone a caret containers
|
||||
if (node.id == '_mce_caret') {
|
||||
continue;
|
||||
}
|
||||
|
||||
clonedNode = node.cloneNode(false);
|
||||
dom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique
|
||||
|
||||
|
@ -17772,7 +18615,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
|
|||
|
||||
// BR is needed in empty blocks on non IE browsers
|
||||
if (!tinymce.isIE) {
|
||||
caretNode.innerHTML = '<br>';
|
||||
caretNode.innerHTML = '<br data-mce-bogus="1">';
|
||||
}
|
||||
|
||||
return block;
|
||||
|
@ -17792,6 +18635,11 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
|
|||
return true;
|
||||
}
|
||||
|
||||
// If the caret if before the first element in parentBlock
|
||||
if (start && container.nodeType == 1 && container == parentBlock.firstChild) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Caret can be before/after a table
|
||||
if (container.nodeName === "TABLE" || (container.previousSibling && container.previousSibling.nodeName == "TABLE")) {
|
||||
return (isAfterLastNodeInContainer && !start) || (!isAfterLastNodeInContainer && start);
|
||||
|
@ -17799,21 +18647,35 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
|
|||
|
||||
// Walk the DOM and look for text nodes or non empty elements
|
||||
walker = new TreeWalker(container, parentBlock);
|
||||
while (node = (start ? walker.prev() : walker.next())) {
|
||||
|
||||
// If caret is in beginning or end of a text block then jump to the next/previous node
|
||||
if (container.nodeType == 3) {
|
||||
if (start && offset == 0) {
|
||||
walker.prev();
|
||||
} else if (!start && offset == container.nodeValue.length) {
|
||||
walker.next();
|
||||
}
|
||||
}
|
||||
|
||||
while (node = walker.current()) {
|
||||
if (node.nodeType === 1) {
|
||||
// Ignore bogus elements
|
||||
if (node.getAttribute('data-mce-bogus')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Keep empty elements like <img />
|
||||
name = node.nodeName.toLowerCase();
|
||||
if (name === 'IMG') {
|
||||
return false;
|
||||
if (!node.getAttribute('data-mce-bogus')) {
|
||||
// Keep empty elements like <img /> <input /> but not trailing br:s like <p>text|<br></p>
|
||||
name = node.nodeName.toLowerCase();
|
||||
if (nonEmptyElementsMap[name] && name !== 'br') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else if (node.nodeType === 3 && !/^[ \t\r\n]*$/.test(node.nodeValue)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (start) {
|
||||
walker.prev();
|
||||
} else {
|
||||
walker.next();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -17897,6 +18759,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
|
|||
} else if (isFirstOrLastLi()) {
|
||||
// Last LI in list then temove LI and add text block after list
|
||||
dom.insertAfter(newBlock, containerBlock);
|
||||
renderBlockOnIE(newBlock);
|
||||
} else {
|
||||
// Middle LI in list the split the list and insert a text block in the middle
|
||||
// Extract after fragment and insert it after the current block
|
||||
|
@ -17928,12 +18791,12 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
|
|||
|
||||
// Inserts a BR element if the forced_root_block option is set to false or empty string
|
||||
function insertBr() {
|
||||
var brElm, extraBr;
|
||||
var brElm, extraBr, marker;
|
||||
|
||||
if (container && container.nodeType == 3 && offset >= container.nodeValue.length) {
|
||||
// Insert extra BR element at the end block elements
|
||||
if (!tinymce.isIE && !hasRightSideBr()) {
|
||||
brElm = dom.create('br')
|
||||
brElm = dom.create('br');
|
||||
rng.insertNode(brElm);
|
||||
rng.setStartAfter(brElm);
|
||||
rng.setEndAfter(brElm);
|
||||
|
@ -17949,6 +18812,12 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
|
|||
brElm.parentNode.insertBefore(dom.doc.createTextNode('\r'), brElm);
|
||||
}
|
||||
|
||||
// Insert temp marker and scroll to that
|
||||
marker = dom.create('span', {}, ' ');
|
||||
brElm.parentNode.insertBefore(marker, brElm);
|
||||
selection.scrollIntoView(marker);
|
||||
dom.remove(marker);
|
||||
|
||||
if (!extraBr) {
|
||||
rng.setStartAfter(brElm);
|
||||
rng.setEndAfter(brElm);
|
||||
|
@ -17988,6 +18857,22 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
|
|||
return parent !== root ? editableRoot : root;
|
||||
};
|
||||
|
||||
// Adds a BR at the end of blocks that only contains an IMG or INPUT since these might be floated and then they won't expand the block
|
||||
function addBrToBlockIfNeeded(block) {
|
||||
var lastChild;
|
||||
|
||||
// IE will render the blocks correctly other browsers needs a BR
|
||||
if (!tinymce.isIE) {
|
||||
block.normalize(); // Remove empty text nodes that got left behind by the extract
|
||||
|
||||
// Check if the block is empty or contains a floated last child
|
||||
lastChild = block.lastChild;
|
||||
if (!lastChild || (/^(left|right)$/gi.test(dom.getStyle(lastChild, 'float', true)))) {
|
||||
dom.add(block, 'br');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Delete any selected contents
|
||||
if (!rng.collapsed) {
|
||||
editor.execCommand('Delete');
|
||||
|
@ -18002,15 +18887,20 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
|
|||
// Setup range items and newBlockName
|
||||
container = rng.startContainer;
|
||||
offset = rng.startOffset;
|
||||
newBlockName = settings.forced_root_block;
|
||||
newBlockName = (settings.force_p_newlines ? 'p' : '') || settings.forced_root_block;
|
||||
newBlockName = newBlockName ? newBlockName.toUpperCase() : '';
|
||||
documentMode = dom.doc.documentMode;
|
||||
shiftKey = evt.shiftKey;
|
||||
|
||||
// Resolve node index
|
||||
if (container.nodeType == 1 && container.hasChildNodes()) {
|
||||
isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
|
||||
container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
|
||||
offset = 0;
|
||||
if (isAfterLastNodeInContainer && container.nodeType == 3) {
|
||||
offset = container.nodeValue.length;
|
||||
} else {
|
||||
offset = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Get editable root node normaly the body element but sometimes a div or span
|
||||
|
@ -18025,7 +18915,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
|
|||
|
||||
// If editable root isn't block nor the root of the editor
|
||||
if (!dom.isBlock(editableRoot) && editableRoot != dom.getRoot()) {
|
||||
if (!newBlockName || evt.shiftKey) {
|
||||
if (!newBlockName || shiftKey) {
|
||||
insertBr();
|
||||
}
|
||||
|
||||
|
@ -18035,7 +18925,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
|
|||
// Wrap the current node and it's sibling in a default block if it's needed.
|
||||
// for example this <td>text|<b>text2</b></td> will become this <td><p>text|<b>text2</p></b></td>
|
||||
// This won't happen if root blocks are disabled or the shiftKey is pressed
|
||||
if ((newBlockName && !evt.shiftKey) || (!newBlockName && evt.shiftKey)) {
|
||||
if ((newBlockName && !shiftKey) || (!newBlockName && shiftKey)) {
|
||||
container = wrapSelfAndSiblingsInDefaultBlock(container, offset);
|
||||
}
|
||||
|
||||
|
@ -18047,26 +18937,40 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
|
|||
parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
|
||||
containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
|
||||
|
||||
// Handle enter inside an empty list item
|
||||
if (parentBlockName == 'LI' && dom.isEmpty(parentBlock)) {
|
||||
// Let the list plugin or browser handle nested lists for now
|
||||
if (/^(UL|OL|LI)$/.test(containerBlock.parentNode.nodeName)) {
|
||||
return false;
|
||||
// Enter inside block contained within a LI then split or insert before/after LI
|
||||
if (containerBlockName == 'LI' && !evt.ctrlKey) {
|
||||
parentBlock = containerBlock;
|
||||
parentBlockName = containerBlockName;
|
||||
}
|
||||
|
||||
// Handle enter in LI
|
||||
if (parentBlockName == 'LI') {
|
||||
if (!newBlockName && shiftKey) {
|
||||
insertBr();
|
||||
return;
|
||||
}
|
||||
|
||||
handleEmptyListItem();
|
||||
return;
|
||||
// Handle enter inside an empty list item
|
||||
if (dom.isEmpty(parentBlock)) {
|
||||
// Let the list plugin or browser handle nested lists for now
|
||||
if (/^(UL|OL|LI)$/.test(containerBlock.parentNode.nodeName)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
handleEmptyListItem();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Don't split PRE tags but insert a BR instead easier when writing code samples etc
|
||||
if (parentBlockName == 'PRE' && settings.br_in_pre !== false) {
|
||||
if (!evt.shiftKey) {
|
||||
if (!shiftKey) {
|
||||
insertBr();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// If no root block is configured then insert a BR by default or if the shiftKey is pressed
|
||||
if ((!newBlockName && !evt.shiftKey && parentBlockName != 'LI') || (newBlockName && evt.shiftKey)) {
|
||||
if ((!newBlockName && !shiftKey && parentBlockName != 'LI') || (newBlockName && shiftKey)) {
|
||||
insertBr();
|
||||
return;
|
||||
}
|
||||
|
@ -18091,9 +18995,12 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
|
|||
} else {
|
||||
dom.insertAfter(newBlock, parentBlock);
|
||||
}
|
||||
|
||||
moveToCaretPosition(newBlock);
|
||||
} else if (isCaretAtStartOrEndOfBlock(true)) {
|
||||
// Insert new block before
|
||||
newBlock = parentBlock.parentNode.insertBefore(createNewBlock(), parentBlock);
|
||||
renderBlockOnIE(newBlock);
|
||||
} else {
|
||||
// Extract after fragment and insert it after the current block
|
||||
tmpRng = rng.cloneRange();
|
||||
|
@ -18102,10 +19009,12 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
|
|||
trimLeadingLineBreaks(fragment);
|
||||
newBlock = fragment.firstChild;
|
||||
dom.insertAfter(fragment, parentBlock);
|
||||
trimInlineElementsOnLeftSideOfBlock(newBlock);
|
||||
addBrToBlockIfNeeded(parentBlock);
|
||||
moveToCaretPosition(newBlock);
|
||||
}
|
||||
|
||||
dom.setAttrib(newBlock, 'id', ''); // Remove ID since it needs to be document unique
|
||||
moveToCaretPosition(newBlock);
|
||||
undoManager.add();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue