Index: openacs-4/packages/richtext-tinymce/richtext-tinymce.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/richtext-tinymce.info,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/richtext-tinymce.info 3 Jan 2016 20:38:56 -0000 1.1.2.1 @@ -0,0 +1,50 @@ + + + + + Richtext TinyMCE + Richtext TinyMCE + f + t + f + f + + + Gustaf Neumann + Richtext editor plugin for integrating TinyMCE with acs-templating + 0 + + + + + + + + + + + + Index: openacs-4/packages/richtext-tinymce/tcl/richtext-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/tcl/richtext-init.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/tcl/richtext-init.tcl 3 Jan 2016 20:38:57 -0000 1.1.2.1 @@ -0,0 +1 @@ +template::util::richtext::register_editor tinymce Index: openacs-4/packages/richtext-tinymce/tcl/richtext-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/tcl/richtext-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/tcl/richtext-procs.tcl 3 Jan 2016 20:38:57 -0000 1.1.2.1 @@ -0,0 +1,199 @@ +ad_library { + + Integration of TinyMCE with the richtext widget of acs-templating. + + This script defines the following two procs: + + ::richtext-tinymce::initialize_widget + ::richtext-tinymce::render_widgets + + @author Gustaf Neumann + @creation-date 1 Jan 2016 + @cvs-id $Id: richtext-procs.tcl,v 1.1.2.1 2016/01/03 20:38:57 gustafn Exp $ +} + +namespace eval ::richtext-tinymce { + + ad_proc initialize_widget { + -form_id + -text_id + {-options {}} + } { + + Initialize an TinyMCE richtext editor widget. + This proc defines finally the global variable + + ::acs_blank_master(tinymce.config) + + } { + ns_log debug "Initialize TinyMCE instance with <$options>" + # + # Build specific javascript configurations from widget options + # and system parameters + # + + # + # Use the following default config + # + set tinymce_default_config { + {mode "exact" } + {relative_urls "false"} + {height "450px" } + {width "100%"} + {plugins "style,layer,table,save,iespell,preview,media,searchreplace,print,contextmenu,paste,fullscreen,noneditable,visualchars,xhtmlxtras" } + {browsers "msie,gecko,safari,opera" } + {apply_source_formatting "true" } + {paste_auto_cleanup_on_paste true} + {paste_convert_headers_to_strong true} + {fix_list_elements true} + {fix_table_elements true} + {theme "openacs"} + {theme_openacs_toolbar_location "top" } + {theme_openacs_toolbar_align "left" } + {theme_openacs_statusbar_location "bottom" } + {theme_openacs_resizing true} + {theme_openacs_disable "styleselect"} + {theme_openacs_buttons1_add_before "save,separator"} + {theme_openacs_buttons2_add "separator,preview,separator,forecolor,backcolor"} + {theme_openacs_buttons2_add_before "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator"} + {theme_openacs_buttons3_add_before "tablecontrols,separator"} + {theme_openacs_buttons3_add "iespell,media,separator,print,separator,fullscreen"} + {extended_valid_elements "img[id|class|style|title|lang|onmouseover|onmouseout|src|alt|name|width|height],hr[id|class|style|title],span[id|class|style|title|lang]"} + {element_format "html"} + } + + set config [parameter::get \ + -package_id [apm_package_id_from_key "richtext-tinymce"] \ + -parameter "TinyMCEDefaultConfig" \ + -default ""] + + set configLegacy [parameter::get \ + -package_id [apm_package_id_from_key "acs-templating"] \ + -parameter "TinyMCEDefaultConfig" \ + -default ""] + + set tinymce_configs_list $config + if {$configLegacy ne ""} { + if {$config eq ""} { + # + # We have no per-package config, but got a legacy + # config. + # + set tinymce_configs_list $configLegacy + ns_log notice "richtext-tinymce uses legacy parameters from acs-templating" + } else { + # + # Config for this package and legacy config in + # acs-templating is set, ignore config from + # acs-templating. + # + ns_log warning "richtext-tinymce ignores legacy parameters from acs-templating" + } + } + if {$tinymce_configs_list eq ""} { + set tinymce_configs_list $tinymce_default_config + } + + ns_log debug "tinymce: options $options" + + set pairslist [list] + foreach config_pair $tinymce_configs_list { + set config_key [lindex $config_pair 0] + if {[dict exists $options $config_key]} { + # override default values with individual + # widget specification + set config_value [dict get $options $config_key] + dict unset options $config_key + } else { + set config_value [lindex $config_pair 1] + } + ns_log debug "tinymce: key $config_key value $config_value" + if {$config_value eq "true" || $config_value eq "false"} { + lappend pairslist "${config_key}:${config_value}" + } else { + lappend pairslist "${config_key}:\"${config_value}\"" + } + } + + foreach name [dict keys $options] { + ns_log debug "tinymce: NAME $name" + # add any additional options not specified in the + # default config + lappend pairslist "${name}:\"[dict get $options $name]\"" + } + + lappend pairslist "elements : \"[join $::acs_blank_master__htmlareas ","]\"" + + set tinymce_configs_js [join $pairslist ","] + set ::acs_blank_master(tinymce.config) $tinymce_configs_js + + #ns_log notice "final ::acs_blank_master(tinymce.config):\n$tinymce_configs_js" + + return "" + } + + + ad_proc render_widgets {} { + + Render the TinyMCE rich-text widgets. This function is created + at a time when all rich-text widgets of this page are already + initialized. The function is controlled via the global variables + + ::acs_blank_master(tinymce) + ::acs_blank_master(tinymce.config) + ::acs_blank_master__htmlareas + + } { + # + # In case no editor instances are created, nothing has to be + # done. + # + if {![info exists ::acs_blank_master(tinymce)]} { + return + } + + # Antonio Pisano 2015-03-27: including big javascripts in head + # is discouraged by current best practices for web. We should + # consider moving every inclusion like this in the body. As + # consequences are non-trivial, just warn for now. + # + template::head::add_javascript \ + -src "/resources/richtext-tinymce/tinymce/jscripts/tiny_mce/tiny_mce_src.js" \ + -order tinymce0 + + # get the textareas where we apply tinymce + set tinymce_elements [list] + foreach htmlarea_id [lsort -unique $::acs_blank_master__htmlareas] { + lappend tinymce_elements $htmlarea_id + } + set tinymce_config $::acs_blank_master(tinymce.config) + + # + # Figure out the language to use: 1st is the user language, if + # not available then the system one, fallback to english which + # is provided by default + # + set tinymce_relpath "packages/richtext-tinymce/www/resources/tinymce/jscripts/tiny_mce" + set lang_list [list [lang::user::language] [lang::system::language]] + set tinymce_lang "en" + foreach elm $lang_list { + if { [file exists $::acs::rootdir/${tinymce_relpath}/langs/${elm}.js] } { + set tinymce_lang $elm + break + } + } + + # + # TODO : each element should have it's own init + # + template::add_script -script [subst { + tinyMCE.init(\{language: \"$tinymce_lang\", $tinymce_config\}); + }] -section body + } +} + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/changelog.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/changelog.txt,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/changelog.txt 3 Jan 2016 20:38:57 -0000 1.1.2.1 @@ -0,0 +1,1116 @@ +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 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) + 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 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
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 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 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 + 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 + 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. Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/custom_formats.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/custom_formats.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/custom_formats.html 3 Jan 2016 20:38:58 -0000 1.1.2.1 @@ -0,0 +1,111 @@ + + + +Custom formats example + + + + + + + + + +
+
+

Custom formats example

+ +

+ This example shows you how to override the default formats for bold, italic, underline, strikethough and alignment to use classes instead of inline styles. + There are more examples on how to use TinyMCE in the Wiki. +

+ + +
+ +
+ + + [Show] + [Hide] + [Bold] + [Get contents] + [Get selected HTML] + [Get selected text] + [Get selected element] + [Insert HTML] + [Replace selection] + +
+ + +
+
+ + + Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/full.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/full.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/full.html 3 Jan 2016 20:38:58 -0000 1.1.2.1 @@ -0,0 +1,101 @@ + + + +Full featured example + + + + + + + + + +
+
+

Full featured example

+ +

+ This page shows all available buttons and plugins that are included in the TinyMCE core package. + There are more examples on how to use TinyMCE in the Wiki. +

+ + +
+ +
+ + + [Show] + [Hide] + [Bold] + [Get contents] + [Get selected HTML] + [Get selected text] + [Get selected element] + [Insert HTML] + [Replace selection] + +
+ + +
+
+ + + + Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/index.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/index.html 3 Jan 2016 20:38:58 -0000 1.1.2.1 @@ -0,0 +1,10 @@ + + + + TinyMCE examples + + + + + + Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/menu.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/menu.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/menu.html 3 Jan 2016 20:38:58 -0000 1.1.2.1 @@ -0,0 +1,17 @@ + + + +Menu + + + +

Examples

+Full featured +Simple theme +Skin support +Word processor +Custom formats + + \ No newline at end of file Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/simple.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/simple.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/simple.html 3 Jan 2016 20:38:58 -0000 1.1.2.1 @@ -0,0 +1,47 @@ + + + +Simple theme example + + + + + + + + + +
+

Simple theme example

+ +

+ This page shows you the simple theme and it's core functionality you can extend it by changing the code use the advanced theme if you need to configure/add more buttons etc. + There are more examples on how to use TinyMCE in the Wiki. +

+ + + + +
+ + +
+ + + Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/skins.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/skins.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/skins.html 3 Jan 2016 20:38:58 -0000 1.1.2.1 @@ -0,0 +1,216 @@ + + + +Skin support example + + + + + + + + + +
+

Skin support example

+ +

+ This page displays the two skins that TinyMCE comes with. You can make your own by creating a CSS file in themes/advanced/skins//ui.css + There are more examples on how to use TinyMCE in the Wiki. +

+ + + + +
+ + + +
+ + + +
+ + + +
+ + +
+ + + Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/translate.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/translate.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/translate.html 3 Jan 2016 20:38:58 -0000 1.1.2.1 @@ -0,0 +1,84 @@ + + + +Full featured example + + + + + + + + + + +
+

Translation

+ +

This page enables you to translate TinyMCE by using XML files.

+

Steps to translate:

+
    +
  1. Download one of the language XML files from the TinyMCE site.
  2. +
  3. Place it in /jscripts/tiny_mce/langs directory, for example /jscripts/tiny_mce/langs/sv.xml.
  4. +
  5. Change the language init option in this file to match the XML file code. For example: sv
  6. +
  7. TinyMCE will now use the XML file instead of the .js versions.
  8. +
  9. Modify the XML file until everything is translated
  10. +
  11. Modify the author information, this is optional.
  12. +
  13. Upload the XML file to the TinyMCE site to share it with others.
  14. +
  15. You can now download the .js versions of the language pack from the TinyMCE site.
  16. +
+ + +
+ + + Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/word.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/word.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/word.html 3 Jan 2016 20:38:59 -0000 1.1.2.1 @@ -0,0 +1,71 @@ + + + +Word processor example + + + + + + + + + +
+

Word processor example

+ +

+ This page shows you how to configure TinyMCE to work more like common word processors. + There are more examples on how to use TinyMCE in the Wiki. +

+ + + + +
+ + +
+ + + Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/css/content.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/css/content.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/css/content.css 3 Jan 2016 20:38:59 -0000 1.1.2.1 @@ -0,0 +1,105 @@ +body { + background-color: #FFFFFF; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} + +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +.example1 { + font-weight: bold; + font-size: 14px +} + +.example2 { + font-weight: bold; + font-size: 12px; + color: #FF0000 +} + +.tablerow1 { + background-color: #BBBBBB; +} + +thead { + background-color: #FFBBBB; +} + +tfoot { + background-color: #BBBBFF; +} + +th { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; +} + +/* Basic formats */ + +.bold { + font-weight: bold; +} + +.italic { + font-style: italic; +} + +.underline { + text-decoration: underline; +} + +/* Global align classes */ + +.left { + text-align: inherit; +} + +.center { + text-align: center; +} + +.right { + text-align: right; +} + +.full { + text-align: justify +} + +/* Image and table specific aligns */ + +img.left, table.left { + float: left; + text-align: inherit; +} + +img.center, table.center { + margin-left: auto; + margin-right: auto; + text-align: inherit; +} + +img.center { + display: block; +} + +img.right, table.right { + float: right; + text-align: inherit; +} Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/css/word.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/css/word.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/css/word.css 3 Jan 2016 20:38:59 -0000 1.1.2.1 @@ -0,0 +1,53 @@ +body { + background-color: #FFFFFF; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} + +p {margin:0; padding:0;} + +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +.example1 { + font-weight: bold; + font-size: 14px +} + +.example2 { + font-weight: bold; + font-size: 12px; + color: #FF0000 +} + +.tablerow1 { + background-color: #BBBBBB; +} + +thead { + background-color: #FFBBBB; +} + +tfoot { + background-color: #BBBBFF; +} + +th { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; +} Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/lists/image_list.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/lists/image_list.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/lists/image_list.js 3 Jan 2016 20:38:59 -0000 1.1.2.1 @@ -0,0 +1,9 @@ +// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system. +// There images will be displayed as a dropdown in all image dialogs if the "external_link_image_url" +// option is defined in TinyMCE init. + +var tinyMCEImageList = new Array( + // Name, URL + ["Logo 1", "media/logo.jpg"], + ["Logo 2 Over", "media/logo_over.jpg"] +); Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/lists/link_list.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/lists/link_list.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/lists/link_list.js 3 Jan 2016 20:38:59 -0000 1.1.2.1 @@ -0,0 +1,10 @@ +// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system. +// There links will be displayed as a dropdown in all link dialogs if the "external_link_list_url" +// option is defined in TinyMCE init. + +var tinyMCELinkList = new Array( + // Name, URL + ["Moxiecode", "http://www.moxiecode.com"], + ["Freshmeat", "http://www.freshmeat.com"], + ["Sourceforge", "http://www.sourceforge.com"] +); Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/lists/media_list.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/lists/media_list.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/lists/media_list.js 3 Jan 2016 20:38:59 -0000 1.1.2.1 @@ -0,0 +1,10 @@ +// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system. +// There flash movies will be displayed as a dropdown in all media dialog if the "media_external_list_url" +// option is defined in TinyMCE init. + +var tinyMCEMediaList = [ + // Name, URL + ["Some Flash", "media/sample.swf"], + ["Some Quicktime", "media/sample.mov"], + ["Some AVI", "media/sample.avi"] +]; \ No newline at end of file Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/lists/template_list.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/lists/template_list.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/lists/template_list.js 3 Jan 2016 20:38:59 -0000 1.1.2.1 @@ -0,0 +1,9 @@ +// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system. +// There templates will be displayed as a dropdown in all media dialog if the "template_external_list_url" +// option is defined in TinyMCE init. + +var tinyMCETemplateList = [ + // Name, URL, Description + ["Simple snippet", "templates/snippet1.htm", "Simple HTML snippet."], + ["Layout", "templates/layout1.htm", "HTML Layout."] +]; \ No newline at end of file Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/media/logo.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/media/logo.jpg,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/media/logo_over.jpg =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/media/logo_over.jpg,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/media/sample.avi =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/media/sample.avi,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/media/sample.dcr =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/media/sample.dcr,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/media/sample.dcr 3 Jan 2016 20:39:00 -0000 1.1.2.1 @@ -0,0 +1,45 @@ +XFIRnMDGFrevF +��:8.5#321rdcF�?x�cf`y9sM�7�y���J�.� �������ع�����󂋔����&&�禦d&*Te�d&)$���g���9y%��% +e: +�y�z: +��y +nE�yə���: +Ύ HF���&�oVp���K*L{~�BDIQ�BP�v����+}���r�\��P7���҂���TyM�sj�PMBA�N�zx�c�fb��ԉA!�Ǔ������-- Z���,`��9CI��3����Q��Á,� ���0��e:s�9��'�3�&�����!! n�A.��Xv�2�F��ŭ�|��}������`0'"���-�:5Ў�d�/)k����� sݏd����4 F�0��t�\kl����eYēvןh�*���)��\�P�U�Yڌ d��IX(� +����t��o�z���|����q� ��]�Rk4y"��Z�'�j7��������m�Lj”�B0o`̯=��z"g��@Qk��>��^�߭��G�q�/���'�>^yLE��~��E^!��!�������P��?��mU���N&�92�1s��H� 1��z߹�^J����B�����>�c�&��^9��X����큈�2�o��f�Q��6НU�,N�<��2��#~���i�(�t +� 9�dY �Ty[Q&���"`�@.�������H5/t��ro��1n���N�*��`%!wq�Q"ـ�jL3��$a�Z� ��A.�� �=�cF�U��>����]��L0�ɤ#h2`.L7���CE��/޽X��w�m�K�e�/a��2 +dt�ff�~��pE-��Ӊ�C� +\T�k=���F%� ���i�&������xݕ�F��>�?;f}Y�����t]�ty�$vM��o�'�~jʵ Q����gRFVOs1��qX��+z��C��f�3���9��$4�}�$��髦]F�Im h:��b�a�{<�md��|���@G�N�!�;n*�b|͘�|U�^LZ�E8_�� _-E��*3[�lHS�MG9�����l~H���O��5{`���vA/���1�`�7x���v���d,�a.゚���.-m�B�?�@dT�@�x +/E�,���Ls��n?����r�E�(!@0Q`�(�����AȘ�m��6=��0sB&�CDO��\���L�i4���.0�`�%�b}h��' �����ٲ��������1����Gl(P#��8d t�p�̻I ,{�')��2��B+D��5!g`����&�W�&hjƕ%�L�P��`�&���,�� ಋ������R��q2���xFyP߉��/Q ��k��)�{y]�VZX�0%I������W +�����E"�W����˝�;ے���-�9e�� +��,G���w�����������������TH�����*�6�A����&f� +��9�K�b�Øq�N_D�ɍu�P�8g%`�D�[`1�� � �n���� &�G�n@�'�& �.GME(�C�e0$:�\� ��{hi-c�eW����1�\���2��h�a�Y�/.�`��w�Ϳ� ��VS �r�;��՞��� +e�����G���J�O��: �&���SH g��?j���)�@��V#�J$'i�geHy��@P�z��1JB���#z��r����`�`Wv���KK��ZIj�0� +D�E����_�,�w.�[�c��3Ȩ1t㕩�!��FM�IOq�i�S-hi2 .Uƒ��s�Aa2�.�:ʝP5J*KQ�X����`h, 1��,#1Dh%1S'N�˜p������ ,����XI���+���=+�tޘ��� ElG�1N;w��Cnteӷ'1��=�{����e&{�]��z��O�-���-Խ+%v���7l.M!E]��C��cU�w:zӎ��Y��Q��� Kpf�޻��D�l� +3�Ck3 #�J��[!��s� +ȀD��2� �iM�+#G��@�x`n�c�1bC +#1/�=)j +9��M�X��Y ���R,�Rdޙ0ձ��MUݳ�UlJ����F�nU��l)�8ʧ���ז�W֒��Z���a��L-:�rR +;t��Q_�}�uKGJ��彧5^����OZ�[���%F<����a�i�(Zz �5�Ozz��4e�i��b"Ha�S1j���� +��b������ +ƲU�,���� +3��b +�O5�u�ː� �~# ����c+�2T���]�sVWU�H�l��V��c<��vhi_dBZ��!$g�̸F �-U��c�3��n��0�Z�5� +zz�_Jʝ�V��\$��s��"�S��b,F$Vgo#��$�H;4<���H�x�MA� ���(�}, eYqN���M��0͜�{� �� �.�H�c.��3���U4n%�N�SP�E���$�)�iM�[^1E+�M���Sc +V����x,*RDޗ��r†D(ʢ@tf��r!����isd�s�>�g>J���%Vֱ��-�ly%��Y�xM{^ +��تq���ә���x,����G#?�j/C[E���Hs06`�s���>�#��`�ϴ����u�U +ɟ�]�ʌ��UV���gO;C����LV5*�SJ���lǙu��'�|5�w��jZ���U�t��ՙ��� ��ċ,�>,�tQ+�Hy��G�n[�f�li���u�h�N���,���w;5l�J���0ywZ@��ΊB�i��q�X�B^>'d�p�z*i� 9� �mw�2��4�%y��`���L��i BR͖"�}š�/d�M�� xiׇ9��@Ɍa��x�21�nʁ(/�yr��<� i� m��bk�9��QE�`�8��{�S�Hu +�_Ϩ��`Z����SEʖ�,��F���M� + ���:D~�F;L�vF3�R��r��&�#�_�)��2�OP����>A����6@���)^�+�&4;֪Y$�O5����j0l)�;xS�}�I@���1oj�Q߸?�B�cT�Q� +%�Ź �H���a0|�!˝���[��h�:PTtSe�,�:�H][�໠o���`���=��]Q�Y�m���.U�A�l�g/�ӳ}T�P��^F�6�e#t���C�v�!��|O�qL:C�n�<��"�P4c!���9e#�.i[��O�^��E-sP ������cu�N@�+�RJ��>$���4�P +�Ŵ�=c���yR�"q��6"RN��f%�E�y*�������Q��Nt`X��y�o$�P�k�uB!s�/c�~��W�%���]�:E�b[rT7�`Z]BLe����t��}�,�-��8����2O��' ��uP8�Qm3S�B��������2�M� ʮ<���XP������C3�W��O^v��sgz���N�Z�%3���ϋ�z�O�&��K��a����j�8�G����Ed5kI#�[�x<���Pݲ��?��G�$��K�@��Pv�#\ƹQ8��H��(� Q :Y�o�s_�xt��@Z�%��Su�{\��b��#��X�N*$�Jq��f)��!� �2�P#��)���g��Qr�4_UCH��_�BS����K��<��"�P^9����eE +#��!�� +?��O�Կϻ|u�u�'w��PXW��s���I�t��� �>�1��H��i���o��O��a��Q����l���] +͹���I\TNu�ޓ�h�����J��~�FXH���"�ҀLfc�lwf�ӾJ�XdNk!���|[��=XT(�1D�l��Iב����x�/��(��PA��w>�iT�O����F9Ǥg#�⭲mfX�QΦ���gFSg˽Υ2�UCI�Ǔ�9J}6�z rx� +�N$�TR`�����T�f�@Q���Ϳ�G�Ϊ,ԣ,��@�@�����1�c�1�c�1JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��)JR��@�@��S��=??���PF]-������������?��vA���p��Jc�p��Jc�p���>RZ��<��Le|q�q�t��X���0\A�v�,��Ӡ�:e 7#�pU��T*��P?�������p�������6#��@���K�o���>�> �'��)��ҟ��)���@L@�*�_��*?��)������{/���o��y�y�� я�b�� Ã�������Kě����������;����'N�AXAN������ڣ9�M�Y�Y!���`R��P�5 +CR���D�)���JG���2�ɿ�҉JUG���e*a0�L&����8����@�0.?@�,�� +`n�r�BtJ"�B��:Փ}�q�qR���")�D�J�L���PSqf2�������?�����k� ���i;�E�v ���c.����y�H*�� _E1�E�7�1b>R���C���#d�G@�9�G�4 +[ܘ&W:d�dDDDI�A0�L& ��Pq��D�n6��#�l�؏`L ��D�N=U@��-l��i�f�& ��a1�6���$~9*���Jc������JiU���)�?��@�AO�}����ң���?�ҚS���?҉D�Q(�J<�Kwv� +��Q�Q�Q(�xDI$��`�wp������?�����|gOi����8���z?LeX�D�E�� C� � +*��?�������p����)���a0�y�d�L& ��a1���X�����������`�C&@����cǭJ>W�� \��� +��b�=�H����Q)�F.8�b���E�� /�%���W�0|}֮�qi��i��V]w����Jc����ѕJ��F��)ē�A�!&9�O�ب��nFe 5�)c��5�F9�2����岂e�ek8�� +�[&5mF$hC�I��Һ�Y�#O�E +���D�`�0�L&�ECȈ���( ��i �3F)����0H�����~ ?�M�"2�$��,I{���HN��G�nLz���� @ �ň�m�%�����Ȧ �J%[̿C��TR�A�s��z�����d�Ʉ#A�RD��m��E*ڮF+� ��DJ�4�i��Z!�c8�� ["%�X� �%�C*�J%�nW �a0�BP:��NFڱ������w�����AJR���AJR����J�GU]�7�1�!U����-$��*2+A�Z,��c� �r$5� +6$��j�Q¾���>�Y�?R�����(����(֋�(2��7)5�PL&L� a�fp' +��4��k��Q�fM � +?�r�PE"#)/��@�3#7B:0(:7�-�H5��C&@������P�dm���W�Z���L�X��`� ����LE �L&�QĈ�� ��kx�%��[��ZE"���z�4��� +`}G��>=�i��Lb@�� +;�)ɚ��Fa��X踆��`cc�Dc�<���1��&q��a0����pJ�$�D!&}�n}Xƫ+T�����s��Ɵ�J%<� +`�`AhDY]֨��(�����������ACA��Ѐ�����.�������(�y�wo�@�P( �ə(N�@��D�Q(�J��a0�L1P��Ѹ��"�`q�:�#l��Fƭn�¢DP�bI�$D$�T�a0�J%�@��T�D�U�L +L� +�K`�D�$ ��y���})�88~�ج���c��H&s��������a0�LP�ppT"A��],� Ārq*)��a0�� ��`*�P� ��a �P� +U`�h@�o�B2v ��"�R�I�˙L& ���Om7.�`�֦���`���t�����(�x;���Q(�q���&L�h�Bm@�M�����N����V�ծ˭�G��� L�B�%c)��bD �p�X�`��$��BIM.s��UW>�2�L&9��������� ���E0�u���`F(FO�8�4 ȍl��P��N��R҃AQ�P������1�G@\�#��L&/�L%�ĩ� �� ��+��%�7� �` �D8�i4�a0��c���I�*ڋ(��(��U�`�?�����~���&32�҉D�i?���&8�-c�9ڶ +��%������b�*�"�E� �H PJ��n�8�k A�� @��A.ˣVQe��M��F$2x�lF�ܗ|���L.C���Ńt��z�Х,��R�Gҫ2I�R�0)A��n�$�(��0@�K)��a0�o.DV���a�wK�`j���T�I$`%��� 8H�S� �����-�ש��a0��� t�A*�2 ���v�.�],�Yt�����6ti�u�*� P�� �M:�O� +-��v�L��@F�i + �`�� ���2 �έk�mB�(F���Pn&I��I0��y +���kO��0H��Bm@�M�q���x��^�L|� aT + L}�@�B��$�r��Ԧ�J<�Q)Ү!0�L& +P� +�Tb#&S&8DK�0Ow�d^J���Q(�J�L&!� �&��R�J%4Ƙ{��p���>� +��L^�+��E����<�LoEpt;�a�OH�h�Y0�� �Y� :������L@d�9�30�;�%W�t���Uj�A�DZ���k�k�P(�}/�53M +GrB& ���Q����pu)���kBB�@ �����1�l�pW�K+\����ݹ�p?`ǺO� +1�c�)JR�R�.� s "�=gΦ�*��)JR��*���̂�:]#0 Z�)�j�opKp�dr\T)JQ���� +�����^��XhP�3΂44���5,{ڶ�`ِX���zt�/�b" @ +k ]��W��7+Ō���R��~ �)_�;�����AUxR��.����!�L�X� D����p�'O_G`3ф�j0�$ +���BE���&��4�;&T0�U}E�� �Z���� �����*�`��q�R�2���"nw==�� ��2����L�(��A��j7T�����ZE"�H?�M,/�(����)AO������D�FR��ZSCs�tN�t(�c�tDK�%� c�+l�dr\� ��$�#?B��� +pXE�EbĐEq+*Eb�:g��L#K�-��nDP3^�s Q"G������� �"Y bSp�%������P +���j&1�V�S��B�B�@g ��7�k��L�wuU�l8�6���JĖA����Ԑ`w��;��1��#����1��� +���+������H0kP�Tq�b�)JR�JR�@_t��p����ACC +w�y�y�y�y�y�ra0�L4 P$�V#$1 %�.�bd���'ff�8� (�! W(5��5YE�J��>����E �BZD��LJE�'=�}+B�;T10�p`�C�)��;W�'6�8�����a���������4�|pY��"H)V�\�2�F/��0���r�L5̜an� +����B�� 2L պ1�.M�� �GQ-�2��`� +d)��i�#�t1\Y�`���82��;#�0�) +���3~��#��`��A��;%#'��E�&M��Q#fpj��C��J��vpz��� +a1���(P�=��E���-�(�Q����� � +Ƒ�<�T���!�]FG���� c�C�r��1��!�2��L&����"#�mbr`J�A0�Y��B�@Y ����H��L}$ۛcK.�Q〖�y*�1#�:.+ �`$x��ũ�2�і)��&GK ��f~�� � �1\��tR�a0�< ""��@�C� ʀ +0�pppre;���x*#:\���O��{J�sj��{��xiO� ��n������y+<�&J���D�Q(���z��pppJ�� ��Hԥ6^{J���[��R��O�����XL=��� +�5#�0bv���lϳg���N�e�L�>\�Rc$����D�$�� ���\*F� +X^��3o�J<�H<�S��(� +���py^{������@��H<�����A�D� +�G��&`� ������b�Z�L�}+�J%�J%�D�҉D�Q)��Q(�J&z��z���(�J%?J%�D�ׄD^? )r*e&�X��[������g5��e}%�e +݌i9�-1)`�F������&b#�s8���Q,��D`��Xf��yE���@ ��;\�@��� +WNI �Z_?�Y +i����#�E��"4)S H���uF�l, �''�V���t�q�� �lD�i��b'�8�]��'(n�绰+�.遁��qu�2L�&�B[_y�{Q]��A4�?�\�#cX�ڄ�& +��u�DS ����ټb�Ļ�� +2#!P�"b¤�á��G�>v ��� Vuu'��+��H�2)���)�\@�v^'N�Li +S��D�a1����P�@�TiD�a0�L&>��T�a=���I���Q)���@�D�rc�@9��RL&>�rS�P89����LJ�^JzQ�*��O�D�� ����Ʉ��/�H�R;������S.���ky����|88aP�R1[��=�<�oOq+��ÿ�*���[F;E�H�d���ʅ�����`8<���ޘxi��0KI5!�ʀ@���;�r`bˈ�c� �� ��a��J&g�:�%4�Q(�J=�����҉@��Hj6�FC@›@���(�L&�.�#�:���J%�DǏȑ"FuDecɅ3S��c��_�MHHK�����2� �¤�-�c8�#��7?J%�D·$�23ug��`� ��H*i<�q� ��DhF% \��F��$5�xC��Ϛ#J���J%�܎,L&�����\�}�?��[:#�AbC�Q�jt7��g/���'���#F +���ȭ{OT��z�n d�1$�n&���1$SY�fN0���?pA�.g�_Ձ����2&Nd>�a{�^Ë�+dر4�ghT�v�3w�v�,���Y[A|Ѧ=3�3�dpp�^�nlM;֕�7&�ଡ଼���3(���"d���S�#�ł^�;.��RG�1r��y ��q����>*_GtҾ� B2�V���.R.�y��]��l�)�ϋ��>��.�G�8RPu����A����>��'����w_�p2�ŀÿw鲞A�eNq�ۺ ��x~,�Nk�����nQ)ZLX �����t�Q?��'�\?��6�������<;��(�X�(7��:Z"mB�I��pb����}󏊗�M�S���F����t���.~�nB����R6�FCBW›A� +������!���O�͸���(R��0�n>:��>>�~�0�?Q.v�"���YZa0�fg��U�N��p �����1��d���z{}���!��⯧A�� +#�����/ +:����^~{&�� m-�xj���\sZ�D���F�듵?A���9kł�.<`K,�V���?� _��� �T Q����+j��6��� +���>%'_ oe����s�i�,r#�Y�I���MG�R�� +�=����������™�Ϩ��vc���s��^Ë��dؿ���FO�4�A�L����_��������c?)��O�h�O��yy�����p���pn���dF'�ϧ�S�3�>̃@��2D�� �w%����C Pb,E�9��HK�~���7K!M��u��w���و��x���\;�'�k�q�h���C����B�B� -�����F&�,5+A��ۭ�̷GO��ei����Ƹ�a/p�Yl��y9Be租���U��|�)���X��g��G�h�H���������5���Ѵ�uUu\Z�AM:L���6��FCA�›a��#���/��>��S���X��;�|~v��\:\SH&��>�������p���*.� ���\�q����ݼy�ռd����/�=����l�?%���6���{v������0�����H*P��+�c!����n��x���Oί�����S��⛰6\e���9+sn��$w��}��;���/w���S�X��W|���,�_��� :��������/���3,_����n5x@�8��z�6/��S ��&شp�SP�AG�˙�l�~�T�� D�1���k�D!@���x�1�a�ݹ��q��u8�1�c�)JR�SJR��)JR��u7YW � Ye3 +jR��)JR��*q��:[�<^a�W\��=)JR��)JWW#��̫�R�HA'7t:����p��NN."�e�.���Q@���q������R���1�Jwbd����⎎/�"C��OΤ'v�9�ī��*�iN0>�q�1Ѭ�������e.1��1�T)���$�mѤM��2�4+w�܊��@�����X$"�hJXfZU��diXЪ�)(IB�G�Op���+�mW�TE���w�޹r{ ��?�� K,��jU�i� s�@\}B쭗?;�N"P��?�DJ���k>�)�V�8��Ȫ�J� +nL�VLV�yvDPϹ�C�2" +R� +pnbqZ��%�f���z�1��nW�eq�7�N��g�b�`Lb��۬� ���J�l��K>��-+�� +ruۼ@�|o=YGbj���E�`�k �y"���G� X��7\�'�jc�7�S�Xsm*y���1FXU�VKb��J������5�t���'��.�����?>�p���M��z���d������p�W�K��D!A������g_����b1�"0a���^{��u;�+�J�5stS�-�YO�QO�FS�_��ڞi7�����xZU�2k�������L�Bѣ�~�վmؿ�v�u}���T` jV��w�Tgx��;���5�#_Q�N}�GG����ůBd�P�Q�オ|��W�r��:<�(��&�'R�8�b����&܎X��ǒ�V�Л�{'���(8�Z��s���2ysO%4�}(�_[�^n���� +D�� ��p ��b�h7#����/�]t>a��A�� +��fO��S��#v?��vTQ���$_����$�{v<����4N�K#��]�x��yG �W��)z,E�����+�mOf��CO;f��LZ�z��Xi����V�쇞E=�&�ı�c��1�c�KR���˜�1�b��)JR��)Q�1�b��)JR��)JR���@iE�bĀ�� ��a0�J& ���(�J%�D�Q)úS��D�Q)Ji�c�:Q(�J%�����?���������L& ��a1��D�Q(�J%��c��JiD�Q)J%?L&k0Ca@���tS"�N�����/x�y�E3VM�^�C�Ը����Sr�����`{��N�ky�!��q a���뢴'�Z������*���z�AJS�N�dS ��a0�12�4���� �ԎĖ�G�Rߟ�4I�5YadbzR++� X��Ilh��j +�)��K%\A��c�� 9��*��ެh��w�hTC�7(��H�L& D�a0})i6l�6I�d��E�$�M���+F'�\���\�nf��5�5�b�a�7}r݌��?� 8��Y�&T��]�6lٲl�)��W����"�l������ Gn�*�"#�Bs��Ɋ�c?)dG >� ��{��6l�6l�l� ���sr�L� ���o���]7GM�# [cd� �L�4��H�ذĝ.1��Ȱ4��g������'� ��W&X�Gb Z�Z �+ ��qm������5��҄v���JBC��T֙@�Ńr����`1�i�m�����]B?���#��:.�ۦRN��K�$������� PL&L�}g�7h�`Dc%���SȷN��Id~�`���A����;3��8��n/��0�����0�CaA ����>���L&͛$�6M�&�f͒l�6l�6L�^�d�$ٳf�� 6I*Y3�S ���$��L&tG9O��b��G�d���a~��)b�&�9N5O�)��F;�ԭ�|���ВI$�V�2M�$����ٳd��"nDFq�{k�̵@���I� +'�Y�l����$ٳd�؝� +�@�4$AWl��LCS��f�,�&�JuȧPS ��E0�L& ��҉D�� ��a0�H&)D�Q(�J%�D�TS ��a0�L&)D�Q(�J%�D�Q(�J%�ĢQ ��A�F��A��D����e��~� ��a0�L}(�L%cy��L%�D�Q(�J%$D"�*�QL%�D�Q(�J%)O����D�Q(�J%�B*0���Z|$��<#� w������İ0&�����6H' ��Q(�>�?I$�|�$��TI$�}�I$pC���}�I$�J@��"I$�a'L��N��I)�a0���a106��6�R3�'*�N���z��s��DLJNSW����RL��$�4��1]Il�ƀc-�%��4B���R� +?�� +(���sF����伄L&4�"ҨDc<�6������W�*7��I�����ҫ(��P�(#� wx-�Z&���D����,/ cn;�%:�0�LB�I�S ��W���a$�I��I'Τ�H�:Fu�%)��@��Q�K�`h:X##hS_���R*��$��$� ��DR�D�Q0�L&X�)�a0�L& D�Q(�J%�M(�L& ��a0�J%�D�Q(�҉D�Q(�J%�<�w G�� $@��",���I!�C� +c"��w G��!���䀀w G��" `/t�!p��O�; ��w�H�]��t G�]5HL��~�pd#P!���B�-8��&Q�w G��C�� $.�w G��!#Bp�!耆w G�� # +@C~H�!w G��#���@��i�Q8ydOB��e�O+�w G����2�!w G�� ]t��!n��!�EՌ�F��`*Q����w G����C�<�w G��1��!��w G�� C�#(���R�O N�<Ʊ� +�d�!UZw G���� ���w G��B�� �n�EE3��\/�lU�=p��Nü��Q��"�C^�[G������A�>w G��2�K� ���w G����"C� ��w G��^ĐB��� `��wE�V�j>@���EՌ���d��b w G��%�h�!ʀw G�� t!Cl�!av�Pn�jT>�aFccr;�<�w G�� ��!��w G��C�#���/=���OP��9�h� 2�EՌ�8E�ab�̧�dO�(����� ��~w G��1@x�!w G��Dt"_���.=a��P�A"�B�י �|*]�w G���ԁ"~H�w G��2_ +�C2Dw G���C�">���w G��z�z 9�Q��ʙ�]?ǡiP�w G��2E +��:������ǭ��tZ��,�w G��B�!~@�<��EՌؕ ��A����ww G��� �ZH�t G���7�!� �w G�����w G��Аz��!�c�QW� �¶�I[#�;s�[$G��?���ciP���w G��  +�!!4�w G����B�-)�Q��F�B�nrŢ�qrODT�Ov �G�'a� ;��w G��CFh����!w G��BP�!f��EՌ�͕��`b7��w G��!�� ���Pp �Z���5D!�і<�w G��A�\zw G����!0�w G��$��!�Oy!w G��]J\!�D !�`D�P� +^�K�m!���#�sP~�B�ţy���jw G�� C@�"!6�.*���{�#h��N�}x7�Eu����_f �1ك�O�v;�ƲK8%�:�w G���� �@h��!n�D��DMt!�!w G��!���B>ć!G��@D�ݽs"Ř�Eu��' +P�"�T�Ew G�� \ +T!r��!<��EՌ� "�������@�P�crJ]�0�#܋f�w G��0!B�@�"w G���H� %�w G���A�Bx�w G��!C@4�~L!�`4OQYIgÏMl:#���w G��B��܀'���P��^G���G>c-�y%�{�/, {L��L�8����yp�e=�4�)P�0�B%m {΅�4L�h�& ,8츸���غ��T2���t�Zx��X|�*(A�`uw"�R����0*4BE<�e��O�" ����{ ��D�B�����V�C>a-� +�Q�c��a�T*�A\Ju:��H���H�W�Oss5��/r�*I��i���T�p2`ֆc��8C(��ӸEm�O���tۚ��LVc��*8ƥg���ef6�$th����09cu~��n���� I�H�i�f�q �P��>��T������c�؃ʎ1JR�q��q �YJt�:�a�=��bF0Ta q�L�Ħ2bL��̯[n���(�����BGU��b��H`Ah8�� ���*�B�@Q���P����G�� +�V� +�X+����ݎ=�%䓜Ɛ�#m�όc�1�c�)�b��)JR��)JR��)JR��)JR��)JQ�@�G�����Ӊ��a0���s����Jy�>3 ?�zq0�L& �Q5+9�n�M҉D�Q(�J&$1�:Rx2H҉D�Q(�JI!���z�t�v�����0�b�����aCW1�\Q%�Y$��I7��yIK������Q(�J%R��� KDm�4I�'XcI ҉C���L& D�Q)<��q��H�#�%�D�8�J& ��a0�H&?҉D�Q(�J%�D�Q �L}(�J%�D�Q(�J%�D���@`H�de������xpӉ��a0��e��� �����g�'�/� �����������@�I��������=A^Yz���q3�5�����4q�����Ǻ�d��%%=G�И͂��* +K��@a0��z{�6?��_%�� y�$c��4p�<`�9��p�C��Z'�$�TY�{-U*���$�4���4�7#���ejw�.�͋&���<}�ǐÜ����'��������% +�AJ� ���:�3���43si�i�AN��P�R�T���D�C�Op��;ٙ�M�hHZi��{��c�p��i���ݚ �ݔ�fڦB +[�e�祲�]��� 1vν���B��g(��r���;��h(y�~Ằ�G�O;���y�̓�!�$�H�[6��L�oԊ�n��+��1�rxcH:B~3wsſ���E~'�yjCG3M�}� + ?<�����k;#!D ��v�yz9�����P"���ݘv��$��p� T���z��������C +��A�J��_���R(�2)��a0��i$�a0�L& ��b��o����4��X�v_�e Fu�3�=`�S��Q(�J%�D�Q)J�F'���*�`������Q(�J%�D�Q)N�i��`��l��j3<���f��|ѳT��+35�Yy�%�I~�}N��8������R��7�-eD�Y�|��'s��wS)D�Q)J$태�==ȹ�8�g��Vw��J%��Q-������ӽ�N�����c��n +~���M��N�Aԯ�d�;�@%�JQ(�f��9s�fFq���{fO �331�J2��x{j��e��KN�futΘ�[��Q)J%���35��,�3���a"Yb��hzM �3;3�`fi�Q)J%���a0�L& ��a0�J%��Q(�J%�D�Q(�J%�D�Q)J%�D�Q(�J%�D�Q(�J%��@�J��5����"�L& �������E0�L& ���a0�� ��J%�M(��Q(�ҟ}1��M(���Q(�҉D�a8�H& ��a0�L%�M(�J%�D�Q(�J%�D�Q(�҉D�Q(�J%�D�Q(�J%�AH e�A6Ke���H�D�a0�L& ��a0�L& ��`��Q"A0�L& � �L& ��a0�H%>4�`��rp���C� B�Ɛ?����D�`�&{��� �GE��uC#j �Ħ3�BJ��J%L�K&��n&n��$���:��J%)��**,T3ԑ�����2�ָ%����P�厳��D�u#1�'O�hդ(-�����~g���vys�iT���w���(��Mݵ��v +�e�_�X`=y� +���'���T>[:ѣ�&8�<��Q���:u��S<:��Ρ*.�@`�9���`� J%?���S��J%?��INDX0EV�3�INDXLE� yB_ �)@*:�!INDX \ No newline at end of file Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/media/sample.swf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/media/sample.swf,v diff -u -N -r1.1 -r1.1.2.1 Binary files differ Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/templates/layout1.htm =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/templates/layout1.htm,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/templates/layout1.htm 3 Jan 2016 20:39:01 -0000 1.1.2.1 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +
Column 1Column 2
Username: {$username}Staffid: {$staffid}
Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/templates/snippet1.htm =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/templates/snippet1.htm,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/examples/templates/snippet1.htm 3 Jan 2016 20:39:01 -0000 1.1.2.1 @@ -0,0 +1 @@ +This is just some code. Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/jscripts/tiny_mce/license.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/jscripts/tiny_mce/license.txt,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/jscripts/tiny_mce/license.txt 3 Jan 2016 20:39:01 -0000 1.1.2.1 @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/jscripts/tiny_mce/tiny_mce.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/jscripts/tiny_mce/tiny_mce.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/jscripts/tiny_mce/tiny_mce.js 3 Jan 2016 20:39:01 -0000 1.1.2.1 @@ -0,0 +1 @@ +(function(d){var a=/^\s*|\s*$/g,e,c="B".replace(/A(.)|B/,"$1")==="$1";var b={majorVersion:"3",minorVersion:"3.9.3",releaseDate:"2010-12-20",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=d.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);if(d.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e.hasOwnProperty&&e instanceof Array){for(c=0,a="[";c0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(m){var k=m.each,j=m.is,i=m.isWebKit,d=m.isIE,a=/^(H[1-6R]|P|DIV|ADDRESS|PRE|FORM|T(ABLE|BODY|HEAD|FOOT|H|R|D)|LI|OL|UL|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|MENU|ISINDEX|SAMP)$/,e=g("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),f=g("src,href,style,coords,shape"),c={"&":"&",'"':""","<":"<",">":">"},n=/[<>&\"]/g,b=/^([a-z0-9],?)+$/i,h=/<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)(\s*\/?)>/g,l=/(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;function g(q){var p={},o;q=q.split(",");for(o=q.length;o>=0;o--){p[q[o]]=1}return p}m.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(u,q){var p=this,o;p.doc=u;p.win=window;p.files={};p.cssFlicker=false;p.counter=0;p.stdMode=u.documentMode>=8;p.boxModel=!m.isIE||u.compatMode=="CSS1Compat"||p.stdMode;p.settings=q=m.extend({keep_values:false,hex_colors:1,process_html:1},q);if(m.isIE6){try{u.execCommand("BackgroundImageCache",false,true)}catch(r){p.cssFlicker=true}}if(q.valid_styles){p._styles={};k(q.valid_styles,function(t,s){p._styles[s]=m.explode(t)})}m.addUnload(p.destroy,p)},getRoot:function(){var o=this,p=o.settings;return(p&&o.get(p.root_element))||o.doc.body},getViewPort:function(p){var q,o;p=!p?this.win:p;q=p.document;o=this.boxModel?q.documentElement:q.body;return{x:p.pageXOffset||o.scrollLeft,y:p.pageYOffset||o.scrollTop,w:p.innerWidth||o.clientWidth,h:p.innerHeight||o.clientHeight}},getRect:function(s){var r,o=this,q;s=o.get(s);r=o.getPos(s);q=o.getSize(s);return{x:r.x,y:r.y,w:q.w,h:q.h}},getSize:function(r){var p=this,o,q;r=p.get(r);o=p.getStyle(r,"width");q=p.getStyle(r,"height");if(o.indexOf("px")===-1){o=0}if(q.indexOf("px")===-1){q=0}return{w:parseInt(o)||r.offsetWidth||r.clientWidth,h:parseInt(q)||r.offsetHeight||r.clientHeight}},getParent:function(q,p,o){return this.getParents(q,p,o,false)},getParents:function(z,v,s,y){var q=this,p,u=q.settings,x=[];z=q.get(z);y=y===undefined;if(u.strict_root){s=s||q.getRoot()}if(j(v,"string")){p=v;if(v==="*"){v=function(o){return o.nodeType==1}}else{v=function(o){return q.is(o,p)}}}while(z){if(z==s||!z.nodeType||z.nodeType===9){break}if(!v||v(z)){if(y){x.push(z)}else{return z}}z=z.parentNode}return y?x:null},get:function(o){var p;if(o&&this.doc&&typeof(o)=="string"){p=o;o=this.doc.getElementById(o);if(o&&o.id!==p){return this.doc.getElementsByName(p)[1]}}return o},getNext:function(p,o){return this._findSib(p,o,"nextSibling")},getPrev:function(p,o){return this._findSib(p,o,"previousSibling")},select:function(q,p){var o=this;return m.dom.Sizzle(q,o.get(p)||o.get(o.settings.root_element)||o.doc,[])},is:function(q,o){var p;if(q.length===undefined){if(o==="*"){return q.nodeType==1}if(b.test(o)){o=o.toLowerCase().split(/,/);q=q.nodeName.toLowerCase();for(p=o.length-1;p>=0;p--){if(o[p]==q){return true}}return false}}return m.dom.Sizzle.matches(o,q.nodeType?[q]:q).length>0},add:function(s,v,o,r,u){var q=this;return this.run(s,function(y){var x,t;x=j(v,"string")?q.doc.createElement(v):v;q.setAttribs(x,o);if(r){if(r.nodeType){x.appendChild(r)}else{q.setHTML(x,r)}}return !u?y.appendChild(x):x})},create:function(q,o,p){return this.add(this.doc.createElement(q),q,o,p,1)},createHTML:function(v,p,s){var u="",r=this,q;u+="<"+v;for(q in p){if(p.hasOwnProperty(q)){u+=" "+q+'="'+r.encode(p[q])+'"'}}if(typeof(s)!="undefined"){return u+">"+s+""}return u+" />"},remove:function(o,p){return this.run(o,function(r){var q,s;q=r.parentNode;if(!q){return null}if(p){while(s=r.firstChild){if(!m.isIE||s.nodeType!==3||s.nodeValue){q.insertBefore(s,r)}else{r.removeChild(s)}}}return q.removeChild(r)})},setStyle:function(r,o,p){var q=this;return q.run(r,function(v){var u,t;u=v.style;o=o.replace(/-(\D)/g,function(x,s){return s.toUpperCase()});if(q.pixelStyles.test(o)&&(m.is(p,"number")||/^[\-0-9\.]+$/.test(p))){p+="px"}switch(o){case"opacity":if(d){u.filter=p===""?"":"alpha(opacity="+(p*100)+")";if(!r.currentStyle||!r.currentStyle.hasLayout){u.display="inline-block"}}u[o]=u["-moz-opacity"]=u["-khtml-opacity"]=p||"";break;case"float":d?u.styleFloat=p:u.cssFloat=p;break;default:u[o]=p||""}if(q.settings.update_styles){q.setAttrib(v,"_mce_style")}})},getStyle:function(r,o,q){r=this.get(r);if(!r){return false}if(this.doc.defaultView&&q){o=o.replace(/[A-Z]/g,function(s){return"-"+s});try{return this.doc.defaultView.getComputedStyle(r,null).getPropertyValue(o)}catch(p){return null}}o=o.replace(/-(\D)/g,function(t,s){return s.toUpperCase()});if(o=="float"){o=d?"styleFloat":"cssFloat"}if(r.currentStyle&&q){return r.currentStyle[o]}return r.style[o]},setStyles:function(u,v){var q=this,r=q.settings,p;p=r.update_styles;r.update_styles=0;k(v,function(o,s){q.setStyle(u,s,o)});r.update_styles=p;if(r.update_styles){q.setAttrib(u,r.cssText)}},setAttrib:function(q,r,o){var p=this;if(!q||!r){return}if(p.settings.strict){r=r.toLowerCase()}return this.run(q,function(u){var t=p.settings;switch(r){case"style":if(!j(o,"string")){k(o,function(s,x){p.setStyle(u,x,s)});return}if(t.keep_values){if(o&&!p._isRes(o)){u.setAttribute("_mce_style",o,2)}else{u.removeAttribute("_mce_style",2)}}u.style.cssText=o;break;case"class":u.className=o||"";break;case"src":case"href":if(t.keep_values){if(t.url_converter){o=t.url_converter.call(t.url_converter_scope||p,o,r,u)}p.setAttrib(u,"_mce_"+r,o,2)}break;case"shape":u.setAttribute("_mce_style",o);break}if(j(o)&&o!==null&&o.length!==0){u.setAttribute(r,""+o,2)}else{u.removeAttribute(r,2)}})},setAttribs:function(q,r){var p=this;return this.run(q,function(o){k(r,function(s,t){p.setAttrib(o,t,s)})})},getAttrib:function(r,s,q){var o,p=this;r=p.get(r);if(!r||r.nodeType!==1){return false}if(!j(q)){q=""}if(/^(src|href|style|coords|shape)$/.test(s)){o=r.getAttribute("_mce_"+s);if(o){return o}}if(d&&p.props[s]){o=r[p.props[s]];o=o&&o.nodeValue?o.nodeValue:o}if(!o){o=r.getAttribute(s,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(s)){if(r[p.props[s]]===true&&o===""){return s}return o?s:""}if(r.nodeName==="FORM"&&r.getAttributeNode(s)){return r.getAttributeNode(s).nodeValue}if(s==="style"){o=o||r.style.cssText;if(o){o=p.serializeStyle(p.parseStyle(o),r.nodeName);if(p.settings.keep_values&&!p._isRes(o)){r.setAttribute("_mce_style",o)}}}if(i&&s==="class"&&o){o=o.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(d){switch(s){case"rowspan":case"colspan":if(o===1){o=""}break;case"size":if(o==="+0"||o===20||o===0){o=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(o===0){o=""}break;case"hspace":if(o===-1){o=""}break;case"maxlength":case"tabindex":if(o===32768||o===2147483647||o==="32768"){o=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(o===65535){return s}return q;case"shape":o=o.toLowerCase();break;default:if(s.indexOf("on")===0&&o){o=m._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+o)}}}return(o!==undefined&&o!==null&&o!=="")?""+o:q},getPos:function(A,s){var p=this,o=0,z=0,u,v=p.doc,q;A=p.get(A);s=s||v.body;if(A){if(d&&!p.stdMode){A=A.getBoundingClientRect();u=p.boxModel?v.documentElement:v.body;o=p.getStyle(p.select("html")[0],"borderWidth");o=(o=="medium"||p.boxModel&&!p.isIE6)&&2||o;return{x:A.left+u.scrollLeft-o,y:A.top+u.scrollTop-o}}q=A;while(q&&q!=s&&q.nodeType){o+=q.offsetLeft||0;z+=q.offsetTop||0;q=q.offsetParent}q=A.parentNode;while(q&&q!=s&&q.nodeType){o-=q.scrollLeft||0;z-=q.scrollTop||0;q=q.parentNode}}return{x:o,y:z}},parseStyle:function(r){var u=this,v=u.settings,x={};if(!r){return x}function p(D,A,C){var z,B,o,y;z=x[D+"-top"+A];if(!z){return}B=x[D+"-right"+A];if(z!=B){return}o=x[D+"-bottom"+A];if(B!=o){return}y=x[D+"-left"+A];if(o!=y){return}x[C]=y;delete x[D+"-top"+A];delete x[D+"-right"+A];delete x[D+"-bottom"+A];delete x[D+"-left"+A]}function q(y,s,o,A){var z;z=x[s];if(!z){return}z=x[o];if(!z){return}z=x[A];if(!z){return}x[y]=x[s]+" "+x[o]+" "+x[A];delete x[s];delete x[o];delete x[A]}r=r.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");k(r.split(";"),function(s){var o,t=[];if(s){s=s.replace(/_MCE_SEMI_/g,";");s=s.replace(/url\([^\)]+\)/g,function(y){t.push(y);return"url("+t.length+")"});s=s.split(":");o=m.trim(s[1]);o=o.replace(/url\(([^\)]+)\)/g,function(z,y){return t[parseInt(y)-1]});o=o.replace(/rgb\([^\)]+\)/g,function(y){return u.toHex(y)});if(v.url_converter){o=o.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(y,z){return"url("+v.url_converter.call(v.url_converter_scope||u,u.decode(z),"style",null)+")"})}x[m.trim(s[0]).toLowerCase()]=o}});p("border","","border");p("border","-width","border-width");p("border","-color","border-color");p("border","-style","border-style");p("padding","","padding");p("margin","","margin");q("border","border-width","border-style","border-color");if(d){if(x.border=="medium none"){x.border=""}}return x},serializeStyle:function(v,p){var q=this,r="";function u(s,o){if(o&&s){if(o.indexOf("-")===0){return}switch(o){case"font-weight":if(s==700){s="bold"}break;case"color":case"background-color":s=s.toLowerCase();break}r+=(r?" ":"")+o+": "+s+";"}}if(p&&q._styles){k(q._styles["*"],function(o){u(v[o],o)});k(q._styles[p.toLowerCase()],function(o){u(v[o],o)})}else{k(v,u)}return r},loadCSS:function(o){var q=this,r=q.doc,p;if(!o){o=""}p=q.select("head")[0];k(o.split(","),function(s){var t;if(q.files[s]){return}q.files[s]=true;t=q.create("link",{rel:"stylesheet",href:m._addVer(s)});if(d&&r.documentMode&&r.recalc){t.onload=function(){r.recalc();t.onload=null}}p.appendChild(t)})},addClass:function(o,p){return this.run(o,function(q){var r;if(!p){return 0}if(this.hasClass(q,p)){return q.className}r=this.removeClass(q,p);return q.className=(r!=""?(r+" "):"")+p})},removeClass:function(q,r){var o=this,p;return o.run(q,function(t){var s;if(o.hasClass(t,r)){if(!p){p=new RegExp("(^|\\s+)"+r+"(\\s+|$)","g")}s=t.className.replace(p," ");s=m.trim(s!=" "?s:"");t.className=s;if(!s){t.removeAttribute("class");t.removeAttribute("className")}return s}return t.className})},hasClass:function(p,o){p=this.get(p);if(!p||!o){return false}return(" "+p.className+" ").indexOf(" "+o+" ")!==-1},show:function(o){return this.setStyle(o,"display","block")},hide:function(o){return this.setStyle(o,"display","none")},isHidden:function(o){o=this.get(o);return !o||o.style.display=="none"||this.getStyle(o,"display")=="none"},uniqueId:function(o){return(!o?"mce_":o)+(this.counter++)},setHTML:function(q,p){var o=this;return this.run(q,function(v){var r,t,s,z,u,r;p=o.processHTML(p);if(d){function y(){while(v.firstChild){v.firstChild.removeNode()}try{v.innerHTML="
"+p;v.removeChild(v.firstChild)}catch(x){r=o.create("div");r.innerHTML="
"+p;k(r.childNodes,function(B,A){if(A){v.appendChild(B)}})}}if(o.settings.fix_ie_paragraphs){p=p.replace(/

<\/p>|]+)><\/p>|/gi,' 

')}y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("p");for(t=s.length-1,r=0;t>=0;t--){z=s[t];if(!z.hasChildNodes()){if(!z._mce_keep){r=1;break}z.removeAttribute("_mce_keep")}}}if(r){p=p.replace(/

]+)>|

/ig,'

');p=p.replace(/<\/p>/gi,"
");y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("DIV");for(t=s.length-1;t>=0;t--){z=s[t];if(z._mce_tmp){u=o.doc.createElement("p");z.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(A,x){var B;if(x!=="_mce_tmp"){B=z.getAttribute(x);if(!B&&x==="class"){B=z.className}u.setAttribute(x,B)}});for(r=0;r]+)\/>|/gi,"",r);if(q.keep_values){if(/)/g,"\n");t=t.replace(/^[\r\n]*|[\r\n]*$/g,"");t=t.replace(/^\s*(\/\/\s*|\]\]>|-->|\]\]-->)\s*$/g,"");return t}r=r.replace(/]+|)>([\s\S]*?)<\/script>/gi,function(s,x,t){if(!x){x=' type="text/javascript"'}x=x.replace(/src=\"([^\"]+)\"?/i,function(y,z){if(q.url_converter){z=p.encode(q.url_converter.call(q.url_converter_scope||p,p.decode(z),"src","script"))}return'_mce_src="'+z+'"'});if(m.trim(t)){v.push(o(t));t=""}return""+t+""});r=r.replace(/]+|)>([\s\S]*?)<\/style>/gi,function(s,x,t){if(t){v.push(o(t));t=""}return""+t+""});r=r.replace(/]+|)>([\s\S]*?)<\/noscript>/g,function(s,x,t){return""})}r=m._replace(//g,"",r);function u(s){return s.replace(h,function(y,z,x,t){return"<"+z+x.replace(l,function(B,A,E,D,C){var F;A=A.toLowerCase();E=E||D||C||"";if(e[A]){if(E==="false"||E==="0"){return}return A+'="'+A+'"'}if(f[A]&&x.indexOf("_mce_"+A)==-1){F=p.decode(E);if(q.url_converter&&(A=="src"||A=="href")){F=q.url_converter.call(q.url_converter_scope||p,F,A,z)}if(A=="style"){F=p.serializeStyle(p.parseStyle(F),A)}return A+'="'+E+'" _mce_'+A+'="'+p.encode(F)+'"'}return B})+t+">"})}r=u(r);r=r.replace(/MCE_SCRIPT:([0-9]+)/g,function(t,s){return v[s]})}return r},getOuterHTML:function(o){var p;o=this.get(o);if(!o){return null}if(o.outerHTML!==undefined){return o.outerHTML}p=(o.ownerDocument||this.doc).createElement("body");p.appendChild(o.cloneNode(true));return p.innerHTML},setOuterHTML:function(r,p,s){var o=this;function q(u,t,x){var y,v;v=x.createElement("body");v.innerHTML=t;y=v.lastChild;while(y){o.insertAfter(y.cloneNode(true),u);y=y.previousSibling}o.remove(u)}return this.run(r,function(u){u=o.get(u);if(u.nodeType==1){s=s||u.ownerDocument||o.doc;if(d){try{if(d&&u.nodeType==1){u.outerHTML=p}else{q(u,p,s)}}catch(t){q(u,p,s)}}else{q(u,p,s)}}})},decode:function(p){var q,r,o;if(/&[\w#]+;/.test(p)){q=this.doc.createElement("div");q.innerHTML=p;r=q.firstChild;o="";if(r){do{o+=r.nodeValue}while(r=r.nextSibling)}return o||p}return p},encode:function(o){return(""+o).replace(n,function(p){return c[p]})},insertAfter:function(o,p){p=this.get(p);return this.run(o,function(r){var q,s;q=p.parentNode;s=p.nextSibling;if(s){q.insertBefore(r,s)}else{q.appendChild(r)}return r})},isBlock:function(o){if(o.nodeType&&o.nodeType!==1){return false}o=o.nodeName||o;return a.test(o)},replace:function(s,r,p){var q=this;if(j(r,"array")){s=s.cloneNode(true)}return q.run(r,function(t){if(p){k(m.grep(t.childNodes),function(o){s.appendChild(o)})}return t.parentNode.replaceChild(s,t)})},rename:function(r,o){var q=this,p;if(r.nodeName!=o.toUpperCase()){p=q.create(o);k(q.getAttribs(r),function(s){q.setAttrib(p,s.nodeName,q.getAttrib(r,s.nodeName))});q.replace(p,r,1)}return p||r},findCommonAncestor:function(q,o){var r=q,p;while(r){p=o;while(p&&r!=p){p=p.parentNode}if(r==p){break}r=r.parentNode}if(!r&&q.ownerDocument){return q.ownerDocument.documentElement}return r},toHex:function(o){var q=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(o);function p(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}if(q){o="#"+p(q[1])+p(q[2])+p(q[3]);return o}return o},getClasses:function(){var s=this,o=[],r,u={},v=s.settings.class_filter,q;if(s.classes){return s.classes}function x(t){k(t.imports,function(y){x(y)});k(t.cssRules||t.rules,function(y){switch(y.type||1){case 1:if(y.selectorText){k(y.selectorText.split(","),function(z){z=z.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(z)||!/\.[\w\-]+$/.test(z)){return}q=z;z=m._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",z);if(v&&!(z=v(z,q))){return}if(!u[z]){o.push({"class":z});u[z]=1}})}break;case 3:x(y.styleSheet);break}})}try{k(s.doc.styleSheets,x)}catch(p){}if(o.length>0){s.classes=o}return o},run:function(u,r,q){var p=this,v;if(p.doc&&typeof(u)==="string"){u=p.get(u)}if(!u){return false}q=q||this;if(!u.nodeType&&(u.length||u.length===0)){v=[];k(u,function(s,o){if(s){if(typeof(s)=="string"){s=p.doc.getElementById(s)}v.push(r.call(q,s,o))}});return v}return r.call(q,u)},getAttribs:function(q){var p;q=this.get(q);if(!q){return[]}if(d){p=[];if(q.nodeName=="OBJECT"){return q.attributes}if(q.nodeName==="OPTION"&&this.getAttrib(q,"selected")){p.push({specified:1,nodeName:"selected"})}q.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(o){p.push({specified:1,nodeName:o})});return p}return q.attributes},destroy:function(p){var o=this;if(o.events){o.events.destroy()}o.win=o.doc=o.root=o.events=null;if(!p){m.removeUnload(o.destroy)}},createRng:function(){var o=this.doc;return o.createRange?o.createRange():new m.dom.Range(this)},nodeIndex:function(s,t){var o=0,q,r,p;if(s){for(q=s.nodeType,s=s.previousSibling,r=s;s;s=s.previousSibling){p=s.nodeType;if(t&&p==3){if(p==q||!s.nodeValue.length){continue}}o++;q=p}}return o},split:function(u,s,y){var z=this,o=z.createRng(),v,q,x;function p(A){var t,r=A.childNodes;if(A.nodeType==1&&A.getAttribute("_mce_type")=="bookmark"){return}for(t=r.length-1;t>=0;t--){p(r[t])}if(A.nodeType!=9){if(A.nodeType==3&&A.nodeValue.length>0){if(!z.isBlock(A.parentNode)||m.trim(A.nodeValue).length>0){return}}if(A.nodeType==1){r=A.childNodes;if(r.length==1&&r[0]&&r[0].nodeType==1&&r[0].getAttribute("_mce_type")=="bookmark"){A.parentNode.insertBefore(r[0],A)}if(r.length||/^(br|hr|input|img)$/i.test(A.nodeName)){return}}z.remove(A)}return A}if(u&&s){o.setStart(u.parentNode,z.nodeIndex(u));o.setEnd(s.parentNode,z.nodeIndex(s));v=o.extractContents();o=z.createRng();o.setStart(s.parentNode,z.nodeIndex(s)+1);o.setEnd(u.parentNode,z.nodeIndex(u)+1);q=o.extractContents();x=u.parentNode;x.insertBefore(p(v),u);if(y){x.replaceChild(y,s)}else{x.insertBefore(s,u)}x.insertBefore(p(q),u);z.remove(u);return y||s}},bind:function(s,o,r,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.add(s,o,r,q||this)},unbind:function(r,o,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.remove(r,o,q)},_findSib:function(r,o,p){var q=this,s=o;if(r){if(j(s,"string")){s=function(t){return q.is(t,o)}}for(r=r[p];r;r=r[p]){if(s(r)){return r}}}return null},_isRes:function(o){return/^(top|left|bottom|right|width|height)/i.test(o)||/;\s*(top|left|bottom|right|width|height)/i.test(o)}});m.DOM=new m.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var N=this,e=c.doc,S=0,E=1,j=2,D=true,R=false,U="startOffset",h="startContainer",P="endContainer",z="endOffset",k=tinymce.extend,n=c.nodeIndex;k(N,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:D,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:I,setEndBefore:J,setEndAfter:u,collapse:A,selectNode:x,selectNodeContents:F,compareBoundaryPoints:v,deleteContents:p,extractContents:H,cloneContents:d,insertNode:C,surroundContents:M,cloneRange:K});function q(V,t){B(D,V,t)}function s(V,t){B(R,V,t)}function g(t){q(t.parentNode,n(t))}function I(t){q(t.parentNode,n(t)+1)}function J(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function A(t){if(t){N[P]=N[h];N[z]=N[U]}else{N[h]=N[P];N[U]=N[z]}N.collapsed=D}function x(t){g(t);u(t)}function F(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(W,X){var Z=N[h],Y=N[U],V=N[P],t=N[z];if(W===0){return G(Z,Y,Z,Y)}if(W===1){return G(Z,Y,V,t)}if(W===2){return G(V,t,V,t)}if(W===3){return G(V,t,Z,Y)}}function p(){m(j)}function H(){return m(S)}function d(){return m(E)}function C(Y){var V=this[h],t=this[U],X,W;if((V.nodeType===3||V.nodeType===4)&&V.nodeValue){if(!t){V.parentNode.insertBefore(Y,V)}else{if(t>=V.nodeValue.length){c.insertAfter(Y,V)}else{X=V.splitText(t);V.parentNode.insertBefore(Y,X)}}}else{if(V.childNodes.length>0){W=V.childNodes[t]}if(W){V.insertBefore(Y,W)}else{V.appendChild(Y)}}}function M(V){var t=N.extractContents();N.insertNode(V);V.appendChild(t);N.selectNode(V)}function K(){return k(new b(c),{startContainer:N[h],startOffset:N[U],endContainer:N[P],endOffset:N[z],collapsed:N.collapsed,commonAncestorContainer:N.commonAncestorContainer})}function O(t,V){var W;if(t.nodeType==3){return t}if(V<0){return t}W=t.firstChild;while(W&&V>0){--V;W=W.nextSibling}if(W){return W}return t}function l(){return(N[h]==N[P]&&N[U]==N[z])}function G(X,Z,V,Y){var aa,W,t,ab,ad,ac;if(X==V){if(Z==Y){return 0}if(Z0){N.collapse(V)}}else{N.collapse(V)}N.collapsed=l();N.commonAncestorContainer=c.findCommonAncestor(N[h],N[P])}function m(ab){var aa,X=0,ad=0,V,Z,W,Y,t,ac;if(N[h]==N[P]){return f(ab)}for(aa=N[P],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[h]){return r(aa,ab)}++X}for(aa=N[h],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[P]){return T(aa,ab)}++ad}Z=ad-X;W=N[h];while(Z>0){W=W.parentNode;Z--}Y=N[P];while(Z<0){Y=Y.parentNode;Z++}for(t=W.parentNode,ac=Y.parentNode;t!=ac;t=t.parentNode,ac=ac.parentNode){W=t;Y=ac}return o(W,Y,ab)}function f(Z){var ab,Y,X,aa,t,W,V;if(Z!=j){ab=e.createDocumentFragment()}if(N[U]==N[z]){return ab}if(N[h].nodeType==3){Y=N[h].nodeValue;X=Y.substring(N[U],N[z]);if(Z!=E){N[h].deleteData(N[U],N[z]-N[U]);N.collapse(D)}if(Z==j){return}ab.appendChild(e.createTextNode(X));return ab}aa=O(N[h],N[U]);t=N[z]-N[U];while(t>0){W=aa.nextSibling;V=y(aa,Z);if(ab){ab.appendChild(V)}--t;aa=W}if(Z!=E){N.collapse(D)}return ab}function r(ab,Y){var aa,Z,V,t,X,W;if(Y!=j){aa=e.createDocumentFragment()}Z=i(ab,Y);if(aa){aa.appendChild(Z)}V=n(ab);t=V-N[U];if(t<=0){if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}Z=ab.previousSibling;while(t>0){X=Z.previousSibling;W=y(Z,Y);if(aa){aa.insertBefore(W,aa.firstChild)}--t;Z=X}if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}function T(Z,Y){var ab,V,aa,t,X,W;if(Y!=j){ab=e.createDocumentFragment()}aa=Q(Z,Y);if(ab){ab.appendChild(aa)}V=n(Z);++V;t=N[z]-V;aa=Z.nextSibling;while(t>0){X=aa.nextSibling;W=y(aa,Y);if(ab){ab.appendChild(W)}--t;aa=X}if(Y!=E){N.setStartAfter(Z);N.collapse(D)}return ab}function o(Z,t,ac){var W,ae,Y,aa,ab,V,ad,X;if(ac!=j){ae=e.createDocumentFragment()}W=Q(Z,ac);if(ae){ae.appendChild(W)}Y=Z.parentNode;aa=n(Z);ab=n(t);++aa;V=ab-aa;ad=Z.nextSibling;while(V>0){X=ad.nextSibling;W=y(ad,ac);if(ae){ae.appendChild(W)}ad=X;--V}W=i(t,ac);if(ae){ae.appendChild(W)}if(ac!=E){N.setStartAfter(Z);N.collapse(D)}return ae}function i(aa,ab){var W=O(N[P],N[z]-1),ac,Z,Y,t,V,X=W!=N[P];if(W==aa){return L(W,X,R,ab)}ac=W.parentNode;Z=L(ac,R,R,ab);while(ac){while(W){Y=W.previousSibling;t=L(W,X,R,ab);if(ab!=j){Z.insertBefore(t,Z.firstChild)}X=D;W=Y}if(ac==aa){return Z}W=ac.previousSibling;ac=ac.parentNode;V=L(ac,R,R,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function Q(aa,ab){var X=O(N[h],N[U]),Y=X!=N[h],ac,Z,W,t,V;if(X==aa){return L(X,Y,D,ab)}ac=X.parentNode;Z=L(ac,R,D,ab);while(ac){while(X){W=X.nextSibling;t=L(X,Y,D,ab);if(ab!=j){Z.appendChild(t)}Y=D;X=W}if(ac==aa){return Z}X=ac.nextSibling;ac=ac.parentNode;V=L(ac,R,D,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function L(t,Y,ab,ac){var X,W,Z,V,aa;if(Y){return y(t,ac)}if(t.nodeType==3){X=t.nodeValue;if(ab){V=N[U];W=X.substring(V);Z=X.substring(0,V)}else{V=N[z];W=X.substring(0,V);Z=X.substring(V)}if(ac!=E){t.nodeValue=Z}if(ac==j){return}aa=t.cloneNode(R);aa.nodeValue=W;return aa}if(ac==j){return}return t.cloneNode(R)}function y(V,t){if(t!=j){return t==E?V.cloneNode(D):V}V.parentNode.removeChild(V)}}a.Range=b})(tinymce.dom);(function(){function a(g){var i=this,j="\uFEFF",e,h,d=g.dom,c=true,f=false;function b(){var n=g.getRng(),k=d.createRng(),m,o;m=n.item?n.item(0):n.parentElement();if(m.ownerDocument!=d.doc){return k}if(n.item||!m.hasChildNodes()){k.setStart(m.parentNode,d.nodeIndex(m));k.setEnd(k.startContainer,k.startOffset+1);return k}o=g.isCollapsed();function l(s){var u,q,t,p,A=0,x,y,z,r,v;r=n.duplicate();r.collapse(s);u=d.create("a");z=r.parentElement();if(!z.hasChildNodes()){k[s?"setStart":"setEnd"](z,0);return}z.appendChild(u);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){k[s?"setStartAfter":"setEndAfter"](z);d.remove(u);return}p=tinymce.grep(z.childNodes);x=p.length-1;while(A<=x){y=Math.floor((A+x)/2);z.insertBefore(u,p[y]);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){A=y+1}else{if(v<0){x=y-1}else{found=true;break}}}q=v>0||y==0?u.nextSibling:u.previousSibling;if(q.nodeType==1){d.remove(u);t=d.nodeIndex(q);q=q.parentNode;if(!s||y>0){t++}}else{if(v>0||y==0){r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=r.text.length}else{r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=q.nodeValue.length-r.text.length}d.remove(u)}k[s?"setStart":"setEnd"](q,t)}l(true);if(!o){l()}return k}this.addRange=function(k){var p,n,m,r,u,s,t=g.dom.doc,o=t.body;function l(B){var x,A,v,z,y;v=d.create("a");x=B?m:u;A=B?r:s;z=p.duplicate();if(x==t){x=o;A=0}if(x.nodeType==3){x.parentNode.insertBefore(v,x);z.moveToElementText(v);z.moveStart("character",A);d.remove(v);p.setEndPoint(B?"StartToStart":"EndToEnd",z)}else{y=x.childNodes;if(y.length){if(A>=y.length){d.insertAfter(v,y[y.length-1])}else{x.insertBefore(v,y[A])}z.moveToElementText(v)}else{v=t.createTextNode(j);x.appendChild(v);z.moveToElementText(v.parentNode);z.collapse(c)}p.setEndPoint(B?"StartToStart":"EndToEnd",z);d.remove(v)}}this.destroy();m=k.startContainer;r=k.startOffset;u=k.endContainer;s=k.endOffset;p=o.createTextRange();if(m==u&&m.nodeType==1&&r==s-1){if(r==s-1){try{n=o.createControlRange();n.addElement(m.childNodes[r]);n.select();n.scrollIntoView();return}catch(q){}}}l(true);l();p.select();p.scrollIntoView()};this.getRangeAt=function(){if(!e||!tinymce.dom.RangeUtils.compareRanges(h,g.getRng())){e=b();h=g.getRng()}try{e.startContainer.nextSibling}catch(k){e=b();h=null}return e};this.destroy=function(){h=e=null}}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,j=0,d=Object.prototype.toString,o=false,i=true;[0,0].sort(function(){i=false;return 0});var b=function(v,e,z,A){z=z||[];e=e||document;var C=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!v||typeof v!=="string"){return z}var x=[],s,E,H,r,u=true,t=b.isXML(e),B=v,D,G,F,y;do{p.exec("");s=p.exec(B);if(s){B=s[3];x.push(s[1]);if(s[2]){r=s[3];break}}}while(s);if(x.length>1&&k.exec(v)){if(x.length===2&&f.relative[x[0]]){E=h(x[0]+x[1],e)}else{E=f.relative[x[0]]?[e]:b(x.shift(),e);while(x.length){v=x.shift();if(f.relative[v]){v+=x.shift()}E=h(v,E)}}}else{if(!A&&x.length>1&&e.nodeType===9&&!t&&f.match.ID.test(x[0])&&!f.match.ID.test(x[x.length-1])){D=b.find(x.shift(),e,t);e=D.expr?b.filter(D.expr,D.set)[0]:D.set[0]}if(e){D=A?{expr:x.pop(),set:a(A)}:b.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&e.parentNode?e.parentNode:e,t);E=D.expr?b.filter(D.expr,D.set):D.set;if(x.length>0){H=a(E)}else{u=false}while(x.length){G=x.pop();F=G;if(!f.relative[G]){G=""}else{F=x.pop()}if(F==null){F=e}f.relative[G](H,F,t)}}else{H=x=[]}}if(!H){H=E}if(!H){b.error(G||v)}if(d.call(H)==="[object Array]"){if(!u){z.push.apply(z,H)}else{if(e&&e.nodeType===1){for(y=0;H[y]!=null;y++){if(H[y]&&(H[y]===true||H[y].nodeType===1&&b.contains(e,H[y]))){z.push(E[y])}}}else{for(y=0;H[y]!=null;y++){if(H[y]&&H[y].nodeType===1){z.push(E[y])}}}}}else{a(H,z)}if(r){b(r,C,z,A);b.uniqueSort(z)}return z};b.uniqueSort=function(r){if(c){o=i;r.sort(c);if(o){for(var e=1;e":function(x,r){var u=typeof r==="string",v,s=0,e=x.length;if(u&&!/\W/.test(r)){r=r.toLowerCase();for(;s=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){return r[1].toLowerCase()},CHILD:function(e){if(e[1]==="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=j++;return e},ATTR:function(u,r,s,e,v,x){var t=u[1].replace(/\\/g,"");if(!x&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if((p.exec(u[3])||"").length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toLowerCase()==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return re[3]-0},nth:function(s,r,e){return e[3]-0===r},eq:function(s,r,e){return e[3]-0===r}},filter:{PSEUDO:function(s,y,x,z){var e=y[1],r=f.filters[e];if(r){return r(s,x,y,z)}else{if(e==="contains"){return(s.textContent||s.innerText||b.getText([s])||"").indexOf(y[3])>=0}else{if(e==="not"){var t=y[3];for(var v=0,u=t.length;v=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName.toLowerCase()===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),x=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?x===r:u==="*="?x.indexOf(r)>=0:u==="~="?(" "+x+" ").indexOf(r)>=0:!r?x&&e!==false:u==="!="?x!==r:u==="^="?x.indexOf(r)===0:u==="$="?x.substr(x.length-r.length)===r:u==="|="?x===r||x.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var k=f.match.POS,g=function(r,e){return"\\"+(e-0+1)};for(var m in f.match){f.match[m]=new RegExp(f.match[m].source+(/(?![^\[]*\])(?![^\(]*\))/.source));f.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+f.match[m].source.replace(/\\(\d+)/g,g))}var a=function(r,e){r=Array.prototype.slice.call(r,0);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(l){a=function(u,t){var r=t||[],s=0;if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var e=u.length;s";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(document.getElementById(s)){f.find.ID=function(u,v,x){if(typeof v.getElementById!=="undefined"&&!x){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r);e=r=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="

";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(x,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!b.isXML(v)){try{return a(v.querySelectorAll(x),t)}catch(y){}}return e(x,v,t,u)};for(var r in e){b[r]=e[r]}s=null})()}(function(){var e=document.createElement("div");e.innerHTML="
";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}};e=null})();function n(r,x,v,A,y,z){for(var t=0,s=A.length;t0){u=e;break}}}e=e[r]}A[t]=u}}}b.contains=document.compareDocumentPosition?function(r,e){return !!(r.compareDocumentPosition(e)&16)}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};b.isXML=function(e){var r=(e?e.ownerDocument||e:0).documentElement;return r?r.nodeName!=="HTML":false};var h=function(e,y){var t=[],u="",v,s=y.nodeType?[y]:y;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var x=0,r=s.length;x=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j_';if(k.startContainer==l&&k.endContainer==l){l.body.innerHTML=j}else{k.deleteContents();if(l.body.childNodes.length==0){l.body.innerHTML=j}else{if(k.createContextualFragment){k.insertNode(k.createContextualFragment(j))}else{var m=l.createDocumentFragment(),f=l.createElement("div");m.appendChild(f);f.outerHTML=j;k.insertNode(m)}}}n=g.dom.get("__caret");k=l.createRange();k.setStartBefore(n);k.setEndBefore(n);g.setRng(k);g.dom.remove("__caret")}else{if(k.item){l.execCommand("Delete",false,null);k=g.getRng()}k.pasteHTML(j)}g.onSetContent.dispatch(g,i)},getStart:function(){var g=this.getRng(),h,f,j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}j=g.duplicate();j.collapse(1);h=j.parentElement();f=i=g.parentElement();while(i=i.parentNode){if(i==h){h=f;break}}if(h&&h.nodeName=="BODY"){return h.firstChild||h}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(h.duplicate||h.item){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(q,r){var u=this,m=u.dom,g,j,i,n,h,o,p,l="\uFEFF",s;function f(v,x){var t=0;d(m.select(v),function(z,y){if(z==x){t=y}});return t}if(q==2){function k(){var v=u.getRng(true),t=m.getRoot(),x={};function y(B,G){var A=B[G?"startContainer":"endContainer"],F=B[G?"startOffset":"endOffset"],z=[],C,E,D=0;if(A.nodeType==3){if(r){for(C=A.previousSibling;C&&C.nodeType==3;C=C.previousSibling){F+=C.nodeValue.length}}z.push(F)}else{E=A.childNodes;if(F>=E.length&&E.length){D=1;F=Math.max(0,E.length-1)}z.push(u.dom.nodeIndex(E[F],r)+D)}for(;A&&A!=t;A=A.parentNode){z.push(u.dom.nodeIndex(A,r))}return z}x.start=y(v,true);if(!u.isCollapsed()){x.end=y(v)}return x}return k()}if(q){return{rng:u.getRng()}}g=u.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();s="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();g.collapse();g.pasteHTML(''+l+"");if(!n){j.collapse(false);j.pasteHTML(''+l+"")}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=u.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_end",style:s},l))}g.collapse(true);g.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_start",style:s},l))}u.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(n){var r=this,l=r.dom,i,h,f,q,j,s,o,p;if(r.tridentSel){r.tridentSel.destroy()}if(n){if(n.start){f=l.createRng();q=l.getRoot();function g(z){var t=n[z?"start":"end"],v,x,y,u;if(t){for(x=q,v=t.length-1;v>=1;v--){u=x.childNodes;if(u.length){x=u[t[v]]}}if(z){f.setStart(x,t[0])}else{f.setEnd(x,t[0])}}}g(true);g();r.setRng(f)}else{if(n.id){function k(A){var u=l.get(n.id+"_"+A),z,t,x,y,v=n.keep;if(u){z=u.parentNode;if(A=="start"){if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}j=s=z;o=p=t}else{if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}s=z;p=t}if(!v){y=u.previousSibling;x=u.nextSibling;d(c.grep(u.childNodes),function(B){if(B.nodeType==3){B.nodeValue=B.nodeValue.replace(/\uFEFF/g,"")}});while(u=l.get(n.id+"_"+A)){l.remove(u,1)}if(y&&x&&y.nodeType==x.nodeType&&y.nodeType==3&&!c.isOpera){t=y.nodeValue.length;y.appendData(x.nodeValue);l.remove(x);if(A=="start"){j=s=y;o=p=t}else{s=y;p=t}}}}}function m(t){if(!a&&l.isBlock(t)&&!t.innerHTML){t.innerHTML='
'}return t}k("start");k("end");if(j){f=l.createRng();f.setStart(m(j),o);f.setEnd(m(s),p);r.setRng(f)}}else{if(n.name){r.select(l.select(n.name)[n.index])}else{if(n.rng){r.setRng(n.rng)}}}}}},select:function(k,j){var i=this,l=i.dom,g=l.createRng(),f;f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g);return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(l){var g=this,h,i,k,j=g.win.document;if(l&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():j.createRange())}}catch(f){}if(c.isIE&&i.setStart&&j.selection.createRange().item){k=j.selection.createRange().item(0);i=j.createRange();i.setStartBefore(k);i.setEndAfter(k)}if(!i){i=j.createRange?j.createRange():j.body.createTextRange()}if(g.selectedRange&&g.explicitRange){if(i.compareBoundaryPoints(i.START_TO_START,g.selectedRange)===0&&i.compareBoundaryPoints(i.END_TO_END,g.selectedRange)===0){i=g.explicitRange}else{g.selectedRange=null;g.explicitRange=null}}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){g.explicitRange=i;h.removeAllRanges();h.addRange(i);g.selectedRange=h.getRangeAt(0)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var g=this,f=g.getRng(),h=g.getSel(),i;if(f.setStart){if(!f){return g.dom.getRoot()}i=f.commonAncestorContainer;if(!f.collapsed){if(f.startContainer==f.endContainer){if(f.startOffset-f.endOffset<2){if(f.startContainer.hasChildNodes()){i=f.startContainer.childNodes[f.startOffset]}}}if(c.isWebKit&&h.anchorNode&&h.anchorNode.nodeType==1){return h.anchorNode.childNodes[h.anchorOffset]}}if(i&&i.nodeType==3){return i.parentNode}return i}return f.item?f.item(0):f.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}},_fixIESelection:function(){var m=this.dom,l=m.doc,g=l.body,i,j;l.documentElement.unselectable=true;function k(n,q){var o=g.createTextRange();try{o.moveToPoint(n,q)}catch(p){o=null}return o}function h(o){var n;if(o.button){n=k(o.x,o.y);if(n){if(n.compareEndPoints("StartToStart",j)>0){n.setEndPoint("StartToStart",j)}else{n.setEndPoint("EndToEnd",j)}n.select()}}else{f()}}function f(){m.unbind(l,"mouseup",f);m.unbind(l,"mousemove",h);i=0}m.bind(l,"mousedown",function(n){if(n.target.nodeName==="HTML"){if(i){f()}i=1;j=k(n.x,n.y);if(j){m.bind(l,"mouseup",f);m.bind(l,"mousemove",h);m.win.focus();j.select()}}})}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();this.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>|]*>|<\/html>||]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,">")}return b}})})(tinymce);(function(c){var d=/[&\"<>]/g,b=/[<>&]/g,a={"&":"&",'"':""","<":"<",">":">"};c.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(e){this.settings=c.extend({indent_char:" ",indentation:0},e);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(e){this._writeAttributesEnd();this.writeRaw("<"+e);this.tags.push(e);this.inAttr=true;this.count++;this.elementCount=this.count;this.attrs={}},writeAttribute:function(g,e){var f=this;if(!f.attrs[g]){f.writeRaw(" "+f.encode(g,true)+'="'+f.encode(e,true)+'"');f.attrs[g]=e}},writeEndElement:function(){var e;if(this.tags.length>0){e=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(e){this._writeAttributesEnd();this.writeRaw(this.encode(e));this.count++},writeCDATA:function(e){this._writeAttributesEnd();this.writeRaw("");this.count++},writeComment:function(e){this._writeAttributesEnd();this.writeRaw("");this.count++},writeRaw:function(e){this.str+=e},encode:function(f,e){return f.replace(e?d:b,function(g){return a[g]})},getContent:function(){return this.str},_writeAttributesEnd:function(e){if(!this.inAttr){return}this.inAttr=false;if(e&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess=new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}if(e.isIE&&document.documentMode>8){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(_mce_|_moz_|sizset|sizcache)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",valid_elements:"*[*]",extended_valid_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;i.schema=j.schema;if(j.entity_encoding=="named"&&!j.entities){j.entity_encoding="raw"}if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(
\s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^
\s*<\//.test(n)){return""}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,z,y=["ol","ul"],u,t,q,k=/^(OL|UL)$/,A;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t]*>)(.*?)(<\/script>)/g},{pattern:/(]*>)(.*?)(<\/noscript>)/g},{pattern:/(]*>)(.*?)(<\/style>)/g},{pattern:/(]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/()/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=e._replace(/

\s+<\/p>|]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?" 

":" 

",j);if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=e._replace(/(<[^>]+>)\s+/g,"$1 ",j);j=e._replace(/\s+(<\/[^>]+>)/g," $1",j);j=e._replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>",j);j=e._replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>",j);j=e._replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"",j)}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=e._replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n",j);j=e._replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>",j);j=e._replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"\n",j);j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=e._replace(//g,"",j);if(k.entity_encoding=="raw"){j=e._replace(/

 <\/p>|]+)> <\/p>/g,"\u00a0

",j)}j=j.replace(/]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return""+i.dom.decode(o.replace(//g,""))+""})}n.content=j},_serializeNode:function(E,J){var A=this,B=A.settings,y=A.writer,q,j,u,G,F,I,C,h,z,k,r,D,p,m,H,o,x;if(!B.node_filter||B.node_filter(E)){switch(E.nodeType){case 1:if(E.hasAttribute?E.hasAttribute("_mce_bogus"):E.getAttribute("_mce_bogus")){return}p=H=false;q=E.hasChildNodes();k=E.getAttribute("_mce_name")||E.nodeName.toLowerCase();o=E.getAttribute("_mce_type");if(o){if(!A._info.cleanup){p=true;return}else{H=1}}if(d){x=E.scopeName;if(x&&x!=="HTML"&&x!=="html"){k=x+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!H){if(!A.validElementsRE||!A.validElementsRE.test(k)||(A.invalidElementsRE&&A.invalidElementsRE.test(k))||J){p=true;break}}if(d){if(B.fix_content_duplication){if(E._mce_serialized==A.key){return}E._mce_serialized=A.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(E.nodeName==="BR"&&E.getAttribute("type")=="_moz"){return}}}if(B.validate_children){if(A.elementName&&!A.schema.isValid(A.elementName,k)){p=true;break}A.elementName=k}r=A.findRule(k);if(!r){p=true;break}k=r.name||k;m=B.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){I=r.requiredAttribs;for(G=I.length-1;G>=0;G--){if(this.dom.getAttrib(E,I[G])!==""){break}}if(G==-1){p=true;break}}y.writeStartElement(k);if(r.attribs){for(G=0,C=r.attribs,F=C.length;G-1;G--){h=C[G];if(h.specified){I=h.nodeName.toLowerCase();if(B.invalid_attrs.test(I)||!r.validAttribsRE.test(I)){continue}D=A.findAttribRule(r,I);z=A._getAttrib(E,D,I);if(z!==null){y.writeAttribute(I,z)}}}}if(o&&H){y.writeAttribute("_mce_type",o)}if(k==="script"&&e.trim(E.innerHTML)){y.writeText("// ");y.writeCDATA(E.innerHTML.replace(/|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=E.firstChild)&&u.nodeType===1&&E.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("_mce_bogus"):u.getAttribute("_mce_bogus")){y.writeText("\u00a0")}}else{if(!q){y.writeText("\u00a0")}}}break;case 3:if(B.validate_children&&A.elementName&&!A.schema.isValid(A.elementName,"#text")){return}return y.writeText(E.nodeValue);case 4:return y.writeCDATA(E.nodeValue);case 8:return y.writeComment(E.nodeValue)}}else{if(E.nodeType==1){q=E.hasChildNodes()}}if(q&&!m){u=E.firstChild;while(u){A._serializeNode(u);A.elementName=k;u=u.nextSibling}}if(!p){if(!m){y.writeFullEndElement()}else{y.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.content).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+""+p}))});return j},_unprotect:function(i,j){i=i.replace(/\"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,""))}}if(b.stdMode){e+=''+j.renderHTML()+""}else{e+=""+j.renderHTML()+""}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,""))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,""));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},""+e+"")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){return this.lookup[d]},requireLangPack:function(e){var d=b.settings;if(d&&d.language){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));if(!f.lookup[h]){b.ScriptLoader.add(e,d,g)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(q){var n=this,p,l=j.ScriptLoader,u,o=[],m;function r(x,y,t){var v=x[y];if(!v){return}if(j.is(v,"string")){t=v.replace(/\.\w+$/,"");t=t?j.resolve(t):0;v=j.resolve(v)}return v.apply(t||this,Array.prototype.slice.call(arguments,2))}q=d({theme:"simple",language:"en"},q);n.settings=q;i.add(document,"init",function(){var s,v;r(q,"onpageload");switch(q.mode){case"exact":s=q.elements||"";if(s.length>0){g(e(s),function(x){if(k.get(x)){m=new j.Editor(x,q);o.push(m);m.render(1)}else{g(document.forms,function(y){g(y.elements,function(z){if(z.name===x){x="mce_editor_"+c++;k.setAttrib(z,"id",x);m=new j.Editor(x,q);o.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(y,x){return x.constructor===RegExp?x.test(y.className):k.hasClass(y,x)}g(k.select("textarea"),function(x){if(q.editor_deselector&&t(x,q.editor_deselector)){return}if(!q.editor_selector||t(x,q.editor_selector)){u=k.get(x.name);if(!x.id&&!u){x.id=x.name}if(!x.id||n.get(x.id)){x.id=k.uniqueId()}m=new j.Editor(x.id,q);o.push(m);m.render(1)}});break}if(q.oninit){s=v=0;g(o,function(x){v++;if(!x.initialized){x.onInit.add(function(){s++;if(s==v){r(q,"oninit")}})}else{s++}if(s==v){r(q,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l':"",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir';if(F.document_base_url!=m.documentBaseURL){E.iframeHTML+=''}E.iframeHTML+='';if(m.relaxedDomain){E.iframeHTML+=''); + tinymce.ScriptLoader.markDone(u); + } + } + }, + + /** + * Executes a color picker on the specified element id. When the user + * then selects a color it will be set as the value of the specified element. + * + * @method pickColor + * @param {DOMEvent} e DOM event object. + * @param {string} element_id Element id to be filled with the color value from the picker. + */ + pickColor : function(e, element_id) { + this.execCommand('mceColorPicker', true, { + color : document.getElementById(element_id).value, + func : function(c) { + document.getElementById(element_id).value = c; + + try { + document.getElementById(element_id).onchange(); + } catch (ex) { + // Try fire event, ignore errors + } + } + }); + }, + + /** + * Opens a filebrowser/imagebrowser this will set the output value from + * the browser as a value on the specified element. + * + * @method openBrowser + * @param {string} element_id Id of the element to set value in. + * @param {string} type Type of browser to open image/file/flash. + * @param {string} option Option name to get the file_broswer_callback function name from. + */ + openBrowser : function(element_id, type, option) { + tinyMCEPopup.restoreSelection(); + this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window); + }, + + /** + * Creates a confirm dialog. Please don't use the blocking behavior of this + * native version use the callback method instead then it can be extended. + * + * @method confirm + * @param {String} t Title for the new confirm dialog. + * @param {function} cb Callback function to be executed after the user has selected ok or cancel. + * @param {Object} s Optional scope to execute the callback in. + */ + confirm : function(t, cb, s) { + this.editor.windowManager.confirm(t, cb, s, window); + }, + + /** + * Creates a alert dialog. Please don't use the blocking behavior of this + * native version use the callback method instead then it can be extended. + * + * @method alert + * @param {String} t Title for the new alert dialog. + * @param {function} cb Callback function to be executed after the user has selected ok. + * @param {Object} s Optional scope to execute the callback in. + */ + alert : function(tx, cb, s) { + this.editor.windowManager.alert(tx, cb, s, window); + }, + + /** + * Closes the current window. + * + * @method close + */ + close : function() { + var t = this; + + // To avoid domain relaxing issue in Opera + function close() { + t.editor.windowManager.close(window); + tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup + }; + + if (tinymce.isOpera) + t.getWin().setTimeout(close, 0); + else + close(); + }, + + // Internal functions + + _restoreSelection : function() { + var e = window.event.srcElement; + + if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button')) + tinyMCEPopup.restoreSelection(); + }, + +/* _restoreSelection : function() { + var e = window.event.srcElement; + + // If user focus a non text input or textarea + if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text') + tinyMCEPopup.restoreSelection(); + },*/ + + _onDOMLoaded : function() { + var t = tinyMCEPopup, ti = document.title, bm, h, nv; + + if (t.domLoaded) + return; + + t.domLoaded = 1; + + // Translate page + if (t.features.translate_i18n !== false) { + h = document.body.innerHTML; + + // Replace a=x with a="x" in IE + if (tinymce.isIE) + h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"') + + document.dir = t.editor.getParam('directionality',''); + + if ((nv = t.editor.translate(h)) && nv != h) + document.body.innerHTML = nv; + + if ((nv = t.editor.translate(ti)) && nv != ti) + document.title = ti = nv; + } + + document.body.style.display = ''; + + // Restore selection in IE when focus is placed on a non textarea or input element of the type text + if (tinymce.isIE) { + document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection); + + // Add base target element for it since it would fail with modal dialogs + t.dom.add(t.dom.select('head')[0], 'base', {target : '_self'}); + } + + t.restoreSelection(); + t.resizeToInnerSize(); + + // Set inline title + if (!t.isWindow) + t.editor.windowManager.setTitle(window, ti); + else + window.focus(); + + if (!tinymce.isIE && !t.isWindow) { + tinymce.dom.Event._add(document, 'focus', function() { + t.editor.windowManager.focus(t.id); + }); + } + + // Patch for accessibility + tinymce.each(t.dom.select('select'), function(e) { + e.onkeydown = tinyMCEPopup._accessHandler; + }); + + // Call onInit + // Init must be called before focus so the selection won't get lost by the focus call + tinymce.each(t.listeners, function(o) { + o.func.call(o.scope, t.editor); + }); + + // Move focus to window + if (t.getWindowArg('mce_auto_focus', true)) { + window.focus(); + + // Focus element with mceFocus class + tinymce.each(document.forms, function(f) { + tinymce.each(f.elements, function(e) { + if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) { + e.focus(); + return false; // Break loop + } + }); + }); + } + + document.onkeyup = tinyMCEPopup._closeWinKeyHandler; + }, + + _accessHandler : function(e) { + e = e || window.event; + + if (e.keyCode == 13 || e.keyCode == 32) { + e = e.target || e.srcElement; + + if (e.onchange) + e.onchange(); + + return tinymce.dom.Event.cancel(e); + } + }, + + _closeWinKeyHandler : function(e) { + e = e || window.event; + + if (e.keyCode == 27) + tinyMCEPopup.close(); + }, + + _wait : function() { + // Use IE method + if (document.attachEvent) { + document.attachEvent("onreadystatechange", function() { + if (document.readyState === "complete") { + document.detachEvent("onreadystatechange", arguments.callee); + tinyMCEPopup._onDOMLoaded(); + } + }); + + if (document.documentElement.doScroll && window == window.top) { + (function() { + if (tinyMCEPopup.domLoaded) + return; + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch (ex) { + setTimeout(arguments.callee, 0); + return; + } + + tinyMCEPopup._onDOMLoaded(); + })(); + } + + document.attachEvent('onload', tinyMCEPopup._onDOMLoaded); + } else if (document.addEventListener) { + window.addEventListener('DOMContentLoaded', tinyMCEPopup._onDOMLoaded, false); + window.addEventListener('load', tinyMCEPopup._onDOMLoaded, false); + } + } +}; + +tinyMCEPopup.init(); +tinyMCEPopup._wait(); // Wait for DOM Content Loaded Index: openacs-4/packages/richtext-tinymce/www/resources/tinymce/jscripts/tiny_mce/tiny_mce_src.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/richtext-tinymce/www/resources/tinymce/jscripts/tiny_mce/tiny_mce_src.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/richtext-tinymce/www/resources/tinymce/jscripts/tiny_mce/tiny_mce_src.js 3 Jan 2016 20:39:02 -0000 1.1.2.1 @@ -0,0 +1,14218 @@ +(function(win) { + var whiteSpaceRe = /^\s*|\s*$/g, + undefined, isRegExpBroken = 'B'.replace(/A(.)|B/, '$1') === '$1'; + + var tinymce = { + majorVersion : '3', + + minorVersion : '3.9.3', + + releaseDate : '2010-12-20', + + _init : function() { + var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v; + + t.isOpera = win.opera && opera.buildNumber; + + t.isWebKit = /WebKit/.test(ua); + + t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName); + + t.isIE6 = t.isIE && /MSIE [56]/.test(ua); + + t.isGecko = !t.isWebKit && /Gecko/.test(ua); + + t.isMac = ua.indexOf('Mac') != -1; + + t.isAir = /adobeair/i.test(ua); + + t.isIDevice = /(iPad|iPhone)/.test(ua); + + // TinyMCE .NET webcontrol might be setting the values for TinyMCE + if (win.tinyMCEPreInit) { + t.suffix = tinyMCEPreInit.suffix; + t.baseURL = tinyMCEPreInit.base; + t.query = tinyMCEPreInit.query; + return; + } + + // Get suffix and base + t.suffix = ''; + + // If base element found, add that infront of baseURL + nl = d.getElementsByTagName('base'); + for (i=0; i : + s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s); + cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name + + // Create namespace for new class + ns = t.createNS(s[3].replace(/\.\w+$/, '')); + + // Class already exists + if (ns[cn]) + return; + + // Make pure static class + if (s[2] == 'static') { + ns[cn] = p; + + if (this.onCreate) + this.onCreate(s[2], s[3], ns[cn]); + + return; + } + + // Create default constructor + if (!p[cn]) { + p[cn] = function() {}; + de = 1; + } + + // Add constructor and methods + ns[cn] = p[cn]; + t.extend(ns[cn].prototype, p); + + // Extend + if (s[5]) { + sp = t.resolve(s[5]).prototype; + scn = s[5].match(/\.(\w+)$/i)[1]; // Class name + + // Extend constructor + c = ns[cn]; + if (de) { + // Add passthrough constructor + ns[cn] = function() { + return sp[scn].apply(this, arguments); + }; + } else { + // Add inherit constructor + ns[cn] = function() { + this.parent = sp[scn]; + return c.apply(this, arguments); + }; + } + ns[cn].prototype[cn] = ns[cn]; + + // Add super methods + t.each(sp, function(f, n) { + ns[cn].prototype[n] = sp[n]; + }); + + // Add overridden methods + t.each(p, function(f, n) { + // Extend methods if needed + if (sp[n]) { + ns[cn].prototype[n] = function() { + this.parent = sp[n]; + return f.apply(this, arguments); + }; + } else { + if (n != cn) + ns[cn].prototype[n] = f; + } + }); + } + + // Add static methods + t.each(p['static'], function(f, n) { + ns[cn][n] = f; + }); + + if (this.onCreate) + this.onCreate(s[2], s[3], ns[cn].prototype); + }, + + walk : function(o, f, n, s) { + s = s || this; + + if (o) { + if (n) + o = o[n]; + + tinymce.each(o, function(o, i) { + if (f.call(s, o, i, n) === false) + return false; + + tinymce.walk(o, f, n, s); + }); + } + }, + + createNS : function(n, o) { + var i, v; + + o = o || win; + + n = n.split('.'); + for (i=0; i= items.length) { + for (i = 0, l = base.length; i < l; i++) { + if (i >= items.length || base[i] != items[i]) { + bp = i + 1; + break; + } + } + } + + if (base.length < items.length) { + for (i = 0, l = items.length; i < l; i++) { + if (i >= base.length || base[i] != items[i]) { + bp = i + 1; + break; + } + } + } + + if (bp == 1) + return path; + + for (i = 0, l = base.length - (bp - 1); i < l; i++) + out += "../"; + + for (i = bp - 1, l = items.length; i < l; i++) { + if (i != bp - 1) + out += "/" + items[i]; + else + out += items[i]; + } + + return out; + }, + + toAbsPath : function(base, path) { + var i, nb = 0, o = [], tr, outPath; + + // Split paths + tr = /\/$/.test(path) ? '/' : ''; + base = base.split('/'); + path = path.split('/'); + + // Remove empty chunks + each(base, function(k) { + if (k) + o.push(k); + }); + + base = o; + + // Merge relURLParts chunks + for (i = path.length - 1, o = []; i >= 0; i--) { + // Ignore empty or . + if (path[i].length == 0 || path[i] == ".") + continue; + + // Is parent + if (path[i] == '..') { + nb++; + continue; + } + + // Move up + if (nb > 0) { + nb--; + continue; + } + + o.push(path[i]); + } + + i = base.length - nb; + + // If /a/b/c or / + if (i <= 0) + outPath = o.reverse().join('/'); + else + outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/'); + + // Add front / if it's needed + if (outPath.indexOf('/') !== 0) + outPath = '/' + outPath; + + // Add traling / if it's needed + if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) + outPath += tr; + + return outPath; + }, + + getURI : function(nh) { + var s, t = this; + + // Rebuild source + if (!t.source || nh) { + s = ''; + + if (!nh) { + if (t.protocol) + s += t.protocol + '://'; + + if (t.userInfo) + s += t.userInfo + '@'; + + if (t.host) + s += t.host; + + if (t.port) + s += ':' + t.port; + } + + if (t.path) + s += t.path; + + if (t.query) + s += '?' + t.query; + + if (t.anchor) + s += '#' + t.anchor; + + t.source = s; + } + + return t.source; + } + }); +})(); + +(function() { + var each = tinymce.each; + + tinymce.create('static tinymce.util.Cookie', { + getHash : function(n) { + var v = this.get(n), h; + + if (v) { + each(v.split('&'), function(v) { + v = v.split('='); + h = h || {}; + h[unescape(v[0])] = unescape(v[1]); + }); + } + + return h; + }, + + setHash : function(n, v, e, p, d, s) { + var o = ''; + + each(v, function(v, k) { + o += (!o ? '' : '&') + escape(k) + '=' + escape(v); + }); + + this.set(n, o, e, p, d, s); + }, + + get : function(n) { + var c = document.cookie, e, p = n + "=", b; + + // Strict mode + if (!c) + return; + + b = c.indexOf("; " + p); + + if (b == -1) { + b = c.indexOf(p); + + if (b != 0) + return null; + } else + b += 2; + + e = c.indexOf(";", b); + + if (e == -1) + e = c.length; + + return unescape(c.substring(b + p.length, e)); + }, + + set : function(n, v, e, p, d, s) { + document.cookie = n + "=" + escape(v) + + ((e) ? "; expires=" + e.toGMTString() : "") + + ((p) ? "; path=" + escape(p) : "") + + ((d) ? "; domain=" + d : "") + + ((s) ? "; secure" : ""); + }, + + remove : function(n, p) { + var d = new Date(); + + d.setTime(d.getTime() - 1000); + + this.set(n, '', d, p, d); + } + }); +})(); + +tinymce.create('static tinymce.util.JSON', { + serialize : function(o) { + var i, v, s = tinymce.util.JSON.serialize, t; + + if (o == null) + return 'null'; + + t = typeof o; + + if (t == 'string') { + v = '\bb\tt\nn\ff\rr\""\'\'\\\\'; + + return '"' + o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g, function(a, b) { + i = v.indexOf(b); + + if (i + 1) + return '\\' + v.charAt(i + 1); + + a = b.charCodeAt().toString(16); + + return '\\u' + '0000'.substring(a.length) + a; + }) + '"'; + } + + if (t == 'object') { + if (o.hasOwnProperty && o instanceof Array) { + for (i=0, v = '['; i 0 ? ',' : '') + s(o[i]); + + return v + ']'; + } + + v = '{'; + + for (i in o) + v += typeof o[i] != 'function' ? (v.length > 1 ? ',"' : '"') + i + '":' + s(o[i]) : ''; + + return v + '}'; + } + + return '' + o; + }, + + parse : function(s) { + try { + return eval('(' + s + ')'); + } catch (ex) { + // Ignore + } + } + + }); + +tinymce.create('static tinymce.util.XHR', { + send : function(o) { + var x, t, w = window, c = 0; + + // Default settings + o.scope = o.scope || this; + o.success_scope = o.success_scope || o.scope; + o.error_scope = o.error_scope || o.scope; + o.async = o.async === false ? false : true; + o.data = o.data || ''; + + function get(s) { + x = 0; + + try { + x = new ActiveXObject(s); + } catch (ex) { + } + + return x; + }; + + x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Microsoft.XMLHTTP') || get('Msxml2.XMLHTTP'); + + if (x) { + if (x.overrideMimeType) + x.overrideMimeType(o.content_type); + + x.open(o.type || (o.data ? 'POST' : 'GET'), o.url, o.async); + + if (o.content_type) + x.setRequestHeader('Content-Type', o.content_type); + + x.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + + x.send(o.data); + + function ready() { + if (!o.async || x.readyState == 4 || c++ > 10000) { + if (o.success && c < 10000 && x.status == 200) + o.success.call(o.success_scope, '' + x.responseText, x, o); + else if (o.error) + o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o); + + x = null; + } else + w.setTimeout(ready, 10); + }; + + // Syncronous request + if (!o.async) + return ready(); + + // Wait for response, onReadyStateChange can not be used since it leaks memory in IE + t = w.setTimeout(ready, 10); + } + } +}); + +(function() { + var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR; + + tinymce.create('tinymce.util.JSONRequest', { + JSONRequest : function(s) { + this.settings = extend({ + }, s); + this.count = 0; + }, + + send : function(o) { + var ecb = o.error, scb = o.success; + + o = extend(this.settings, o); + + o.success = function(c, x) { + c = JSON.parse(c); + + if (typeof(c) == 'undefined') { + c = { + error : 'JSON Parse error.' + }; + } + + if (c.error) + ecb.call(o.error_scope || o.scope, c.error, x); + else + scb.call(o.success_scope || o.scope, c.result); + }; + + o.error = function(ty, x) { + ecb.call(o.error_scope || o.scope, ty, x); + }; + + o.data = JSON.serialize({ + id : o.id || 'c' + (this.count++), + method : o.method, + params : o.params + }); + + // JSON content type for Ruby on rails. Bug: #1883287 + o.content_type = 'application/json'; + + XHR.send(o); + }, + + 'static' : { + sendRPC : function(o) { + return new tinymce.util.JSONRequest().send(o); + } + } + }); +}()); +(function(tinymce) { + // Shorten names + var each = tinymce.each, + is = tinymce.is, + isWebKit = tinymce.isWebKit, + isIE = tinymce.isIE, + blockRe = /^(H[1-6R]|P|DIV|ADDRESS|PRE|FORM|T(ABLE|BODY|HEAD|FOOT|H|R|D)|LI|OL|UL|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|MENU|ISINDEX|SAMP)$/, + boolAttrs = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'), + mceAttribs = makeMap('src,href,style,coords,shape'), + encodedChars = {'&' : '&', '"' : '"', '<' : '<', '>' : '>'}, + encodeCharsRe = /[<>&\"]/g, + simpleSelectorRe = /^([a-z0-9],?)+$/i, + tagRegExp = /<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)(\s*\/?)>/g, + attrRegExp = /(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g; + + function makeMap(str) { + var map = {}, i; + + str = str.split(','); + for (i = str.length; i >= 0; i--) + map[str[i]] = 1; + + return map; + }; + + tinymce.create('tinymce.dom.DOMUtils', { + doc : null, + root : null, + files : null, + pixelStyles : /^(top|left|bottom|right|width|height|borderWidth)$/, + props : { + "for" : "htmlFor", + "class" : "className", + className : "className", + checked : "checked", + disabled : "disabled", + maxlength : "maxLength", + readonly : "readOnly", + selected : "selected", + value : "value", + id : "id", + name : "name", + type : "type" + }, + + DOMUtils : function(d, s) { + var t = this, globalStyle; + + t.doc = d; + t.win = window; + t.files = {}; + t.cssFlicker = false; + t.counter = 0; + t.stdMode = d.documentMode >= 8; + t.boxModel = !tinymce.isIE || d.compatMode == "CSS1Compat" || t.stdMode; + + t.settings = s = tinymce.extend({ + keep_values : false, + hex_colors : 1, + process_html : 1 + }, s); + + // Fix IE6SP2 flicker and check it failed for pre SP2 + if (tinymce.isIE6) { + try { + d.execCommand('BackgroundImageCache', false, true); + } catch (e) { + t.cssFlicker = true; + } + } + + // Build styles list + if (s.valid_styles) { + t._styles = {}; + + // Convert styles into a rule list + each(s.valid_styles, function(value, key) { + t._styles[key] = tinymce.explode(value); + }); + } + + tinymce.addUnload(t.destroy, t); + }, + + getRoot : function() { + var t = this, s = t.settings; + + return (s && t.get(s.root_element)) || t.doc.body; + }, + + getViewPort : function(w) { + var d, b; + + w = !w ? this.win : w; + d = w.document; + b = this.boxModel ? d.documentElement : d.body; + + // Returns viewport size excluding scrollbars + return { + x : w.pageXOffset || b.scrollLeft, + y : w.pageYOffset || b.scrollTop, + w : w.innerWidth || b.clientWidth, + h : w.innerHeight || b.clientHeight + }; + }, + + getRect : function(e) { + var p, t = this, sr; + + e = t.get(e); + p = t.getPos(e); + sr = t.getSize(e); + + return { + x : p.x, + y : p.y, + w : sr.w, + h : sr.h + }; + }, + + getSize : function(e) { + var t = this, w, h; + + e = t.get(e); + w = t.getStyle(e, 'width'); + h = t.getStyle(e, 'height'); + + // Non pixel value, then force offset/clientWidth + if (w.indexOf('px') === -1) + w = 0; + + // Non pixel value, then force offset/clientWidth + if (h.indexOf('px') === -1) + h = 0; + + return { + w : parseInt(w) || e.offsetWidth || e.clientWidth, + h : parseInt(h) || e.offsetHeight || e.clientHeight + }; + }, + + getParent : function(n, f, r) { + return this.getParents(n, f, r, false); + }, + + getParents : function(n, f, r, c) { + var t = this, na, se = t.settings, o = []; + + n = t.get(n); + c = c === undefined; + + if (se.strict_root) + r = r || t.getRoot(); + + // Wrap node name as func + if (is(f, 'string')) { + na = f; + + if (f === '*') { + f = function(n) {return n.nodeType == 1;}; + } else { + f = function(n) { + return t.is(n, na); + }; + } + } + + while (n) { + if (n == r || !n.nodeType || n.nodeType === 9) + break; + + if (!f || f(n)) { + if (c) + o.push(n); + else + return n; + } + + n = n.parentNode; + } + + return c ? o : null; + }, + + get : function(e) { + var n; + + if (e && this.doc && typeof(e) == 'string') { + n = e; + e = this.doc.getElementById(e); + + // IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick + if (e && e.id !== n) + return this.doc.getElementsByName(n)[1]; + } + + return e; + }, + + getNext : function(node, selector) { + return this._findSib(node, selector, 'nextSibling'); + }, + + getPrev : function(node, selector) { + return this._findSib(node, selector, 'previousSibling'); + }, + + + select : function(pa, s) { + var t = this; + + return tinymce.dom.Sizzle(pa, t.get(s) || t.get(t.settings.root_element) || t.doc, []); + }, + + is : function(n, selector) { + var i; + + // If it isn't an array then try to do some simple selectors instead of Sizzle for to boost performance + if (n.length === undefined) { + // Simple all selector + if (selector === '*') + return n.nodeType == 1; + + // Simple selector just elements + if (simpleSelectorRe.test(selector)) { + selector = selector.toLowerCase().split(/,/); + n = n.nodeName.toLowerCase(); + + for (i = selector.length - 1; i >= 0; i--) { + if (selector[i] == n) + return true; + } + + return false; + } + } + + return tinymce.dom.Sizzle.matches(selector, n.nodeType ? [n] : n).length > 0; + }, + + + add : function(p, n, a, h, c) { + var t = this; + + return this.run(p, function(p) { + var e, k; + + e = is(n, 'string') ? t.doc.createElement(n) : n; + t.setAttribs(e, a); + + if (h) { + if (h.nodeType) + e.appendChild(h); + else + t.setHTML(e, h); + } + + return !c ? p.appendChild(e) : e; + }); + }, + + create : function(n, a, h) { + return this.add(this.doc.createElement(n), n, a, h, 1); + }, + + createHTML : function(n, a, h) { + var o = '', t = this, k; + + o += '<' + n; + + for (k in a) { + if (a.hasOwnProperty(k)) + o += ' ' + k + '="' + t.encode(a[k]) + '"'; + } + + // A call to tinymce.is doesn't work for some odd reason on IE9 possible bug inside their JS runtime + if (typeof(h) != "undefined") + return o + '>' + h + ''; + + return o + ' />'; + }, + + remove : function(node, keep_children) { + return this.run(node, function(node) { + var parent, child; + + parent = node.parentNode; + + if (!parent) + return null; + + if (keep_children) { + while (child = node.firstChild) { + // IE 8 will crash if you don't remove completely empty text nodes + if (!tinymce.isIE || child.nodeType !== 3 || child.nodeValue) + parent.insertBefore(child, node); + else + node.removeChild(child); + } + } + + return parent.removeChild(node); + }); + }, + + setStyle : function(n, na, v) { + var t = this; + + return t.run(n, function(e) { + var s, i; + + s = e.style; + + // Camelcase it, if needed + na = na.replace(/-(\D)/g, function(a, b){ + return b.toUpperCase(); + }); + + // Default px suffix on these + if (t.pixelStyles.test(na) && (tinymce.is(v, 'number') || /^[\-0-9\.]+$/.test(v))) + v += 'px'; + + switch (na) { + case 'opacity': + // IE specific opacity + if (isIE) { + s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")"; + + if (!n.currentStyle || !n.currentStyle.hasLayout) + s.display = 'inline-block'; + } + + // Fix for older browsers + s[na] = s['-moz-opacity'] = s['-khtml-opacity'] = v || ''; + break; + + case 'float': + isIE ? s.styleFloat = v : s.cssFloat = v; + break; + + default: + s[na] = v || ''; + } + + // Force update of the style data + if (t.settings.update_styles) + t.setAttrib(e, '_mce_style'); + }); + }, + + getStyle : function(n, na, c) { + n = this.get(n); + + if (!n) + return false; + + // Gecko + if (this.doc.defaultView && c) { + // Remove camelcase + na = na.replace(/[A-Z]/g, function(a){ + return '-' + a; + }); + + try { + return this.doc.defaultView.getComputedStyle(n, null).getPropertyValue(na); + } catch (ex) { + // Old safari might fail + return null; + } + } + + // Camelcase it, if needed + na = na.replace(/-(\D)/g, function(a, b){ + return b.toUpperCase(); + }); + + if (na == 'float') + na = isIE ? 'styleFloat' : 'cssFloat'; + + // IE & Opera + if (n.currentStyle && c) + return n.currentStyle[na]; + + return n.style[na]; + }, + + setStyles : function(e, o) { + var t = this, s = t.settings, ol; + + ol = s.update_styles; + s.update_styles = 0; + + each(o, function(v, n) { + t.setStyle(e, n, v); + }); + + // Update style info + s.update_styles = ol; + if (s.update_styles) + t.setAttrib(e, s.cssText); + }, + + setAttrib : function(e, n, v) { + var t = this; + + // Whats the point + if (!e || !n) + return; + + // Strict XML mode + if (t.settings.strict) + n = n.toLowerCase(); + + return this.run(e, function(e) { + var s = t.settings; + + switch (n) { + case "style": + if (!is(v, 'string')) { + each(v, function(v, n) { + t.setStyle(e, n, v); + }); + + return; + } + + // No mce_style for elements with these since they might get resized by the user + if (s.keep_values) { + if (v && !t._isRes(v)) + e.setAttribute('_mce_style', v, 2); + else + e.removeAttribute('_mce_style', 2); + } + + e.style.cssText = v; + break; + + case "class": + e.className = v || ''; // Fix IE null bug + break; + + case "src": + case "href": + if (s.keep_values) { + if (s.url_converter) + v = s.url_converter.call(s.url_converter_scope || t, v, n, e); + + t.setAttrib(e, '_mce_' + n, v, 2); + } + + break; + + case "shape": + e.setAttribute('_mce_style', v); + break; + } + + if (is(v) && v !== null && v.length !== 0) + e.setAttribute(n, '' + v, 2); + else + e.removeAttribute(n, 2); + }); + }, + + setAttribs : function(e, o) { + var t = this; + + return this.run(e, function(e) { + each(o, function(v, n) { + t.setAttrib(e, n, v); + }); + }); + }, + + getAttrib : function(e, n, dv) { + var v, t = this; + + e = t.get(e); + + if (!e || e.nodeType !== 1) + return false; + + if (!is(dv)) + dv = ''; + + // Try the mce variant for these + if (/^(src|href|style|coords|shape)$/.test(n)) { + v = e.getAttribute("_mce_" + n); + + if (v) + return v; + } + + if (isIE && t.props[n]) { + v = e[t.props[n]]; + v = v && v.nodeValue ? v.nodeValue : v; + } + + if (!v) + v = e.getAttribute(n, 2); + + // Check boolean attribs + if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(n)) { + if (e[t.props[n]] === true && v === '') + return n; + + return v ? n : ''; + } + + // Inner input elements will override attributes on form elements + if (e.nodeName === "FORM" && e.getAttributeNode(n)) + return e.getAttributeNode(n).nodeValue; + + if (n === 'style') { + v = v || e.style.cssText; + + if (v) { + v = t.serializeStyle(t.parseStyle(v), e.nodeName); + + if (t.settings.keep_values && !t._isRes(v)) + e.setAttribute('_mce_style', v); + } + } + + // Remove Apple and WebKit stuff + if (isWebKit && n === "class" && v) + v = v.replace(/(apple|webkit)\-[a-z\-]+/gi, ''); + + // Handle IE issues + if (isIE) { + switch (n) { + case 'rowspan': + case 'colspan': + // IE returns 1 as default value + if (v === 1) + v = ''; + + break; + + case 'size': + // IE returns +0 as default value for size + if (v === '+0' || v === 20 || v === 0) + v = ''; + + break; + + case 'width': + case 'height': + case 'vspace': + case 'checked': + case 'disabled': + case 'readonly': + if (v === 0) + v = ''; + + break; + + case 'hspace': + // IE returns -1 as default value + if (v === -1) + v = ''; + + break; + + case 'maxlength': + case 'tabindex': + // IE returns default value + if (v === 32768 || v === 2147483647 || v === '32768') + v = ''; + + break; + + case 'multiple': + case 'compact': + case 'noshade': + case 'nowrap': + if (v === 65535) + return n; + + return dv; + + case 'shape': + v = v.toLowerCase(); + break; + + default: + // IE has odd anonymous function for event attributes + if (n.indexOf('on') === 0 && v) + v = tinymce._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, '$1', '' + v); + } + } + + return (v !== undefined && v !== null && v !== '') ? '' + v : dv; + }, + + getPos : function(n, ro) { + var t = this, x = 0, y = 0, e, d = t.doc, r; + + n = t.get(n); + ro = ro || d.body; + + if (n) { + // Use getBoundingClientRect on IE, Opera has it but it's not perfect + if (isIE && !t.stdMode) { + n = n.getBoundingClientRect(); + e = t.boxModel ? d.documentElement : d.body; + x = t.getStyle(t.select('html')[0], 'borderWidth'); // Remove border + x = (x == 'medium' || t.boxModel && !t.isIE6) && 2 || x; + + return {x : n.left + e.scrollLeft - x, y : n.top + e.scrollTop - x}; + } + + r = n; + while (r && r != ro && r.nodeType) { + x += r.offsetLeft || 0; + y += r.offsetTop || 0; + r = r.offsetParent; + } + + r = n.parentNode; + while (r && r != ro && r.nodeType) { + x -= r.scrollLeft || 0; + y -= r.scrollTop || 0; + r = r.parentNode; + } + } + + return {x : x, y : y}; + }, + + parseStyle : function(st) { + var t = this, s = t.settings, o = {}; + + if (!st) + return o; + + function compress(p, s, ot) { + var t, r, b, l; + + // Get values and check it it needs compressing + t = o[p + '-top' + s]; + if (!t) + return; + + r = o[p + '-right' + s]; + if (t != r) + return; + + b = o[p + '-bottom' + s]; + if (r != b) + return; + + l = o[p + '-left' + s]; + if (b != l) + return; + + // Compress + o[ot] = l; + delete o[p + '-top' + s]; + delete o[p + '-right' + s]; + delete o[p + '-bottom' + s]; + delete o[p + '-left' + s]; + }; + + function compress2(ta, a, b, c) { + var t; + + t = o[a]; + if (!t) + return; + + t = o[b]; + if (!t) + return; + + t = o[c]; + if (!t) + return; + + // Compress + o[ta] = o[a] + ' ' + o[b] + ' ' + o[c]; + delete o[a]; + delete o[b]; + delete o[c]; + }; + + st = st.replace(/&(#?[a-z0-9]+);/g, '&$1_MCE_SEMI_'); // Protect entities + + each(st.split(';'), function(v) { + var sv, ur = []; + + if (v) { + v = v.replace(/_MCE_SEMI_/g, ';'); // Restore entities + v = v.replace(/url\([^\)]+\)/g, function(v) {ur.push(v);return 'url(' + ur.length + ')';}); + v = v.split(':'); + sv = tinymce.trim(v[1]); + sv = sv.replace(/url\(([^\)]+)\)/g, function(a, b) {return ur[parseInt(b) - 1];}); + + sv = sv.replace(/rgb\([^\)]+\)/g, function(v) { + return t.toHex(v); + }); + + if (s.url_converter) { + sv = sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g, function(x, c) { + return 'url(' + s.url_converter.call(s.url_converter_scope || t, t.decode(c), 'style', null) + ')'; + }); + } + + o[tinymce.trim(v[0]).toLowerCase()] = sv; + } + }); + + compress("border", "", "border"); + compress("border", "-width", "border-width"); + compress("border", "-color", "border-color"); + compress("border", "-style", "border-style"); + compress("padding", "", "padding"); + compress("margin", "", "margin"); + compress2('border', 'border-width', 'border-style', 'border-color'); + + if (isIE) { + // Remove pointless border + if (o.border == 'medium none') + o.border = ''; + } + + return o; + }, + + serializeStyle : function(o, name) { + var t = this, s = ''; + + function add(v, k) { + if (k && v) { + // Remove browser specific styles like -moz- or -webkit- + if (k.indexOf('-') === 0) + return; + + switch (k) { + case 'font-weight': + // Opera will output bold as 700 + if (v == 700) + v = 'bold'; + + break; + + case 'color': + case 'background-color': + v = v.toLowerCase(); + break; + } + + s += (s ? ' ' : '') + k + ': ' + v + ';'; + } + }; + + // Validate style output + if (name && t._styles) { + each(t._styles['*'], function(name) { + add(o[name], name); + }); + + each(t._styles[name.toLowerCase()], function(name) { + add(o[name], name); + }); + } else + each(o, add); + + return s; + }, + + loadCSS : function(u) { + var t = this, d = t.doc, head; + + if (!u) + u = ''; + + head = t.select('head')[0]; + + each(u.split(','), function(u) { + var link; + + if (t.files[u]) + return; + + t.files[u] = true; + link = t.create('link', {rel : 'stylesheet', href : tinymce._addVer(u)}); + + // IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug + // This fix seems to resolve that issue by realcing the document ones a stylesheet finishes loading + // It's ugly but it seems to work fine. + if (isIE && d.documentMode && d.recalc) { + link.onload = function() { + d.recalc(); + link.onload = null; + }; + } + + head.appendChild(link); + }); + }, + + addClass : function(e, c) { + return this.run(e, function(e) { + var o; + + if (!c) + return 0; + + if (this.hasClass(e, c)) + return e.className; + + o = this.removeClass(e, c); + + return e.className = (o != '' ? (o + ' ') : '') + c; + }); + }, + + removeClass : function(e, c) { + var t = this, re; + + return t.run(e, function(e) { + var v; + + if (t.hasClass(e, c)) { + if (!re) + re = new RegExp("(^|\\s+)" + c + "(\\s+|$)", "g"); + + v = e.className.replace(re, ' '); + v = tinymce.trim(v != ' ' ? v : ''); + + e.className = v; + + // Empty class attr + if (!v) { + e.removeAttribute('class'); + e.removeAttribute('className'); + } + + return v; + } + + return e.className; + }); + }, + + hasClass : function(n, c) { + n = this.get(n); + + if (!n || !c) + return false; + + return (' ' + n.className + ' ').indexOf(' ' + c + ' ') !== -1; + }, + + show : function(e) { + return this.setStyle(e, 'display', 'block'); + }, + + hide : function(e) { + return this.setStyle(e, 'display', 'none'); + }, + + isHidden : function(e) { + e = this.get(e); + + return !e || e.style.display == 'none' || this.getStyle(e, 'display') == 'none'; + }, + + uniqueId : function(p) { + return (!p ? 'mce_' : p) + (this.counter++); + }, + + setHTML : function(e, h) { + var t = this; + + return this.run(e, function(e) { + var x, i, nl, n, p, x; + + h = t.processHTML(h); + + if (isIE) { + function set() { + // Remove all child nodes + while (e.firstChild) + e.firstChild.removeNode(); + + try { + // IE will remove comments from the beginning + // unless you padd the contents with something + e.innerHTML = '
' + h; + e.removeChild(e.firstChild); + } catch (ex) { + // IE sometimes produces an unknown runtime error on innerHTML if it's an block element within a block element for example a div inside a p + // This seems to fix this problem + + // Create new div with HTML contents and a BR infront to keep comments + x = t.create('div'); + x.innerHTML = '
' + h; + + // Add all children from div to target + each (x.childNodes, function(n, i) { + // Skip br element + if (i) + e.appendChild(n); + }); + } + }; + + // IE has a serious bug when it comes to paragraphs it can produce an invalid + // DOM tree if contents like this

  • Item 1

is inserted + // It seems to be that IE doesn't like a root block element placed inside another root block element + if (t.settings.fix_ie_paragraphs) + h = h.replace(/

<\/p>|]+)><\/p>|/gi, ' 

'); + + set(); + + if (t.settings.fix_ie_paragraphs) { + // Check for odd paragraphs this is a sign of a broken DOM + nl = e.getElementsByTagName("p"); + for (i = nl.length - 1, x = 0; i >= 0; i--) { + n = nl[i]; + + if (!n.hasChildNodes()) { + if (!n._mce_keep) { + x = 1; // Is broken + break; + } + + n.removeAttribute('_mce_keep'); + } + } + } + + // Time to fix the madness IE left us + if (x) { + // So if we replace the p elements with divs and mark them and then replace them back to paragraphs + // after we use innerHTML we can fix the DOM tree + h = h.replace(/

]+)>|

