diff --git a/docs/upgrades/upgrade_6.2.8-6.3.0.sql b/docs/upgrades/upgrade_6.2.8-6.3.0.sql index 66a931114..279de71c5 100644 --- a/docs/upgrades/upgrade_6.2.8-6.3.0.sql +++ b/docs/upgrades/upgrade_6.2.8-6.3.0.sql @@ -3,7 +3,7 @@ insert into webguiVersion values ('6.3.0','upgrade',unix_timestamp()); delete from template where templateId='tinymce' and namespace='richEditor'; INSERT INTO template VALUES ('tinymce','TinyMCE','^JavaScript(\"/tinymce/jscripts/tiny_mce/tiny_mce.js\");\r\n\r\n\r\n','richEditor',1,1); delete from template where templateId='1' and namespace='richEditor/pagetree'; -INSERT INTO template VALUES ('1','Rich Editor Page Tree','\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\nInsert/Edit Link\r\n\r\n
\r\n Link Settings\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Link URL:
Link Target:\r\n
 
\r\n
\r\n \r\n\r\n
\r\n
\r\n\r\n\r\n
\r\n Available Page Tree\r\n\r\n\r\n \')\">
\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n','richEditor/pagetree',1,1); +INSERT INTO template VALUES ('1','Rich Editor Page Tree','\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\nInsert/Edit Link\r\n\r\n
\r\n Link Settings\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Link URL:
Link Target:\r\n
 
\r\n
\r\n \r\n\r\n
\r\n
\r\n\r\n\r\n
\r\n Available Page Tree\r\n\r\n\r\n \')\">
\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n','richEditor/pagetree',1,1); UPDATE template set template = '\r\n \r\n \r\n <tmpl_var session.page.title> - <tmpl_var session.setting.companyName>\r\n \r\n \r\n\r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n\r\n \r\n ' where templateId = '10' and namespace='style'; delete from userProfileField where fieldName='richEditor'; INSERT INTO userProfileField VALUES ('richEditor','WebGUI::International::get(496)',1,0,'selectList','{5=>WebGUI::International::get(880),\r\nnone=>WebGUI::International::get(881),\r\n\'tinymce\'=>WebGUI::International::get(\"tinymce\")\n}','[\'tinymce\']',11,'4',0,1); diff --git a/lib/WebGUI/Operation.pm b/lib/WebGUI/Operation.pm index 72ed31ba5..35ffb269e 100644 --- a/lib/WebGUI/Operation.pm +++ b/lib/WebGUI/Operation.pm @@ -168,6 +168,7 @@ sub getOperations { 'moveTreePageDown' => 'WebGUI::Operation::Page', 'moveTreePageLeft' => 'WebGUI::Operation::Page', 'moveTreePageRight' => 'WebGUI::Operation::Page', + 'richEditPageTree' => 'WebGUI::Operation::Page', 'editProfile' => 'WebGUI::Operation::Profile', 'editProfileSave' => 'WebGUI::Operation::Profile', 'viewProfile' => 'WebGUI::Operation::Profile', diff --git a/lib/WebGUI/Operation/Collateral.pm b/lib/WebGUI/Operation/Collateral.pm index b9dd1288f..5c08362d5 100644 --- a/lib/WebGUI/Operation/Collateral.pm +++ b/lib/WebGUI/Operation/Collateral.pm @@ -493,13 +493,12 @@ sub _htmlAreaCreateTree { my ($name, $description, $url, $image, $indent, $target, $delete) = @_; if($delete) { $delete = qq//; - $delete .= ''; + $delete .= deleteIcon().""; } $target = ' target="'.$target.'" ' if ($target); $output .= ''; - $output .= ('') x$indent; - $output .= ''.$name.''; + $output .= ('') x$indent; + $output .= ''.$name.''; $output .= ''.$name.''; $output .= ''.$delete.''; return $output; @@ -566,7 +565,7 @@ sub www_htmlAreaviewCollateral { $output .= ''; if($session{form}{cid} eq "" || ! WebGUI::Grouping::isInGroup(4)) { $output .= '
'; - $output .= '


'; $output .= '

WebGUI Image Manager
for TinyMCE

'; $output .= '
'; diff --git a/lib/WebGUI/Utility.pm b/lib/WebGUI/Utility.pm index 7cdc015c0..62f9398aa 100644 --- a/lib/WebGUI/Utility.pm +++ b/lib/WebGUI/Utility.pm @@ -21,7 +21,7 @@ use strict; use Tie::IxHash; our @ISA = qw(Exporter); -our @EXPORT = qw(&makeTabSafe &makeArrayTabSafe &randomizeHash &commify &randomizeArray +our @EXPORT = qw(&isBetween &makeTabSafe &makeArrayTabSafe &randomizeHash &commify &randomizeArray &sortHashDescending &sortHash &isIn &makeCommaSafe &makeArrayCommaSafe &randint &round); @@ -75,6 +75,41 @@ sub commify { #------------------------------------------------------------------- +=head2 isBetween ( value, first, second ) + +Returns true if value is between two other values (inclusive). Otherwise returns false. + +=head3 value + +An integer to compare against first and second. + +=head3 first + +An integer to compare value against. + +=head3 second + +Another integer to compare value against. + +=cut + +sub isBetween { + my $value = shift; + my $first = shift; + my $second = shift; + if ($first > $second) { + my $temp = $first; + $first = $second; + $second = $temp; + } + if ($value >= $first && $value <= $second) { + return 1; + } + return 0; +} + +#------------------------------------------------------------------- + =head2 isIn ( value, list ) Returns a boolean value as to whether the value is in the array. diff --git a/www/extras/adminConsole/adminConsole.css b/www/extras/adminConsole/adminConsole.css index 693d71d48..d3d94b6de 100644 --- a/www/extras/adminConsole/adminConsole.css +++ b/www/extras/adminConsole/adminConsole.css @@ -1,11 +1,24 @@ - +body{ + background-image: url(bg.jpg); + background-repeat: repeat-x; + border: 5px #4E8AAB solid; + margin:0px; +} .adminConsoleTitleIcon { position: absolute; - top: 10px; - left: 20px; + top: 12px; + left: 22px; width: 48px; height: 48px; text-align: center; + z-index: 10; +} + +.adminConsoleTitleIconMedalian { + z-index: 5; + position: absolute; + top: 4px; + left: 14px; } .adminConsoleTitle { @@ -14,10 +27,9 @@ left: 85px; font-size: 50px; text-align: left; - /*background-image: url(bg_title.gif);*/ - background-repeat: repeat-x; + padding: 20px 0px 0px 0px; font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, Arial, sans-serif; - color: black; + color: white; text-transform: uppercase; letter-spacing: 2px; font-size: 25px; @@ -26,12 +38,13 @@ } .adminConsoleWorkArea { - border: 1px solid #ddd; - margin: 65px 200px 50px 10px; - padding: 5px; - -moz-border-radius: 10px; + border: 1px solid #D7D7D7; + margin: 65px 190px 50px 10px; + padding: 15px; + /*-moz-border-radius: 10px;*/ background-image: url(bg_console.gif); background-repeat: repeat-x; + min-height: 400px; } /* Hides from non-ie: the holly hack \*/ * html .adminConsoleWorkArea { @@ -50,33 +63,33 @@ padding: 5px; */ font-family: helvetica, arial; font-size: 12px; - background-image: url(bg_console.gif); - background-repeat: repeat-x; + /* background-image: url(bg_console.gif); + background-repeat: repeat-x; */ } .adminConsoleMainMenu { - border: 1px solid #ddd; + border: 1px solid #D7D7D7; padding: 5px; margin: 5px; - -moz-border-radius: 10px; + /*-moz-border-radius: 10px;*/ background-image: url(bg_console.gif); background-repeat: repeat-x; } .adminConsoleSubmenu { - border: 1px solid #ddd; + border: 1px solid #D7D7D7; padding: 5px; margin: 5px; - -moz-border-radius: 10px; + /*-moz-border-radius: 10px;*/ background-image: url(bg_console.gif); background-repeat: repeat-x; } .adminConsoleUtilityMenu { - border: 1px solid #ddd; + border: 1px solid #D7D7D7; padding: 5px; margin: 5px; - -moz-border-radius: 10px; + /*-moz-border-radius: 10px;*/ background-image: url(bg_console.gif); background-repeat: repeat-x; } @@ -142,17 +155,19 @@ /* tab forms */ .tab { - border: 1px solid black; + border: 1px solid #dddddd; background-color: #eeeeee; - -moz-border-radius: 6px 6px 0px 0px; + background-image: url(bg_console.gif); + background-repeat: repeat-x; + /*-moz-border-radius: 6px 6px 0px 0px;*/ } .tabBody { - border: 1px solid black; - border-top: 1px solid black; - border-left: 1px solid black; - background-color: #dddddd; - -moz-border-radius: 10px; + border: 1px solid #dddddd; + border-top: 1px solid #dddddd; + border-left: 1px solid #dddddd; + background-color: #ffffff; + /*-moz-border-radius: 10px;*/ } div.tabs { @@ -179,3 +194,16 @@ div.tabs { font-family: helvetica, arial; font-size: 11px; } + +a{ + font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, Arial, sans-serif; + color: #639CBA; + text-decoration: none; +} + +a:hover{ + font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, Arial, sans-serif; + color: 336B8A; + text-decoration: underline; + +} diff --git a/www/extras/adminConsole/adminConsole.gif b/www/extras/adminConsole/adminConsole.gif index b0f570e10..95fae9d3d 100644 Binary files a/www/extras/adminConsole/adminConsole.gif and b/www/extras/adminConsole/adminConsole.gif differ diff --git a/www/extras/adminConsole/assets.gif b/www/extras/adminConsole/assets.gif index b0f570e10..77dd54ba6 100644 Binary files a/www/extras/adminConsole/assets.gif and b/www/extras/adminConsole/assets.gif differ diff --git a/www/extras/adminConsole/clipboard.gif b/www/extras/adminConsole/clipboard.gif index b0f570e10..d127fec69 100644 Binary files a/www/extras/adminConsole/clipboard.gif and b/www/extras/adminConsole/clipboard.gif differ diff --git a/www/extras/adminConsole/databases.gif b/www/extras/adminConsole/databases.gif index b0f570e10..0f24d4e21 100644 Binary files a/www/extras/adminConsole/databases.gif and b/www/extras/adminConsole/databases.gif differ diff --git a/www/extras/adminConsole/help-small.gif b/www/extras/adminConsole/help-small.gif deleted file mode 100644 index b0f570e10..000000000 Binary files a/www/extras/adminConsole/help-small.gif and /dev/null differ diff --git a/www/extras/adminConsole/help.gif b/www/extras/adminConsole/help.gif index b0f570e10..c625ca758 100644 Binary files a/www/extras/adminConsole/help.gif and b/www/extras/adminConsole/help.gif differ diff --git a/www/extras/adminConsole/packages.gif b/www/extras/adminConsole/packages.gif index b0f570e10..13e4fe62f 100644 Binary files a/www/extras/adminConsole/packages.gif and b/www/extras/adminConsole/packages.gif differ diff --git a/www/extras/adminConsole/statistics.gif b/www/extras/adminConsole/statistics.gif index b0f570e10..9e46265aa 100644 Binary files a/www/extras/adminConsole/statistics.gif and b/www/extras/adminConsole/statistics.gif differ diff --git a/www/extras/adminConsole/trash.gif b/www/extras/adminConsole/trash.gif index b0f570e10..2a6d224b9 100644 Binary files a/www/extras/adminConsole/trash.gif and b/www/extras/adminConsole/trash.gif differ diff --git a/www/extras/tinymce/changelog b/www/extras/tinymce/changelog index 97876b932..8af95e654 100644 --- a/www/extras/tinymce/changelog +++ b/www/extras/tinymce/changelog @@ -1,3 +1,30 @@ +Version 1.36 (2004-10-19) + Added a newly modified version of the German language pack from "krokogras". + Added auto resizing to popup windows with the same name. + Added example page for the plugin_preview_pageurl option in the preview plugin. + Fixed issue with link button auto enable/disable feature when content selection was made with the keyboard. + Fixed bug where events wasn't handled correctly in MSIE 5.5 and some 6.0 versions. + Fixed so align on images gets set as float style when the inline_styles option is enabled. + Fixed so solid border style isn't applied on elements with a border when the inline_styles option is enabled. + Fixed some issues with tables and the inline_styles option. + Fixed back button issue with MSIE, iframes was placed in browser history. +Version 1.35 (2004-10-13) + Added so that whitespace gets stripped in plugin and theme_advanced_buttons options. + Added custom plugin_preview_pageurl option to preview plugin. + Added Canadian French language packs for the new plugins, contributed by Virtuelcom. + Added new theme_advanced_blockformats option. + Added new title support to advanced theme link dialog. + Added new Ctrl+B/I/U keyboard shortcuts for Firefox. + Added Polish language pack contributed by "revyag". + Added Taiwanese language pack contributed by "Jim Kou". + Added updated German language pack contributed by "Krokogras". + Fixed some issues with ieSpell including better language support. + Fixed bug with default value in valid_elements not working in Firefox some times. + Fixed bug when focusing links without selecting any characters. + Fixed some typos in Swedish language pack. + Fixed bug with content selection and link button auto enable/disable feature. + Fixed bug issue when "theme_advanced_buttons" options where left empty. + Fixed various bugs with absolute URLs. Version 1.34 (2004-10-03) Added new insertdatetime plugin, inserts date/time in various formats. Added new preview plugin, previews the HTML page in a new window. diff --git a/www/extras/tinymce/docs/using.htm b/www/extras/tinymce/docs/using.htm index 0f68675b2..e28f0c7df 100755 --- a/www/extras/tinymce/docs/using.htm +++ b/www/extras/tinymce/docs/using.htm @@ -205,9 +205,9 @@ optional and is not a requierd setting.
[insertlink_callback] Name of function to call when "insertlink" command is executed. This function gets the selected link url and target and should return a - array with "href" and "target" as collection names or + array with "href", "target" and "title" as collection names or call the tinyMCE.insertLink on window.opener for compatiblity with Mozilla - if a new window was used. Function format: linkcallback(href, target). + if a new window was used. Function format: linkcallback(href, target, title). [insertimage_callback] @@ -343,7 +343,7 @@ optional and is not a requierd setting.
[inline_styles] - If enabled attributes like width, height, vspace, hspace and align gets placed within the style attribute instead. The default value for this option is false. + If enabled attributes like width, height, vspace, hspace and align gets placed within the style attribute instead. The default value for this option is false. Remeber to enable the style attribute in valid elements when using this one. Advanced theme specific settings @@ -390,10 +390,14 @@ optional and is not a requierd setting.
[theme_advanced_source_editor_width] Source editor window width. - + [theme_advanced_source_editor_height] Source editor window height. + + [theme_advanced_blockformats] + Comma separated list of blockformats for the formatselect list. Defaults to: p,address,pre,h1,h2,h3,h4,h5,h6. +
Heres a example of a more complex initialization:
@@ -674,7 +678,18 @@ template - Name/Value array with width, height and html keys in it.
name - Name of window argument to get.
[default_value] - Default value to be returned if window argument is missing.

-Returns: Window argument value.
+Returns: Window argument value. +
+Syntax: tinyMCE.getParam(name, [default_value], [strip_whitespace]);
+
+Description: This method returns a TinyMCE configuration parameter.
+
+Parameters:
+name - Name of window argument to get.
+[default_value] - Default value to be returned if window argument is missing.
+[strip_whitespace] - If true all whitespace will be removed from return value, default: false.
+
+Returns: TinyMCE configuration parameter.

diff --git a/www/extras/tinymce/jscripts/tiny_mce/langs/de.js b/www/extras/tinymce/jscripts/tiny_mce/langs/de.js index d929e3b95..4dbfec1e1 100644 --- a/www/extras/tinymce/jscripts/tiny_mce/langs/de.js +++ b/www/extras/tinymce/jscripts/tiny_mce/langs/de.js @@ -1,5 +1,6 @@ // DE lang variables // Edited by Simon Rupf (simon.rupf@intnet.ch) +// updated by krokogras 10/14/2004 tinyMCELang['lang_bold_desc'] = 'Fett'; tinyMCELang['lang_italic_desc'] = 'Kursiv'; @@ -9,25 +10,25 @@ tinyMCELang['lang_justifyleft_desc'] = 'Linksbündig'; tinyMCELang['lang_justifycenter_desc'] = 'Zentriert'; tinyMCELang['lang_justifyright_desc'] = 'Rechtsbündig'; tinyMCELang['lang_justifyfull_desc'] = 'Blocksatz'; -tinyMCELang['lang_bullist_desc'] = 'Aufzählungszeichen'; +tinyMCELang['lang_bullist_desc'] = 'Aufzählungszeichen'; tinyMCELang['lang_numlist_desc'] = 'Nummerierung'; tinyMCELang['lang_outdent_desc'] = 'Einzug verkleinern'; tinyMCELang['lang_indent_desc'] = 'Einzug vergrössern'; -tinyMCELang['lang_undo_desc'] = 'Rückgängig'; +tinyMCELang['lang_undo_desc'] = 'Rückgängig'; tinyMCELang['lang_redo_desc'] = 'Wiederholen'; tinyMCELang['lang_link_desc'] = 'Hyperlink einfügen'; -tinyMCELang['lang_unlink_desc'] = 'Hyperlink löschen'; -tinyMCELang['lang_image_desc'] = 'Bild einfügen'; +tinyMCELang['lang_unlink_desc'] = 'Hyperlink löschen'; +tinyMCELang['lang_image_desc'] = 'Bild einfügen/bearbeiten'; tinyMCELang['lang_cleanup_desc'] = 'unsauberen Code aufräumen'; -tinyMCELang['lang_focus_alert'] = 'Bevor dieser Befehl ausgef\u00FChrt werden kann, muss eine zu editierende Instanz angegeben werden.'; -tinyMCELang['lang_edit_confirm'] = 'Möchten Sie den WYSIWYG-Modus f\u00FCr dieses Textfeld benutzen?'; +tinyMCELang['lang_focus_alert'] = 'Bevor dieser Befehl ausgeführt werden kann, muss die zu editierende Instanz ausgewählt werden.'; +tinyMCELang['lang_edit_confirm'] = 'Möchten Sie den WYSIWYG-Modus für dieses Textfeld benutzen?'; tinyMCELang['lang_insert_link_title'] = 'Hyperlink einfügen/bearbeiten'; tinyMCELang['lang_insert'] = 'Einfügen'; tinyMCELang['lang_cancel'] = 'Abbrechen'; tinyMCELang['lang_insert_link_url'] = 'Hyperlink URL'; tinyMCELang['lang_insert_link_target'] = 'Ziel'; -tinyMCELang['lang_insert_link_target_same'] = 'Den Hyperlink im gleichen Fenster öffnen'; -tinyMCELang['lang_insert_link_target_blank'] = 'Den Hyperlink in einem neuen Fenster öffnen'; +tinyMCELang['lang_insert_link_target_same'] = 'Hyperlink im gleichen Fenster öffnen'; +tinyMCELang['lang_insert_link_target_blank'] = 'Hyperlink in neuem Fenster öffnen'; tinyMCELang['lang_insert_image_title'] = 'Bild einfügen/bearbeiten'; tinyMCELang['lang_insert_image_src'] = 'Bild URL'; tinyMCELang['lang_insert_image_alt'] = 'Bildbeschreibung'; diff --git a/www/extras/tinymce/jscripts/tiny_mce/langs/se.js b/www/extras/tinymce/jscripts/tiny_mce/langs/se.js index 57589a895..7349846ad 100644 --- a/www/extras/tinymce/jscripts/tiny_mce/langs/se.js +++ b/www/extras/tinymce/jscripts/tiny_mce/langs/se.js @@ -10,7 +10,7 @@ tinyMCELang['lang_justifyright_desc'] = 'Högerställ'; tinyMCELang['lang_justifyfull_desc'] = 'Fyll'; tinyMCELang['lang_bullist_desc'] = 'Punktlista'; tinyMCELang['lang_numlist_desc'] = 'Nummerlista'; -tinyMCELang['lang_outdent_desc'] = 'Undrag'; +tinyMCELang['lang_outdent_desc'] = 'Utdrag'; tinyMCELang['lang_indent_desc'] = 'Indrag'; tinyMCELang['lang_undo_desc'] = 'Ångra'; tinyMCELang['lang_redo_desc'] = 'Gör om'; diff --git a/www/extras/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js b/www/extras/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js index 7f7db480a..86f1e5457 100644 --- a/www/extras/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js +++ b/www/extras/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js @@ -5,7 +5,7 @@ tinyMCE.importPluginLanguagePack('emotions', 'uk,se'); * Returns the HTML contents of the emotions control. */ function TinyMCE_emotions_getControlHTML(control_name) { - switch (control_name) { + switch (control_name) { case "emotions": return ''; } @@ -18,7 +18,7 @@ function TinyMCE_emotions_getControlHTML(control_name) { */ function TinyMCE_emotions_execCommand(editor_id, element, command, user_interface, value) { // Handle commands - switch (command) { + switch (command) { case "mceEmotion": var template = new Array(); diff --git a/www/extras/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js b/www/extras/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js index 971cc8253..fc4dcf446 100755 --- a/www/extras/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js +++ b/www/extras/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js @@ -23,11 +23,10 @@ function TinyMCE_iespell_execCommand(editor_id, element, command, user_interface ieSpell.CheckDocumentNode(tinyMCE._getInstanceById(editor_id).contentDocument.documentElement); } catch (e) { if (e.number == -2146827859) { - if (confirm("ieSpell not detected. Click OK to go to download page.")) - window.open('http://www.iespell.com/download.php','Download',''); - else - alert("Error Loading ieSpell: Exception " + exception.number); - } + if (confirm(tinyMCE.getLang("lang_iespell_download", "", true))) + window.open('http://www.iespell.com/download.php', 'ieSpellDownload', ''); + } else + alert("Error Loading ieSpell: Exception " + e.number); } return true; diff --git a/www/extras/tinymce/jscripts/tiny_mce/plugins/iespell/langs/se.js b/www/extras/tinymce/jscripts/tiny_mce/plugins/iespell/langs/se.js index 4cb1d37a9..2230c1cb9 100755 --- a/www/extras/tinymce/jscripts/tiny_mce/plugins/iespell/langs/se.js +++ b/www/extras/tinymce/jscripts/tiny_mce/plugins/iespell/langs/se.js @@ -1,3 +1,4 @@ // SE lang variables tinyMCELang['lang_iespell_desc'] = 'Kör rättstavningskontroll'; +tinyMCELang['lang_iespell_download'] = "ieSpell verkar inte vara installerad. Klicka OK för att ladda hem." diff --git a/www/extras/tinymce/jscripts/tiny_mce/plugins/iespell/langs/uk.js b/www/extras/tinymce/jscripts/tiny_mce/plugins/iespell/langs/uk.js index 54c5a8d91..b7cc3a439 100755 --- a/www/extras/tinymce/jscripts/tiny_mce/plugins/iespell/langs/uk.js +++ b/www/extras/tinymce/jscripts/tiny_mce/plugins/iespell/langs/uk.js @@ -1,3 +1,4 @@ // UK lang variables tinyMCELang['lang_iespell_desc'] = 'Run spell checking'; +tinyMCELang['lang_iespell_download'] = "ieSpell not detected. Click OK to go to download page." diff --git a/www/extras/tinymce/jscripts/tiny_mce/plugins/pagetree/editor_plugin.js b/www/extras/tinymce/jscripts/tiny_mce/plugins/pagetree/editor_plugin.js index 6cbb0fb95..4353dfdee 100755 --- a/www/extras/tinymce/jscripts/tiny_mce/plugins/pagetree/editor_plugin.js +++ b/www/extras/tinymce/jscripts/tiny_mce/plugins/pagetree/editor_plugin.js @@ -21,7 +21,11 @@ function TinyMCE_pagetree_execCommand(editor_id, element, command, user_interfac case "wgPageTree": var template = new Array(); - template['file'] = getWebguiProperty ("pageURL") + '?op=richEditPageTree'; // Relative to theme + alert(getWebguiProperty("pageURL")); + + template['file'] = "../../../../../.." + getWebguiProperty ("pageURL") + '?op=richEditPageTree'; // Relative to theme + + alert(template['file']); template['width'] = 500; template['height'] = 500; diff --git a/www/extras/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js b/www/extras/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js index d3a56a137..74aa5fdef 100755 --- a/www/extras/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js +++ b/www/extras/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js @@ -20,23 +20,38 @@ function TinyMCE_preview_execCommand(editor_id, element, command, user_interface // Handle commands switch (command) { case "mcePreview": - var win = window.open("", "mcePreview", "menubar=yes,toolbar=yes,scrollbars=yes,left=20,top=20,width=" + tinyMCE.getParam("plugin_preview_width", "550") + ",height=" + tinyMCE.getParam("plugin_preview_height", "600")); - var html = ""; + var previewPage = tinyMCE.getParam("plugin_preview_pageurl", null); + var previewWidth = tinyMCE.getParam("plugin_preview_width", "550"); + var previewHeight = tinyMCE.getParam("plugin_preview_height", "600"); - html += ''; - html += ''; - html += ''; - html += '' + tinyMCE.getLang('lang_preview_desc') + ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += tinyMCE.getContent(); - html += ''; - html += ''; + // Use a custom preview page + if (previewPage) { + var template = new Array(); - win.document.write(html); - win.document.close(); + template['file'] = previewPage; + template['width'] = previewWidth; + template['height'] = previewHeight; + + tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "yes", content : tinyMCE.getContent(), content_css : tinyMCE.getParam("content_css")}); + } else { + var win = window.open("", "mcePreview", "menubar=yes,toolbar=yes,scrollbars=yes,left=20,top=20,width=" + previewWidth + ",height=" + previewHeight); + var html = ""; + + html += ''; + html += ''; + html += ''; + html += '' + tinyMCE.getLang('lang_preview_desc') + ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += tinyMCE.getContent(); + html += ''; + html += ''; + + win.document.write(html); + win.document.close(); + } return true; } diff --git a/www/extras/tinymce/jscripts/tiny_mce/plugins/preview/readme.txt b/www/extras/tinymce/jscripts/tiny_mce/plugins/preview/readme.txt index bebcb7f73..01ca90ce5 100755 --- a/www/extras/tinymce/jscripts/tiny_mce/plugins/preview/readme.txt +++ b/www/extras/tinymce/jscripts/tiny_mce/plugins/preview/readme.txt @@ -19,3 +19,5 @@ Initialization example: Configuration: plugin_preview_width - Preview window width. Defaults to 550. plugin_preview_height - Preview window height. Defaults to 600. + plugin_preview_pageurl - Custom preview page URL relative from theme + use "../../plugins/preview/example.html" for a example. diff --git a/www/extras/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js b/www/extras/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js index 6a8319729..de8380dd3 100644 --- a/www/extras/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js +++ b/www/extras/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js @@ -1,16 +1,5 @@ /* Import theme specific language pack */ - tinyMCE.importThemeLanguagePack();var TinyMCE_advanced_autoImportCSSClasses=true;var TinyMCE_advanced_foreColor="#000000";var TinyMCE_advanced_anchorName="";var TinyMCE_advanced_buttons=[['bold','{$lang_bold_img}','{$lang_bold_desc}','Bold'],['italic','{$lang_italic_img}','{$lang_italic_desc}','Italic'],['underline','underline.gif','{$lang_underline_desc}','Underline'],['strikethrough','strikethrough.gif','{$lang_striketrough_desc}','Strikethrough'],['justifyleft','left.gif','{$lang_justifyleft_desc}','JustifyLeft'],['justifycenter','center.gif','{$lang_justifycenter_desc}','JustifyCenter'],['justifyright','right.gif','{$lang_justifyright_desc}','JustifyRight'],['justifyfull','full.gif','{$lang_justifyfull_desc}','JustifyFull'],['bullist','bullist.gif','{$lang_bullist_desc}','InsertUnorderedList'],['numlist','numlist.gif','{$lang_numlist_desc}','InsertOrderedList'],['outdent','outdent.gif','{$lang_outdent_desc}','Outdent'],['indent','indent.gif','{$lang_indent_desc}','Indent'],['undo','undo.gif','{$lang_undo_desc}','Undo'],['redo','redo.gif','{$lang_redo_desc}','Redo'],['link','link.gif','{$lang_link_desc}','mceLink',true],['unlink','unlink.gif','{$lang_unlink_desc}','unlink'],['image','image.gif','{$lang_image_desc}','mceImage',true],['cleanup','cleanup.gif','{$lang_cleanup_desc}','mceCleanup'],['help','help.gif','{$lang_help_desc}','mceHelp'],['code','code.gif','{$lang_theme_code_desc}','mceCodeEditor'],['table','table.gif','{$lang_theme_table_desc}','mceInsertTable',true],['row_before','table_insert_row_before.gif','{$lang_theme_table_insert_row_before_desc}','mceTableInsertRowBefore'],['row_after','table_insert_row_after.gif','{$lang_theme_table_insert_row_after_desc}','mceTableInsertRowAfter'],['delete_row','table_delete_row.gif','{$lang_theme_table_delete_row_desc}','mceTableDeleteRow'],['col_before','table_insert_col_before.gif','{$lang_theme_table_insert_col_before_desc}','mceTableInsertColBefore'],['col_after','table_insert_col_after.gif','{$lang_theme_table_insert_col_after_desc}','mceTableInsertColAfter'],['delete_col','table_delete_col.gif','{$lang_theme_table_delete_col_desc}','mceTableDeleteCol'],['hr','hr.gif','{$lang_theme_hr_desc}','inserthorizontalrule'],['removeformat','removeformat.gif','{$lang_theme_removeformat_desc}','removeformat'],['sub','sub.gif','{$lang_theme_sub_desc}','subscript'],['sup','sup.gif','{$lang_theme_sup_desc}','superscript'],['forecolor','forecolor.gif','{$lang_theme_forecolor_desc}','mceForeColor'],['charmap','charmap.gif','{$lang_theme_charmap_desc}','mceCharMap'],['visualaid','visualaid.gif','{$lang_theme_visualaid_desc}','mceToggleVisualAid'],['anchor','anchor.gif','{$lang_theme_anchor_desc}','mceInsertAnchor']];function TinyMCE_advanced_getControlHTML(button_name){for(var i=0;i';}switch(button_name){case "formatselect":return '';case "styleselect":return '';case "fontselect":return '';var formats=tinyMCE.getParam("theme_advanced_blockformats","p,address,pre,h1,h2,h3,h4,h5,h6",true).split(',');var lookup=[['p','{$lang_theme_paragraph}'],['address','{$lang_theme_address}'],['pre','{$lang_theme_pre}'],['h1','{$lang_theme_h1}'],['h2','{$lang_theme_h2}'],['h3','{$lang_theme_h3}'],['h4','{$lang_theme_h4}'],['h5','{$lang_theme_h5}'],['h6','{$lang_theme_h6}']];for(var i=0;i'+lookup[x][1]+'';}}html+='';return html;case "styleselect":return '';case "fontselect":return '';case "separator":return '';case "rowseparator":return '
';}return "";}function TinyMCE_advanced_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceForeColor":var template=new Array();var inputColor=TinyMCE_advanced_foreColor;if(!inputColor)inputColor="#000000";template['file']='color_picker.htm';template['width']=170;template['height']=205;tinyMCE.openWindow(template,{editor_id:editor_id,command:"forecolor",input_color:inputColor});return true;case "mceCodeEditor":var template=new Array();template['file']='source_editor.htm';template['width']=tinyMCE.getParam("theme_advanced_source_editor_width",440);template['height']=tinyMCE.getParam("theme_advanced_source_editor_height",370);tinyMCE.openWindow(template,{editor_id:editor_id,resizable:"yes",scrollbars:"yes"});return true;case "mceCharMap":var template=new Array();template['file']='charmap.htm';template['width']=320;template['height']=190;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case "mceInsertAnchor":var template=new Array();template['file']='anchor.htm';template['width']=320;template['height']=110;tinyMCE.openWindow(template,{editor_id:editor_id,name:TinyMCE_advanced_anchorName});return true;}return false;}function TinyMCE_advanced_getEditorTemplate(settings){function removeFromArray(in_array,remove_array){var outArray=new Array();for(var i=0;i0)toolbarHTML+="
";var buttonNamesRow2=tinyMCE.getParam("theme_advanced_buttons2","bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code").split(',');buttonNamesRow2=removeFromArray(buttonNamesRow2,tinyMCE.getParam("theme_advanced_disable","").split(','));buttonNamesRow2=addToArray(buttonNamesRow2,tinyMCE.getParam("theme_advanced_buttons2_add","").split(','));for(var i=0;i0)toolbarHTML+="
";var buttonNamesRow3=tinyMCE.getParam("theme_advanced_buttons3","table,separator,row_before,row_after,delete_row,separator,col_before,col_after,delete_col,separator,hr,removeformat,visualaid,separator,sub,sup,separator,charmap").split(',');buttonNamesRow3=removeFromArray(buttonNamesRow3,tinyMCE.getParam("theme_advanced_disable","").split(','));buttonNamesRow3=addToArray(buttonNamesRow3,tinyMCE.getParam("theme_advanced_buttons3_add","").split(','));for(var i=0;i';if(toolbarLocation=="top")template['html']+='
';template['html']+='';template['html']+='';if(toolbarLocation=="bottom")template['html']+='';template['html']+='';var styleSelectHTML='';if(settings['theme_advanced_styles']){var stylesAr=settings['theme_advanced_styles'].split(';');for(var i=0;i'+key+'';}TinyMCE_advanced_autoImportCSSClasses=false;}template['html']=tinyMCE.replaceVar(template['html'],'style_select_options',styleSelectHTML);template['delta_width']=0;template['delta_height']=-40;return template;}function TinyMCE_advanced_getInsertLinkTemplate(){var template=new Array();template['file']='link.htm';template['width']=320;template['height']=130;template['width']+=tinyMCE.getLang('lang_insert_link_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_link_delta_height',0);return template;}function TinyMCE_advanced_getInsertImageTemplate(){var template=new Array();template['file']='image.htm';template['width']=340;template['height']=260;template['width']+=tinyMCE.getLang('lang_insert_image_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_image_delta_height',0);return template;}function TinyMCE_advanced_getInsertTableTemplate(settings){var template=new Array();template['file']='table.htm';template['width']=330;template['height']=200;template['width']+=tinyMCE.getLang('lang_insert_table_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_table_delta_height',0);return template;}function TinyMCE_advanced_handleNodeChange(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){function selectByValue(select_elm,value){if(select_elm){for(var i=0;i0))tinyMCE.switchClassSticky(editor_id+'_redo','mceButtonNormal',false);if(undo_index!=-1&&(undo_index>0&&undo_levels>0))tinyMCE.switchClassSticky(editor_id+'_undo','mceButtonNormal',false);var selectElm=document.getElementById(editor_id+"_styleSelect");if(selectElm){TinyMCE_advanced_setupCSSClasses(editor_id);classNode=node;breakOut=false;var index=0;do{if(classNode&&classNode.className){for(var i=0;i");}else selectByValue(selectElm,"

");}var selectElm=document.getElementById(editor_id+"_fontNameSelect");if(selectElm){var elm=tinyMCE.getParentElement(node,"font","face");if(elm)selectByValue(selectElm,elm.getAttribute("face"));else selectByValue(selectElm,"");}var selectElm=document.getElementById(editor_id+"_fontSizeSelect");if(selectElm){var elm=tinyMCE.getParentElement(node,"font","size");if(elm)selectByValue(selectElm,elm.getAttribute("size"));else selectByValue(selectElm,"1");}alignNode=node;breakOut=false;do{if(!alignNode.getAttribute||!alignNode.getAttribute('align'))continue;switch(alignNode.getAttribute('align').toLowerCase()){case "left":tinyMCE.switchClassSticky(editor_id+'_justifyleft','mceButtonSelected');breakOut=true;break;case "right":tinyMCE.switchClassSticky(editor_id+'_justifyright','mceButtonSelected');breakOut=true;break;case "middle":case "center":tinyMCE.switchClassSticky(editor_id+'_justifycenter','mceButtonSelected');breakOut=true;break;case "justify":tinyMCE.switchClassSticky(editor_id+'_justifyfull','mceButtonSelected');breakOut=true;break;}}while(!breakOut&&(alignNode=alignNode.parentNode));do{switch(node.nodeName.toLowerCase()){case "b":case "strong":tinyMCE.switchClassSticky(editor_id+'_bold','mceButtonSelected');break;case "i":case "em":tinyMCE.switchClassSticky(editor_id+'_italic','mceButtonSelected');break;case "u":tinyMCE.switchClassSticky(editor_id+'_underline','mceButtonSelected');break;case "strike":tinyMCE.switchClassSticky(editor_id+'_strikethrough','mceButtonSelected');break;case "ul":tinyMCE.switchClassSticky(editor_id+'_bullist','mceButtonSelected');break;case "ol":tinyMCE.switchClassSticky(editor_id+'_numlist','mceButtonSelected');break;case "sub":tinyMCE.switchClassSticky(editor_id+'_sub','mceButtonSelected');break;case "sup":tinyMCE.switchClassSticky(editor_id+'_sup','mceButtonSelected');break;}}while((node=node.parentNode));}function TinyMCE_advanced_setupCSSClasses(editor_id){if(!TinyMCE_advanced_autoImportCSSClasses)return;var selectElm=document.getElementById(editor_id+'_styleSelect');if(selectElm&&selectElm.getAttribute('cssImported')!='true'){var csses=tinyMCE.getCSSClasses(editor_id);if(csses&&selectElm){for(var i=0;i0)selectElm.setAttribute('cssImported','true');}} \ No newline at end of file + ';if(toolbarLocation=="bottom")template['html']+=''+toolbarHTML+'';template['html']+='';var styleSelectHTML='';if(settings['theme_advanced_styles']){var stylesAr=settings['theme_advanced_styles'].split(';');for(var i=0;i'+key+'';}TinyMCE_advanced_autoImportCSSClasses=false;}template['html']=tinyMCE.replaceVar(template['html'],'style_select_options',styleSelectHTML);template['delta_width']=0;template['delta_height']=-40;return template;}function TinyMCE_advanced_getInsertLinkTemplate(){var template=new Array();template['file']='link.htm';template['width']=320;template['height']=160;template['width']+=tinyMCE.getLang('lang_insert_link_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_link_delta_height',0);return template;}function TinyMCE_advanced_getInsertImageTemplate(){var template=new Array();template['file']='image.htm';template['width']=340;template['height']=260;template['width']+=tinyMCE.getLang('lang_insert_image_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_image_delta_height',0);return template;}function TinyMCE_advanced_getInsertTableTemplate(settings){var template=new Array();template['file']='table.htm';template['width']=330;template['height']=200;template['width']+=tinyMCE.getLang('lang_insert_table_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_table_delta_height',0);return template;}function TinyMCE_advanced_handleNodeChange(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){function selectByValue(select_elm,value){if(select_elm){for(var i=0;i0))tinyMCE.switchClassSticky(editor_id+'_redo','mceButtonNormal',false);if(undo_index!=-1&&(undo_index>0&&undo_levels>0))tinyMCE.switchClassSticky(editor_id+'_undo','mceButtonNormal',false);var selectElm=document.getElementById(editor_id+"_styleSelect");if(selectElm){TinyMCE_advanced_setupCSSClasses(editor_id);classNode=node;breakOut=false;var index=0;do{if(classNode&&classNode.className){for(var i=0;i");}else selectByValue(selectElm,"

");}var selectElm=document.getElementById(editor_id+"_fontNameSelect");if(selectElm){var elm=tinyMCE.getParentElement(node,"font","face");if(elm)selectByValue(selectElm,elm.getAttribute("face"));else selectByValue(selectElm,"");}var selectElm=document.getElementById(editor_id+"_fontSizeSelect");if(selectElm){var elm=tinyMCE.getParentElement(node,"font","size");if(elm)selectByValue(selectElm,elm.getAttribute("size"));else selectByValue(selectElm,"1");}alignNode=node;breakOut=false;do{if(!alignNode.getAttribute||!alignNode.getAttribute('align'))continue;switch(alignNode.getAttribute('align').toLowerCase()){case "left":tinyMCE.switchClassSticky(editor_id+'_justifyleft','mceButtonSelected');breakOut=true;break;case "right":tinyMCE.switchClassSticky(editor_id+'_justifyright','mceButtonSelected');breakOut=true;break;case "middle":case "center":tinyMCE.switchClassSticky(editor_id+'_justifycenter','mceButtonSelected');breakOut=true;break;case "justify":tinyMCE.switchClassSticky(editor_id+'_justifyfull','mceButtonSelected');breakOut=true;break;}}while(!breakOut&&(alignNode=alignNode.parentNode));do{switch(node.nodeName.toLowerCase()){case "b":case "strong":tinyMCE.switchClassSticky(editor_id+'_bold','mceButtonSelected');break;case "i":case "em":tinyMCE.switchClassSticky(editor_id+'_italic','mceButtonSelected');break;case "u":tinyMCE.switchClassSticky(editor_id+'_underline','mceButtonSelected');break;case "strike":tinyMCE.switchClassSticky(editor_id+'_strikethrough','mceButtonSelected');break;case "ul":tinyMCE.switchClassSticky(editor_id+'_bullist','mceButtonSelected');break;case "ol":tinyMCE.switchClassSticky(editor_id+'_numlist','mceButtonSelected');break;case "sub":tinyMCE.switchClassSticky(editor_id+'_sub','mceButtonSelected');break;case "sup":tinyMCE.switchClassSticky(editor_id+'_sup','mceButtonSelected');break;}}while((node=node.parentNode));}function TinyMCE_advanced_setupCSSClasses(editor_id){if(!TinyMCE_advanced_autoImportCSSClasses)return;var selectElm=document.getElementById(editor_id+'_styleSelect');if(selectElm&&selectElm.getAttribute('cssImported')!='true'){var csses=tinyMCE.getCSSClasses(editor_id);if(csses&&selectElm){for(var i=0;i0)selectElm.setAttribute('cssImported','true');}} \ No newline at end of file diff --git a/www/extras/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js b/www/extras/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js index 1b6db0397..825f38fa1 100644 --- a/www/extras/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js +++ b/www/extras/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js @@ -58,18 +58,32 @@ function TinyMCE_advanced_getControlHTML(button_name) { // Custom controlls other than buttons switch (button_name) { case "formatselect": - return ''; + var html = ''; + + return html; + case "styleselect": return ''; @@ -193,9 +207,9 @@ function TinyMCE_advanced_getEditorTemplate(settings) { var toolbarLocation = tinyMCE.getParam("theme_advanced_toolbar_location", "bottom"); // Render row 1 - var buttonNamesRow1 = tinyMCE.getParam("theme_advanced_buttons1", "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect").split(','); - buttonNamesRow1 = removeFromArray(buttonNamesRow1, tinyMCE.getParam("theme_advanced_disable", "").split(',')); - buttonNamesRow1 = addToArray(buttonNamesRow1, tinyMCE.getParam("theme_advanced_buttons1_add", "").split(',')); + var buttonNamesRow1 = tinyMCE.getParam("theme_advanced_buttons1", "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect", true, ','); + buttonNamesRow1 = removeFromArray(buttonNamesRow1, tinyMCE.getParam("theme_advanced_disable", "", true, ',')); + buttonNamesRow1 = addToArray(buttonNamesRow1, tinyMCE.getParam("theme_advanced_buttons1_add", "", true, ',')); for (var i=0; i + + + + {$lang_theme_insert_link_titlefield}: + diff --git a/www/extras/tinymce/jscripts/tiny_mce/tiny_mce.js b/www/extras/tinymce/jscripts/tiny_mce/tiny_mce.js index c85c5f38c..62da3d43e 100644 --- a/www/extras/tinymce/jscripts/tiny_mce/tiny_mce.js +++ b/www/extras/tinymce/jscripts/tiny_mce/tiny_mce.js @@ -6,4 +6,4 @@ * @author Moxiecode * @copyright Copyright © 2004, Moxiecode Systems AB, All rights reserved. */ - function TinyMCE(){this.instances=new Array();this.stickyClassesLookup=new Array();this.windowArgs=new Array();this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.idCounter=0;this.init=TinyMCE_init;this.addMCEControl=TinyMCE_addMCEControl;this.createMCEControl=TinyMCE_createMCEControl;this.triggerSave=TinyMCE_triggerSave;this.execCommand=TinyMCE_execCommand;this.execInstanceCommand=TinyMCE_execInstanceCommand;this._createIFrame=TinyMCE__createIFrame;this.setEditMode=TinyMCE_setEditMode;this.handleEvent=TinyMCE_handleEvent;this.setupContent=TinyMCE_setupContent;this.switchClass=TinyMCE_switchClass;this.restoreAndSwitchClass=TinyMCE_restoreAndSwitchClass;this.switchClassSticky=TinyMCE_switchClassSticky;this.restoreClass=TinyMCE_restoreClass;this.setClassLock=TinyMCE_setClassLock;this.onLoad=TinyMCE_onLoad;this.removeMCEControl=TinyMCE_removeMCEControl;this._initCleanup=TinyMCE__initCleanup;this._cleanupHTML=TinyMCE__cleanupHTML;this._cleanupAttribute=TinyMCE__cleanupAttribute;this._fixInlineStyles=TinyMCE__fixInlineStyles;this._cleanupElementName=TinyMCE__cleanupElementName;this._verifyClass=TinyMCE__verifyClass;this.cleanupNode=TinyMCE_cleanupNode;this.convertStringToXML=TinyMCE_convertStringToXML;this.insertLink=TinyMCE_insertLink;this.insertImage=TinyMCE_insertImage;this.getElementByAttributeValue=TinyMCE_getElementByAttributeValue;this.getElementsByAttributeValue=TinyMCE_getElementsByAttributeValue;this.getParentElement=TinyMCE_getParentElement;this.getParam=TinyMCE_getParam;this.getLang=TinyMCE_getLang;this.replaceVar=TinyMCE_replaceVar;this.replaceVars=TinyMCE_replaceVars;this.triggerNodeChange=TinyMCE_triggerNodeChange;this.parseURL=TinyMCE_parseURL;this.convertAbsoluteURLToRelativeURL=TinyMCE_convertAbsoluteURLToRelativeURL;this.updateContent=TinyMCE_updateContent;this.getContent=TinyMCE_getContent;this.setContent=TinyMCE_setContent;this.importThemeLanguagePack=TinyMCE_importThemeLanguagePack;this.importPluginLanguagePack=TinyMCE_importPluginLanguagePack;this.applyTemplate=TinyMCE_applyTemplate;this.openWindow=TinyMCE_openWindow;this.handleVisualAid=TinyMCE_handleVisualAid;this.setAttrib=TinyMCE_setAttrib;this.getAttrib=TinyMCE_getAttrib;this._selectNode=TinyMCE__selectNode;this._getThemeFunction=TinyMCE__getThemeFunction;this._themeExecCommand=TinyMCE__themeExecCommand;this.getControlHTML=TinyMCE_getControlHTML;this._setHTML=TinyMCE__setHTML;this._getElementById=TinyMCE__getElementById;this._getInstanceById=TinyMCE__getInstanceById;this.getEditorId=TinyMCE_getEditorId;this.queryInstanceCommandValue=TinyMCE_queryInstanceCommandValue;this.queryInstanceCommandState=TinyMCE_queryInstanceCommandState;this.getWindowArg=TinyMCE_getWindowArg;this.getCSSClasses=TinyMCE_getCSSClasses;this.regexpReplace=TinyMCE_regexpReplace;}function TinyMCE_init(settings){var theme;if(typeof document.execCommand=='undefined')return;if(!tinyMCE.baseURL){var elements=document.getElementsByTagName('script');for(var i=0;i');document.write('');document.write('');var themePlugins=this.settings['plugins'].split(',');if(this.settings['plugins']!=''){for(var i=0;i');}}function TinyMCE_confirmAdd(e){if(tinyMCE.isMSIE)var targetElement=event.srcElement;else var targetElement=e.target;var elementId=targetElement.name?targetElement.name:targetElement.id;if(!targetElement.getAttribute('mce_noask')&&confirm(tinyMCELang['lang_edit_confirm']))tinyMCE.addMCEControl(targetElement,elementId,tinyMCE.createMCEControl(tinyMCE.settings));else targetElement.setAttribute('mce_noask','true');}function TinyMCE_updateContent(form_element_name){var formElement=document.getElementById(form_element_name);for(var instanceName in tinyMCE.instances){var instance=tinyMCE.instances[instanceName];if(instance.formElement==formElement){tinyMCE._setHTML(instance.contentWindow.document,instance.formElement.value);if(!tinyMCE.isMSIE)instance.contentWindow.document.body.innerHTML=tinyMCE._cleanupHTML(instance.contentWindow.document,this.settings,instance.contentWindow.document.body,instance.visualAid);}}}function TinyMCE_addMCEControl(replace_element,form_element_name,mce_control){var editorId="mce_editor_"+tinyMCE.idCounter++;mce_control.editorId=editorId;this.instances[editorId]=mce_control;mce_control.onAdd(replace_element,form_element_name);}function TinyMCE_createMCEControl(settings){return new TinyMCEControl(settings);}function TinyMCE_triggerSave(){for(var instanceName in tinyMCE.instances){var instance=tinyMCE.instances[instanceName];tinyMCE.settings['preformatted']=false;tinyMCE._setHTML(instance.contentWindow.document,instance.contentWindow.document.body.innerHTML);var cleanedHTML=tinyMCE._cleanupHTML(instance.contentWindow.document,this.settings,instance.contentWindow.document.body,this.visualAid,true);if(tinyMCE.settings["encoding"]=="xml"||tinyMCE.settings["encoding"]=="html")cleanedHTML=tinyMCE.convertStringToXML(cleanedHTML);if(tinyMCE.settings['save_callback']!="")var content=eval(tinyMCE.settings['save_callback']+"(instance.formTargetElementId,cleanedHTML,instance.contentWindow.document.body);");if((typeof content!="undefined")&&content!=null)cleanedHTML=content;instance.formElement.value=cleanedHTML;}}function TinyMCE_execInstanceCommand(editor_id,command,user_interface,value){var mceControl=tinyMCE._getInstanceById(editor_id);if(mceControl){mceControl.contentWindow.focus();this.selectedElement=mceControl.getFocusElement();this.selectedInstance=mceControl;tinyMCE.execCommand(command,user_interface,value);}}function TinyMCE_execCommand(command,user_interface,value){user_interface=user_interface?user_interface:false;value=value?value:null;switch(command){case 'mceHelp':window.open(tinyMCE.themeURL+"/docs/"+this.settings['docs_language']+"/index.htm","mceHelp","menubar=yes,toolbar=yes,scrollbars=yes,left=20,top=20,width=550,height=600");return;case 'mceFocus':var mceControl=tinyMCE._getInstanceById(value);if(mceControl)mceControl.contentWindow.focus();return;case "mceAddControl":case "mceAddEditor":tinyMCE.addMCEControl(tinyMCE._getElementById(value),value,tinyMCE.createMCEControl(tinyMCE.settings));return;case "mceRemoveControl":case "mceRemoveEditor":tinyMCE.removeMCEControl(value);return;}if(this.selectedInstance)this.selectedInstance.execCommand(command,user_interface,value);else if(tinyMCE.settings['focus_alert'])alert(tinyMCELang['lang_focus_alert']);}function TinyMCE_addEventHandlers(editor_id){var instance=tinyMCE.instances[editor_id];instance.contentWindow.document.editor_id=editor_id;instance.contentWindow.document.addEventListener("keypress",tinyMCE.handleEvent,false);instance.contentWindow.document.addEventListener("keydown",tinyMCE.handleEvent,false);instance.contentWindow.document.addEventListener("keyup",tinyMCE.handleEvent,false);instance.contentWindow.document.addEventListener("click",tinyMCE.handleEvent,false);instance.contentWindow.document.addEventListener("focus",tinyMCE.handleEvent,false);instance.contentWindow.document.designMode="on";}function TinyMCE__createIFrame(replace_element){var iframe=document.createElement("iframe");var id=replace_element.getAttribute("id");iframe.setAttribute("id",id);iframe.setAttribute("className","mceEditorArea");iframe.setAttribute("border","0");iframe.setAttribute("frameBorder","0");iframe.setAttribute("marginWidth","0");iframe.setAttribute("marginHeight","0");iframe.setAttribute("leftMargin","0");iframe.setAttribute("topMargin","0");iframe.setAttribute("width",tinyMCE.settings['area_width']);iframe.setAttribute("height",tinyMCE.settings['area_height']);iframe.style.width=tinyMCE.settings['area_width'];iframe.style.height=tinyMCE.settings['area_height'];if(tinyMCE.isMSIE)replace_element.outerHTML=iframe.outerHTML;else replace_element.parentNode.replaceChild(iframe,replace_element);if(tinyMCE.isMSIE)return window.frames[id];else return iframe;}function TinyMCE_setEditMode(editor_id,mode){var targetMCEControl=this.instances[editor_id];var dynamicIFrame=false;if(!this.isMSIE){var targetElement=document.getElementById(editor_id);if(targetElement&&targetElement.nodeName.toLowerCase()=="span"){targetElement=tinyMCE._createIFrame(targetElement);dynamicIFrame=true;}targetMCEControl.targetElement=targetElement;targetMCEControl.contentDocument=targetElement.contentDocument;targetMCEControl.contentWindow=targetElement.contentWindow;}else{var targetElement=document.getElementById(editor_id);if(targetElement&&targetElement.nodeName.toLowerCase()=="span"){targetElement=tinyMCE._createIFrame(targetElement);dynamicIFrame=true;}else targetElement=document.frames[editor_id];targetMCEControl.targetElement=targetElement;targetMCEControl.contentDocument=targetElement.window.document;targetMCEControl.contentWindow=targetElement.window;targetMCEControl.contentDocument.designMode=mode?"on":"off";}var doc=targetMCEControl.contentDocument;if(dynamicIFrame){var html="";html+='';html+='';html+='';html+='blank_page';html+='';html+='';html+='';html+='';html+='';try{targetMCEControl.contentWindow.document.designMode="on";doc.open();doc.write(html);doc.close();}catch(e){targetMCEControl.contentWindow.document.location.href=tinyMCE.baseURL+"/blank.htm";}}if(tinyMCE.isMSIE){document.frames[editor_id].document.ondeactive=tinyMCE.handleEvent;var patchFunc=function(){var event=document.frames[editor_id].event;event.target=event.srcElement;event.target.editor_id=editor_id;TinyMCE_handleEvent(event);};document.frames[editor_id].document.onkeypress=patchFunc;document.frames[editor_id].document.onkeyup=patchFunc;document.frames[editor_id].document.onkeydown=patchFunc;document.frames[editor_id].document.onmouseup=patchFunc;document.frames[editor_id].document.onclick=patchFunc;}tinyMCE.setupContent(editor_id);}function TinyMCE_setupContent(editor_id){var instance=tinyMCE.instances[editor_id];var doc=instance.contentWindow.document;var head=doc.getElementsByTagName('head').item(0);if(!tinyMCE.isMSIE&&doc.title!="blank_page"){doc.location.href=tinyMCE.baseURL+"/blank.htm";window.setTimeout("tinyMCE.setupContent('"+editor_id+"');",1000);return;}if(!head){window.setTimeout("tinyMCE.setupContent('"+editor_id+"');",10);return;}doc.body.dir=this.settings['directionality'];doc.editorId=editor_id;base=doc.createElement("base");base.setAttribute('href',tinyMCE.settings['base_href']);head.appendChild(base);var oldElement=instance.oldTargetElement;if(oldElement.nodeName.toLowerCase()=="textarea")var content=oldElement.value;else var content=instance.oldTargetElement.innerHTML;if(tinyMCE.isMSIE){var styleSheet=document.frames[editor_id].document.createStyleSheet(instance.settings['content_css']);window.setInterval('tinyMCE.getCSSClasses(document.frames["'+editor_id+'"].document, "'+editor_id+'");',500);if(tinyMCE.settings["force_br_newlines"])document.frames[editor_id].document.styleSheets[0].addRule("p","margin: 0px;");var patchFunc=function(){var event=document.frames[editor_id].event;event.target=document.frames[editor_id].document;TinyMCE_handleEvent(event);};document.frames[editor_id].document.body.onblur=patchFunc;document.frames[editor_id].document.body.onbeforepaste=patchFunc;document.frames[editor_id].document.body.onbeforecut=patchFunc;document.frames[editor_id].document.body.onpaste=patchFunc;document.frames[editor_id].document.body.editorId=editor_id;}else{var targetDocument=document.getElementById(editor_id).contentWindow.document;var cssImporter=targetDocument.createElement("link");cssImporter.rel="stylesheet";cssImporter.href=instance.settings['content_css'];if(headArr=targetDocument.getElementsByTagName("head"));headArr[0].appendChild(cssImporter);}if(!tinyMCE.isMSIE){if(tinyMCE.settings['cleanup_on_startup']){var contentElement=instance.contentWindow.document.createElement("body");contentElement.innerHTML=content;instance.contentWindow.document.body.innerHTML=tinyMCE._cleanupHTML(instance.contentWindow.document,this.settings,contentElement);}else{var contentElement=instance.contentWindow.document.createElement("body");var doc=instance.contentWindow.document;content=tinyMCE.regexpReplace(content,"","","gi");content=tinyMCE.regexpReplace(content,"","","gi");contentElement.innerHTML=content;var elms=contentElement.getElementsByTagName("img");for(var i=0;i");rng.collapse(false);rng.select();}}if(e.keyCode==8||e.keyCode==46){tinyMCE.selectedElement=e.target;tinyMCE.linkElement=tinyMCE.getParentElement(e.target,"a");tinyMCE.imgElement=tinyMCE.getParentElement(e.target,"img");tinyMCE.triggerNodeChange(false);}return false;break;case "keyup":case "keydown":if(e.target.editorId)tinyMCE.selectedInstance=tinyMCE.instances[e.target.editorId];else return;tinyMCE.selectedElement=null;var elm=tinyMCE.selectedInstance.getFocusElement();tinyMCE.linkElement=tinyMCE.getParentElement(elm,"a");tinyMCE.imgElement=tinyMCE.getParentElement(elm,"img");tinyMCE.selectedElement=elm;if(tinyMCE.isMSIE&&tinyMCE.settings['custom_undo_redo']){var keys=new Array(13,45,36,35,33,34,37,38,39,40);var posKey=false;for(var i=0;i18&&e.keyCode!=255)){tinyMCE.selectedInstance.execCommand("mceAddUndoLevel");tinyMCE.selectedInstance.typing=true;tinyMCE.triggerNodeChange(false);}if(posKey&&e.type=="keyup")tinyMCE.triggerNodeChange(false);var ctrlKeys=new Array(66,73,85,86,88);var keys=new Array(8,46);for(var i=0;i0){for(var i=0;i ";if(tinyMCE.isMSIE&&elementName=="script")return "<"+elementName+elementAttribs+">"+node.text+"";if(node.hasChildNodes()){if(elementName=="p"&&tinyMCE.cleanup_force_br_newlines)output+="";else output+="<"+elementName+elementAttribs+">";for(var i=0;i
";else output+="";}else output+="<"+elementName+elementAttribs+" />";return output;case 3:if(node.parentNode.nodeName.toLowerCase()=="script")return node.nodeValue;return this.convertStringToXML(node.nodeValue);case 8:return "";default:return "[UNKNOWN NODETYPE "+node.nodeType+"]";}}function TinyMCE_convertStringToXML(html_data){var output="";if(!html_data)return null;for(var i=0;i':output+=">";break;case '&':output+="&";break;case ''+String.fromCharCode(8230):output+="...";break;case '\\':output+="\";break;case ''+String.fromCharCode(160):output+=" ";break;default:output+=chr;}}return output;}function TinyMCE__initCleanup(){function getElementName(chunk){var pos;if((pos=chunk.indexOf('/'))!=-1)chunk=chunk.substring(0,pos);if((pos=chunk.indexOf('['))!=-1)chunk=chunk.substring(0,pos);return chunk;}var validElements=tinyMCE.settings["valid_elements"];validElements=validElements.split(',');var extendedValidElements=tinyMCE.settings["extended_valid_elements"];extendedValidElements=extendedValidElements.split(',');for(var i=0;i


','
');html=tinyMCE.regexpReplace(html,'

 


 

','
');if(!tinyMCE.isMSIE){html=html.replace(new RegExp('','g'),"");}if(tinyMCE.settings['apply_source_formatting']){html=html.replace(new RegExp('<(p|div)([^>]*)>','g'),"\n<$1$2>\n");html=html.replace(new RegExp('<\/(p|div)([^>]*)>','g'),"\n\n");html=html.replace(new RegExp('
','g'),"
\n");}if(tinyMCE.settings['force_br_newlines']){var re=new RegExp('

 

','g');html=html.replace(re,"
");}if(html=="
"||html=="

 

")html="";if(tinyMCE.settings["preformatted"])return "
"+html+"
";return html;}function TinyMCE_insertLink(href,target){this.execCommand("mceAddUndoLevel");if(this.selectedInstance&&this.selectedElement&&this.selectedElement.nodeName.toLowerCase()=="img"){var doc=this.selectedInstance.contentWindow.document;var linkElement=doc.createElement("a");href=eval(tinyMCE.settings['urlconvertor_callback']+"(href, linkElement);");linkElement.setAttribute('href',href);linkElement.setAttribute('target',target);linkElement.appendChild(this.selectedElement.cloneNode(true));this.selectedElement.parentNode.replaceChild(linkElement,this.selectedElement);return;}if(!this.linkElement&&this.selectedInstance){this.selectedInstance.contentDocument.execCommand("createlink",false,"#mce_temp_url#");tinyMCE.linkElement=this.getElementByAttributeValue(this.selectedInstance.contentDocument.body,"a","href","#mce_temp_url#");var elementArray=this.getElementsByAttributeValue(this.selectedInstance.contentDocument.body,"a","href","#mce_temp_url#");for(var i=0;i=strTok2.length){for(var i=0;i=strTok2.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break;}}}if(strTok1.length=strTok1.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break;}}}if(breakPoint==1)return url_to_relative;for(var i=0;i<(strTok1.length-(breakPoint-1));i++)outputString+="../";for(var i=breakPoint-1;i0);if(tinyMCE.settings['custom_undo_redo']){undoIndex=tinyMCE.selectedInstance.undoIndex;undoLevels=tinyMCE.selectedInstance.undoLevels.length;}var plugins=tinyMCE.settings['plugins'].split(',');for(var i=0;i');}function TinyMCE_importPluginLanguagePack(theme_name,valid_languages){var lang="uk";valid_languages=valid_languages.split(',');for(var i=0;i');}function TinyMCE_applyTemplate(html,args){html=tinyMCE.replaceVar(html,"themeurl",tinyMCE.themeURL);if(typeof args!="undefined")html=tinyMCE.replaceVars(html,args);html=tinyMCE.replaceVars(html,tinyMCE.settings);html=tinyMCE.replaceVars(html,tinyMCELang);return html;}function TinyMCE_openWindow(template,args,skip_lang){var html,width,height,x,y,resizable,scrollbars;tinyMCE.windowArgs=args;html=template['html'];if(!(width=template['width']))width=320;if(!(height=template['height']))height=200;x=parseInt(screen.width/2.0)-(width/2.0);y=parseInt(screen.height/2.0)-(height/2.0);resizable=(args&&args['resizable'])?args['resizable']:"no";scrollbars=(args&&args['scrollbars'])?args['scrollbars']:"no";if(html){html=tinyMCE.replaceVar(html,"css",this.settings['popups_css']);html=tinyMCE.applyTemplate(html,args,skip_lang);var win=window.open("","mcePopup","top="+y+",left="+x+",scrollbars="+scrollbars+",modal=yes,width="+width+",height="+height+",resizable="+resizable);win.document.write(html);win.document.close();}else var win=window.open(tinyMCE.baseURL+"/themes/"+tinyMCE.getParam("theme")+"/"+template['file'],"mcePopup","top="+y+",left="+x+",scrollbars="+scrollbars+",modal=yes,width="+width+",height="+height+",resizable="+resizable);}function TinyMCE_handleVisualAid(element,deep,state){var tableElement=null;switch(element.nodeName.toLowerCase()){case "table":var cssText=element.getAttribute("border")==0?tinyMCE.settings['visual_table_style']:"";element.style.cssText=state?cssText:"";for(var y=0;y

','g');html_content=html_content.replace(re,"
");}doc.body.innerHTML=html_content;if(tinyMCE.isMSIE&&tinyMCE.settings['fix_content_duplication']){var paras=doc.getElementsByTagName("P");for(var i=0;i<\/o:p>","
");html=tinyMCE.regexpReplace(html," <\/o:p>","");html=tinyMCE.regexpReplace(html,"","");html=tinyMCE.regexpReplace(html,"

<\/p>","");html=tinyMCE.regexpReplace(html,"

<\/p>\r\n

<\/p>","");html=tinyMCE.regexpReplace(html,"

 <\/p>","
");html=tinyMCE.regexpReplace(html,"

\s*(

\s*)?","

");html=tinyMCE.regexpReplace(html,"<\/p>\s*(<\/p>\s*)?","

");doc.body.innerHTML=html;}}}function TinyMCE__getElementById(element_id){var elm=document.getElementById(element_id);if(!elm){for(var j=0;j0){var csses=null;eval("try {var csses = tinyMCE.isMSIE ? doc.styleSheets(0).rules : doc.styleSheets[0].cssRules;} catch(e) {}");if(!csses)return null;for(var i=0;i0)tinyMCE.cssClasses=output;return output;}function TinyMCE_regexpReplace(in_str,reg_exp,replace_str,opts){if(typeof opts=="undefined")opts='g';var re=new RegExp(reg_exp,opts);return in_str.replace(re,replace_str);}function TinyMCEControl(settings){this.undoLevels=new Array();this.undoIndex=0;this.settings=settings;this.settings['theme']=tinyMCE.getParam("theme","default");this.settings['width']=tinyMCE.getParam("width",-1);this.settings['height']=tinyMCE.getParam("height",-1);this.execCommand=TinyMCEControl_execCommand;this.queryCommandValue=TinyMCEControl_queryCommandValue;this.queryCommandState=TinyMCEControl_queryCommandState;this.onAdd=TinyMCEControl_onAdd;this.getFocusElement=TinyMCEControl_getFocusElement;}function TinyMCEControl_execCommand(command,user_interface,value){if(!tinyMCE.isMSIE&&!this.useCSS){this.contentWindow.document.execCommand("useCSS",false,true);this.useCSS=true;}this.contentDocument=this.contentWindow.document;if(tinyMCE._themeExecCommand(this.editorId,this.contentDocument.body,command,user_interface,value))return;if(command!="mceAddUndoLevel"&&command!="Undo"&&command!="Redo"&&command!="mceImage"&&command!="mceLink"&&command!="mceToggleVisualAid"&&(command!="mceInsertTable"&&!user_interface))this.execCommand("mceAddUndoLevel");if(this.getFocusElement()&&this.getFocusElement().nodeName.toLowerCase()=="img"){var align=this.getFocusElement().getAttribute('align');switch(command){case "JustifyLeft":if(align=='left')this.getFocusElement().removeAttribute('align');else this.getFocusElement().setAttribute('align','left');tinyMCE.triggerNodeChange();return;case "JustifyCenter":if(align=='middle')this.getFocusElement().removeAttribute('align');else this.getFocusElement().setAttribute('align','middle');tinyMCE.triggerNodeChange();return;case "JustifyRight":if(align=='right')this.getFocusElement().removeAttribute('align');else this.getFocusElement().setAttribute('align','right');tinyMCE.triggerNodeChange();return;}}if(tinyMCE.settings['force_br_newlines']){var documentRef=this.contentWindow.document;var alignValue="";if(documentRef.selection.type!="Control"){switch(command){case "JustifyLeft":alignValue="left";break;case "JustifyCenter":alignValue="center";break;case "JustifyFull":alignValue="justify";break;case "JustifyRight":alignValue="right";break;}if(alignValue!=""){var rng=documentRef.selection.createRange();if((divElm=tinyMCE.getParentElement(rng.parentElement(),"div"))!=null)divElm.setAttribute("align",alignValue);else if(rng.pasteHTML&&rng.htmlText.length>0)rng.pasteHTML('
'+rng.htmlText+"
");tinyMCE.triggerNodeChange();return;}}}switch(command){case "mceLink":var selectedText="";if(tinyMCE.isMSIE){var documentRef=this.contentWindow.document;var rng=documentRef.selection.createRange();selectedText=rng.text;}else selectedText=this.contentWindow.getSelection().toString();if((tinyMCE.selectedElement.nodeName.toLowerCase()!="img")&&(selectedText.length<=0))return;var href="",target="";if(tinyMCE.selectedElement.nodeName.toLowerCase()=="a")tinyMCE.linkElement=tinyMCE.selectedElement;if(tinyMCE.linkElement){href=tinyMCE.linkElement.getAttribute('href')?tinyMCE.linkElement.getAttribute('href'):"";target=tinyMCE.linkElement.getAttribute('target')?tinyMCE.linkElement.getAttribute('target'):"";mceRealHref=tinyMCE.linkElement.getAttribute('mce_real_href')?tinyMCE.linkElement.getAttribute('mce_real_href'):"";if(mceRealHref!="")href=mceRealHref;href=eval(tinyMCE.settings['urlconvertor_callback']+"(href, tinyMCE.linkElement, true);");}if(this.settings['insertlink_callback']){var returnVal=eval(this.settings['insertlink_callback']+"(href, target);");if(returnVal&&returnVal['href'])tinyMCE.insertLink(returnVal['href'],returnVal['target']);}else{tinyMCE.openWindow(this.insertLinkTemplate,{href:href,target:target});}break;case "mceImage":var src="",alt="",border="",hspace="",vspace="",width="",height="",align="";if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img")tinyMCE.imgElement=tinyMCE.selectedElement;if(tinyMCE.imgElement){src=tinyMCE.imgElement.getAttribute('src')?tinyMCE.imgElement.getAttribute('src'):"";alt=tinyMCE.imgElement.getAttribute('alt')?tinyMCE.imgElement.getAttribute('alt'):"";border=tinyMCE.imgElement.getAttribute('border')?tinyMCE.imgElement.getAttribute('border'):"";hspace=tinyMCE.imgElement.getAttribute('hspace')?tinyMCE.imgElement.getAttribute('hspace'):"";vspace=tinyMCE.imgElement.getAttribute('vspace')?tinyMCE.imgElement.getAttribute('vspace'):"";width=tinyMCE.imgElement.getAttribute('width')?tinyMCE.imgElement.getAttribute('width'):"";height=tinyMCE.imgElement.getAttribute('height')?tinyMCE.imgElement.getAttribute('height'):"";align=tinyMCE.imgElement.getAttribute('align')?tinyMCE.imgElement.getAttribute('align'):"";mceRealSrc=tinyMCE.imgElement.getAttribute('mce_real_src')?tinyMCE.imgElement.getAttribute('mce_real_src'):"";if(mceRealSrc!="")src=mceRealSrc;src=eval(tinyMCE.settings['urlconvertor_callback']+"(src, tinyMCE.imgElement, true);");}if(this.settings['insertimage_callback']){var returnVal=eval(this.settings['insertimage_callback']+"(src, alt, border, hspace, vspace, width, height, align);");if(returnVal&&returnVal['src'])tinyMCE.insertImage(returnVal['src'],returnVal['alt'],returnVal['border'],returnVal['hspace'],returnVal['vspace'],returnVal['width'],returnVal['height'],returnVal['align']);}else tinyMCE.openWindow(this.insertImageTemplate,{src:src,alt:alt,border:border,hspace:hspace,vspace:vspace,width:width,height:height,align:align});break;case "mceCleanupWord":if(tinyMCE.isMSIE){var html=this.contentDocument.body.createTextRange().htmlText;if(html.indexOf('="mso')!=-1){tinyMCE._setHTML(this.contentDocument,this.contentDocument.body.innerHTML);var cleanedHTML=tinyMCE._cleanupHTML(this.contentDocument,this.settings,this.contentDocument.body,this.visualAid);this.contentDocument.body.innerHTML=cleanedHTML;}}break;case "mceCleanup":tinyMCE._setHTML(this.contentDocument,this.contentDocument.body.innerHTML);var cleanedHTML=tinyMCE._cleanupHTML(this.contentDocument,this.settings,this.contentDocument.body,this.visualAid);this.contentDocument.body.innerHTML=cleanedHTML;break;case "mceAnchor":if(!user_interface){var aElm=tinyMCE.getParentElement(this.getFocusElement(),"a","name");if(aElm)aElm.setAttribute('name',value);else{this.contentDocument.execCommand("fontname",false,"#mce_temp_font#");var elementArray=tinyMCE.getElementsByAttributeValue(this.contentDocument.body,"font","face","#mce_temp_font#");for(var x=0;x0){value=tinyMCE.replaceVar(value,"selection",selectedText);tinyMCE.execCommand('mceInsertContent',false,value);}tinyMCE.triggerNodeChange();break;case "mceSetAttribute":if(typeof value=='object'){var targetElms=(typeof value['targets']=="undefined")?"p,img,span,div,td,h1,h2,h3,h4,h5,h6,pre,address":value['targets'];var targetNode=tinyMCE.getParentElement(this.getFocusElement(),targetElms);if(targetNode){targetNode.setAttribute(value['name'],value['value']);tinyMCE.triggerNodeChange();}}break;case "mceSetCSSClass":var selectedText=false;if(tinyMCE.isMSIE){var documentRef=this.contentWindow.document;var rng=documentRef.selection.createRange();selectedText=(rng.text&&rng.text.length>0);}else selectedText=(this.contentWindow.getSelection().toString().length>0);if(selectedText){this.contentDocument.execCommand("removeformat",false,null);this.contentDocument.execCommand("fontname",false,"#mce_temp_font#");var elementArray=tinyMCE.getElementsByAttributeValue(this.contentDocument.body,"font","face","#mce_temp_font#");for(var x=0;xcols)cols=rowsAr[i].cells.length;cols=cols;rows=rowsAr.length;border=tinyMCE.getAttrib(tinyMCE.tableElement,'border',border);cellpadding=tinyMCE.getAttrib(tinyMCE.tableElement,'cellpadding',"");cellspacing=tinyMCE.getAttrib(tinyMCE.tableElement,'cellspacing',"");width=tinyMCE.getAttrib(tinyMCE.tableElement,'width',width);height=tinyMCE.getAttrib(tinyMCE.tableElement,'height',height);align=tinyMCE.getAttrib(tinyMCE.tableElement,'align',align);className=tinyMCE.getAttrib(tinyMCE.tableElement,tinyMCE.isMSIE?'className':"class","");if(tinyMCE.isMSIE){width=tinyMCE.tableElement.style.pixelWidth==0?tinyMCE.tableElement.getAttribute("width"):tinyMCE.tableElement.style.pixelWidth;height=tinyMCE.tableElement.style.pixelHeight==0?tinyMCE.tableElement.getAttribute("height"):tinyMCE.tableElement.style.pixelHeight;}action="update";}tinyMCE.openWindow(this.insertTableTemplate,{editor_id:this.editorId,cols:cols,rows:rows,border:border,cellpadding:cellpadding,cellspacing:cellspacing,align:align,width:width,height:height,action:action,className:className});}else{var html='';var cols=2,rows=2,border=0,cellpadding=-1,cellspacing=-1,align,width,height,className;if(typeof value=='object'){cols=value['cols'];rows=value['rows'];border=value['border']!=""?value['border']:0;cellpadding=value['cellpadding']!=""?value['cellpadding']:-1;cellspacing=value['cellspacing']!=""?value['cellspacing']:-1;align=value['align'];width=value['width'];height=value['height'];className=value['className'];}if(tinyMCE.tableElement){tinyMCE.setAttrib(tinyMCE.tableElement,'cellPadding',cellpadding);tinyMCE.setAttrib(tinyMCE.tableElement,'cellSpacing',cellspacing);tinyMCE.setAttrib(tinyMCE.tableElement,'border',border);tinyMCE.setAttrib(tinyMCE.tableElement,'width',width);tinyMCE.setAttrib(tinyMCE.tableElement,'height',height);tinyMCE.setAttrib(tinyMCE.tableElement,'align',align,true);tinyMCE.setAttrib(tinyMCE.tableElement,tinyMCE.isMSIE?'className':"class",className,true);if(tinyMCE.isMSIE){tinyMCE.tableElement.style.pixelWidth=(width==null||width=="")?0:width;tinyMCE.tableElement.style.pixelHeight=(height==null||height=="")?0:height;}tinyMCE.handleVisualAid(tinyMCE.tableElement,false,this.visualAid);tinyMCE.tableElement.outerHTML=tinyMCE.tableElement.outerHTML;tinyMCE.triggerNodeChange();return;}html+='";for(var x=0;x';else html+='";}html+="";}html+="
';html+=" 
";this.execCommand('mceInsertContent',false,html);}break;case "mceTableInsertRowBefore":case "mceTableInsertRowAfter":case "mceTableDeleteRow":case "mceTableInsertColBefore":case "mceTableInsertColAfter":case "mceTableDeleteCol":var trElement=tinyMCE.getParentElement(this.getFocusElement(),"tr");var tdElement=tinyMCE.getParentElement(this.getFocusElement(),"td");var tableElement=tinyMCE.getParentElement(this.getFocusElement(),"table");if(!tableElement)return;var documentRef=this.contentWindow.document;var tableBorder=tableElement.getAttribute("border");var visualAidStyle=this.visualAid?tinyMCE.settings['visual_table_style']:"";if(tableElement.firstChild&&tableElement.firstChild.nodeName.toLowerCase()=="tbody")tableElement=tableElement.firstChild;if(tableElement&&trElement){switch(command){case "mceTableInsertRowBefore":var numcells=trElement.cells.length;var rowCount=0;var tmpTR=trElement;while(tmpTR){if(tmpTR.nodeName.toLowerCase()=="tr")rowCount++;tmpTR=tmpTR.previousSibling;}var r=tableElement.insertRow(rowCount==0?1:rowCount-1);for(var i=0;inumCols)numCols=tableElement.rows[y].cells.length;}if(numCols<=1){tinyMCE._selectNode(this.contentWindow,selElm);tableElement.parentNode.removeChild(tableElement);tinyMCE.triggerNodeChange();return;}for(var y=0;y0)selElm=tableElement.rows[0].cells[index-1];tinyMCE._selectNode(this.contentWindow,selElm);break;}tinyMCE.triggerNodeChange();}break;case "mceAddUndoLevel":if(tinyMCE.settings['custom_undo_redo']){var customUndoLevels=tinyMCE.settings['custom_undo_redo_levels'];var newHTML=this.contentWindow.document.body.innerHTML;if(newHTML!=this.undoLevels[this.undoLevels.length-1]){if(customUndoLevels!=-1&&this.undoLevels.length>customUndoLevels){for(var i=0;i0){this.undoIndex--;this.contentWindow.document.body.innerHTML=this.undoLevels[this.undoIndex];}tinyMCE.triggerNodeChange();}else this.contentDocument.execCommand(command,user_interface,value);break;case "Redo":if(tinyMCE.settings['custom_undo_redo']){if(this.undoIndex<(this.undoLevels.length-1)){this.undoIndex++;this.contentWindow.document.body.innerHTML=this.undoLevels[this.undoIndex];}tinyMCE.triggerNodeChange();}else this.contentDocument.execCommand(command,user_interface,value);break;case "mceToggleVisualAid":this.visualAid=!this.visualAid;tinyMCE.handleVisualAid(this.contentWindow.document.body,true,this.visualAid);tinyMCE.triggerNodeChange();break;default:this.contentDocument.execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();}}function TinyMCE__selectNode(win,node,expand){if(!tinyMCE.isMSIE){var rng=win.document.createRange();rng.selectNode(node);sel=win.getSelection();sel.addRange(rng);if(expand)sel.extend(node,0);else sel.collapse(node,0);}}function TinyMCE_getControlHTML(control_name){var themePlugins=tinyMCE.settings['plugins'].split(',');var templateFunction;for(var i=themePlugins.length;i>=0;i--){templateFunction='TinyMCE_'+themePlugins[i]+"_getControlHTML";if(eval("typeof "+templateFunction)!='undefined'){var html=eval(templateFunction+"('"+control_name+"');");if(html!="")return tinyMCE.replaceVar(html,"pluginurl",tinyMCE.baseURL+"/plugins/"+themePlugins[i]);}}return eval('TinyMCE_'+tinyMCE.settings['theme']+"_getControlHTML"+"('"+control_name+"');");}function TinyMCE__themeExecCommand(editor_id,element,command,user_interface,value){var themePlugins=tinyMCE.settings['plugins'].split(',');var templateFunction;for(var i=themePlugins.length;i>=0;i--){templateFunction='TinyMCE_'+themePlugins[i]+"_execCommand";if(eval("typeof "+templateFunction)!='undefined'){if(eval(templateFunction+"(editor_id, element, command, user_interface, value);"))return true;}}templateFunction='TinyMCE_'+tinyMCE.settings['theme']+"_execCommand";if(eval("typeof "+templateFunction)!='undefined')return eval(templateFunction+"(editor_id, element, command, user_interface, value);");return false;}function TinyMCE__getThemeFunction(suffix){var themePlugins=tinyMCE.settings['plugins'].split(',');var templateFunction;for(var i=themePlugins.length;i>=0;i--){templateFunction='TinyMCE_'+themePlugins[i]+suffix;if(eval("typeof "+templateFunction)!='undefined')return templateFunction;}return 'TinyMCE_'+tinyMCE.settings['theme']+suffix;}function TinyMCEControl_queryCommandValue(command){return this.contentWindow.document.queryCommandValue(command);}function TinyMCEControl_queryCommandState(command){return this.contentWindow.document.queryCommandState(command);}function TinyMCEControl_onAdd(replace_element,form_element_name){tinyMCE.themeURL=tinyMCE.baseURL+"/themes/"+this.settings['theme'];this.settings['themeurl']=tinyMCE.themeURL;if(!replace_element){alert("Error: Could not find the target element.");return false;}var templateFunction=tinyMCE._getThemeFunction('_getInsertTableTemplate');if(eval("typeof "+templateFunction)!='undefined')this.insertTableTemplate=eval(templateFunction+'(this.settings);');var templateFunction=tinyMCE._getThemeFunction('_getInsertLinkTemplate');if(eval("typeof "+templateFunction)!='undefined')this.insertLinkTemplate=eval(templateFunction+'(this.settings);');var templateFunction=tinyMCE._getThemeFunction('_getInsertImageTemplate');if(eval("typeof "+templateFunction)!='undefined')this.insertImageTemplate=eval(templateFunction+'(this.settings);');var templateFunction=tinyMCE._getThemeFunction('_getEditorTemplate');if(eval("typeof "+templateFunction)=='undefined'){alert("Error: Could not find the template function: "+templateFunction);return false;}var editorTemplate=eval(templateFunction+'(this.settings, this.editorId);');var deltaWidth=editorTemplate['delta_width']?editorTemplate['delta_width']:0;var deltaHeight=editorTemplate['delta_height']?editorTemplate['delta_height']:0;var html=''+editorTemplate['html'];var templateFunction=tinyMCE._getThemeFunction('_handleNodeChange');if(eval("typeof "+templateFunction)!='undefined')this.settings['handleNodeChangeCallback']=templateFunction;html=tinyMCE.replaceVar(html,"editor_id",this.editorId);html=tinyMCE.replaceVar(html,"default_document",tinyMCE.baseURL+"/blank.htm");this.settings['default_document']=tinyMCE.baseURL+"/blank.htm";this.settings['old_width']=this.settings['width'];this.settings['old_height']=this.settings['height'];if(this.settings['width']==-1)this.settings['width']=replace_element.offsetWidth;if(this.settings['height']==-1)this.settings['height']=replace_element.offsetHeight;this.settings['area_width']=this.settings['width'];this.settings['area_height']=this.settings['height'];this.settings['area_width']+=deltaWidth;this.settings['area_height']+=deltaHeight;if((""+this.settings['width']).indexOf('%')!=-1)this.settings['area_width']="100%";if((""+this.settings['height']).indexOf('%')!=-1)this.settings['area_height']="100%";if((""+replace_element.style.width).indexOf('%')!=-1){this.settings['width']=replace_element.style.width;this.settings['area_width']="100%";}if((""+replace_element.style.height).indexOf('%')!=-1){this.settings['height']=replace_element.style.height;this.settings['area_height']="100%";}html=tinyMCE.applyTemplate(html);this.settings['width']=this.settings['old_width'];this.settings['height']=this.settings['old_height'];this.visualAid=this.settings['visual'];this.oldTargetElement=replace_element.cloneNode(true);this.formTargetElementId=form_element_name;html=html+'';if(!tinyMCE.isMSIE){var rng=replace_element.ownerDocument.createRange();rng.setStartBefore(replace_element);var fragment=rng.createContextualFragment(html);replace_element.parentNode.replaceChild(fragment,replace_element);}else replace_element.outerHTML=html;tinyMCE.setEditMode(this.editorId,true);return true;}function TinyMCEControl_getFocusElement(){if(tinyMCE.isMSIE){var documentRef=this.contentWindow.document;var rng=documentRef.selection.createRange();var elm=rng.item?rng.item(0):rng.parentElement();}else{var sel=this.contentWindow.getSelection();var elm=sel.anchorNode;if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img")elm=tinyMCE.selectedElement;}return elm;}var tinyMCE=new TinyMCE();var tinyMCELang=new Array(); \ No newline at end of file + function TinyMCE(){this.instances=new Array();this.stickyClassesLookup=new Array();this.windowArgs=new Array();this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.idCounter=0;this.init=TinyMCE_init;this.addMCEControl=TinyMCE_addMCEControl;this.createMCEControl=TinyMCE_createMCEControl;this.triggerSave=TinyMCE_triggerSave;this.execCommand=TinyMCE_execCommand;this.execInstanceCommand=TinyMCE_execInstanceCommand;this._createIFrame=TinyMCE__createIFrame;this.setEditMode=TinyMCE_setEditMode;this.handleEvent=TinyMCE_handleEvent;this.setupContent=TinyMCE_setupContent;this.switchClass=TinyMCE_switchClass;this.restoreAndSwitchClass=TinyMCE_restoreAndSwitchClass;this.switchClassSticky=TinyMCE_switchClassSticky;this.restoreClass=TinyMCE_restoreClass;this.setClassLock=TinyMCE_setClassLock;this.onLoad=TinyMCE_onLoad;this.removeMCEControl=TinyMCE_removeMCEControl;this._initCleanup=TinyMCE__initCleanup;this._cleanupHTML=TinyMCE__cleanupHTML;this._cleanupAttribute=TinyMCE__cleanupAttribute;this._fixInlineStyles=TinyMCE__fixInlineStyles;this._cleanupElementName=TinyMCE__cleanupElementName;this._verifyClass=TinyMCE__verifyClass;this.cleanupNode=TinyMCE_cleanupNode;this.convertStringToXML=TinyMCE_convertStringToXML;this.insertLink=TinyMCE_insertLink;this.insertImage=TinyMCE_insertImage;this.getElementByAttributeValue=TinyMCE_getElementByAttributeValue;this.getElementsByAttributeValue=TinyMCE_getElementsByAttributeValue;this.getParentElement=TinyMCE_getParentElement;this.getParam=TinyMCE_getParam;this.getLang=TinyMCE_getLang;this.replaceVar=TinyMCE_replaceVar;this.replaceVars=TinyMCE_replaceVars;this.triggerNodeChange=TinyMCE_triggerNodeChange;this.parseURL=TinyMCE_parseURL;this.convertAbsoluteURLToRelativeURL=TinyMCE_convertAbsoluteURLToRelativeURL;this.updateContent=TinyMCE_updateContent;this.getContent=TinyMCE_getContent;this.setContent=TinyMCE_setContent;this.importThemeLanguagePack=TinyMCE_importThemeLanguagePack;this.importPluginLanguagePack=TinyMCE_importPluginLanguagePack;this.applyTemplate=TinyMCE_applyTemplate;this.openWindow=TinyMCE_openWindow;this.handleVisualAid=TinyMCE_handleVisualAid;this.setAttrib=TinyMCE_setAttrib;this.getAttrib=TinyMCE_getAttrib;this._selectNode=TinyMCE__selectNode;this._getThemeFunction=TinyMCE__getThemeFunction;this._themeExecCommand=TinyMCE__themeExecCommand;this.getControlHTML=TinyMCE_getControlHTML;this._setHTML=TinyMCE__setHTML;this._getElementById=TinyMCE__getElementById;this._getInstanceById=TinyMCE__getInstanceById;this.getEditorId=TinyMCE_getEditorId;this.queryInstanceCommandValue=TinyMCE_queryInstanceCommandValue;this.queryInstanceCommandState=TinyMCE_queryInstanceCommandState;this.getWindowArg=TinyMCE_getWindowArg;this.getCSSClasses=TinyMCE_getCSSClasses;this.regexpReplace=TinyMCE_regexpReplace;}function TinyMCE_init(settings){var theme;if(typeof document.execCommand=='undefined')return;if(!tinyMCE.baseURL){var elements=document.getElementsByTagName('script');for(var i=0;i');document.write('');document.write('');var themePlugins=tinyMCE.getParam('plugins','',true,',');if(this.settings['plugins']!=''){for(var i=0;i');}}function TinyMCE_confirmAdd(e){if(tinyMCE.isMSIE)var targetElement=event.srcElement;else var targetElement=e.target;var elementId=targetElement.name?targetElement.name:targetElement.id;if(!targetElement.getAttribute('mce_noask')&&confirm(tinyMCELang['lang_edit_confirm']))tinyMCE.addMCEControl(targetElement,elementId,tinyMCE.createMCEControl(tinyMCE.settings));else targetElement.setAttribute('mce_noask','true');}function TinyMCE_updateContent(form_element_name){var formElement=document.getElementById(form_element_name);for(var instanceName in tinyMCE.instances){var instance=tinyMCE.instances[instanceName];if(instance.formElement==formElement){tinyMCE._setHTML(instance.contentWindow.document,instance.formElement.value);if(!tinyMCE.isMSIE)instance.contentWindow.document.body.innerHTML=tinyMCE._cleanupHTML(instance.contentWindow.document,this.settings,instance.contentWindow.document.body,instance.visualAid);}}}function TinyMCE_addMCEControl(replace_element,form_element_name,mce_control){var editorId="mce_editor_"+tinyMCE.idCounter++;mce_control.editorId=editorId;this.instances[editorId]=mce_control;mce_control.onAdd(replace_element,form_element_name);}function TinyMCE_createMCEControl(settings){return new TinyMCEControl(settings);}function TinyMCE_triggerSave(){for(var instanceName in tinyMCE.instances){var instance=tinyMCE.instances[instanceName];tinyMCE.settings['preformatted']=false;tinyMCE._setHTML(instance.contentWindow.document,instance.contentWindow.document.body.innerHTML);var cleanedHTML=tinyMCE._cleanupHTML(instance.contentWindow.document,this.settings,instance.contentWindow.document.body,this.visualAid,true);if(tinyMCE.settings["encoding"]=="xml"||tinyMCE.settings["encoding"]=="html")cleanedHTML=tinyMCE.convertStringToXML(cleanedHTML);if(tinyMCE.settings['save_callback']!="")var content=eval(tinyMCE.settings['save_callback']+"(instance.formTargetElementId,cleanedHTML,instance.contentWindow.document.body);");if((typeof content!="undefined")&&content!=null)cleanedHTML=content;instance.formElement.value=cleanedHTML;}}function TinyMCE_execInstanceCommand(editor_id,command,user_interface,value){var mceControl=tinyMCE._getInstanceById(editor_id);if(mceControl){mceControl.contentWindow.focus();this.selectedElement=mceControl.getFocusElement();this.selectedInstance=mceControl;tinyMCE.execCommand(command,user_interface,value);}}function TinyMCE_execCommand(command,user_interface,value){user_interface=user_interface?user_interface:false;value=value?value:null;switch(command){case 'mceHelp':window.open(tinyMCE.themeURL+"/docs/"+this.settings['docs_language']+"/index.htm","mceHelp","menubar=yes,toolbar=yes,scrollbars=yes,left=20,top=20,width=550,height=600");return;case 'mceFocus':var mceControl=tinyMCE._getInstanceById(value);if(mceControl)mceControl.contentWindow.focus();return;case "mceAddControl":case "mceAddEditor":tinyMCE.addMCEControl(tinyMCE._getElementById(value),value,tinyMCE.createMCEControl(tinyMCE.settings));return;case "mceRemoveControl":case "mceRemoveEditor":tinyMCE.removeMCEControl(value);return;}if(this.selectedInstance)this.selectedInstance.execCommand(command,user_interface,value);else if(tinyMCE.settings['focus_alert'])alert(tinyMCELang['lang_focus_alert']);}function TinyMCE_addEventHandlers(editor_id){if(tinyMCE.isMSIE){var patchFunc=function(){var event=document.frames[editor_id].event;event.target=event.srcElement;event.target.editor_id=editor_id;TinyMCE_handleEvent(event);};document.frames[editor_id].document.onkeypress=patchFunc;document.frames[editor_id].document.onkeyup=patchFunc;document.frames[editor_id].document.onkeydown=patchFunc;document.frames[editor_id].document.onmouseup=patchFunc;document.frames[editor_id].document.onclick=patchFunc;}else{var instance=tinyMCE.instances[editor_id];instance.contentWindow.document.editor_id=editor_id;instance.contentWindow.document.addEventListener("keypress",tinyMCE.handleEvent,false);instance.contentWindow.document.addEventListener("keydown",tinyMCE.handleEvent,false);instance.contentWindow.document.addEventListener("keyup",tinyMCE.handleEvent,false);instance.contentWindow.document.addEventListener("click",tinyMCE.handleEvent,false);instance.contentWindow.document.addEventListener("mouseup",tinyMCE.handleEvent,false);instance.contentWindow.document.addEventListener("mousedown",tinyMCE.handleEvent,false);instance.contentWindow.document.addEventListener("focus",tinyMCE.handleEvent,false);instance.contentWindow.document.designMode="on";}}function TinyMCE__createIFrame(replace_element){var iframe=document.createElement("iframe");var id=replace_element.getAttribute("id");iframe.setAttribute("id",id);iframe.setAttribute("className","mceEditorArea");iframe.setAttribute("border","0");iframe.setAttribute("frameBorder","0");iframe.setAttribute("marginWidth","0");iframe.setAttribute("marginHeight","0");iframe.setAttribute("leftMargin","0");iframe.setAttribute("topMargin","0");iframe.setAttribute("width",tinyMCE.settings['area_width']);iframe.setAttribute("height",tinyMCE.settings['area_height']);if(tinyMCE.isMSIE)iframe.setAttribute("src",tinyMCE.baseURL+"/blank.htm");iframe.style.width=tinyMCE.settings['area_width'];iframe.style.height=tinyMCE.settings['area_height'];if(tinyMCE.isMSIE)replace_element.outerHTML=iframe.outerHTML;else replace_element.parentNode.replaceChild(iframe,replace_element);if(tinyMCE.isMSIE)return window.frames[id];else return iframe;}function TinyMCE_setEditMode(editor_id,mode){var targetMCEControl=this.instances[editor_id];var dynamicIFrame=false;if(!this.isMSIE){var targetElement=document.getElementById(editor_id);if(targetElement&&targetElement.nodeName.toLowerCase()=="span"){targetElement=tinyMCE._createIFrame(targetElement);dynamicIFrame=true;}targetMCEControl.targetElement=targetElement;targetMCEControl.contentDocument=targetElement.contentDocument;targetMCEControl.contentWindow=targetElement.contentWindow;}else{var targetElement=document.getElementById(editor_id);if(targetElement&&targetElement.nodeName.toLowerCase()=="span")targetElement=tinyMCE._createIFrame(targetElement);else targetElement=document.frames[editor_id];targetMCEControl.targetElement=targetElement;targetMCEControl.contentDocument=targetElement.window.document;targetMCEControl.contentWindow=targetElement.window;targetMCEControl.contentDocument.designMode=mode?"on":"off";}var doc=targetMCEControl.contentDocument;if(dynamicIFrame){var html="";html+='';html+='';html+='';html+='blank_page';html+='';html+='';html+='';html+='';html+='';try{targetMCEControl.contentWindow.document.designMode="on";doc.open();doc.write(html);doc.close();}catch(e){targetMCEControl.contentWindow.document.location.href=tinyMCE.baseURL+"/blank.htm";}}if(tinyMCE.isMSIE)window.setTimeout("TinyMCE_addEventHandlers('"+editor_id+"');",1);tinyMCE.setupContent(editor_id);}function TinyMCE_setupContent(editor_id){var instance=tinyMCE.instances[editor_id];var doc=instance.contentWindow.document;var head=doc.getElementsByTagName('head').item(0);if(!tinyMCE.isMSIE&&doc.title!="blank_page"){doc.location.href=tinyMCE.baseURL+"/blank.htm";window.setTimeout("tinyMCE.setupContent('"+editor_id+"');",1000);return;}if(!head){window.setTimeout("tinyMCE.setupContent('"+editor_id+"');",10);return;}doc.body.dir=this.settings['directionality'];doc.editorId=editor_id;if(!tinyMCE.isMSIE)doc.documentElement.editorId=editor_id;base=doc.createElement("base");base.setAttribute('href',tinyMCE.settings['base_href']);head.appendChild(base);var oldElement=instance.oldTargetElement;if(oldElement.nodeName.toLowerCase()=="textarea")var content=oldElement.value;else var content=instance.oldTargetElement.innerHTML;if(tinyMCE.isMSIE){var styleSheet=document.frames[editor_id].document.createStyleSheet(instance.settings['content_css']);window.setInterval('try{tinyMCE.getCSSClasses(document.frames["'+editor_id+'"].document, "'+editor_id+'");}catch(e){}',500);if(tinyMCE.settings["force_br_newlines"])document.frames[editor_id].document.styleSheets[0].addRule("p","margin: 0px;");var patchFunc=function(){var event=document.frames[editor_id].event;event.target=document.frames[editor_id].document;TinyMCE_handleEvent(event);};document.frames[editor_id].document.body.onbeforepaste=patchFunc;document.frames[editor_id].document.body.onbeforecut=patchFunc;document.frames[editor_id].document.body.onpaste=patchFunc;document.frames[editor_id].document.body.editorId=editor_id;}else{var targetDocument=document.getElementById(editor_id).contentWindow.document;var cssImporter=targetDocument.createElement("link");cssImporter.rel="stylesheet";cssImporter.href=instance.settings['content_css'];if(headArr=targetDocument.getElementsByTagName("head"));headArr[0].appendChild(cssImporter);}if(!tinyMCE.isMSIE){if(tinyMCE.settings['cleanup_on_startup']){var contentElement=instance.contentWindow.document.createElement("body");contentElement.innerHTML=content;instance.contentWindow.document.body.innerHTML=tinyMCE._cleanupHTML(instance.contentWindow.document,this.settings,contentElement);}else{var contentElement=instance.contentWindow.document.createElement("body");var doc=instance.contentWindow.document;content=tinyMCE.regexpReplace(content,"","","gi");content=tinyMCE.regexpReplace(content,"","","gi");contentElement.innerHTML=content;var elms=contentElement.getElementsByTagName("img");for(var i=0;i");rng.collapse(false);rng.select();}}if(e.keyCode==8||e.keyCode==46){tinyMCE.selectedElement=e.target;tinyMCE.linkElement=tinyMCE.getParentElement(e.target,"a");tinyMCE.imgElement=tinyMCE.getParentElement(e.target,"img");tinyMCE.triggerNodeChange(false);}return false;break;case "keyup":case "keydown":if(e.target.editorId)tinyMCE.selectedInstance=tinyMCE.instances[e.target.editorId];else return;tinyMCE.selectedElement=null;var elm=tinyMCE.selectedInstance.getFocusElement();tinyMCE.linkElement=tinyMCE.getParentElement(elm,"a");tinyMCE.imgElement=tinyMCE.getParentElement(elm,"img");tinyMCE.selectedElement=elm;if(tinyMCE.isMSIE&&tinyMCE.settings['custom_undo_redo']){var keys=new Array(13,45,36,35,33,34,37,38,39,40);var posKey=false;for(var i=0;i18&&e.keyCode!=255)){tinyMCE.selectedInstance.execCommand("mceAddUndoLevel");tinyMCE.selectedInstance.typing=true;tinyMCE.triggerNodeChange(false);}if(posKey&&e.type=="keyup")tinyMCE.triggerNodeChange(false);var ctrlKeys=new Array(66,73,85,86,88);var keys=new Array(8,46);for(var i=0;i0){for(var i=0;i ";if(tinyMCE.isMSIE&&elementName=="script")return "<"+elementName+elementAttribs+">"+node.text+"";if(node.hasChildNodes()){if(elementName=="p"&&tinyMCE.cleanup_force_br_newlines)output+="";else output+="<"+elementName+elementAttribs+">";for(var i=0;i
";else output+="";}else output+="<"+elementName+elementAttribs+" />";return output;case 3:if(node.parentNode.nodeName.toLowerCase()=="script")return node.nodeValue;return this.convertStringToXML(node.nodeValue);case 8:return "";default:return "[UNKNOWN NODETYPE "+node.nodeType+"]";}}function TinyMCE_convertStringToXML(html_data){var output="";if(!html_data)return null;for(var i=0;i':output+=">";break;case '&':output+="&";break;case ''+String.fromCharCode(8230):output+="...";break;case '\\':output+="\";break;case ''+String.fromCharCode(160):output+=" ";break;default:output+=chr;}}return output;}function TinyMCE__initCleanup(){function getElementName(chunk){var pos;if((pos=chunk.indexOf('/'))!=-1)chunk=chunk.substring(0,pos);if((pos=chunk.indexOf('['))!=-1)chunk=chunk.substring(0,pos);return chunk;}var validElements=tinyMCE.settings["valid_elements"];validElements=validElements.split(',');var extendedValidElements=tinyMCE.settings["extended_valid_elements"];extendedValidElements=extendedValidElements.split(',');for(var i=0;i

','
');html=tinyMCE.regexpReplace(html,'

 


 

','
');if(!tinyMCE.isMSIE){html=html.replace(new RegExp('','g'),"");}if(tinyMCE.settings['apply_source_formatting']){html=html.replace(new RegExp('<(p|div)([^>]*)>','g'),"\n<$1$2>\n");html=html.replace(new RegExp('<\/(p|div)([^>]*)>','g'),"\n\n");html=html.replace(new RegExp('
','g'),"
\n");}if(tinyMCE.settings['force_br_newlines']){var re=new RegExp('

 

','g');html=html.replace(re,"
");}if(html=="
"||html=="

 

")html="";if(tinyMCE.settings["preformatted"])return "
"+html+"
";return html;}function TinyMCE_insertLink(href,target,title){function setAttrib(element,name,value){if(value!=null&&value!="")element.setAttribute(name,value);else element.removeAttribute(name);}this.execCommand("mceAddUndoLevel");if(this.selectedInstance&&this.selectedElement&&this.selectedElement.nodeName.toLowerCase()=="img"){var doc=this.selectedInstance.contentWindow.document;var linkElement=doc.createElement("a");href=eval(tinyMCE.settings['urlconvertor_callback']+"(href, linkElement);");setAttrib(linkElement,'href',href);setAttrib(linkElement,'target',target);setAttrib(linkElement,'title',title);linkElement.appendChild(this.selectedElement.cloneNode(true));this.selectedElement.parentNode.replaceChild(linkElement,this.selectedElement);return;}if(!this.linkElement&&this.selectedInstance){this.selectedInstance.contentDocument.execCommand("createlink",false,"#mce_temp_url#");tinyMCE.linkElement=this.getElementByAttributeValue(this.selectedInstance.contentDocument.body,"a","href","#mce_temp_url#");var elementArray=this.getElementsByAttributeValue(this.selectedInstance.contentDocument.body,"a","href","#mce_temp_url#");for(var i=0;i=strTok2.length){for(var i=0;i=strTok2.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break;}}}if(strTok1.length=strTok1.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break;}}}if(breakPoint==1)return url_to_relative;for(var i=0;i<(strTok1.length-(breakPoint-1));i++)outputString+="../";for(var i=breakPoint-1;i0);if(tinyMCE.settings['custom_undo_redo']){undoIndex=tinyMCE.selectedInstance.undoIndex;undoLevels=tinyMCE.selectedInstance.undoLevels.length;}var plugins=tinyMCE.getParam('plugins','',true,',');for(var i=0;i');}function TinyMCE_importPluginLanguagePack(theme_name,valid_languages){var lang="uk";valid_languages=valid_languages.split(',');for(var i=0;i');}function TinyMCE_applyTemplate(html,args){html=tinyMCE.replaceVar(html,"themeurl",tinyMCE.themeURL);if(typeof args!="undefined")html=tinyMCE.replaceVars(html,args);html=tinyMCE.replaceVars(html,tinyMCE.settings);html=tinyMCE.replaceVars(html,tinyMCELang);return html;}function TinyMCE_openWindow(template,args,skip_lang){var html,width,height,x,y,resizable,scrollbars;tinyMCE.windowArgs=args;html=template['html'];if(!(width=template['width']))width=320;if(!(height=template['height']))height=200;x=parseInt(screen.width/2.0)-(width/2.0);y=parseInt(screen.height/2.0)-(height/2.0);resizable=(args&&args['resizable'])?args['resizable']:"no";scrollbars=(args&&args['scrollbars'])?args['scrollbars']:"no";if(html){html=tinyMCE.replaceVar(html,"css",this.settings['popups_css']);html=tinyMCE.applyTemplate(html,args,skip_lang);var win=window.open("","mcePopup","top="+y+",left="+x+",scrollbars="+scrollbars+",modal=yes,width="+width+",height="+height+",resizable="+resizable);win.document.write(html);win.document.close();}else var win=window.open(tinyMCE.baseURL+"/themes/"+tinyMCE.getParam("theme")+"/"+template['file'],"mcePopup","top="+y+",left="+x+",scrollbars="+scrollbars+",modal=yes,width="+width+",height="+height+",resizable="+resizable);if(!tinyMCE.isMSIE){win.innerWidth=width;win.innerHeight=height;}else win.resizeTo(width,height+20);}function TinyMCE_handleVisualAid(element,deep,state){var tableElement=null;switch(element.nodeName.toLowerCase()){case "table":var cssText=element.getAttribute("border")==0?tinyMCE.settings['visual_table_style']:"";element.style.cssText=state?cssText:"";for(var y=0;y

','g');html_content=html_content.replace(re,"
");}doc.body.innerHTML=html_content;if(tinyMCE.isMSIE&&tinyMCE.settings['fix_content_duplication']){var paras=doc.getElementsByTagName("P");for(var i=0;i<\/o:p>","
");html=tinyMCE.regexpReplace(html," <\/o:p>","");html=tinyMCE.regexpReplace(html,"","");html=tinyMCE.regexpReplace(html,"

<\/p>","");html=tinyMCE.regexpReplace(html,"

<\/p>\r\n

<\/p>","");html=tinyMCE.regexpReplace(html,"

 <\/p>","
");html=tinyMCE.regexpReplace(html,"

\s*(

\s*)?","

");html=tinyMCE.regexpReplace(html,"<\/p>\s*(<\/p>\s*)?","

");doc.body.innerHTML=html;}}}function TinyMCE__getElementById(element_id){var elm=document.getElementById(element_id);if(!elm){for(var j=0;j0){var csses=null;eval("try {var csses = tinyMCE.isMSIE ? doc.styleSheets(0).rules : doc.styleSheets[0].cssRules;} catch(e) {}");if(!csses)return null;for(var i=0;i0)tinyMCE.cssClasses=output;return output;}function TinyMCE_regexpReplace(in_str,reg_exp,replace_str,opts){if(typeof opts=="undefined")opts='g';var re=new RegExp(reg_exp,opts);return in_str.replace(re,replace_str);}function TinyMCEControl(settings){this.undoLevels=new Array();this.undoIndex=0;this.settings=settings;this.settings['theme']=tinyMCE.getParam("theme","default");this.settings['width']=tinyMCE.getParam("width",-1);this.settings['height']=tinyMCE.getParam("height",-1);this.execCommand=TinyMCEControl_execCommand;this.queryCommandValue=TinyMCEControl_queryCommandValue;this.queryCommandState=TinyMCEControl_queryCommandState;this.onAdd=TinyMCEControl_onAdd;this.getFocusElement=TinyMCEControl_getFocusElement;}function TinyMCEControl_execCommand(command,user_interface,value){if(!tinyMCE.isMSIE&&!this.useCSS){this.contentWindow.document.execCommand("useCSS",false,true);this.useCSS=true;}this.contentDocument=this.contentWindow.document;if(tinyMCE._themeExecCommand(this.editorId,this.contentDocument.body,command,user_interface,value))return;if(command!="mceAddUndoLevel"&&command!="Undo"&&command!="Redo"&&command!="mceImage"&&command!="mceLink"&&command!="mceToggleVisualAid"&&(command!="mceInsertTable"&&!user_interface))this.execCommand("mceAddUndoLevel");if(this.getFocusElement()&&this.getFocusElement().nodeName.toLowerCase()=="img"){var align=this.getFocusElement().getAttribute('align');switch(command){case "JustifyLeft":if(align=='left')this.getFocusElement().removeAttribute('align');else this.getFocusElement().setAttribute('align','left');tinyMCE.triggerNodeChange();return;case "JustifyCenter":if(align=='middle')this.getFocusElement().removeAttribute('align');else this.getFocusElement().setAttribute('align','middle');tinyMCE.triggerNodeChange();return;case "JustifyRight":if(align=='right')this.getFocusElement().removeAttribute('align');else this.getFocusElement().setAttribute('align','right');tinyMCE.triggerNodeChange();return;}}if(tinyMCE.settings['force_br_newlines']){var documentRef=this.contentWindow.document;var alignValue="";if(documentRef.selection.type!="Control"){switch(command){case "JustifyLeft":alignValue="left";break;case "JustifyCenter":alignValue="center";break;case "JustifyFull":alignValue="justify";break;case "JustifyRight":alignValue="right";break;}if(alignValue!=""){var rng=documentRef.selection.createRange();if((divElm=tinyMCE.getParentElement(rng.parentElement(),"div"))!=null)divElm.setAttribute("align",alignValue);else if(rng.pasteHTML&&rng.htmlText.length>0)rng.pasteHTML('
'+rng.htmlText+"
");tinyMCE.triggerNodeChange();return;}}}switch(command){case "mceLink":var selectedText="";if(tinyMCE.isMSIE){var documentRef=this.contentWindow.document;var rng=documentRef.selection.createRange();selectedText=rng.text;}else selectedText=this.contentWindow.getSelection().toString();if(!tinyMCE.linkElement){if((tinyMCE.selectedElement.nodeName.toLowerCase()!="img")&&(selectedText.length<=0))return;}var href="",target="",title="";if(tinyMCE.selectedElement.nodeName.toLowerCase()=="a")tinyMCE.linkElement=tinyMCE.selectedElement;if(tinyMCE.linkElement){href=tinyMCE.linkElement.getAttribute('href')?tinyMCE.linkElement.getAttribute('href'):"";target=tinyMCE.linkElement.getAttribute('target')?tinyMCE.linkElement.getAttribute('target'):"";title=tinyMCE.linkElement.getAttribute('title')?tinyMCE.linkElement.getAttribute('title'):"";mceRealHref=tinyMCE.linkElement.getAttribute('mce_real_href')?tinyMCE.linkElement.getAttribute('mce_real_href'):"";if(mceRealHref!="")href=mceRealHref;href=eval(tinyMCE.settings['urlconvertor_callback']+"(href, tinyMCE.linkElement, true);");}if(this.settings['insertlink_callback']){var returnVal=eval(this.settings['insertlink_callback']+"(href, target, title);");if(returnVal&&returnVal['href'])tinyMCE.insertLink(returnVal['href'],returnVal['target'],returnVal['title']);}else{tinyMCE.openWindow(this.insertLinkTemplate,{href:href,target:target,title:title});}break;case "mceImage":var src="",alt="",border="",hspace="",vspace="",width="",height="",align="";if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img")tinyMCE.imgElement=tinyMCE.selectedElement;if(tinyMCE.imgElement){src=tinyMCE.imgElement.getAttribute('src')?tinyMCE.imgElement.getAttribute('src'):"";alt=tinyMCE.imgElement.getAttribute('alt')?tinyMCE.imgElement.getAttribute('alt'):"";border=tinyMCE.imgElement.getAttribute('border')?tinyMCE.imgElement.getAttribute('border'):"";hspace=tinyMCE.imgElement.getAttribute('hspace')?tinyMCE.imgElement.getAttribute('hspace'):"";vspace=tinyMCE.imgElement.getAttribute('vspace')?tinyMCE.imgElement.getAttribute('vspace'):"";width=tinyMCE.imgElement.getAttribute('width')?tinyMCE.imgElement.getAttribute('width'):"";height=tinyMCE.imgElement.getAttribute('height')?tinyMCE.imgElement.getAttribute('height'):"";align=tinyMCE.imgElement.getAttribute('align')?tinyMCE.imgElement.getAttribute('align'):"";mceRealSrc=tinyMCE.imgElement.getAttribute('mce_real_src')?tinyMCE.imgElement.getAttribute('mce_real_src'):"";if(mceRealSrc!="")src=mceRealSrc;src=eval(tinyMCE.settings['urlconvertor_callback']+"(src, tinyMCE.imgElement, true);");}if(this.settings['insertimage_callback']){var returnVal=eval(this.settings['insertimage_callback']+"(src, alt, border, hspace, vspace, width, height, align);");if(returnVal&&returnVal['src'])tinyMCE.insertImage(returnVal['src'],returnVal['alt'],returnVal['border'],returnVal['hspace'],returnVal['vspace'],returnVal['width'],returnVal['height'],returnVal['align']);}else tinyMCE.openWindow(this.insertImageTemplate,{src:src,alt:alt,border:border,hspace:hspace,vspace:vspace,width:width,height:height,align:align});break;case "mceCleanupWord":if(tinyMCE.isMSIE){var html=this.contentDocument.body.createTextRange().htmlText;if(html.indexOf('="mso')!=-1){tinyMCE._setHTML(this.contentDocument,this.contentDocument.body.innerHTML);var cleanedHTML=tinyMCE._cleanupHTML(this.contentDocument,this.settings,this.contentDocument.body,this.visualAid);this.contentDocument.body.innerHTML=cleanedHTML;}}break;case "mceCleanup":tinyMCE._setHTML(this.contentDocument,this.contentDocument.body.innerHTML);var cleanedHTML=tinyMCE._cleanupHTML(this.contentDocument,this.settings,this.contentDocument.body,this.visualAid);this.contentDocument.body.innerHTML=cleanedHTML;break;case "mceAnchor":if(!user_interface){var aElm=tinyMCE.getParentElement(this.getFocusElement(),"a","name");if(aElm)aElm.setAttribute('name',value);else{this.contentDocument.execCommand("fontname",false,"#mce_temp_font#");var elementArray=tinyMCE.getElementsByAttributeValue(this.contentDocument.body,"font","face","#mce_temp_font#");for(var x=0;x0){value=tinyMCE.replaceVar(value,"selection",selectedText);tinyMCE.execCommand('mceInsertContent',false,value);}tinyMCE.triggerNodeChange();break;case "mceSetAttribute":if(typeof value=='object'){var targetElms=(typeof value['targets']=="undefined")?"p,img,span,div,td,h1,h2,h3,h4,h5,h6,pre,address":value['targets'];var targetNode=tinyMCE.getParentElement(this.getFocusElement(),targetElms);if(targetNode){targetNode.setAttribute(value['name'],value['value']);tinyMCE.triggerNodeChange();}}break;case "mceSetCSSClass":var selectedText=false;if(tinyMCE.isMSIE){var documentRef=this.contentWindow.document;var rng=documentRef.selection.createRange();selectedText=(rng.text&&rng.text.length>0);}else selectedText=(this.contentWindow.getSelection().toString().length>0);if(selectedText){this.contentDocument.execCommand("removeformat",false,null);this.contentDocument.execCommand("fontname",false,"#mce_temp_font#");var elementArray=tinyMCE.getElementsByAttributeValue(this.contentDocument.body,"font","face","#mce_temp_font#");for(var x=0;xcols)cols=rowsAr[i].cells.length;cols=cols;rows=rowsAr.length;border=tinyMCE.getAttrib(tinyMCE.tableElement,'border',border);cellpadding=tinyMCE.getAttrib(tinyMCE.tableElement,'cellpadding',"");cellspacing=tinyMCE.getAttrib(tinyMCE.tableElement,'cellspacing',"");width=tinyMCE.getAttrib(tinyMCE.tableElement,'width',width);height=tinyMCE.getAttrib(tinyMCE.tableElement,'height',height);align=tinyMCE.getAttrib(tinyMCE.tableElement,'align',align);className=tinyMCE.getAttrib(tinyMCE.tableElement,tinyMCE.isMSIE?'className':"class","");if(tinyMCE.isMSIE){width=tinyMCE.tableElement.style.pixelWidth==0?tinyMCE.tableElement.getAttribute("width"):tinyMCE.tableElement.style.pixelWidth;height=tinyMCE.tableElement.style.pixelHeight==0?tinyMCE.tableElement.getAttribute("height"):tinyMCE.tableElement.style.pixelHeight;}action="update";}tinyMCE.openWindow(this.insertTableTemplate,{editor_id:this.editorId,cols:cols,rows:rows,border:border,cellpadding:cellpadding,cellspacing:cellspacing,align:align,width:width,height:height,action:action,className:className});}else{var html='';var cols=2,rows=2,border=0,cellpadding=-1,cellspacing=-1,align,width,height,className;if(typeof value=='object'){cols=value['cols'];rows=value['rows'];border=value['border']!=""?value['border']:0;cellpadding=value['cellpadding']!=""?value['cellpadding']:-1;cellspacing=value['cellspacing']!=""?value['cellspacing']:-1;align=value['align'];width=value['width'];height=value['height'];className=value['className'];}if(tinyMCE.tableElement){tinyMCE.setAttrib(tinyMCE.tableElement,'cellPadding',cellpadding);tinyMCE.setAttrib(tinyMCE.tableElement,'cellSpacing',cellspacing);tinyMCE.setAttrib(tinyMCE.tableElement,'border',border);tinyMCE.setAttrib(tinyMCE.tableElement,'width',width);tinyMCE.setAttrib(tinyMCE.tableElement,'height',height);tinyMCE.setAttrib(tinyMCE.tableElement,'align',align,true);tinyMCE.setAttrib(tinyMCE.tableElement,tinyMCE.isMSIE?'className':"class",className,true);if(tinyMCE.isMSIE){tinyMCE.tableElement.style.pixelWidth=(width==null||width=="")?0:width;tinyMCE.tableElement.style.pixelHeight=(height==null||height=="")?0:height;}tinyMCE.handleVisualAid(tinyMCE.tableElement,false,this.visualAid);tinyMCE.tableElement.outerHTML=tinyMCE.tableElement.outerHTML;tinyMCE.triggerNodeChange();return;}html+='";for(var x=0;x';else html+='";}html+="";}html+="
';html+=" 
";this.execCommand('mceInsertContent',false,html);}break;case "mceTableInsertRowBefore":case "mceTableInsertRowAfter":case "mceTableDeleteRow":case "mceTableInsertColBefore":case "mceTableInsertColAfter":case "mceTableDeleteCol":var trElement=tinyMCE.getParentElement(this.getFocusElement(),"tr");var tdElement=tinyMCE.getParentElement(this.getFocusElement(),"td");var tableElement=tinyMCE.getParentElement(this.getFocusElement(),"table");if(!tableElement)return;var documentRef=this.contentWindow.document;var tableBorder=tableElement.getAttribute("border");var visualAidStyle=this.visualAid?tinyMCE.settings['visual_table_style']:"";if(tableElement.firstChild&&tableElement.firstChild.nodeName.toLowerCase()=="tbody")tableElement=tableElement.firstChild;if(tableElement&&trElement){switch(command){case "mceTableInsertRowBefore":var numcells=trElement.cells.length;var rowCount=0;var tmpTR=trElement;while(tmpTR){if(tmpTR.nodeName.toLowerCase()=="tr")rowCount++;tmpTR=tmpTR.previousSibling;}var r=tableElement.insertRow(rowCount==0?1:rowCount-1);for(var i=0;inumCols)numCols=tableElement.rows[y].cells.length;}if(numCols<=1){tinyMCE._selectNode(this.contentWindow,selElm);tableElement.parentNode.removeChild(tableElement);tinyMCE.triggerNodeChange();return;}for(var y=0;y0)selElm=tableElement.rows[0].cells[index-1];tinyMCE._selectNode(this.contentWindow,selElm);break;}tinyMCE.triggerNodeChange();}break;case "mceAddUndoLevel":if(tinyMCE.settings['custom_undo_redo']){var customUndoLevels=tinyMCE.settings['custom_undo_redo_levels'];var newHTML=this.contentWindow.document.body.innerHTML;if(newHTML!=this.undoLevels[this.undoLevels.length-1]){if(customUndoLevels!=-1&&this.undoLevels.length>customUndoLevels){for(var i=0;i0){this.undoIndex--;this.contentWindow.document.body.innerHTML=this.undoLevels[this.undoIndex];}tinyMCE.triggerNodeChange();}else this.contentDocument.execCommand(command,user_interface,value);break;case "Redo":if(tinyMCE.settings['custom_undo_redo']){if(this.undoIndex<(this.undoLevels.length-1)){this.undoIndex++;this.contentWindow.document.body.innerHTML=this.undoLevels[this.undoIndex];}tinyMCE.triggerNodeChange();}else this.contentDocument.execCommand(command,user_interface,value);break;case "mceToggleVisualAid":this.visualAid=!this.visualAid;tinyMCE.handleVisualAid(this.contentWindow.document.body,true,this.visualAid);tinyMCE.triggerNodeChange();break;default:this.contentDocument.execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();}}function TinyMCE__selectNode(win,node,expand){if(!tinyMCE.isMSIE){var rng=win.document.createRange();rng.selectNode(node);sel=win.getSelection();sel.addRange(rng);if(expand)sel.extend(node,0);else sel.collapse(node,0);}}function TinyMCE_getControlHTML(control_name){var themePlugins=tinyMCE.getParam('plugins','',true,',');var templateFunction;for(var i=themePlugins.length;i>=0;i--){templateFunction='TinyMCE_'+themePlugins[i]+"_getControlHTML";if(eval("typeof "+templateFunction)!='undefined'){var html=eval(templateFunction+"('"+control_name+"');");if(html!="")return tinyMCE.replaceVar(html,"pluginurl",tinyMCE.baseURL+"/plugins/"+themePlugins[i]);}}return eval('TinyMCE_'+tinyMCE.settings['theme']+"_getControlHTML"+"('"+control_name+"');");}function TinyMCE__themeExecCommand(editor_id,element,command,user_interface,value){var themePlugins=tinyMCE.getParam('plugins','',true,',');var templateFunction;for(var i=themePlugins.length;i>=0;i--){templateFunction='TinyMCE_'+themePlugins[i]+"_execCommand";if(eval("typeof "+templateFunction)!='undefined'){if(eval(templateFunction+"(editor_id, element, command, user_interface, value);"))return true;}}templateFunction='TinyMCE_'+tinyMCE.settings['theme']+"_execCommand";if(eval("typeof "+templateFunction)!='undefined')return eval(templateFunction+"(editor_id, element, command, user_interface, value);");return false;}function TinyMCE__getThemeFunction(suffix){var themePlugins=tinyMCE.getParam('plugins','',true,',');var templateFunction;for(var i=themePlugins.length;i>=0;i--){templateFunction='TinyMCE_'+themePlugins[i]+suffix;if(eval("typeof "+templateFunction)!='undefined')return templateFunction;}return 'TinyMCE_'+tinyMCE.settings['theme']+suffix;}function TinyMCEControl_queryCommandValue(command){return this.contentWindow.document.queryCommandValue(command);}function TinyMCEControl_queryCommandState(command){return this.contentWindow.document.queryCommandState(command);}function TinyMCEControl_onAdd(replace_element,form_element_name){tinyMCE.themeURL=tinyMCE.baseURL+"/themes/"+this.settings['theme'];this.settings['themeurl']=tinyMCE.themeURL;if(!replace_element){alert("Error: Could not find the target element.");return false;}var templateFunction=tinyMCE._getThemeFunction('_getInsertTableTemplate');if(eval("typeof "+templateFunction)!='undefined')this.insertTableTemplate=eval(templateFunction+'(this.settings);');var templateFunction=tinyMCE._getThemeFunction('_getInsertLinkTemplate');if(eval("typeof "+templateFunction)!='undefined')this.insertLinkTemplate=eval(templateFunction+'(this.settings);');var templateFunction=tinyMCE._getThemeFunction('_getInsertImageTemplate');if(eval("typeof "+templateFunction)!='undefined')this.insertImageTemplate=eval(templateFunction+'(this.settings);');var templateFunction=tinyMCE._getThemeFunction('_getEditorTemplate');if(eval("typeof "+templateFunction)=='undefined'){alert("Error: Could not find the template function: "+templateFunction);return false;}var editorTemplate=eval(templateFunction+'(this.settings, this.editorId);');var deltaWidth=editorTemplate['delta_width']?editorTemplate['delta_width']:0;var deltaHeight=editorTemplate['delta_height']?editorTemplate['delta_height']:0;var html=''+editorTemplate['html'];var templateFunction=tinyMCE._getThemeFunction('_handleNodeChange');if(eval("typeof "+templateFunction)!='undefined')this.settings['handleNodeChangeCallback']=templateFunction;html=tinyMCE.replaceVar(html,"editor_id",this.editorId);html=tinyMCE.replaceVar(html,"default_document",tinyMCE.baseURL+"/blank.htm");this.settings['default_document']=tinyMCE.baseURL+"/blank.htm";this.settings['old_width']=this.settings['width'];this.settings['old_height']=this.settings['height'];if(this.settings['width']==-1)this.settings['width']=replace_element.offsetWidth;if(this.settings['height']==-1)this.settings['height']=replace_element.offsetHeight;this.settings['area_width']=this.settings['width'];this.settings['area_height']=this.settings['height'];this.settings['area_width']+=deltaWidth;this.settings['area_height']+=deltaHeight;if((""+this.settings['width']).indexOf('%')!=-1)this.settings['area_width']="100%";if((""+this.settings['height']).indexOf('%')!=-1)this.settings['area_height']="100%";if((""+replace_element.style.width).indexOf('%')!=-1){this.settings['width']=replace_element.style.width;this.settings['area_width']="100%";}if((""+replace_element.style.height).indexOf('%')!=-1){this.settings['height']=replace_element.style.height;this.settings['area_height']="100%";}html=tinyMCE.applyTemplate(html);this.settings['width']=this.settings['old_width'];this.settings['height']=this.settings['old_height'];this.visualAid=this.settings['visual'];this.oldTargetElement=replace_element.cloneNode(true);this.formTargetElementId=form_element_name;html=html+'';if(!tinyMCE.isMSIE){var rng=replace_element.ownerDocument.createRange();rng.setStartBefore(replace_element);var fragment=rng.createContextualFragment(html);replace_element.parentNode.replaceChild(fragment,replace_element);}else replace_element.outerHTML=html;tinyMCE.setEditMode(this.editorId,true);return true;}function TinyMCEControl_getFocusElement(){if(tinyMCE.isMSIE){var documentRef=this.contentWindow.document;var rng=documentRef.selection.createRange();var elm=rng.item?rng.item(0):rng.parentElement();}else{var sel=this.contentWindow.getSelection();var elm=sel.anchorNode;if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img")elm=tinyMCE.selectedElement;}return elm;}var tinyMCE=new TinyMCE();var tinyMCELang=new Array(); diff --git a/www/extras/tinymce/jscripts/tiny_mce/tiny_mce_src.js b/www/extras/tinymce/jscripts/tiny_mce/tiny_mce_src.js index 742887522..5d13e6eff 100644 --- a/www/extras/tinymce/jscripts/tiny_mce/tiny_mce_src.js +++ b/www/extras/tinymce/jscripts/tiny_mce/tiny_mce_src.js @@ -116,12 +116,12 @@ function TinyMCE_init(settings) { this.settings = settings; this.settings['mode'] = tinyMCE.getParam("mode", "none"); this.settings['theme'] = tinyMCE.getParam("theme", "default"); - this.settings['plugins'] = tinyMCE.getParam("plugins", ""); + this.settings['plugins'] = tinyMCE.getParam("plugins", "", true); this.settings['language'] = tinyMCE.getParam("language", "uk"); this.settings['docs_language'] = tinyMCE.getParam("docs_language", this.settings['language']); this.settings['elements'] = tinyMCE.getParam("elements", ""); this.settings['textarea_trigger'] = tinyMCE.getParam("textarea_trigger", "mce_editable"); - this.settings['valid_elements'] = tinyMCE.getParam("valid_elements", "a[name|href|target],strong/b[class],em/i[class],strike[class],u[class],p[class|align],ol,ul,li,br,img[class|src|border=0|alt|hspace|vspace|width|height|align],sub,sup,blockquote[dir|style],table[border=0|cellspacing|cellpadding|width|height|class|align],tr[class|rowspan],td[class|colspan|rowspan|width|height],div[class|align],span[class|align],pre[class|align],address[class|align],h1[class|align],h2[class|align],h3[class|align],h4[class|align],h5[class|align],h6[class|align],hr"); + this.settings['valid_elements'] = tinyMCE.getParam("valid_elements", "a[name|href|target|title],strong/b[class],em/i[class],strike[class],u[class],p[class|align],ol,ul,li,br,img[class|src|border=0|alt|hspace|vspace|width|height|align],sub,sup,blockquote[dir|style],table[border=0|cellspacing|cellpadding|width|height|class|align],tr[class|rowspan],td[class|colspan|rowspan|width|height],div[class|align],span[class|align],pre[class|align],address[class|align],h1[class|align],h2[class|align],h3[class|align],h4[class|align],h5[class|align],h6[class|align],hr"); this.settings['extended_valid_elements'] = tinyMCE.getParam("extended_valid_elements", ""); this.settings['invalid_elements'] = tinyMCE.getParam("invalid_elements", ""); this.settings['encoding'] = tinyMCE.getParam("encoding", ""); @@ -220,7 +220,7 @@ function TinyMCE_init(settings) { document.write(''); // Add theme plugins - var themePlugins = this.settings['plugins'].split(','); + var themePlugins = tinyMCE.getParam('plugins', '', true, ','); if (this.settings['plugins'] != '') { for (var i=0; i'); @@ -346,14 +346,38 @@ function TinyMCE_execCommand(command, user_interface, value) { } function TinyMCE_addEventHandlers(editor_id) { - var instance = tinyMCE.instances[editor_id]; - instance.contentWindow.document.editor_id = editor_id; - instance.contentWindow.document.addEventListener("keypress", tinyMCE.handleEvent, false); - instance.contentWindow.document.addEventListener("keydown", tinyMCE.handleEvent, false); - instance.contentWindow.document.addEventListener("keyup", tinyMCE.handleEvent, false); - instance.contentWindow.document.addEventListener("click", tinyMCE.handleEvent, false); - instance.contentWindow.document.addEventListener("focus", tinyMCE.handleEvent, false); - instance.contentWindow.document.designMode = "on"; + if (tinyMCE.isMSIE) { + var patchFunc = function() { + var event = document.frames[editor_id].event; + + event.target = event.srcElement; + event.target.editor_id = editor_id; + + TinyMCE_handleEvent(event); + }; + + // Event patch + document.frames[editor_id].document.onkeypress = patchFunc; + document.frames[editor_id].document.onkeyup = patchFunc; + document.frames[editor_id].document.onkeydown = patchFunc; + + // Due to stange focus bug in MSIE this line is disabled for now + //document.frames[editor_id].document.onmousedown = patchFunc; + document.frames[editor_id].document.onmouseup = patchFunc; + document.frames[editor_id].document.onclick = patchFunc; + } else { + var instance = tinyMCE.instances[editor_id]; + + instance.contentWindow.document.editor_id = editor_id; + instance.contentWindow.document.addEventListener("keypress", tinyMCE.handleEvent, false); + instance.contentWindow.document.addEventListener("keydown", tinyMCE.handleEvent, false); + instance.contentWindow.document.addEventListener("keyup", tinyMCE.handleEvent, false); + instance.contentWindow.document.addEventListener("click", tinyMCE.handleEvent, false); + instance.contentWindow.document.addEventListener("mouseup", tinyMCE.handleEvent, false); + instance.contentWindow.document.addEventListener("mousedown", tinyMCE.handleEvent, false); + instance.contentWindow.document.addEventListener("focus", tinyMCE.handleEvent, false); + instance.contentWindow.document.designMode = "on"; + } } function TinyMCE__createIFrame(replace_element) { @@ -370,6 +394,11 @@ function TinyMCE__createIFrame(replace_element) { iframe.setAttribute("topMargin", "0"); iframe.setAttribute("width", tinyMCE.settings['area_width']); iframe.setAttribute("height", tinyMCE.settings['area_height']); + + // Must have a src element in MSIE HTTPs breaks aswell as absoute URLs + if (tinyMCE.isMSIE) + iframe.setAttribute("src", tinyMCE.baseURL + "/blank.htm"); + iframe.style.width = tinyMCE.settings['area_width']; iframe.style.height = tinyMCE.settings['area_height']; @@ -403,10 +432,9 @@ function TinyMCE_setEditMode(editor_id, mode) { //targetMCEControl.contentWindow.document.designMode = mode ? "on" : "off"; } else { var targetElement = document.getElementById(editor_id); - if (targetElement && targetElement.nodeName.toLowerCase() == "span") { + if (targetElement && targetElement.nodeName.toLowerCase() == "span") targetElement = tinyMCE._createIFrame(targetElement); - dynamicIFrame = true; - } else + else targetElement = document.frames[editor_id]; targetMCEControl.targetElement = targetElement; @@ -442,28 +470,10 @@ function TinyMCE_setEditMode(editor_id, mode) { } } - if (tinyMCE.isMSIE) { - document.frames[editor_id].document.ondeactive = tinyMCE.handleEvent; - - var patchFunc = function() { - var event = document.frames[editor_id].event; - - event.target = event.srcElement; - event.target.editor_id = editor_id; - - TinyMCE_handleEvent(event); - }; - - // * * Event patch - document.frames[editor_id].document.onkeypress = patchFunc; - document.frames[editor_id].document.onkeyup = patchFunc; - document.frames[editor_id].document.onkeydown = patchFunc; - - // Due to stange focus bug in MSIE this line is disabled for now - //document.frames[editor_id].document.onmousedown = patchFunc; - document.frames[editor_id].document.onmouseup = patchFunc; - document.frames[editor_id].document.onclick = patchFunc; - } + // This timeout is needed in MSIE 5.5 for some odd reason + // it seems that the document.frames isn't initialized yet? + if (tinyMCE.isMSIE) + window.setTimeout("TinyMCE_addEventHandlers('" + editor_id + "');", 1); //window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", (tinyMCE.isMSIE ? 1 : 1000)); tinyMCE.setupContent(editor_id); @@ -490,6 +500,10 @@ function TinyMCE_setupContent(editor_id) { doc.body.dir = this.settings['directionality']; doc.editorId = editor_id; + // Add on document element in Mozilla + if (!tinyMCE.isMSIE) + doc.documentElement.editorId = editor_id; + // Setup base element base = doc.createElement("base"); base.setAttribute('href', tinyMCE.settings['base_href']); @@ -504,20 +518,19 @@ function TinyMCE_setupContent(editor_id) { if (tinyMCE.isMSIE) { var styleSheet = document.frames[editor_id].document.createStyleSheet(instance.settings['content_css']); - window.setInterval('tinyMCE.getCSSClasses(document.frames["' + editor_id + '"].document, "' + editor_id + '");', 500); + // Ugly!!! + window.setInterval('try{tinyMCE.getCSSClasses(document.frames["' + editor_id + '"].document, "' + editor_id + '");}catch(e){}', 500); if (tinyMCE.settings["force_br_newlines"]) document.frames[editor_id].document.styleSheets[0].addRule("p", "margin: 0px;"); var patchFunc = function() { var event = document.frames[editor_id].event; - event.target = document.frames[editor_id].document; TinyMCE_handleEvent(event); }; - document.frames[editor_id].document.body.onblur = patchFunc; document.frames[editor_id].document.body.onbeforepaste = patchFunc; document.frames[editor_id].document.body.onbeforecut = patchFunc; document.frames[editor_id].document.body.onpaste = patchFunc; @@ -611,9 +624,8 @@ function TinyMCE_setupContent(editor_id) { eval(tinyMCE.settings['setupcontent_callback'] + '(editor_id,instance.contentWindow.document.body);'); // Re-add design mode on mozilla - if (!tinyMCE.isMSIE) { + if (!tinyMCE.isMSIE) TinyMCE_addEventHandlers(editor_id); - } } function TinyMCE_handleEvent(e) { @@ -661,6 +673,30 @@ function TinyMCE_handleEvent(e) { e.preventDefault(); return false; } + + if (e.charCode == 98) { // Ctrl+B + tinyMCE.selectedInstance.execCommand("Bold"); + + // Cancel event + e.preventDefault(); + return false; + } + + if (e.charCode == 105) { // Ctrl+I + tinyMCE.selectedInstance.execCommand("Italic"); + + // Cancel event + e.preventDefault(); + return false; + } + + if (e.charCode == 117) { // Ctrl+U + tinyMCE.selectedInstance.execCommand("Underline"); + + // Cancel event + e.preventDefault(); + return false; + } } if (tinyMCE.settings['custom_undo_redo']) { @@ -788,6 +824,10 @@ function TinyMCE_handleEvent(e) { return false; } } + + // Trigger some nodechange on keyup + if (e.type == "keyup") + tinyMCE.triggerNodeChange(); break; case "mousedown": @@ -806,11 +846,12 @@ function TinyMCE_handleEvent(e) { // Reset typing tinyMCE.selectedInstance.typing = false; - tinyMCE.triggerNodeChange(false); break; } } + tinyMCE.triggerNodeChange(false); + // Just in case if (!tinyMCE.selectedInstance && e.target.editorId) tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId]; @@ -889,7 +930,7 @@ function TinyMCE_onLoad() { // Add editor instances based on mode switch (tinyMCE.settings['mode']) { case "exact": - var elements = tinyMCE.settings['elements'].split(','); + var elements = tinyMCE.getParam('elements', '', true, ','); for (var i=0; i