/ig, '

'); + h = h.replace(/<\/p>/gi, '
'); + + // Set the new HTML with DIVs + set(); + + // Replace all DIV elements with the _mce_tmp attibute back to paragraphs + // This is needed since IE has a annoying bug see above for details + // This is a slow process but it has to be done. :( + if (t.settings.fix_ie_paragraphs) { + nl = e.getElementsByTagName("DIV"); + for (i = nl.length - 1; i >= 0; i--) { + n = nl[i]; + + // Is it a temp div + if (n._mce_tmp) { + // Create new paragraph + p = t.doc.createElement('p'); + + // Copy all attributes + n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi, function(a, b) { + var v; + + if (b !== '_mce_tmp') { + v = n.getAttribute(b); + + if (!v && b === 'class') + v = n.className; + + p.setAttribute(b, v); + } + }); + + // Append all children to new paragraph + for (x = 0; x]+)\/>|/gi, '', h); // Force open + + // Store away src and href in _mce_src and mce_href since browsers mess them up + if (s.keep_values) { + // Wrap scripts and styles in comments for serialization purposes + if (/)/g, '\n'); + s = s.replace(/^[\r\n]*|[\r\n]*$/g, ''); + s = s.replace(/^\s*(\/\/\s*|\]\]>|-->|\]\]-->)\s*$/g, ''); + + return s; + }; + + // Wrap the script contents in CDATA and keep them from executing + h = h.replace(/]+|)>([\s\S]*?)<\/script>/gi, function(v, attribs, text) { + // Force type attribute + if (!attribs) + attribs = ' type="text/javascript"'; + + // Convert the src attribute of the scripts + attribs = attribs.replace(/src=\"([^\"]+)\"?/i, function(a, url) { + if (s.url_converter) + url = t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(url), 'src', 'script')); + + return '_mce_src="' + url + '"'; + }); + + // Wrap text contents + if (tinymce.trim(text)) { + codeBlocks.push(trim(text)); + text = ''; + } + + return '' + text + ''; + }); + + // Wrap style elements + h = h.replace(/]+|)>([\s\S]*?)<\/style>/gi, function(v, attribs, text) { + // Wrap text contents + if (text) { + codeBlocks.push(trim(text)); + text = ''; + } + + return '' + text + ''; + }); + + // Wrap noscript elements + h = h.replace(/]+|)>([\s\S]*?)<\/noscript>/g, function(v, attribs, text) { + return ''; + }); + } + + h = tinymce._replace(//g, '', h); + + // This function processes the attributes in the HTML string to force boolean + // attributes to the attr="attr" format and convert style, src and href to _mce_ versions + function processTags(html) { + return html.replace(tagRegExp, function(match, elm_name, attrs, end) { + return '<' + elm_name + attrs.replace(attrRegExp, function(match, name, value, val2, val3) { + var mceValue; + + name = name.toLowerCase(); + value = value || val2 || val3 || ""; + + // Treat boolean attributes + if (boolAttrs[name]) { + // false or 0 is treated as a missing attribute + if (value === 'false' || value === '0') + return; + + return name + '="' + name + '"'; + } + + // Is attribute one that needs special treatment + if (mceAttribs[name] && attrs.indexOf('_mce_' + name) == -1) { + mceValue = t.decode(value); + + // Convert URLs to relative/absolute ones + if (s.url_converter && (name == "src" || name == "href")) + mceValue = s.url_converter.call(s.url_converter_scope || t, mceValue, name, elm_name); + + // Process styles lowercases them and compresses them + if (name == 'style') + mceValue = t.serializeStyle(t.parseStyle(mceValue), name); + + return name + '="' + value + '"' + ' _mce_' + name + '="' + t.encode(mceValue) + '"'; + } + + return match; + }) + end + '>'; + }); + }; + + h = processTags(h); + + // Restore script blocks + h = h.replace(/MCE_SCRIPT:([0-9]+)/g, function(val, idx) { + return codeBlocks[idx]; + }); + } + + return h; + }, + + getOuterHTML : function(e) { + var d; + + e = this.get(e); + + if (!e) + return null; + + if (e.outerHTML !== undefined) + return e.outerHTML; + + d = (e.ownerDocument || this.doc).createElement("body"); + d.appendChild(e.cloneNode(true)); + + return d.innerHTML; + }, + + setOuterHTML : function(e, h, d) { + var t = this; + + function setHTML(e, h, d) { + var n, tp; + + tp = d.createElement("body"); + tp.innerHTML = h; + + n = tp.lastChild; + while (n) { + t.insertAfter(n.cloneNode(true), e); + n = n.previousSibling; + } + + t.remove(e); + }; + + return this.run(e, function(e) { + e = t.get(e); + + // Only set HTML on elements + if (e.nodeType == 1) { + d = d || e.ownerDocument || t.doc; + + if (isIE) { + try { + // Try outerHTML for IE it sometimes produces an unknown runtime error + if (isIE && e.nodeType == 1) + e.outerHTML = h; + else + setHTML(e, h, d); + } catch (ex) { + // Fix for unknown runtime error + setHTML(e, h, d); + } + } else + setHTML(e, h, d); + } + }); + }, + + decode : function(s) { + var e, n, v; + + // Look for entities to decode + if (/&[\w#]+;/.test(s)) { + // Decode the entities using a div element not super efficient but less code + e = this.doc.createElement("div"); + e.innerHTML = s; + n = e.firstChild; + v = ''; + + if (n) { + do { + v += n.nodeValue; + } while (n = n.nextSibling); + } + + return v || s; + } + + return s; + }, + + encode : function(str) { + return ('' + str).replace(encodeCharsRe, function(chr) { + return encodedChars[chr]; + }); + }, + + insertAfter : function(node, reference_node) { + reference_node = this.get(reference_node); + + return this.run(node, function(node) { + var parent, nextSibling; + + parent = reference_node.parentNode; + nextSibling = reference_node.nextSibling; + + if (nextSibling) + parent.insertBefore(node, nextSibling); + else + parent.appendChild(node); + + return node; + }); + }, + + isBlock : function(n) { + if (n.nodeType && n.nodeType !== 1) + return false; + + n = n.nodeName || n; + + return blockRe.test(n); + }, + + replace : function(n, o, k) { + var t = this; + + if (is(o, 'array')) + n = n.cloneNode(true); + + return t.run(o, function(o) { + if (k) { + each(tinymce.grep(o.childNodes), function(c) { + n.appendChild(c); + }); + } + + return o.parentNode.replaceChild(n, o); + }); + }, + + rename : function(elm, name) { + var t = this, newElm; + + if (elm.nodeName != name.toUpperCase()) { + // Rename block element + newElm = t.create(name); + + // Copy attribs to new block + each(t.getAttribs(elm), function(attr_node) { + t.setAttrib(newElm, attr_node.nodeName, t.getAttrib(elm, attr_node.nodeName)); + }); + + // Replace block + t.replace(newElm, elm, 1); + } + + return newElm || elm; + }, + + findCommonAncestor : function(a, b) { + var ps = a, pe; + + while (ps) { + pe = b; + + while (pe && ps != pe) + pe = pe.parentNode; + + if (ps == pe) + break; + + ps = ps.parentNode; + } + + if (!ps && a.ownerDocument) + return a.ownerDocument.documentElement; + + return ps; + }, + + toHex : function(s) { + var c = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s); + + function hex(s) { + s = parseInt(s).toString(16); + + return s.length > 1 ? s : '0' + s; // 0 -> 00 + }; + + if (c) { + s = '#' + hex(c[1]) + hex(c[2]) + hex(c[3]); + + return s; + } + + return s; + }, + + getClasses : function() { + var t = this, cl = [], i, lo = {}, f = t.settings.class_filter, ov; + + if (t.classes) + return t.classes; + + function addClasses(s) { + // IE style imports + each(s.imports, function(r) { + addClasses(r); + }); + + each(s.cssRules || s.rules, function(r) { + // Real type or fake it on IE + switch (r.type || 1) { + // Rule + case 1: + if (r.selectorText) { + each(r.selectorText.split(','), function(v) { + v = v.replace(/^\s*|\s*$|^\s\./g, ""); + + // Is internal or it doesn't contain a class + if (/\.mce/.test(v) || !/\.[\w\-]+$/.test(v)) + return; + + // Remove everything but class name + ov = v; + v = tinymce._replace(/.*\.([a-z0-9_\-]+).*/i, '$1', v); + + // Filter classes + if (f && !(v = f(v, ov))) + return; + + if (!lo[v]) { + cl.push({'class' : v}); + lo[v] = 1; + } + }); + } + break; + + // Import + case 3: + addClasses(r.styleSheet); + break; + } + }); + }; + + try { + each(t.doc.styleSheets, addClasses); + } catch (ex) { + // Ignore + } + + if (cl.length > 0) + t.classes = cl; + + return cl; + }, + + run : function(e, f, s) { + var t = this, o; + + if (t.doc && typeof(e) === 'string') + e = t.get(e); + + if (!e) + return false; + + s = s || this; + if (!e.nodeType && (e.length || e.length === 0)) { + o = []; + + each(e, function(e, i) { + if (e) { + if (typeof(e) == 'string') + e = t.doc.getElementById(e); + + o.push(f.call(s, e, i)); + } + }); + + return o; + } + + return f.call(s, e); + }, + + getAttribs : function(n) { + var o; + + n = this.get(n); + + if (!n) + return []; + + if (isIE) { + o = []; + + // Object will throw exception in IE + if (n.nodeName == 'OBJECT') + return n.attributes; + + // IE doesn't keep the selected attribute if you clone option elements + if (n.nodeName === 'OPTION' && this.getAttrib(n, 'selected')) + o.push({specified : 1, nodeName : 'selected'}); + + // It's crazy that this is faster in IE but it's because it returns all attributes all the time + n.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi, '').replace(/[\w:\-]+/gi, function(a) { + o.push({specified : 1, nodeName : a}); + }); + + return o; + } + + return n.attributes; + }, + + destroy : function(s) { + var t = this; + + if (t.events) + t.events.destroy(); + + t.win = t.doc = t.root = t.events = null; + + // Manual destroy then remove unload handler + if (!s) + tinymce.removeUnload(t.destroy); + }, + + createRng : function() { + var d = this.doc; + + return d.createRange ? d.createRange() : new tinymce.dom.Range(this); + }, + + nodeIndex : function(node, normalized) { + var idx = 0, lastNodeType, lastNode, nodeType; + + if (node) { + for (lastNodeType = node.nodeType, node = node.previousSibling, lastNode = node; node; node = node.previousSibling) { + nodeType = node.nodeType; + + // Normalize text nodes + if (normalized && nodeType == 3) { + if (nodeType == lastNodeType || !node.nodeValue.length) + continue; + } + + idx++; + lastNodeType = nodeType; + } + } + + return idx; + }, + + split : function(pe, e, re) { + var t = this, r = t.createRng(), bef, aft, pa; + + // W3C valid browsers tend to leave empty nodes to the left/right side of the contents, this makes sense + // but we don't want that in our code since it serves no purpose for the end user + // For example if this is chopped: + //

text 1CHOPtext 2

+ // would produce: + //

text 1

CHOP

text 2

+ // this function will then trim of empty edges and produce: + //

text 1

CHOP

text 2

+ function trim(node) { + var i, children = node.childNodes; + + if (node.nodeType == 1 && node.getAttribute('_mce_type') == 'bookmark') + return; + + for (i = children.length - 1; i >= 0; i--) + trim(children[i]); + + if (node.nodeType != 9) { + // Keep non whitespace text nodes + if (node.nodeType == 3 && node.nodeValue.length > 0) { + // If parent element isn't a block or there isn't any useful contents for example "

" + if (!t.isBlock(node.parentNode) || tinymce.trim(node.nodeValue).length > 0) + return; + } + + if (node.nodeType == 1) { + // If the only child is a bookmark then move it up + children = node.childNodes; + if (children.length == 1 && children[0] && children[0].nodeType == 1 && children[0].getAttribute('_mce_type') == 'bookmark') + node.parentNode.insertBefore(children[0], node); + + // Keep non empty elements or img, hr etc + if (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) + return; + } + + t.remove(node); + } + + return node; + }; + + if (pe && e) { + // Get before chunk + r.setStart(pe.parentNode, t.nodeIndex(pe)); + r.setEnd(e.parentNode, t.nodeIndex(e)); + bef = r.extractContents(); + + // Get after chunk + r = t.createRng(); + r.setStart(e.parentNode, t.nodeIndex(e) + 1); + r.setEnd(pe.parentNode, t.nodeIndex(pe) + 1); + aft = r.extractContents(); + + // Insert before chunk + pa = pe.parentNode; + pa.insertBefore(trim(bef), pe); + + // Insert middle chunk + if (re) + pa.replaceChild(re, e); + else + pa.insertBefore(e, pe); + + // Insert after chunk + pa.insertBefore(trim(aft), pe); + t.remove(pe); + + return re || e; + } + }, + + bind : function(target, name, func, scope) { + var t = this; + + if (!t.events) + t.events = new tinymce.dom.EventUtils(); + + return t.events.add(target, name, func, scope || this); + }, + + unbind : function(target, name, func) { + var t = this; + + if (!t.events) + t.events = new tinymce.dom.EventUtils(); + + return t.events.remove(target, name, func); + }, + + + _findSib : function(node, selector, name) { + var t = this, f = selector; + + if (node) { + // If expression make a function of it using is + if (is(f, 'string')) { + f = function(node) { + return t.is(node, selector); + }; + } + + // Loop all siblings + for (node = node[name]; node; node = node[name]) { + if (f(node)) + return node; + } + } + + return null; + }, + + _isRes : function(c) { + // Is live resizble element + return /^(top|left|bottom|right|width|height)/i.test(c) || /;\s*(top|left|bottom|right|width|height)/i.test(c); + } + + /* + walk : function(n, f, s) { + var d = this.doc, w; + + if (d.createTreeWalker) { + w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); + + while ((n = w.nextNode()) != null) + f.call(s || this, n); + } else + tinymce.walk(n, f, 'childNodes', s); + } + */ + + /* + toRGB : function(s) { + var c = /^\s*?#([0-9A-F]{2})([0-9A-F]{1,2})([0-9A-F]{2})?\s*?$/.exec(s); + + if (c) { + // #FFF -> #FFFFFF + if (!is(c[3])) + c[3] = c[2] = c[1]; + + return "rgb(" + parseInt(c[1], 16) + "," + parseInt(c[2], 16) + "," + parseInt(c[3], 16) + ")"; + } + + return s; + } + */ + }); + + tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0}); +})(tinymce); + +(function(ns) { + // Range constructor + function Range(dom) { + var t = this, + doc = dom.doc, + EXTRACT = 0, + CLONE = 1, + DELETE = 2, + TRUE = true, + FALSE = false, + START_OFFSET = 'startOffset', + START_CONTAINER = 'startContainer', + END_CONTAINER = 'endContainer', + END_OFFSET = 'endOffset', + extend = tinymce.extend, + nodeIndex = dom.nodeIndex; + + extend(t, { + // Inital states + startContainer : doc, + startOffset : 0, + endContainer : doc, + endOffset : 0, + collapsed : TRUE, + commonAncestorContainer : doc, + + // Range constants + START_TO_START : 0, + START_TO_END : 1, + END_TO_END : 2, + END_TO_START : 3, + + // Public methods + setStart : setStart, + setEnd : setEnd, + setStartBefore : setStartBefore, + setStartAfter : setStartAfter, + setEndBefore : setEndBefore, + setEndAfter : setEndAfter, + collapse : collapse, + selectNode : selectNode, + selectNodeContents : selectNodeContents, + compareBoundaryPoints : compareBoundaryPoints, + deleteContents : deleteContents, + extractContents : extractContents, + cloneContents : cloneContents, + insertNode : insertNode, + surroundContents : surroundContents, + cloneRange : cloneRange + }); + + function setStart(n, o) { + _setEndPoint(TRUE, n, o); + }; + + function setEnd(n, o) { + _setEndPoint(FALSE, n, o); + }; + + function setStartBefore(n) { + setStart(n.parentNode, nodeIndex(n)); + }; + + function setStartAfter(n) { + setStart(n.parentNode, nodeIndex(n) + 1); + }; + + function setEndBefore(n) { + setEnd(n.parentNode, nodeIndex(n)); + }; + + function setEndAfter(n) { + setEnd(n.parentNode, nodeIndex(n) + 1); + }; + + function collapse(ts) { + if (ts) { + t[END_CONTAINER] = t[START_CONTAINER]; + t[END_OFFSET] = t[START_OFFSET]; + } else { + t[START_CONTAINER] = t[END_CONTAINER]; + t[START_OFFSET] = t[END_OFFSET]; + } + + t.collapsed = TRUE; + }; + + function selectNode(n) { + setStartBefore(n); + setEndAfter(n); + }; + + function selectNodeContents(n) { + setStart(n, 0); + setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length); + }; + + function compareBoundaryPoints(h, r) { + var sc = t[START_CONTAINER], so = t[START_OFFSET], ec = t[END_CONTAINER], eo = t[END_OFFSET]; + + // Check START_TO_START + if (h === 0) + return _compareBoundaryPoints(sc, so, sc, so); + + // Check START_TO_END + if (h === 1) + return _compareBoundaryPoints(sc, so, ec, eo); + + // Check END_TO_END + if (h === 2) + return _compareBoundaryPoints(ec, eo, ec, eo); + + // Check END_TO_START + if (h === 3) + return _compareBoundaryPoints(ec, eo, sc, so); + }; + + function deleteContents() { + _traverse(DELETE); + }; + + function extractContents() { + return _traverse(EXTRACT); + }; + + function cloneContents() { + return _traverse(CLONE); + }; + + function insertNode(n) { + var startContainer = this[START_CONTAINER], + startOffset = this[START_OFFSET], nn, o; + + // Node is TEXT_NODE or CDATA + if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) { + if (!startOffset) { + // At the start of text + startContainer.parentNode.insertBefore(n, startContainer); + } else if (startOffset >= startContainer.nodeValue.length) { + // At the end of text + dom.insertAfter(n, startContainer); + } else { + // Middle, need to split + nn = startContainer.splitText(startOffset); + startContainer.parentNode.insertBefore(n, nn); + } + } else { + // Insert element node + if (startContainer.childNodes.length > 0) + o = startContainer.childNodes[startOffset]; + + if (o) + startContainer.insertBefore(n, o); + else + startContainer.appendChild(n); + } + }; + + function surroundContents(n) { + var f = t.extractContents(); + + t.insertNode(n); + n.appendChild(f); + t.selectNode(n); + }; + + function cloneRange() { + return extend(new Range(dom), { + startContainer : t[START_CONTAINER], + startOffset : t[START_OFFSET], + endContainer : t[END_CONTAINER], + endOffset : t[END_OFFSET], + collapsed : t.collapsed, + commonAncestorContainer : t.commonAncestorContainer + }); + }; + + // Private methods + + function _getSelectedNode(container, offset) { + var child; + + if (container.nodeType == 3 /* TEXT_NODE */) + return container; + + if (offset < 0) + return container; + + child = container.firstChild; + while (child && offset > 0) { + --offset; + child = child.nextSibling; + } + + if (child) + return child; + + return container; + }; + + function _isCollapsed() { + return (t[START_CONTAINER] == t[END_CONTAINER] && t[START_OFFSET] == t[END_OFFSET]); + }; + + function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) { + var c, offsetC, n, cmnRoot, childA, childB; + + // In the first case the boundary-points have the same container. A is before B + // if its offset is less than the offset of B, A is equal to B if its offset is + // equal to the offset of B, and A is after B if its offset is greater than the + // offset of B. + if (containerA == containerB) { + if (offsetA == offsetB) + return 0; // equal + + if (offsetA < offsetB) + return -1; // before + + return 1; // after + } + + // In the second case a child node C of the container of A is an ancestor + // container of B. In this case, A is before B if the offset of A is less than or + // equal to the index of the child node C and A is after B otherwise. + c = containerB; + while (c && c.parentNode != containerA) + c = c.parentNode; + + if (c) { + offsetC = 0; + n = containerA.firstChild; + + while (n != c && offsetC < offsetA) { + offsetC++; + n = n.nextSibling; + } + + if (offsetA <= offsetC) + return -1; // before + + return 1; // after + } + + // In the third case a child node C of the container of B is an ancestor container + // of A. In this case, A is before B if the index of the child node C is less than + // the offset of B and A is after B otherwise. + c = containerA; + while (c && c.parentNode != containerB) { + c = c.parentNode; + } + + if (c) { + offsetC = 0; + n = containerB.firstChild; + + while (n != c && offsetC < offsetB) { + offsetC++; + n = n.nextSibling; + } + + if (offsetC < offsetB) + return -1; // before + + return 1; // after + } + + // In the fourth case, none of three other cases hold: the containers of A and B + // are siblings or descendants of sibling nodes. In this case, A is before B if + // the container of A is before the container of B in a pre-order traversal of the + // Ranges' context tree and A is after B otherwise. + cmnRoot = dom.findCommonAncestor(containerA, containerB); + childA = containerA; + + while (childA && childA.parentNode != cmnRoot) + childA = childA.parentNode; + + if (!childA) + childA = cmnRoot; + + childB = containerB; + while (childB && childB.parentNode != cmnRoot) + childB = childB.parentNode; + + if (!childB) + childB = cmnRoot; + + if (childA == childB) + return 0; // equal + + n = cmnRoot.firstChild; + while (n) { + if (n == childA) + return -1; // before + + if (n == childB) + return 1; // after + + n = n.nextSibling; + } + }; + + function _setEndPoint(st, n, o) { + var ec, sc; + + if (st) { + t[START_CONTAINER] = n; + t[START_OFFSET] = o; + } else { + t[END_CONTAINER] = n; + t[END_OFFSET] = o; + } + + // If one boundary-point of a Range is set to have a root container + // other than the current one for the Range, the Range is collapsed to + // the new position. This enforces the restriction that both boundary- + // points of a Range must have the same root container. + ec = t[END_CONTAINER]; + while (ec.parentNode) + ec = ec.parentNode; + + sc = t[START_CONTAINER]; + while (sc.parentNode) + sc = sc.parentNode; + + if (sc == ec) { + // The start position of a Range is guaranteed to never be after the + // end position. To enforce this restriction, if the start is set to + // be at a position after the end, the Range is collapsed to that + // position. + if (_compareBoundaryPoints(t[START_CONTAINER], t[START_OFFSET], t[END_CONTAINER], t[END_OFFSET]) > 0) + t.collapse(st); + } else + t.collapse(st); + + t.collapsed = _isCollapsed(); + t.commonAncestorContainer = dom.findCommonAncestor(t[START_CONTAINER], t[END_CONTAINER]); + }; + + function _traverse(how) { + var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep; + + if (t[START_CONTAINER] == t[END_CONTAINER]) + return _traverseSameContainer(how); + + for (c = t[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { + if (p == t[START_CONTAINER]) + return _traverseCommonStartContainer(c, how); + + ++endContainerDepth; + } + + for (c = t[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { + if (p == t[END_CONTAINER]) + return _traverseCommonEndContainer(c, how); + + ++startContainerDepth; + } + + depthDiff = startContainerDepth - endContainerDepth; + + startNode = t[START_CONTAINER]; + while (depthDiff > 0) { + startNode = startNode.parentNode; + depthDiff--; + } + + endNode = t[END_CONTAINER]; + while (depthDiff < 0) { + endNode = endNode.parentNode; + depthDiff++; + } + + // ascend the ancestor hierarchy until we have a common parent. + for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) { + startNode = sp; + endNode = ep; + } + + return _traverseCommonAncestors(startNode, endNode, how); + }; + + function _traverseSameContainer(how) { + var frag, s, sub, n, cnt, sibling, xferNode; + + if (how != DELETE) + frag = doc.createDocumentFragment(); + + // If selection is empty, just return the fragment + if (t[START_OFFSET] == t[END_OFFSET]) + return frag; + + // Text node needs special case handling + if (t[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) { + // get the substring + s = t[START_CONTAINER].nodeValue; + sub = s.substring(t[START_OFFSET], t[END_OFFSET]); + + // set the original text node to its new value + if (how != CLONE) { + t[START_CONTAINER].deleteData(t[START_OFFSET], t[END_OFFSET] - t[START_OFFSET]); + + // Nothing is partially selected, so collapse to start point + t.collapse(TRUE); + } + + if (how == DELETE) + return; + + frag.appendChild(doc.createTextNode(sub)); + return frag; + } + + // Copy nodes between the start/end offsets. + n = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]); + cnt = t[END_OFFSET] - t[START_OFFSET]; + + while (cnt > 0) { + sibling = n.nextSibling; + xferNode = _traverseFullySelected(n, how); + + if (frag) + frag.appendChild( xferNode ); + + --cnt; + n = sibling; + } + + // Nothing is partially selected, so collapse to start point + if (how != CLONE) + t.collapse(TRUE); + + return frag; + }; + + function _traverseCommonStartContainer(endAncestor, how) { + var frag, n, endIdx, cnt, sibling, xferNode; + + if (how != DELETE) + frag = doc.createDocumentFragment(); + + n = _traverseRightBoundary(endAncestor, how); + + if (frag) + frag.appendChild(n); + + endIdx = nodeIndex(endAncestor); + cnt = endIdx - t[START_OFFSET]; + + if (cnt <= 0) { + // Collapse to just before the endAncestor, which + // is partially selected. + if (how != CLONE) { + t.setEndBefore(endAncestor); + t.collapse(FALSE); + } + + return frag; + } + + n = endAncestor.previousSibling; + while (cnt > 0) { + sibling = n.previousSibling; + xferNode = _traverseFullySelected(n, how); + + if (frag) + frag.insertBefore(xferNode, frag.firstChild); + + --cnt; + n = sibling; + } + + // Collapse to just before the endAncestor, which + // is partially selected. + if (how != CLONE) { + t.setEndBefore(endAncestor); + t.collapse(FALSE); + } + + return frag; + }; + + function _traverseCommonEndContainer(startAncestor, how) { + var frag, startIdx, n, cnt, sibling, xferNode; + + if (how != DELETE) + frag = doc.createDocumentFragment(); + + n = _traverseLeftBoundary(startAncestor, how); + if (frag) + frag.appendChild(n); + + startIdx = nodeIndex(startAncestor); + ++startIdx; // Because we already traversed it.... + + cnt = t[END_OFFSET] - startIdx; + n = startAncestor.nextSibling; + while (cnt > 0) { + sibling = n.nextSibling; + xferNode = _traverseFullySelected(n, how); + + if (frag) + frag.appendChild(xferNode); + + --cnt; + n = sibling; + } + + if (how != CLONE) { + t.setStartAfter(startAncestor); + t.collapse(TRUE); + } + + return frag; + }; + + function _traverseCommonAncestors(startAncestor, endAncestor, how) { + var n, frag, commonParent, startOffset, endOffset, cnt, sibling, nextSibling; + + if (how != DELETE) + frag = doc.createDocumentFragment(); + + n = _traverseLeftBoundary(startAncestor, how); + if (frag) + frag.appendChild(n); + + commonParent = startAncestor.parentNode; + startOffset = nodeIndex(startAncestor); + endOffset = nodeIndex(endAncestor); + ++startOffset; + + cnt = endOffset - startOffset; + sibling = startAncestor.nextSibling; + + while (cnt > 0) { + nextSibling = sibling.nextSibling; + n = _traverseFullySelected(sibling, how); + + if (frag) + frag.appendChild(n); + + sibling = nextSibling; + --cnt; + } + + n = _traverseRightBoundary(endAncestor, how); + + if (frag) + frag.appendChild(n); + + if (how != CLONE) { + t.setStartAfter(startAncestor); + t.collapse(TRUE); + } + + return frag; + }; + + function _traverseRightBoundary(root, how) { + var next = _getSelectedNode(t[END_CONTAINER], t[END_OFFSET] - 1), parent, clonedParent, prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != t[END_CONTAINER]; + + if (next == root) + return _traverseNode(next, isFullySelected, FALSE, how); + + parent = next.parentNode; + clonedParent = _traverseNode(parent, FALSE, FALSE, how); + + while (parent) { + while (next) { + prevSibling = next.previousSibling; + clonedChild = _traverseNode(next, isFullySelected, FALSE, how); + + if (how != DELETE) + clonedParent.insertBefore(clonedChild, clonedParent.firstChild); + + isFullySelected = TRUE; + next = prevSibling; + } + + if (parent == root) + return clonedParent; + + next = parent.previousSibling; + parent = parent.parentNode; + + clonedGrandParent = _traverseNode(parent, FALSE, FALSE, how); + + if (how != DELETE) + clonedGrandParent.appendChild(clonedParent); + + clonedParent = clonedGrandParent; + } + }; + + function _traverseLeftBoundary(root, how) { + var next = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]), isFullySelected = next != t[START_CONTAINER], parent, clonedParent, nextSibling, clonedChild, clonedGrandParent; + + if (next == root) + return _traverseNode(next, isFullySelected, TRUE, how); + + parent = next.parentNode; + clonedParent = _traverseNode(parent, FALSE, TRUE, how); + + while (parent) { + while (next) { + nextSibling = next.nextSibling; + clonedChild = _traverseNode(next, isFullySelected, TRUE, how); + + if (how != DELETE) + clonedParent.appendChild(clonedChild); + + isFullySelected = TRUE; + next = nextSibling; + } + + if (parent == root) + return clonedParent; + + next = parent.nextSibling; + parent = parent.parentNode; + + clonedGrandParent = _traverseNode(parent, FALSE, TRUE, how); + + if (how != DELETE) + clonedGrandParent.appendChild(clonedParent); + + clonedParent = clonedGrandParent; + } + }; + + function _traverseNode(n, isFullySelected, isLeft, how) { + var txtValue, newNodeValue, oldNodeValue, offset, newNode; + + if (isFullySelected) + return _traverseFullySelected(n, how); + + if (n.nodeType == 3 /* TEXT_NODE */) { + txtValue = n.nodeValue; + + if (isLeft) { + offset = t[START_OFFSET]; + newNodeValue = txtValue.substring(offset); + oldNodeValue = txtValue.substring(0, offset); + } else { + offset = t[END_OFFSET]; + newNodeValue = txtValue.substring(0, offset); + oldNodeValue = txtValue.substring(offset); + } + + if (how != CLONE) + n.nodeValue = oldNodeValue; + + if (how == DELETE) + return; + + newNode = n.cloneNode(FALSE); + newNode.nodeValue = newNodeValue; + + return newNode; + } + + if (how == DELETE) + return; + + return n.cloneNode(FALSE); + }; + + function _traverseFullySelected(n, how) { + if (how != DELETE) + return how == CLONE ? n.cloneNode(TRUE) : n; + + n.parentNode.removeChild(n); + }; + }; + + ns.Range = Range; +})(tinymce.dom); + +(function() { + function Selection(selection) { + var t = this, invisibleChar = '\uFEFF', range, lastIERng, dom = selection.dom, TRUE = true, FALSE = false; + + // Returns a W3C DOM compatible range object by using the IE Range API + function getRange() { + var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed; + + // If selection is outside the current document just return an empty range + element = ieRange.item ? ieRange.item(0) : ieRange.parentElement(); + if (element.ownerDocument != dom.doc) + return domRange; + + // Handle control selection or text selection of a image + if (ieRange.item || !element.hasChildNodes()) { + domRange.setStart(element.parentNode, dom.nodeIndex(element)); + domRange.setEnd(domRange.startContainer, domRange.startOffset + 1); + + return domRange; + } + + collapsed = selection.isCollapsed(); + + function findEndPoint(start) { + var marker, container, offset, nodes, startIndex = 0, endIndex, index, parent, checkRng, position; + + // Setup temp range and collapse it + checkRng = ieRange.duplicate(); + checkRng.collapse(start); + + // Create marker and insert it at the end of the endpoints parent + marker = dom.create('a'); + parent = checkRng.parentElement(); + + // If parent doesn't have any children then set the container to that parent and the index to 0 + if (!parent.hasChildNodes()) { + domRange[start ? 'setStart' : 'setEnd'](parent, 0); + return; + } + + parent.appendChild(marker); + checkRng.moveToElementText(marker); + position = ieRange.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', checkRng); + if (position > 0) { + // The position is after the end of the parent element. + // This is the case where IE puts the caret to the left edge of a table. + domRange[start ? 'setStartAfter' : 'setEndAfter'](parent); + dom.remove(marker); + return; + } + + // Setup node list and endIndex + nodes = tinymce.grep(parent.childNodes); + endIndex = nodes.length - 1; + // Perform a binary search for the position + while (startIndex <= endIndex) { + index = Math.floor((startIndex + endIndex) / 2); + + // Insert marker and check it's position relative to the selection + parent.insertBefore(marker, nodes[index]); + checkRng.moveToElementText(marker); + position = ieRange.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', checkRng); + if (position > 0) { + // Marker is to the right + startIndex = index + 1; + } else if (position < 0) { + // Marker is to the left + endIndex = index - 1; + } else { + // Maker is where we are + found = true; + break; + } + } + + // Setup container + container = position > 0 || index == 0 ? marker.nextSibling : marker.previousSibling; + + // Handle element selection + if (container.nodeType == 1) { + dom.remove(marker); + + // Find offset and container + offset = dom.nodeIndex(container); + container = container.parentNode; + + // Move the offset if we are setting the end or the position is after an element + if (!start || index > 0) + offset++; + } else { + // Calculate offset within text node + if (position > 0 || index == 0) { + checkRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', ieRange); + offset = checkRng.text.length; + } else { + checkRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', ieRange); + offset = container.nodeValue.length - checkRng.text.length; + } + + dom.remove(marker); + } + + domRange[start ? 'setStart' : 'setEnd'](container, offset); + }; + + // Find start point + findEndPoint(true); + + // Find end point if needed + if (!collapsed) + findEndPoint(); + + return domRange; + }; + + this.addRange = function(rng) { + var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, doc = selection.dom.doc, body = doc.body; + + function setEndPoint(start) { + var container, offset, marker, tmpRng, nodes; + + marker = dom.create('a'); + container = start ? startContainer : endContainer; + offset = start ? startOffset : endOffset; + tmpRng = ieRng.duplicate(); + + if (container == doc) { + container = body; + offset = 0; + } + + if (container.nodeType == 3) { + container.parentNode.insertBefore(marker, container); + tmpRng.moveToElementText(marker); + tmpRng.moveStart('character', offset); + dom.remove(marker); + ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); + } else { + nodes = container.childNodes; + + if (nodes.length) { + if (offset >= nodes.length) { + dom.insertAfter(marker, nodes[nodes.length - 1]); + } else { + container.insertBefore(marker, nodes[offset]); + } + + tmpRng.moveToElementText(marker); + } else { + // Empty node selection for example
|
+ marker = doc.createTextNode(invisibleChar); + container.appendChild(marker); + tmpRng.moveToElementText(marker.parentNode); + tmpRng.collapse(TRUE); + } + + ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); + dom.remove(marker); + } + } + + // Destroy cached range + this.destroy(); + + // Setup some shorter versions + startContainer = rng.startContainer; + startOffset = rng.startOffset; + endContainer = rng.endContainer; + endOffset = rng.endOffset; + ieRng = body.createTextRange(); + + // If single element selection then try making a control selection out of it + if (startContainer == endContainer && startContainer.nodeType == 1 && startOffset == endOffset - 1) { + if (startOffset == endOffset - 1) { + try { + ctrlRng = body.createControlRange(); + ctrlRng.addElement(startContainer.childNodes[startOffset]); + ctrlRng.select(); + ctrlRng.scrollIntoView(); + return; + } catch (ex) { + // Ignore + } + } + } + + // Set start/end point of selection + setEndPoint(true); + setEndPoint(); + + // Select the new range and scroll it into view + ieRng.select(); + ieRng.scrollIntoView(); + }; + + this.getRangeAt = function() { + // Setup new range if the cache is empty + if (!range || !tinymce.dom.RangeUtils.compareRanges(lastIERng, selection.getRng())) { + range = getRange(); + + // Store away text range for next call + lastIERng = selection.getRng(); + } + + // IE will say that the range is equal then produce an invalid argument exception + // if you perform specific operations in a keyup event. For example Ctrl+Del. + // This hack will invalidate the range cache if the exception occurs + try { + range.startContainer.nextSibling; + } catch (ex) { + range = getRange(); + lastIERng = null; + } + + // Return cached range + return range; + }; + + this.destroy = function() { + // Destroy cached range and last IE range to avoid memory leaks + lastIERng = range = null; + }; + }; + + // Expose the selection object + tinymce.dom.TridentSelection = Selection; +})(); + + +/* + * Sizzle CSS Selector Engine - v1.0 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function(){ + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function(selector, context, results, seed) { + results = results || []; + context = context || document; + + var origContext = context; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var parts = [], m, set, checkSet, extra, prune = true, contextXML = Sizzle.isXML(context), + soFar = selector, ret, cur, pop, i; + + // Reset the position of the chunker regexp (start from head) + do { + chunker.exec(""); + m = chunker.exec(soFar); + + if ( m ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + } while ( m ); + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context ); + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set ); + } + } + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; + } + + if ( context ) { + ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray(set); + } else { + prune = false; + } + + while ( parts.length ) { + cur = parts.pop(); + pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + } else if ( context && context.nodeType === 1 ) { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + } else { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function(results){ + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort(sortOrder); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[i-1] ) { + results.splice(i--, 1); + } + } + } + } + + return results; +}; + +Sizzle.matches = function(expr, set){ + return Sizzle(expr, null, null, set); +}; + +Sizzle.find = function(expr, context, isXML){ + var set; + + if ( !expr ) { + return []; + } + + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { + var type = Expr.order[i], match; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + var left = match[1]; + match.splice(1,1); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace(/\\/g, ""); + set = Expr.find[ type ]( match, context, isXML ); + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = context.getElementsByTagName("*"); + } + + return {set: set, expr: expr}; +}; + +Sizzle.filter = function(expr, set, inplace, not){ + var old = expr, result = [], curLoop = set, match, anyFound, + isXMLFilter = set && set[0] && Sizzle.isXML(set[0]); + + while ( expr && set.length ) { + for ( var type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + var filter = Expr.filter[ type ], found, item, left = match[1]; + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + var pass = not ^ !!found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + } else { + curLoop[i] = false; + } + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw "Syntax error, unrecognized expression: " + msg; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + match: { + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + leftMatch: {}, + attrMap: { + "class": "className", + "for": "htmlFor" + }, + attrHandle: { + href: function(elem){ + return elem.getAttribute("href"); + } + }, + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !/\W/.test(part), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + ">": function(checkSet, part){ + var isPartStr = typeof part === "string", + elem, i = 0, l = checkSet.length; + + if ( isPartStr && !/\W/.test(part) ) { + part = part.toLowerCase(); + + for ( ; i < l; i++ ) { + elem = checkSet[i]; + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + } else { + for ( ; i < l; i++ ) { + elem = checkSet[i]; + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + "": function(checkSet, part, isXML){ + var doneName = done++, checkFn = dirCheck, nodeCheck; + + if ( typeof part === "string" && !/\W/.test(part) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); + }, + "~": function(checkSet, part, isXML){ + var doneName = done++, checkFn = dirCheck, nodeCheck; + + if ( typeof part === "string" && !/\W/.test(part) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); + } + }, + find: { + ID: function(match, context, isXML){ + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + return m ? [m] : []; + } + }, + NAME: function(match, context){ + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], results = context.getElementsByName(match[1]); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + TAG: function(match, context){ + return context.getElementsByTagName(match[1]); + } + }, + preFilter: { + CLASS: function(match, curLoop, inplace, result, not, isXML){ + match = " " + match[1].replace(/\\/g, "") + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + ID: function(match){ + return match[1].replace(/\\/g, ""); + }, + TAG: function(match, curLoop){ + return match[1].toLowerCase(); + }, + CHILD: function(match){ + if ( match[1] === "nth" ) { + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + ATTR: function(match, curLoop, inplace, result, not, isXML){ + var name = match[1].replace(/\\/g, ""); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + PSEUDO: function(match, curLoop, inplace, result, not){ + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + if ( !inplace ) { + result.push.apply( result, ret ); + } + return false; + } + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + POS: function(match){ + match.unshift( true ); + return match; + } + }, + filters: { + enabled: function(elem){ + return elem.disabled === false && elem.type !== "hidden"; + }, + disabled: function(elem){ + return elem.disabled === true; + }, + checked: function(elem){ + return elem.checked === true; + }, + selected: function(elem){ + // Accessing this property makes selected-by-default + // options in Safari work properly + elem.parentNode.selectedIndex; + return elem.selected === true; + }, + parent: function(elem){ + return !!elem.firstChild; + }, + empty: function(elem){ + return !elem.firstChild; + }, + has: function(elem, i, match){ + return !!Sizzle( match[3], elem ).length; + }, + header: function(elem){ + return (/h\d/i).test( elem.nodeName ); + }, + text: function(elem){ + return "text" === elem.type; + }, + radio: function(elem){ + return "radio" === elem.type; + }, + checkbox: function(elem){ + return "checkbox" === elem.type; + }, + file: function(elem){ + return "file" === elem.type; + }, + password: function(elem){ + return "password" === elem.type; + }, + submit: function(elem){ + return "submit" === elem.type; + }, + image: function(elem){ + return "image" === elem.type; + }, + reset: function(elem){ + return "reset" === elem.type; + }, + button: function(elem){ + return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; + }, + input: function(elem){ + return (/input|select|textarea|button/i).test(elem.nodeName); + } + }, + setFilters: { + first: function(elem, i){ + return i === 0; + }, + last: function(elem, i, match, array){ + return i === array.length - 1; + }, + even: function(elem, i){ + return i % 2 === 0; + }, + odd: function(elem, i){ + return i % 2 === 1; + }, + lt: function(elem, i, match){ + return i < match[3] - 0; + }, + gt: function(elem, i, match){ + return i > match[3] - 0; + }, + nth: function(elem, i, match){ + return match[3] - 0 === i; + }, + eq: function(elem, i, match){ + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function(elem, match, i, array){ + var name = match[1], filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; + } else if ( name === "not" ) { + var not = match[3]; + + for ( var j = 0, l = not.length; j < l; j++ ) { + if ( not[j] === elem ) { + return false; + } + } + + return true; + } else { + Sizzle.error( "Syntax error, unrecognized expression: " + name ); + } + }, + CHILD: function(elem, match){ + var type = match[1], node = elem; + switch (type) { + case 'only': + case 'first': + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + if ( type === "first" ) { + return true; + } + node = elem; + case 'last': + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + return true; + case 'nth': + var first = match[2], last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + var doneName = match[0], + parent = elem.parentNode; + + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { + var count = 0; + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + parent.sizcache = doneName; + } + + var diff = elem.nodeIndex - last; + if ( first === 0 ) { + return diff === 0; + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + ID: function(elem, match){ + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + TAG: function(elem, match){ + return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; + }, + CLASS: function(elem, match){ + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + ATTR: function(elem, match){ + var name = match[1], + result = Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + POS: function(elem, match, i, array){ + var name = match[2], filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS, + fescape = function(all, num){ + return "\\" + (num - 0 + 1); + }; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); +} + +var makeArray = function(array, results) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch(e){ + makeArray = function(array, results) { + var ret = results || [], i = 0; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + } else { + if ( typeof array.length === "number" ) { + for ( var l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + } else { + for ( ; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.compareDocumentPosition ? -1 : 1; + } + + var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} else if ( "sourceIndex" in document.documentElement ) { + sortOrder = function( a, b ) { + if ( !a.sourceIndex || !b.sourceIndex ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.sourceIndex ? -1 : 1; + } + + var ret = a.sourceIndex - b.sourceIndex; + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} else if ( document.createRange ) { + sortOrder = function( a, b ) { + if ( !a.ownerDocument || !b.ownerDocument ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.ownerDocument ? -1 : 1; + } + + var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); + aRange.setStart(a, 0); + aRange.setEnd(a, 0); + bRange.setStart(b, 0); + bRange.setEnd(b, 0); + var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} + +// Utility function for retreiving the text value of an array of DOM nodes +Sizzle.getText = function( elems ) { + var ret = "", elem; + + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += Sizzle.getText( elem.childNodes ); + } + } + + return ret; +}; + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date()).getTime(); + form.innerHTML = ""; + + // Inject it into the root element, check its status, and remove it quickly + var root = document.documentElement; + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function(match, context, isXML){ + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; + } + }; + + Expr.filter.ID = function(elem, match){ + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } + + root.removeChild( form ); + root = form = null; // release memory in IE +})(); + +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); + + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function(match, context){ + var results = context.getElementsByTagName(match[1]); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + } + + // Check to see if an attribute returns normalized href attributes + div.innerHTML = ""; + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + Expr.attrHandle.href = function(elem){ + return elem.getAttribute("href", 2); + }; + } + + div = null; // release memory in IE +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, div = document.createElement("div"); + div.innerHTML = "

"; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function(query, context, extra, seed){ + context = context || document; + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && context.nodeType === 9 && !Sizzle.isXML(context) ) { + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(e){} + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + div = null; // release memory in IE + })(); +} + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "
"; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function(match, context, isXML) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + div = null; // release memory in IE +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + elem = elem[dir]; + var match = false; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + elem = elem[dir]; + var match = false; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem.sizcache = doneName; + elem.sizset = i; + } + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +Sizzle.contains = document.compareDocumentPosition ? function(a, b){ + return !!(a.compareDocumentPosition(b) & 16); +} : function(a, b){ + return a !== b && (a.contains ? a.contains(b) : true); +}; + +Sizzle.isXML = function(elem){ + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function(selector, context){ + var tmpSet = [], later = "", match, + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE + +window.tinymce.dom.Sizzle = Sizzle; + +})(); + + +(function(tinymce) { + // Shorten names + var each = tinymce.each, DOM = tinymce.DOM, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, Event; + + tinymce.create('tinymce.dom.EventUtils', { + EventUtils : function() { + this.inits = []; + this.events = []; + }, + + add : function(o, n, f, s) { + var cb, t = this, el = t.events, r; + + if (n instanceof Array) { + r = []; + + each(n, function(n) { + r.push(t.add(o, n, f, s)); + }); + + return r; + } + + // Handle array + if (o && o.hasOwnProperty && o instanceof Array) { + r = []; + + each(o, function(o) { + o = DOM.get(o); + r.push(t.add(o, n, f, s)); + }); + + return r; + } + + o = DOM.get(o); + + if (!o) + return; + + // Setup event callback + cb = function(e) { + // Is all events disabled + if (t.disabled) + return; + + e = e || window.event; + + // Patch in target, preventDefault and stopPropagation in IE it's W3C valid + if (e && isIE) { + if (!e.target) + e.target = e.srcElement; + + // Patch in preventDefault, stopPropagation methods for W3C compatibility + tinymce.extend(e, t._stoppers); + } + + if (!s) + return f(e); + + return f.call(s, e); + }; + + if (n == 'unload') { + tinymce.unloads.unshift({func : cb}); + return cb; + } + + if (n == 'init') { + if (t.domLoaded) + cb(); + else + t.inits.push(cb); + + return cb; + } + + // Store away listener reference + el.push({ + obj : o, + name : n, + func : f, + cfunc : cb, + scope : s + }); + + t._add(o, n, cb); + + return f; + }, + + remove : function(o, n, f) { + var t = this, a = t.events, s = false, r; + + // Handle array + if (o && o.hasOwnProperty && o instanceof Array) { + r = []; + + each(o, function(o) { + o = DOM.get(o); + r.push(t.remove(o, n, f)); + }); + + return r; + } + + o = DOM.get(o); + + each(a, function(e, i) { + if (e.obj == o && e.name == n && (!f || (e.func == f || e.cfunc == f))) { + a.splice(i, 1); + t._remove(o, n, e.cfunc); + s = true; + return false; + } + }); + + return s; + }, + + clear : function(o) { + var t = this, a = t.events, i, e; + + if (o) { + o = DOM.get(o); + + for (i = a.length - 1; i >= 0; i--) { + e = a[i]; + + if (e.obj === o) { + t._remove(e.obj, e.name, e.cfunc); + e.obj = e.cfunc = null; + a.splice(i, 1); + } + } + } + }, + + cancel : function(e) { + if (!e) + return false; + + this.stop(e); + + return this.prevent(e); + }, + + stop : function(e) { + if (e.stopPropagation) + e.stopPropagation(); + else + e.cancelBubble = true; + + return false; + }, + + prevent : function(e) { + if (e.preventDefault) + e.preventDefault(); + else + e.returnValue = false; + + return false; + }, + + destroy : function() { + var t = this; + + each(t.events, function(e, i) { + t._remove(e.obj, e.name, e.cfunc); + e.obj = e.cfunc = null; + }); + + t.events = []; + t = null; + }, + + _add : function(o, n, f) { + if (o.attachEvent) + o.attachEvent('on' + n, f); + else if (o.addEventListener) + o.addEventListener(n, f, false); + else + o['on' + n] = f; + }, + + _remove : function(o, n, f) { + if (o) { + try { + if (o.detachEvent) + o.detachEvent('on' + n, f); + else if (o.removeEventListener) + o.removeEventListener(n, f, false); + else + o['on' + n] = null; + } catch (ex) { + // Might fail with permission denined on IE so we just ignore that + } + } + }, + + _pageInit : function(win) { + var t = this; + + // Keep it from running more than once + if (t.domLoaded) + return; + + t.domLoaded = true; + + each(t.inits, function(c) { + c(); + }); + + t.inits = []; + }, + + _wait : function(win) { + var t = this, doc = win.document; + + // No need since the document is already loaded + if (win.tinyMCE_GZ && tinyMCE_GZ.loaded) { + t.domLoaded = 1; + return; + } + + // Use IE method + if (doc.attachEvent) { + doc.attachEvent("onreadystatechange", function() { + if (doc.readyState === "complete") { + doc.detachEvent("onreadystatechange", arguments.callee); + t._pageInit(win); + } + }); + + if (doc.documentElement.doScroll && win == win.top) { + (function() { + if (t.domLoaded) + return; + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + doc.documentElement.doScroll("left"); + } catch (ex) { + setTimeout(arguments.callee, 0); + return; + } + + t._pageInit(win); + })(); + } + } else if (doc.addEventListener) { + t._add(win, 'DOMContentLoaded', function() { + t._pageInit(win); + }); + } + + t._add(win, 'load', function() { + t._pageInit(win); + }); + }, + + _stoppers : { + preventDefault : function() { + this.returnValue = false; + }, + + stopPropagation : function() { + this.cancelBubble = true; + } + } + }); + + Event = tinymce.dom.Event = new tinymce.dom.EventUtils(); + + // Dispatch DOM content loaded event for IE and Safari + Event._wait(window); + + tinymce.addUnload(function() { + Event.destroy(); + }); +})(tinymce); + +(function(tinymce) { + tinymce.dom.Element = function(id, settings) { + var t = this, dom, el; + + t.settings = settings = settings || {}; + t.id = id; + t.dom = dom = settings.dom || tinymce.DOM; + + // Only IE leaks DOM references, this is a lot faster + if (!tinymce.isIE) + el = dom.get(t.id); + + tinymce.each( + ('getPos,getRect,getParent,add,setStyle,getStyle,setStyles,' + + 'setAttrib,setAttribs,getAttrib,addClass,removeClass,' + + 'hasClass,getOuterHTML,setOuterHTML,remove,show,hide,' + + 'isHidden,setHTML,get').split(/,/) + , function(k) { + t[k] = function() { + var a = [id], i; + + for (i = 0; i < arguments.length; i++) + a.push(arguments[i]); + + a = dom[k].apply(dom, a); + t.update(k); + + return a; + }; + }); + + tinymce.extend(t, { + on : function(n, f, s) { + return tinymce.dom.Event.add(t.id, n, f, s); + }, + + getXY : function() { + return { + x : parseInt(t.getStyle('left')), + y : parseInt(t.getStyle('top')) + }; + }, + + getSize : function() { + var n = dom.get(t.id); + + return { + w : parseInt(t.getStyle('width') || n.clientWidth), + h : parseInt(t.getStyle('height') || n.clientHeight) + }; + }, + + moveTo : function(x, y) { + t.setStyles({left : x, top : y}); + }, + + moveBy : function(x, y) { + var p = t.getXY(); + + t.moveTo(p.x + x, p.y + y); + }, + + resizeTo : function(w, h) { + t.setStyles({width : w, height : h}); + }, + + resizeBy : function(w, h) { + var s = t.getSize(); + + t.resizeTo(s.w + w, s.h + h); + }, + + update : function(k) { + var b; + + if (tinymce.isIE6 && settings.blocker) { + k = k || ''; + + // Ignore getters + if (k.indexOf('get') === 0 || k.indexOf('has') === 0 || k.indexOf('is') === 0) + return; + + // Remove blocker on remove + if (k == 'remove') { + dom.remove(t.blocker); + return; + } + + if (!t.blocker) { + t.blocker = dom.uniqueId(); + b = dom.add(settings.container || dom.getRoot(), 'iframe', {id : t.blocker, style : 'position:absolute;', frameBorder : 0, src : 'javascript:""'}); + dom.setStyle(b, 'opacity', 0); + } else + b = dom.get(t.blocker); + + dom.setStyles(b, { + left : t.getStyle('left', 1), + top : t.getStyle('top', 1), + width : t.getStyle('width', 1), + height : t.getStyle('height', 1), + display : t.getStyle('display', 1), + zIndex : parseInt(t.getStyle('zIndex', 1) || 0) - 1 + }); + } + } + }); + }; +})(tinymce); + +(function(tinymce) { + function trimNl(s) { + return s.replace(/[\n\r]+/g, ''); + }; + + // Shorten names + var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each; + + tinymce.create('tinymce.dom.Selection', { + Selection : function(dom, win, serializer) { + var t = this; + + t.dom = dom; + t.win = win; + t.serializer = serializer; + + // Add events + each([ + 'onBeforeSetContent', + 'onBeforeGetContent', + 'onSetContent', + 'onGetContent' + ], function(e) { + t[e] = new tinymce.util.Dispatcher(t); + }); + + // No W3C Range support + if (!t.win.getSelection) + t.tridentSel = new tinymce.dom.TridentSelection(t); + + if (tinymce.isIE && dom.boxModel) + this._fixIESelection(); + + // Prevent leaks + tinymce.addUnload(t.destroy, t); + }, + + getContent : function(s) { + var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n; + + s = s || {}; + wb = wa = ''; + s.get = true; + s.format = s.format || 'html'; + t.onBeforeGetContent.dispatch(t, s); + + if (s.format == 'text') + return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : '')); + + if (r.cloneContents) { + n = r.cloneContents(); + + if (n) + e.appendChild(n); + } else if (is(r.item) || is(r.htmlText)) + e.innerHTML = r.item ? r.item(0).outerHTML : r.htmlText; + else + e.innerHTML = r.toString(); + + // Keep whitespace before and after + if (/^\s/.test(e.innerHTML)) + wb = ' '; + + if (/\s+$/.test(e.innerHTML)) + wa = ' '; + + s.getInner = true; + + s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa; + t.onGetContent.dispatch(t, s); + + return s.content; + }, + + setContent : function(h, s) { + var t = this, r = t.getRng(), c, d = t.win.document; + + s = s || {format : 'html'}; + s.set = true; + h = s.content = t.dom.processHTML(h); + + // Dispatch before set content event + t.onBeforeSetContent.dispatch(t, s); + h = s.content; + + if (r.insertNode) { + // Make caret marker since insertNode places the caret in the beginning of text after insert + h += '_'; + + // Delete and insert new node + + if (r.startContainer == d && r.endContainer == d) { + // WebKit will fail if the body is empty since the range is then invalid and it can't insert contents + d.body.innerHTML = h; + } else { + r.deleteContents(); + if (d.body.childNodes.length == 0) { + d.body.innerHTML = h; + } else { + // createContextualFragment doesn't exists in IE 9 DOMRanges + if (r.createContextualFragment) { + r.insertNode(r.createContextualFragment(h)); + } else { + // Fake createContextualFragment call in IE 9 + var frag = d.createDocumentFragment(), temp = d.createElement('div'); + + frag.appendChild(temp); + temp.outerHTML = h; + + r.insertNode(frag); + } + } + } + + // Move to caret marker + c = t.dom.get('__caret'); + // Make sure we wrap it compleatly, Opera fails with a simple select call + r = d.createRange(); + r.setStartBefore(c); + r.setEndBefore(c); + t.setRng(r); + + // Remove the caret position + t.dom.remove('__caret'); + } else { + if (r.item) { + // Delete content and get caret text selection + d.execCommand('Delete', false, null); + r = t.getRng(); + } + + r.pasteHTML(h); + } + + // Dispatch set content event + t.onSetContent.dispatch(t, s); + }, + + getStart : function() { + var rng = this.getRng(), startElement, parentElement, checkRng, node; + + if (rng.duplicate || rng.item) { + // Control selection, return first item + if (rng.item) + return rng.item(0); + + // Get start element + checkRng = rng.duplicate(); + checkRng.collapse(1); + startElement = checkRng.parentElement(); + + // Check if range parent is inside the start element, then return the inner parent element + // This will fix issues when a single element is selected, IE would otherwise return the wrong start element + parentElement = node = rng.parentElement(); + while (node = node.parentNode) { + if (node == startElement) { + startElement = parentElement; + break; + } + } + + // If start element is body element try to move to the first child if it exists + if (startElement && startElement.nodeName == 'BODY') + return startElement.firstChild || startElement; + + return startElement; + } else { + startElement = rng.startContainer; + + if (startElement.nodeType == 1 && startElement.hasChildNodes()) + startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)]; + + if (startElement && startElement.nodeType == 3) + return startElement.parentNode; + + return startElement; + } + }, + + getEnd : function() { + var t = this, r = t.getRng(), e, eo; + + if (r.duplicate || r.item) { + if (r.item) + return r.item(0); + + r = r.duplicate(); + r.collapse(0); + e = r.parentElement(); + + if (e && e.nodeName == 'BODY') + return e.lastChild || e; + + return e; + } else { + e = r.endContainer; + eo = r.endOffset; + + if (e.nodeType == 1 && e.hasChildNodes()) + e = e.childNodes[eo > 0 ? eo - 1 : eo]; + + if (e && e.nodeType == 3) + return e.parentNode; + + return e; + } + }, + + getBookmark : function(type, normalized) { + var t = this, dom = t.dom, rng, rng2, id, collapsed, name, element, index, chr = '\uFEFF', styles; + + function findIndex(name, element) { + var index = 0; + + each(dom.select(name), function(node, i) { + if (node == element) + index = i; + }); + + return index; + }; + + if (type == 2) { + function getLocation() { + var rng = t.getRng(true), root = dom.getRoot(), bookmark = {}; + + function getPoint(rng, start) { + var container = rng[start ? 'startContainer' : 'endContainer'], + offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0; + + if (container.nodeType == 3) { + if (normalized) { + for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling) + offset += node.nodeValue.length; + } + + point.push(offset); + } else { + childNodes = container.childNodes; + + if (offset >= childNodes.length && childNodes.length) { + after = 1; + offset = Math.max(0, childNodes.length - 1); + } + + point.push(t.dom.nodeIndex(childNodes[offset], normalized) + after); + } + + for (; container && container != root; container = container.parentNode) + point.push(t.dom.nodeIndex(container, normalized)); + + return point; + }; + + bookmark.start = getPoint(rng, true); + + if (!t.isCollapsed()) + bookmark.end = getPoint(rng); + + return bookmark; + }; + + return getLocation(); + } + + // Handle simple range + if (type) + return {rng : t.getRng()}; + + rng = t.getRng(); + id = dom.uniqueId(); + collapsed = tinyMCE.activeEditor.selection.isCollapsed(); + styles = 'overflow:hidden;line-height:0px'; + + // Explorer method + if (rng.duplicate || rng.item) { + // Text selection + if (!rng.item) { + rng2 = rng.duplicate(); + + // Insert start marker + rng.collapse(); + rng.pasteHTML('' + chr + ''); + + // Insert end marker + if (!collapsed) { + rng2.collapse(false); + rng2.pasteHTML('' + chr + ''); + } + } else { + // Control selection + element = rng.item(0); + name = element.nodeName; + + return {name : name, index : findIndex(name, element)}; + } + } else { + element = t.getNode(); + name = element.nodeName; + if (name == 'IMG') + return {name : name, index : findIndex(name, element)}; + + // W3C method + rng2 = rng.cloneRange(); + + // Insert end marker + if (!collapsed) { + rng2.collapse(false); + rng2.insertNode(dom.create('span', {_mce_type : "bookmark", id : id + '_end', style : styles}, chr)); + } + + rng.collapse(true); + rng.insertNode(dom.create('span', {_mce_type : "bookmark", id : id + '_start', style : styles}, chr)); + } + + t.moveToBookmark({id : id, keep : 1}); + + return {id : id}; + }, + + moveToBookmark : function(bookmark) { + var t = this, dom = t.dom, marker1, marker2, rng, root, startContainer, endContainer, startOffset, endOffset; + + // Clear selection cache + if (t.tridentSel) + t.tridentSel.destroy(); + + if (bookmark) { + if (bookmark.start) { + rng = dom.createRng(); + root = dom.getRoot(); + + function setEndPoint(start) { + var point = bookmark[start ? 'start' : 'end'], i, node, offset, children; + + if (point) { + // Find container node + for (node = root, i = point.length - 1; i >= 1; i--) { + children = node.childNodes; + + if (children.length) + node = children[point[i]]; + } + + // Set offset within container node + if (start) + rng.setStart(node, point[0]); + else + rng.setEnd(node, point[0]); + } + }; + + setEndPoint(true); + setEndPoint(); + + t.setRng(rng); + } else if (bookmark.id) { + function restoreEndPoint(suffix) { + var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep; + + if (marker) { + node = marker.parentNode; + + if (suffix == 'start') { + if (!keep) { + idx = dom.nodeIndex(marker); + } else { + node = marker.firstChild; + idx = 1; + } + + startContainer = endContainer = node; + startOffset = endOffset = idx; + } else { + if (!keep) { + idx = dom.nodeIndex(marker); + } else { + node = marker.firstChild; + idx = 1; + } + + endContainer = node; + endOffset = idx; + } + + if (!keep) { + prev = marker.previousSibling; + next = marker.nextSibling; + + // Remove all marker text nodes + each(tinymce.grep(marker.childNodes), function(node) { + if (node.nodeType == 3) + node.nodeValue = node.nodeValue.replace(/\uFEFF/g, ''); + }); + + // Remove marker but keep children if for example contents where inserted into the marker + // Also remove duplicated instances of the marker for example by a split operation or by WebKit auto split on paste feature + while (marker = dom.get(bookmark.id + '_' + suffix)) + dom.remove(marker, 1); + + // If siblings are text nodes then merge them unless it's Opera since it some how removes the node + // and we are sniffing since adding a lot of detection code for a browser with 3% of the market isn't worth the effort. Sorry, Opera but it's just a fact + if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3 && !tinymce.isOpera) { + idx = prev.nodeValue.length; + prev.appendData(next.nodeValue); + dom.remove(next); + + if (suffix == 'start') { + startContainer = endContainer = prev; + startOffset = endOffset = idx; + } else { + endContainer = prev; + endOffset = idx; + } + } + } + } + }; + + function addBogus(node) { + // Adds a bogus BR element for empty block elements + // on non IE browsers just to have a place to put the caret + if (!isIE && dom.isBlock(node) && !node.innerHTML) + node.innerHTML = '
'; + + return node; + }; + + // Restore start/end points + restoreEndPoint('start'); + restoreEndPoint('end'); + + if (startContainer) { + rng = dom.createRng(); + rng.setStart(addBogus(startContainer), startOffset); + rng.setEnd(addBogus(endContainer), endOffset); + t.setRng(rng); + } + } else if (bookmark.name) { + t.select(dom.select(bookmark.name)[bookmark.index]); + } else if (bookmark.rng) + t.setRng(bookmark.rng); + } + }, + + select : function(node, content) { + var t = this, dom = t.dom, rng = dom.createRng(), idx; + + idx = dom.nodeIndex(node); + rng.setStart(node.parentNode, idx); + rng.setEnd(node.parentNode, idx + 1); + + // Find first/last text node or BR element + if (content) { + function setPoint(node, start) { + var walker = new tinymce.dom.TreeWalker(node, node); + + do { + // Text node + if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { + if (start) + rng.setStart(node, 0); + else + rng.setEnd(node, node.nodeValue.length); + + return; + } + + // BR element + if (node.nodeName == 'BR') { + if (start) + rng.setStartBefore(node); + else + rng.setEndBefore(node); + + return; + } + } while (node = (start ? walker.next() : walker.prev())); + }; + + setPoint(node, 1); + setPoint(node); + } + + t.setRng(rng); + + return node; + }, + + isCollapsed : function() { + var t = this, r = t.getRng(), s = t.getSel(); + + if (!r || r.item) + return false; + + if (r.compareEndPoints) + return r.compareEndPoints('StartToEnd', r) === 0; + + return !s || r.collapsed; + }, + + collapse : function(b) { + var t = this, r = t.getRng(), n; + + // Control range on IE + if (r.item) { + n = r.item(0); + r = this.win.document.body.createTextRange(); + r.moveToElementText(n); + } + + r.collapse(!!b); + t.setRng(r); + }, + + getSel : function() { + var t = this, w = this.win; + + return w.getSelection ? w.getSelection() : w.document.selection; + }, + + getRng : function(w3c) { + var t = this, s, r, elm, doc = t.win.document; + + // Found tridentSel object then we need to use that one + if (w3c && t.tridentSel) + return t.tridentSel.getRangeAt(0); + + try { + if (s = t.getSel()) + r = s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : doc.createRange()); + } catch (ex) { + // IE throws unspecified error here if TinyMCE is placed in a frame/iframe + } + + // We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet + if (tinymce.isIE && r.setStart && doc.selection.createRange().item) { + elm = doc.selection.createRange().item(0); + r = doc.createRange(); + r.setStartBefore(elm); + r.setEndAfter(elm); + } + + // No range found then create an empty one + // This can occur when the editor is placed in a hidden container element on Gecko + // Or on IE when there was an exception + if (!r) + r = doc.createRange ? doc.createRange() : doc.body.createTextRange(); + + if (t.selectedRange && t.explicitRange) { + if (r.compareBoundaryPoints(r.START_TO_START, t.selectedRange) === 0 && r.compareBoundaryPoints(r.END_TO_END, t.selectedRange) === 0) { + // Safari, Opera and Chrome only ever select text which causes the range to change. + // This lets us use the originally set range if the selection hasn't been changed by the user. + r = t.explicitRange; + } else { + t.selectedRange = null; + t.explicitRange = null; + } + } + return r; + }, + + setRng : function(r) { + var s, t = this; + + if (!t.tridentSel) { + s = t.getSel(); + + if (s) { + t.explicitRange = r; + s.removeAllRanges(); + s.addRange(r); + t.selectedRange = s.getRangeAt(0); + } + } else { + // Is W3C Range + if (r.cloneRange) { + t.tridentSel.addRange(r); + return; + } + + // Is IE specific range + try { + r.select(); + } catch (ex) { + // Needed for some odd IE bug #1843306 + } + } + }, + + setNode : function(n) { + var t = this; + + t.setContent(t.dom.getOuterHTML(n)); + + return n; + }, + + getNode : function() { + var t = this, rng = t.getRng(), sel = t.getSel(), elm; + + if (rng.setStart) { + // Range maybe lost after the editor is made visible again + if (!rng) + return t.dom.getRoot(); + + elm = rng.commonAncestorContainer; + + // Handle selection a image or other control like element such as anchors + if (!rng.collapsed) { + if (rng.startContainer == rng.endContainer) { + if (rng.startOffset - rng.endOffset < 2) { + if (rng.startContainer.hasChildNodes()) + elm = rng.startContainer.childNodes[rng.startOffset]; + } + } + + // If the anchor node is a element instead of a text node then return this element + if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1) + return sel.anchorNode.childNodes[sel.anchorOffset]; + } + + if (elm && elm.nodeType == 3) + return elm.parentNode; + + return elm; + } + + return rng.item ? rng.item(0) : rng.parentElement(); + }, + + getSelectedBlocks : function(st, en) { + var t = this, dom = t.dom, sb, eb, n, bl = []; + + sb = dom.getParent(st || t.getStart(), dom.isBlock); + eb = dom.getParent(en || t.getEnd(), dom.isBlock); + + if (sb) + bl.push(sb); + + if (sb && eb && sb != eb) { + n = sb; + + while ((n = n.nextSibling) && n != eb) { + if (dom.isBlock(n)) + bl.push(n); + } + } + + if (eb && sb != eb) + bl.push(eb); + + return bl; + }, + + destroy : function(s) { + var t = this; + + t.win = null; + + if (t.tridentSel) + t.tridentSel.destroy(); + + // Manual destroy then remove unload handler + if (!s) + tinymce.removeUnload(t.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 + _fixIESelection : function() { + var dom = this.dom, doc = dom.doc, body = doc.body, started, startRng; + + // Make HTML element unselectable since we are going to handle selection by hand + doc.documentElement.unselectable = true; + + // Return range from point or null if it failed + function rngFromPoint(x, y) { + var rng = body.createTextRange(); + + try { + rng.moveToPoint(x, y); + } catch (ex) { + // IE sometimes throws and exception, so lets just ignore it + rng = null; + } + + return rng; + }; + + // Fires while the selection is changing + function selectionChange(e) { + var pointRng; + + // Check if the button is down or not + if (e.button) { + // Create range from mouse position + pointRng = rngFromPoint(e.x, e.y); + + if (pointRng) { + // Check if pointRange is before/after selection then change the endPoint + if (pointRng.compareEndPoints('StartToStart', startRng) > 0) + pointRng.setEndPoint('StartToStart', startRng); + else + pointRng.setEndPoint('EndToEnd', startRng); + + pointRng.select(); + } + } else + endSelection(); + } + + // Removes listeners + function endSelection() { + dom.unbind(doc, 'mouseup', endSelection); + dom.unbind(doc, 'mousemove', selectionChange); + started = 0; + }; + + // Detect when user selects outside BODY + dom.bind(doc, 'mousedown', function(e) { + if (e.target.nodeName === 'HTML') { + if (started) + endSelection(); + + started = 1; + + // Setup start position + startRng = rngFromPoint(e.x, e.y); + if (startRng) { + // Listen for selection change events + dom.bind(doc, 'mouseup', endSelection); + dom.bind(doc, 'mousemove', selectionChange); + + dom.win.focus(); + startRng.select(); + } + } + }); + } + }); +})(tinymce); + +(function(tinymce) { + tinymce.create('tinymce.dom.XMLWriter', { + node : null, + + XMLWriter : function(s) { + // Get XML document + function getXML() { + var i = document.implementation; + + if (!i || !i.createDocument) { + // Try IE objects + try {return new ActiveXObject('MSXML2.DOMDocument');} catch (ex) {} + try {return new ActiveXObject('Microsoft.XmlDom');} catch (ex) {} + } else + return i.createDocument('', '', null); + }; + + this.doc = getXML(); + + // Since Opera and WebKit doesn't escape > into > we need to do it our self to normalize the output for all browsers + this.valid = tinymce.isOpera || tinymce.isWebKit; + + this.reset(); + }, + + reset : function() { + var t = this, d = t.doc; + + if (d.firstChild) + d.removeChild(d.firstChild); + + t.node = d.appendChild(d.createElement("html")); + }, + + writeStartElement : function(n) { + var t = this; + + t.node = t.node.appendChild(t.doc.createElement(n)); + }, + + writeAttribute : function(n, v) { + if (this.valid) + v = v.replace(/>/g, '%MCGT%'); + + this.node.setAttribute(n, v); + }, + + writeEndElement : function() { + this.node = this.node.parentNode; + }, + + writeFullEndElement : function() { + var t = this, n = t.node; + + n.appendChild(t.doc.createTextNode("")); + t.node = n.parentNode; + }, + + writeText : function(v) { + if (this.valid) + v = v.replace(/>/g, '%MCGT%'); + + this.node.appendChild(this.doc.createTextNode(v)); + }, + + writeCDATA : function(v) { + this.node.appendChild(this.doc.createCDATASection(v)); + }, + + writeComment : function(v) { + // Fix for bug #2035694 + if (tinymce.isIE) + v = v.replace(/^\-|\-$/g, ' '); + + this.node.appendChild(this.doc.createComment(v.replace(/\-\-/g, ' '))); + }, + + getContent : function() { + var h; + + h = this.doc.xml || new XMLSerializer().serializeToString(this.doc); + h = h.replace(/<\?[^?]+\?>|]*>|<\/html>||]+>/g, ''); + h = h.replace(/ ?\/>/g, ' />'); + + if (this.valid) + h = h.replace(/\%MCGT%/g, '>'); + + return h; + } + }); +})(tinymce); + +(function(tinymce) { + var attrsCharsRegExp = /[&\"<>]/g, textCharsRegExp = /[<>&]/g, encodedChars = {'&' : '&', '"' : '"', '<' : '<', '>' : '>'}; + + tinymce.create('tinymce.dom.StringWriter', { + str : null, + tags : null, + count : 0, + settings : null, + indent : null, + + StringWriter : function(s) { + this.settings = tinymce.extend({ + indent_char : ' ', + indentation : 0 + }, s); + + this.reset(); + }, + + reset : function() { + this.indent = ''; + this.str = ""; + this.tags = []; + this.count = 0; + }, + + writeStartElement : function(n) { + this._writeAttributesEnd(); + this.writeRaw('<' + n); + this.tags.push(n); + this.inAttr = true; + this.count++; + this.elementCount = this.count; + this.attrs = {}; + }, + + writeAttribute : function(n, v) { + var t = this; + + if (!t.attrs[n]) { + t.writeRaw(" " + t.encode(n, true) + '="' + t.encode(v, true) + '"'); + t.attrs[n] = v; + } + }, + + writeEndElement : function() { + var n; + + if (this.tags.length > 0) { + n = this.tags.pop(); + + if (this._writeAttributesEnd(1)) + this.writeRaw(''); + + if (this.settings.indentation > 0) + this.writeRaw('\n'); + } + }, + + writeFullEndElement : function() { + if (this.tags.length > 0) { + this._writeAttributesEnd(); + this.writeRaw(''); + + if (this.settings.indentation > 0) + this.writeRaw('\n'); + } + }, + + writeText : function(v) { + this._writeAttributesEnd(); + this.writeRaw(this.encode(v)); + this.count++; + }, + + writeCDATA : function(v) { + this._writeAttributesEnd(); + this.writeRaw(''); + this.count++; + }, + + writeComment : function(v) { + this._writeAttributesEnd(); + this.writeRaw(''); + this.count++; + }, + + writeRaw : function(v) { + this.str += v; + }, + + encode : function(s, attr) { + return s.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(v) { + return encodedChars[v]; + }); + }, + + getContent : function() { + return this.str; + }, + + _writeAttributesEnd : function(s) { + if (!this.inAttr) + return; + + this.inAttr = false; + + if (s && this.elementCount == this.count) { + this.writeRaw(' />'); + return false; + } + + this.writeRaw('>'); + + return true; + } + }); +})(tinymce); + +(function(tinymce) { + // Shorten names + var extend = tinymce.extend, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, isIE = tinymce.isIE, isGecko = tinymce.isGecko; + + function wildcardToRE(s) { + return s.replace(/([?+*])/g, '.$1'); + }; + + tinymce.create('tinymce.dom.Serializer', { + Serializer : function(s) { + var t = this; + + t.key = 0; + t.onPreProcess = new Dispatcher(t); + t.onPostProcess = new Dispatcher(t); + + try { + t.writer = new tinymce.dom.XMLWriter(); + } catch (ex) { + // IE might throw exception if ActiveX is disabled so we then switch to the slightly slower StringWriter + t.writer = new tinymce.dom.StringWriter(); + } + + // IE9 broke the XML attributes order so it can't be used anymore + if (tinymce.isIE && document.documentMode > 8) { + t.writer = new tinymce.dom.StringWriter(); + } + + // Default settings + t.settings = s = extend({ + dom : tinymce.DOM, + valid_nodes : 0, + node_filter : 0, + attr_filter : 0, + invalid_attrs : /^(_mce_|_moz_|sizset|sizcache)/, + closed : /^(br|hr|input|meta|img|link|param|area)$/, + entity_encoding : 'named', + entities : '160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro', + valid_elements : '*[*]', + extended_valid_elements : 0, + invalid_elements : 0, + fix_table_elements : 1, + fix_list_elements : true, + fix_content_duplication : true, + convert_fonts_to_spans : false, + font_size_classes : 0, + apply_source_formatting : 0, + indent_mode : 'simple', + indent_char : '\t', + indent_levels : 1, + remove_linebreaks : 1, + remove_redundant_brs : 1, + element_format : 'xhtml' + }, s); + + t.dom = s.dom; + t.schema = s.schema; + + // Use raw entities if no entities are defined + if (s.entity_encoding == 'named' && !s.entities) + s.entity_encoding = 'raw'; + + if (s.remove_redundant_brs) { + t.onPostProcess.add(function(se, o) { + // Remove single BR at end of block elements since they get rendered + o.content = o.content.replace(/(
\s*)+<\/(p|h[1-6]|div|li)>/gi, function(a, b, c) { + // Check if it's a single element + if (/^
\s*<\//.test(a)) + return ''; + + return a; + }); + }); + } + + // Remove XHTML element endings i.e. produce crap :) XHTML is better + if (s.element_format == 'html') { + t.onPostProcess.add(function(se, o) { + o.content = o.content.replace(/<([^>]+) \/>/g, '<$1>'); + }); + } + + if (s.fix_list_elements) { + t.onPreProcess.add(function(se, o) { + var nl, x, a = ['ol', 'ul'], i, n, p, r = /^(OL|UL)$/, np; + + function prevNode(e, n) { + var a = n.split(','), i; + + while ((e = e.previousSibling) != null) { + for (i=0; i 1) { + each(p[1].split('|'), function(s) { + var ar = {}, i; + + at = at || []; + + // Parse attribute rule + s = s.replace(/::/g, '~'); + s = /^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(s); + s[2] = s[2].replace(/~/g, ':'); + + // Add required attributes + if (s[1] == '!') { + ra = ra || []; + ra.push(s[2]); + } + + // Remove inherited attributes + if (s[1] == '-') { + for (i = 0; i ]*>)(.*?)(<\/script>)/g}, + {pattern : /(]*>)(.*?)(<\/noscript>)/g}, + {pattern : /(]*>)(.*?)(<\/style>)/g}, + {pattern : /(]*>)(.*?)(<\/pre>)/g, encode : 1}, + {pattern : /()/g} + ] + }); + + h = p.content; + + // Entity encode + if (s.entity_encoding !== 'raw') + h = t._encode(h); + + // Use BR instead of   padded P elements inside editor and use

 

outside editor +/* if (o.set) + h = h.replace(/

\s+( | |\u00a0|
)\s+<\/p>/g, '


'); + else + h = h.replace(/

\s+( | |\u00a0|
)\s+<\/p>/g, '

$1

');*/ + + // Since Gecko and Safari keeps whitespace in the DOM we need to + // remove it inorder to match other browsers. But I think Gecko and Safari is right. + // This process is only done when getting contents out from the editor. + if (!o.set) { + // We need to replace paragraph whitespace with an nbsp before indentation to keep the \u00a0 char + h = tinymce._replace(/

\s+<\/p>|]+)>\s+<\/p>/g, s.entity_encoding == 'numeric' ? ' 

' : ' 

', h); + + if (s.remove_linebreaks) { + h = h.replace(/\r?\n|\r/g, ' '); + h = tinymce._replace(/(<[^>]+>)\s+/g, '$1 ', h); + h = tinymce._replace(/\s+(<\/[^>]+>)/g, ' $1', h); + h = tinymce._replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g, '<$1 $2>', h); // Trim block start + h = tinymce._replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g, '<$1>', h); // Trim block start + h = tinymce._replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g, '', h); // Trim block end + } + + // Simple indentation + if (s.apply_source_formatting && s.indent_mode == 'simple') { + // Add line breaks before and after block elements + h = tinymce._replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g, '\n<$1$2$3>\n', h); + h = tinymce._replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g, '\n<$1$2>', h); + h = tinymce._replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g, '\n', h); + h = h.replace(/\n\n/g, '\n'); + } + } + + h = t._unprotect(h, p); + + // Restore CDATA sections + h = tinymce._replace(//g, '', h); + + // Restore the \u00a0 character if raw mode is enabled + if (s.entity_encoding == 'raw') + h = tinymce._replace(/

 <\/p>|]+)> <\/p>/g, '\u00a0

', h); + + // Restore noscript elements + h = h.replace(/]+|)>([\s\S]*?)<\/noscript>/g, function(v, attribs, text) { + return '' + t.dom.decode(text.replace(//g, '')) + ''; + }); + } + + o.content = h; + }, + + _serializeNode : function(n, inner) { + var t = this, s = t.settings, w = t.writer, hc, el, cn, i, l, a, at, no, v, nn, ru, ar, iv, closed, keep, type, scopeName; + + if (!s.node_filter || s.node_filter(n)) { + switch (n.nodeType) { + case 1: // Element + if (n.hasAttribute ? n.hasAttribute('_mce_bogus') : n.getAttribute('_mce_bogus')) + return; + + iv = keep = false; + hc = n.hasChildNodes(); + nn = n.getAttribute('_mce_name') || n.nodeName.toLowerCase(); + + // Get internal type + type = n.getAttribute('_mce_type'); + if (type) { + if (!t._info.cleanup) { + iv = true; + return; + } else + keep = 1; + } + + // Add correct prefix on IE + if (isIE) { + scopeName = n.scopeName; + if (scopeName && scopeName !== 'HTML' && scopeName !== 'html') + nn = scopeName + ':' + nn; + } + + // Remove mce prefix on IE needed for the abbr element + if (nn.indexOf('mce:') === 0) + nn = nn.substring(4); + + // Check if valid + if (!keep) { + if (!t.validElementsRE || !t.validElementsRE.test(nn) || (t.invalidElementsRE && t.invalidElementsRE.test(nn)) || inner) { + iv = true; + break; + } + } + + if (isIE) { + // Fix IE content duplication (DOM can have multiple copies of the same node) + if (s.fix_content_duplication) { + if (n._mce_serialized == t.key) + return; + + n._mce_serialized = t.key; + } + + // IE sometimes adds a / infront of the node name + if (nn.charAt(0) == '/') + nn = nn.substring(1); + } else if (isGecko) { + // Ignore br elements + if (n.nodeName === 'BR' && n.getAttribute('type') == '_moz') + return; + } + + // Check if valid child + if (s.validate_children) { + if (t.elementName && !t.schema.isValid(t.elementName, nn)) { + iv = true; + break; + } + + t.elementName = nn; + } + + ru = t.findRule(nn); + + // No valid rule for this element could be found then skip it + if (!ru) { + iv = true; + break; + } + + nn = ru.name || nn; + closed = s.closed.test(nn); + + // Skip empty nodes or empty node name in IE + if ((!hc && ru.noEmpty) || (isIE && !nn)) { + iv = true; + break; + } + + // Check required + if (ru.requiredAttribs) { + a = ru.requiredAttribs; + + for (i = a.length - 1; i >= 0; i--) { + if (this.dom.getAttrib(n, a[i]) !== '') + break; + } + + // None of the required was there + if (i == -1) { + iv = true; + break; + } + } + + w.writeStartElement(nn); + + // Add ordered attributes + if (ru.attribs) { + for (i=0, at = ru.attribs, l = at.length; i-1; i--) { + no = at[i]; + + if (no.specified) { + a = no.nodeName.toLowerCase(); + + if (s.invalid_attrs.test(a) || !ru.validAttribsRE.test(a)) + continue; + + ar = t.findAttribRule(ru, a); + v = t._getAttrib(n, ar, a); + + if (v !== null) + w.writeAttribute(a, v); + } + } + } + + // Keep type attribute + if (type && keep) + w.writeAttribute('_mce_type', type); + + // Write text from script + if (nn === 'script' && tinymce.trim(n.innerHTML)) { + w.writeText('// '); // Padd it with a comment so it will parse on older browsers + w.writeCDATA(n.innerHTML.replace(/|<\[CDATA\[|\]\]>/g, '')); // Remove comments and cdata stuctures + hc = false; + break; + } + + // Padd empty nodes with a   + if (ru.padd) { + // If it has only one bogus child, padd it anyway workaround for
bug + if (hc && (cn = n.firstChild) && cn.nodeType === 1 && n.childNodes.length === 1) { + if (cn.hasAttribute ? cn.hasAttribute('_mce_bogus') : cn.getAttribute('_mce_bogus')) + w.writeText('\u00a0'); + } else if (!hc) + w.writeText('\u00a0'); // No children then padd it + } + + break; + + case 3: // Text + // Check if valid child + if (s.validate_children && t.elementName && !t.schema.isValid(t.elementName, '#text')) + return; + + return w.writeText(n.nodeValue); + + case 4: // CDATA + return w.writeCDATA(n.nodeValue); + + case 8: // Comment + return w.writeComment(n.nodeValue); + } + } else if (n.nodeType == 1) + hc = n.hasChildNodes(); + + if (hc && !closed) { + cn = n.firstChild; + + while (cn) { + t._serializeNode(cn); + t.elementName = nn; + cn = cn.nextSibling; + } + } + + // Write element end + if (!iv) { + if (!closed) + w.writeFullEndElement(); + else + w.writeEndElement(); + } + }, + + _protect : function(o) { + var t = this; + + o.items = o.items || []; + + function enc(s) { + return s.replace(/[\r\n\\]/g, function(c) { + if (c === '\n') + return '\\n'; + else if (c === '\\') + return '\\\\'; + + return '\\r'; + }); + }; + + function dec(s) { + return s.replace(/\\[\\rn]/g, function(c) { + if (c === '\\n') + return '\n'; + else if (c === '\\\\') + return '\\'; + + return '\r'; + }); + }; + + each(o.patterns, function(p) { + o.content = dec(enc(o.content).replace(p.pattern, function(x, a, b, c) { + b = dec(b); + + if (p.encode) + b = t._encode(b); + + o.items.push(b); + return a + '' + c; + })); + }); + + return o; + }, + + _unprotect : function(h, o) { + h = h.replace(/\')); + } + + // Add toolbar end before list box and after the previous button + // This is to fix the o2k7 editor skins + if (pr && co.ListBox) { + if (pr.Button || pr.SplitButton) + h += dom.createHTML('td', {'class' : 'mceToolbarEnd'}, dom.createHTML('span', null, '')); + } + + // Render control HTML + + // IE 8 quick fix, needed to propertly generate a hit area for anchors + if (dom.stdMode) + h += '' + co.renderHTML() + ''; + else + h += '' + co.renderHTML() + ''; + + // Add toolbar start after list box and before the next button + // This is to fix the o2k7 editor skins + if (nx && co.ListBox) { + if (nx.Button || nx.SplitButton) + h += dom.createHTML('td', {'class' : 'mceToolbarStart'}, dom.createHTML('span', null, '')); + } + } + + c = 'mceToolbarEnd'; + + if (co.Button) + c += ' mceToolbarEndButton'; + else if (co.SplitButton) + c += ' mceToolbarEndSplitButton'; + else if (co.ListBox) + c += ' mceToolbarEndListBox'; + + h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '')); + + return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || ''}, '' + h + ''); + } +}); + +(function(tinymce) { + var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each; + + tinymce.create('tinymce.AddOnManager', { + AddOnManager : function() { + var self = this; + + self.items = []; + self.urls = {}; + self.lookup = {}; + self.onAdd = new Dispatcher(self); + }, + + get : function(n) { + return this.lookup[n]; + }, + + requireLangPack : function(n) { + var s = tinymce.settings; + + if (s && s.language) + tinymce.ScriptLoader.add(this.urls[n] + '/langs/' + s.language + '.js'); + }, + + add : function(id, o) { + this.items.push(o); + this.lookup[id] = o; + this.onAdd.dispatch(this, id, o); + + return o; + }, + + load : function(n, u, cb, s) { + var t = this; + + if (t.urls[n]) + return; + + if (u.indexOf('/') != 0 && u.indexOf('://') == -1) + u = tinymce.baseURL + '/' + u; + + t.urls[n] = u.substring(0, u.lastIndexOf('/')); + + if (!t.lookup[n]) + tinymce.ScriptLoader.add(u, cb, s); + } + }); + + // Create plugin and theme managers + tinymce.PluginManager = new tinymce.AddOnManager(); + tinymce.ThemeManager = new tinymce.AddOnManager(); +}(tinymce)); + +(function(tinymce) { + // Shorten names + var each = tinymce.each, extend = tinymce.extend, + DOM = tinymce.DOM, Event = tinymce.dom.Event, + ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, + explode = tinymce.explode, + Dispatcher = tinymce.util.Dispatcher, undefined, instanceCounter = 0; + + // Setup some URLs where the editor API is located and where the document is + tinymce.documentBaseURL = window.location.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, ''); + if (!/[\/\\]$/.test(tinymce.documentBaseURL)) + tinymce.documentBaseURL += '/'; + + tinymce.baseURL = new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL); + + tinymce.baseURI = new tinymce.util.URI(tinymce.baseURL); + + // Add before unload listener + // This was required since IE was leaking memory if you added and removed beforeunload listeners + // with attachEvent/detatchEvent so this only adds one listener and instances can the attach to the onBeforeUnload event + tinymce.onBeforeUnload = new Dispatcher(tinymce); + + // Must be on window or IE will leak if the editor is placed in frame or iframe + Event.add(window, 'beforeunload', function(e) { + tinymce.onBeforeUnload.dispatch(tinymce, e); + }); + + tinymce.onAddEditor = new Dispatcher(tinymce); + + tinymce.onRemoveEditor = new Dispatcher(tinymce); + + tinymce.EditorManager = extend(tinymce, { + editors : [], + + i18n : {}, + + activeEditor : null, + + init : function(s) { + var t = this, pl, sl = tinymce.ScriptLoader, e, el = [], ed; + + function execCallback(se, n, s) { + var f = se[n]; + + if (!f) + return; + + if (tinymce.is(f, 'string')) { + s = f.replace(/\.\w+$/, ''); + s = s ? tinymce.resolve(s) : 0; + f = tinymce.resolve(f); + } + + return f.apply(s || this, Array.prototype.slice.call(arguments, 2)); + }; + + s = extend({ + theme : "simple", + language : "en" + }, s); + + t.settings = s; + + // Legacy call + Event.add(document, 'init', function() { + var l, co; + + execCallback(s, 'onpageload'); + + switch (s.mode) { + case "exact": + l = s.elements || ''; + + if(l.length > 0) { + each(explode(l), function(v) { + if (DOM.get(v)) { + ed = new tinymce.Editor(v, s); + el.push(ed); + ed.render(1); + } else { + each(document.forms, function(f) { + each(f.elements, function(e) { + if (e.name === v) { + v = 'mce_editor_' + instanceCounter++; + DOM.setAttrib(e, 'id', v); + + ed = new tinymce.Editor(v, s); + el.push(ed); + ed.render(1); + } + }); + }); + } + }); + } + break; + + case "textareas": + case "specific_textareas": + function hasClass(n, c) { + return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c); + }; + + each(DOM.select('textarea'), function(v) { + if (s.editor_deselector && hasClass(v, s.editor_deselector)) + return; + + if (!s.editor_selector || hasClass(v, s.editor_selector)) { + // Can we use the name + e = DOM.get(v.name); + if (!v.id && !e) + v.id = v.name; + + // Generate unique name if missing or already exists + if (!v.id || t.get(v.id)) + v.id = DOM.uniqueId(); + + ed = new tinymce.Editor(v.id, s); + el.push(ed); + ed.render(1); + } + }); + break; + } + + // Call onInit when all editors are initialized + if (s.oninit) { + l = co = 0; + + each(el, function(ed) { + co++; + + if (!ed.initialized) { + // Wait for it + ed.onInit.add(function() { + l++; + + // All done + if (l == co) + execCallback(s, 'oninit'); + }); + } else + l++; + + // All done + if (l == co) + execCallback(s, 'oninit'); + }); + } + }); + }, + + get : function(id) { + if (id === undefined) + return this.editors; + + return this.editors[id]; + }, + + getInstanceById : function(id) { + return this.get(id); + }, + + add : function(editor) { + var self = this, editors = self.editors; + + // Add named and index editor instance + editors[editor.id] = editor; + editors.push(editor); + + self._setActive(editor); + self.onAddEditor.dispatch(self, editor); + + + return editor; + }, + + remove : function(editor) { + var t = this, i, editors = t.editors; + + // Not in the collection + if (!editors[editor.id]) + return null; + + delete editors[editor.id]; + + for (i = 0; i < editors.length; i++) { + if (editors[i] == editor) { + editors.splice(i, 1); + break; + } + } + + // Select another editor since the active one was removed + if (t.activeEditor == editor) + t._setActive(editors[0]); + + editor.destroy(); + t.onRemoveEditor.dispatch(t, editor); + + return editor; + }, + + execCommand : function(c, u, v) { + var t = this, ed = t.get(v), w; + + // Manager commands + switch (c) { + case "mceFocus": + ed.focus(); + return true; + + case "mceAddEditor": + case "mceAddControl": + if (!t.get(v)) + new tinymce.Editor(v, t.settings).render(); + + return true; + + case "mceAddFrameControl": + w = v.window; + + // Add tinyMCE global instance and tinymce namespace to specified window + w.tinyMCE = tinyMCE; + w.tinymce = tinymce; + + tinymce.DOM.doc = w.document; + tinymce.DOM.win = w; + + ed = new tinymce.Editor(v.element_id, v); + ed.render(); + + // Fix IE memory leaks + if (tinymce.isIE) { + function clr() { + ed.destroy(); + w.detachEvent('onunload', clr); + w = w.tinyMCE = w.tinymce = null; // IE leak + }; + + w.attachEvent('onunload', clr); + } + + v.page_window = null; + + return true; + + case "mceRemoveEditor": + case "mceRemoveControl": + if (ed) + ed.remove(); + + return true; + + case 'mceToggleEditor': + if (!ed) { + t.execCommand('mceAddControl', 0, v); + return true; + } + + if (ed.isHidden()) + ed.show(); + else + ed.hide(); + + return true; + } + + // Run command on active editor + if (t.activeEditor) + return t.activeEditor.execCommand(c, u, v); + + return false; + }, + + execInstanceCommand : function(id, c, u, v) { + var ed = this.get(id); + + if (ed) + return ed.execCommand(c, u, v); + + return false; + }, + + triggerSave : function() { + each(this.editors, function(e) { + e.save(); + }); + }, + + addI18n : function(p, o) { + var lo, i18n = this.i18n; + + if (!tinymce.is(p, 'string')) { + each(p, function(o, lc) { + each(o, function(o, g) { + each(o, function(o, k) { + if (g === 'common') + i18n[lc + '.' + k] = o; + else + i18n[lc + '.' + g + '.' + k] = o; + }); + }); + }); + } else { + each(o, function(o, k) { + i18n[p + '.' + k] = o; + }); + } + }, + + // Private methods + + _setActive : function(editor) { + this.selectedInstance = this.activeEditor = editor; + } + }); +})(tinymce); + +(function(tinymce) { + // Shorten these names + var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, + Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isGecko = tinymce.isGecko, + isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, is = tinymce.is, + ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, + inArray = tinymce.inArray, grep = tinymce.grep, explode = tinymce.explode; + + tinymce.create('tinymce.Editor', { + Editor : function(id, s) { + var t = this; + + t.id = t.editorId = id; + + t.execCommands = {}; + t.queryStateCommands = {}; + t.queryValueCommands = {}; + + t.isNotDirty = false; + + t.plugins = {}; + + // Add events to the editor + each([ + 'onPreInit', + + 'onBeforeRenderUI', + + 'onPostRender', + + 'onInit', + + 'onRemove', + + 'onActivate', + + 'onDeactivate', + + 'onClick', + + 'onEvent', + + 'onMouseUp', + + 'onMouseDown', + + 'onDblClick', + + 'onKeyDown', + + 'onKeyUp', + + 'onKeyPress', + + 'onContextMenu', + + 'onSubmit', + + 'onReset', + + 'onPaste', + + 'onPreProcess', + + 'onPostProcess', + + 'onBeforeSetContent', + + 'onBeforeGetContent', + + 'onSetContent', + + 'onGetContent', + + 'onLoadContent', + + 'onSaveContent', + + 'onNodeChange', + + 'onChange', + + 'onBeforeExecCommand', + + 'onExecCommand', + + 'onUndo', + + 'onRedo', + + 'onVisualAid', + + 'onSetProgressState' + ], function(e) { + t[e] = new Dispatcher(t); + }); + + t.settings = s = extend({ + id : id, + language : 'en', + docs_language : 'en', + theme : 'simple', + skin : 'default', + delta_width : 0, + delta_height : 0, + popup_css : '', + plugins : '', + document_base_url : tinymce.documentBaseURL, + add_form_submit_trigger : 1, + submit_patch : 1, + add_unload_trigger : 1, + convert_urls : 1, + relative_urls : 1, + remove_script_host : 1, + table_inline_editing : 0, + object_resizing : 1, + cleanup : 1, + accessibility_focus : 1, + custom_shortcuts : 1, + custom_undo_redo_keyboard_shortcuts : 1, + custom_undo_redo_restore_selection : 1, + custom_undo_redo : 1, + doctype : tinymce.isIE6 ? '' : '', // Use old doctype on IE 6 to avoid horizontal scroll + visual_table_class : 'mceItemTable', + visual : 1, + font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large', + apply_source_formatting : 1, + directionality : 'ltr', + forced_root_block : 'p', + valid_elements : '@[id|class|style|title|dir