diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php index 234b70869e..19a5286048 100644 --- a/wp-admin/admin-header.php +++ b/wp-admin/admin-header.php @@ -9,6 +9,26 @@ if (!isset($_GET["page"])) require_once('admin.php'); ?> + + + + + + + 100)) { + $rows = 12; + } +?> +
+ diff --git a/wp-admin/options-writing.php b/wp-admin/options-writing.php index f07c6fc8ff..e012021267 100644 --- a/wp-admin/options-writing.php +++ b/wp-admin/options-writing.php @@ -11,21 +11,24 @@ include('admin-header.php');

- + - - - - + + + +';};ContextMenu.prototype.addItem=function(icon,title,command,value,disabled){if(title.charAt(0)=='$')title=tinyMCE.getLang(title.substring(1));var onMouseDown='';var html='';if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0)onMouseDown='contextMenu.execCommand(\''+command+'\', \''+value+'\');return false;';else onMouseDown=this.settings['commandhandler']+'(\''+command+'\', \''+value+'\');return false;';if(icon=="")icon=this.settings['spacer_image'];if(!disabled)html+='';else html+='';html+='';html+='';html+='';this.html+=html;};ContextMenu.prototype.show=function(x,y){if(this.html=="")return;var html='';html+='

+
+ +
';html+=title;html+='
';html+=this.html;html+='
';this.contextMenuDiv.innerHTML=html;if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0){var width,height;this.contextMenuDiv.style.display="block";width=this.contextMenuDiv.offsetWidth;height=this.contextMenuDiv.offsetHeight;this.contextMenuDiv.style.display="none";this.pop.document.body.innerHTML='
'+html+"
";this.pop.document.tinyMCE=tinyMCE;this.pop.document.contextMenu=this;this.pop.show(x,y,width,height);}else{this.contextMenuDiv.style.left=x+'px';this.contextMenuDiv.style.top=y+'px';this.contextMenuDiv.style.display="block";}};ContextMenu.prototype.hide=function(){if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0)this.pop.hide();else this.contextMenuDiv.style.display="none";};ContextMenu.prototype.execCommand=function(command,value){eval(this.settings['commandhandler']+"(command, value);");}; \ No newline at end of file diff --git a/wp-admin/tinymce/plugins/contextmenu/editor_plugin_src.js b/wp-admin/tinymce/plugins/contextmenu/editor_plugin_src.js new file mode 100644 index 0000000000..23675de4f0 --- /dev/null +++ b/wp-admin/tinymce/plugins/contextmenu/editor_plugin_src.js @@ -0,0 +1,292 @@ +/* Import plugin specific language pack */ +//tinyMCE.importPluginLanguagePack('contextmenu', 'en,zh_cn,cs,fa,fr_ca,fr,de'); +if (!tinyMCE.settings['contextmenu_skip_plugin_css']) + tinyMCE.loadCSS(tinyMCE.baseURL + "/plugins/contextmenu/contextmenu.css"); + +// Global contextmenu class instance +var TinyMCE_contextmenu_contextMenu = null; + +function TinyMCE_contextmenu_initInstance(inst) { + // Is not working on MSIE 5.0 + if (tinyMCE.isMSIE5_0) + return; + + // Add hide event handles + tinyMCE.addEvent(inst.getDoc(), "click", TinyMCE_contextmenu_hideContextMenu); + tinyMCE.addEvent(inst.getDoc(), "keypress", TinyMCE_contextmenu_hideContextMenu); + tinyMCE.addEvent(inst.getDoc(), "keydown", TinyMCE_contextmenu_hideContextMenu); + tinyMCE.addEvent(document, "click", TinyMCE_contextmenu_hideContextMenu); + tinyMCE.addEvent(document, "keypress", TinyMCE_contextmenu_hideContextMenu); + tinyMCE.addEvent(document, "keydown", TinyMCE_contextmenu_hideContextMenu); + + var contextMenu = new ContextMenu({ + commandhandler : "TinyMCE_contextmenu_commandHandler", + spacer_image : tinyMCE.baseURL + "/plugins/contextmenu/images/spacer.gif" + }); + + // Register global reference + TinyMCE_contextmenu_contextMenu = contextMenu; + + // Attach contextmenu event + if (tinyMCE.isGecko) { + tinyMCE.addEvent(inst.getDoc(), "contextmenu", function(e) {TinyMCE_contextmenu_showContextMenu(tinyMCE.isMSIE ? inst.contentWindow.event : e, inst);}); + } else + tinyMCE.addEvent(inst.getDoc(), "contextmenu", TinyMCE_contextmenu_onContextMenu); +} + +function TinyMCE_contextmenu_onContextMenu(e) { + var elm = tinyMCE.isMSIE ? e.srcElement : e.target; + var targetInst, body; + + // Find instance + if ((body = tinyMCE.getParentElement(elm, "body")) != null) { + for (var n in tinyMCE.instances) { + var inst = tinyMCE.instances[n]; + + if (body == inst.getBody()) { + targetInst = inst; + break; + } + } + + return TinyMCE_contextmenu_showContextMenu(tinyMCE.isMSIE ? targetInst.contentWindow.event : e, targetInst); + } +} + +function TinyMCE_contextmenu_showContextMenu(e, inst) { + function getAttrib(elm, name) { + return elm.getAttribute(name) ? elm.getAttribute(name) : ""; + } + + var x, y, elm, contextMenu; + var pos = tinyMCE.getAbsPosition(inst.iframeElement); + + x = tinyMCE.isMSIE ? e.screenX : pos.absLeft + (e.pageX - inst.getBody().scrollLeft); + y = tinyMCE.isMSIE ? e.screenY : pos.absTop + (e.pageY - inst.getBody().scrollTop); + elm = tinyMCE.isMSIE ? e.srcElement : e.target; + contextMenu = TinyMCE_contextmenu_contextMenu; + contextMenu.inst = inst; + + // Mozilla needs some time + window.setTimeout(function () { + var theme = tinyMCE.getParam("theme"); + + contextMenu.clearAll(); + var sel = inst.getSelectedText().length != 0 || elm.nodeName == "IMG"; + + // Default items + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_cut_desc", "Cut", "", !sel); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_copy_desc", "Copy", "", !sel); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_paste_desc", "Paste", "", false); + + // Get element + elm = tinyMCE.getParentElement(elm, "img,table,td"); + if (elm) { + switch (elm.nodeName) { + case "IMG": + contextMenu.addSeparator(); + + // If flash + if (tinyMCE.getAttrib(elm, 'name', '').indexOf('mce_plugin_flash') == 0) + contextMenu.addItem(tinyMCE.baseURL + "/plugins/flash/images/flash.gif", "$lang_flash_props", "mceFlash"); + else + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/image.gif", "$lang_image_props_desc", "mceImage"); + break; + + case "TABLE": + case "TD": + // Is table plugin loaded + if (typeof(TinyMCE_table_getControlHTML) != "undefined") { + var colspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "colspan"); + var rowspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "rowspan"); + + colspan = colspan == "" ? "1" : colspan; + rowspan = rowspan == "" ? "1" : rowspan; + + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_table_cut_row_desc", "mceTableCutRow"); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_table_copy_row_desc", "mceTableCopyRow"); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_before_desc", "mceTablePasteRowBefore", "", inst.tableRowClipboard == null); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_after_desc", "mceTablePasteRowAfter", "", inst.tableRowClipboard == null); + +/* contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/left.gif", "$lang_justifyleft_desc", "JustifyLeft", "", false); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/center.gif", "$lang_justifycenter_desc", "JustifyCenter", "", false); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/right.gif", "$lang_justifyright_desc", "JustifyRight", "", false); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/full.gif", "$lang_justifyfull_desc", "JustifyFull", "", false);*/ + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_insert_desc", "mceInsertTable", "insert"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_props_desc", "mceInsertTable"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_cell_props.gif", "$lang_table_cell_desc", "mceTableCellProps"); + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_row_props.gif", "$lang_table_row_desc", "mceTableRowProps"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_before.gif", "$lang_table_insert_row_before_desc", "mceTableInsertRowBefore"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_after.gif", "$lang_table_insert_row_after_desc", "mceTableInsertRowAfter"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_row.gif", "$lang_table_delete_row_desc", "mceTableDeleteRow"); + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_before.gif", "$lang_table_insert_col_before_desc", "mceTableInsertColBefore"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_after.gif", "$lang_table_insert_col_after_desc", "mceTableInsertColAfter"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_col.gif", "$lang_table_delete_col_desc", "mceTableDeleteCol"); + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_split_cells.gif", "$lang_table_split_cells_desc", "mceTableSplitCells", "", (colspan == "1" && rowspan == "1")); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_merge_cells.gif", "$lang_table_merge_cells_desc", "mceTableMergeCells", "", false); + } + break; + } + } + + contextMenu.show(x, y); + }, 10); + + // Cancel default handeling + tinyMCE.cancelEvent(e); + return false; +} + +function TinyMCE_contextmenu_hideContextMenu() { + TinyMCE_contextmenu_contextMenu.hide(); + + return true; +} + +function TinyMCE_contextmenu_commandHandler(command, value) { + TinyMCE_contextmenu_contextMenu.hide(); + + // UI must be true on these + var ui = false; + if (command == "mceInsertTable" || command == "mceTableCellProps" || command == "mceTableRowProps" || command == "mceTableMergeCells") + ui = true; + + if (command == "Paste") + value = null; + + TinyMCE_contextmenu_contextMenu.inst.execCommand(command, ui, value); +} + +// Context menu class + +function ContextMenu(settings) { + // Default value function + function defParam(key, def_val) { + settings[key] = typeof(settings[key]) != "undefined" ? settings[key] : def_val; + } + + var self = this; + + this.isMSIE = (navigator.appName == "Microsoft Internet Explorer"); + + // Setup contextmenu div + this.contextMenuDiv = document.createElement("div"); + this.contextMenuDiv.className = "contextMenu"; + this.contextMenuDiv.setAttribute("class", "contextMenu"); + this.contextMenuDiv.style.display = "none"; + this.contextMenuDiv.style.position = 'absolute'; + this.contextMenuDiv.style.zindex = 1000; + this.contextMenuDiv.style.left = '0px'; + this.contextMenuDiv.style.top = '0px'; + this.contextMenuDiv.unselectable = "on"; + + document.body.appendChild(this.contextMenuDiv); + + // Setup default values + defParam("commandhandler", ""); + defParam("spacer_image", "images/spacer.gif"); + + this.items = new Array(); + this.settings = settings; + this.html = ""; + + // IE Popup + if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0) { + this.pop = window.createPopup(); + doc = this.pop.document; + doc.open(); + doc.write(''); + doc.close(); + } +}; + +ContextMenu.prototype.clearAll = function() { + this.html = ""; + this.contextMenuDiv.innerHTML = ""; +}; + +ContextMenu.prototype.addSeparator = function() { + this.html += ''; +}; + +ContextMenu.prototype.addItem = function(icon, title, command, value, disabled) { + if (title.charAt(0) == '$') + title = tinyMCE.getLang(title.substring(1)); + + var onMouseDown = ''; + var html = ''; + + if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0) + onMouseDown = 'contextMenu.execCommand(\'' + command + '\', \'' + value + '\');return false;'; + else + onMouseDown = this.settings['commandhandler'] + '(\'' + command + '\', \'' + value + '\');return false;'; + + if (icon == "") + icon = this.settings['spacer_image']; + + if (!disabled) + html += ''; + else + html += ''; + + html += ''; + html += '
'; + + // Add text + html += title; + + html += '
'; + html += ''; + + // Add to main + this.html += html; +}; + +ContextMenu.prototype.show = function(x, y) { + if (this.html == "") + return; + + var html = ''; + + html += ''; + html += this.html; + html += '
'; + + this.contextMenuDiv.innerHTML = html; + + if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0) { + var width, height; + + // Get dimensions + this.contextMenuDiv.style.display = "block"; + width = this.contextMenuDiv.offsetWidth; + height = this.contextMenuDiv.offsetHeight; + this.contextMenuDiv.style.display = "none"; + + // Setup popup and show + this.pop.document.body.innerHTML = '
' + html + "
"; + this.pop.document.tinyMCE = tinyMCE; + this.pop.document.contextMenu = this; + this.pop.show(x, y, width, height); + } else { + this.contextMenuDiv.style.left = x + 'px'; + this.contextMenuDiv.style.top = y + 'px'; + this.contextMenuDiv.style.display = "block"; + } +}; + +ContextMenu.prototype.hide = function() { + if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0) + this.pop.hide(); + else + this.contextMenuDiv.style.display = "none"; +}; + +ContextMenu.prototype.execCommand = function(command, value) { + eval(this.settings['commandhandler'] + "(command, value);"); +}; diff --git a/wp-admin/tinymce/plugins/contextmenu/images/spacer.gif b/wp-admin/tinymce/plugins/contextmenu/images/spacer.gif new file mode 100644 index 0000000000..fc2560981e Binary files /dev/null and b/wp-admin/tinymce/plugins/contextmenu/images/spacer.gif differ diff --git a/wp-admin/tinymce/plugins/contextmenu/readme.txt b/wp-admin/tinymce/plugins/contextmenu/readme.txt new file mode 100644 index 0000000000..4fdb78aecd --- /dev/null +++ b/wp-admin/tinymce/plugins/contextmenu/readme.txt @@ -0,0 +1 @@ +Check the TinyMCE documentation for details on this plugin. diff --git a/wp-admin/tinymce/plugins/emotions/editor_plugin.js b/wp-admin/tinymce/plugins/emotions/editor_plugin.js new file mode 100644 index 0000000000..f41fe7bbc2 --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/editor_plugin.js @@ -0,0 +1,2 @@ +/* Import plugin specific language pack */ + tinyMCE.importPluginLanguagePack('emotions','en,sv,zh_cn,cs,fa,fr_ca,fr,de,pl,pt_br,nl');function TinyMCE_emotions_getControlHTML(control_name){switch(control_name){case "emotions":return '';}return "";}function TinyMCE_emotions_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceEmotion":var template=new Array();template['file']='../../plugins/emotions/emotions.htm';template['width']=150;template['height']=180;tinyMCE.openWindow(template,{editor_id:editor_id});return true;}return false;} \ No newline at end of file diff --git a/wp-admin/tinymce/plugins/emotions/editor_plugin_src.js b/wp-admin/tinymce/plugins/emotions/editor_plugin_src.js new file mode 100644 index 0000000000..2db546974f --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/editor_plugin_src.js @@ -0,0 +1,36 @@ +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('emotions', 'en,sv,zh_cn,cs,fa,fr_ca,fr,de,pl,pt_br,nl'); + +/** + * Returns the HTML contents of the emotions control. + */ +function TinyMCE_emotions_getControlHTML(control_name) { + switch (control_name) { + case "emotions": + return ''; + } + + return ""; +} + +/** + * Executes the mceEmotion command. + */ +function TinyMCE_emotions_execCommand(editor_id, element, command, user_interface, value) { + // Handle commands + switch (command) { + case "mceEmotion": + var template = new Array(); + + template['file'] = '../../plugins/emotions/emotions.htm'; // Relative to theme + template['width'] = 150; + template['height'] = 180; + + tinyMCE.openWindow(template, {editor_id : editor_id}); + + return true; + } + + // Pass to next handler in chain + return false; +} diff --git a/wp-admin/tinymce/plugins/emotions/emotions.htm b/wp-admin/tinymce/plugins/emotions/emotions.htm new file mode 100644 index 0000000000..5466dba96a --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/emotions.htm @@ -0,0 +1,45 @@ + + +{$lang_insert_emotions_title} + + + + +
+
{$lang_insert_emotions_title}:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + diff --git a/wp-admin/tinymce/plugins/emotions/images/emotions.gif b/wp-admin/tinymce/plugins/emotions/images/emotions.gif new file mode 100644 index 0000000000..d34f0e0bf3 Binary files /dev/null and b/wp-admin/tinymce/plugins/emotions/images/emotions.gif differ diff --git a/wp-admin/tinymce/plugins/emotions/images/readme.txt b/wp-admin/tinymce/plugins/emotions/images/readme.txt new file mode 100644 index 0000000000..a3cea1b687 --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/images/readme.txt @@ -0,0 +1,2 @@ +These emotions where taken from Mozilla Thunderbird. +I hope they don't get angry if I use them here after all this is a open source project aswell. diff --git a/wp-admin/tinymce/plugins/emotions/images/smiley-cool.gif b/wp-admin/tinymce/plugins/emotions/images/smiley-cool.gif new file mode 100644 index 0000000000..1e2c1d62bb Binary files /dev/null and b/wp-admin/tinymce/plugins/emotions/images/smiley-cool.gif differ diff --git a/wp-admin/tinymce/plugins/emotions/images/smiley-cry.gif b/wp-admin/tinymce/plugins/emotions/images/smiley-cry.gif new file mode 100644 index 0000000000..e0dcf8a8fc Binary files /dev/null and b/wp-admin/tinymce/plugins/emotions/images/smiley-cry.gif differ diff --git a/wp-admin/tinymce/plugins/emotions/images/smiley-embarassed.gif b/wp-admin/tinymce/plugins/emotions/images/smiley-embarassed.gif new file mode 100644 index 0000000000..8e3f07a57d Binary files /dev/null and b/wp-admin/tinymce/plugins/emotions/images/smiley-embarassed.gif differ diff --git a/wp-admin/tinymce/plugins/emotions/images/smiley-foot-in-mouth.gif b/wp-admin/tinymce/plugins/emotions/images/smiley-foot-in-mouth.gif new file mode 100644 index 0000000000..b3e47cc3f8 Binary files /dev/null and b/wp-admin/tinymce/plugins/emotions/images/smiley-foot-in-mouth.gif differ diff --git a/wp-admin/tinymce/plugins/emotions/images/smiley-frown.gif b/wp-admin/tinymce/plugins/emotions/images/smiley-frown.gif new file mode 100644 index 0000000000..9335e9945e Binary files /dev/null and b/wp-admin/tinymce/plugins/emotions/images/smiley-frown.gif differ diff --git a/wp-admin/tinymce/plugins/emotions/images/smiley-innocent.gif b/wp-admin/tinymce/plugins/emotions/images/smiley-innocent.gif new file mode 100644 index 0000000000..cdb72568da Binary files /dev/null and b/wp-admin/tinymce/plugins/emotions/images/smiley-innocent.gif differ diff --git a/wp-admin/tinymce/plugins/emotions/images/smiley-kiss.gif b/wp-admin/tinymce/plugins/emotions/images/smiley-kiss.gif new file mode 100644 index 0000000000..242c38c1ee Binary files /dev/null and b/wp-admin/tinymce/plugins/emotions/images/smiley-kiss.gif differ diff --git a/wp-admin/tinymce/plugins/emotions/images/smiley-laughing.gif b/wp-admin/tinymce/plugins/emotions/images/smiley-laughing.gif new file mode 100644 index 0000000000..09a9ec7e4f Binary files /dev/null and b/wp-admin/tinymce/plugins/emotions/images/smiley-laughing.gif differ diff --git a/wp-admin/tinymce/plugins/emotions/images/smiley-money-mouth.gif b/wp-admin/tinymce/plugins/emotions/images/smiley-money-mouth.gif new file mode 100644 index 0000000000..12b1138aca Binary files /dev/null and b/wp-admin/tinymce/plugins/emotions/images/smiley-money-mouth.gif differ diff --git a/wp-admin/tinymce/plugins/emotions/images/smiley-sealed.gif b/wp-admin/tinymce/plugins/emotions/images/smiley-sealed.gif new file mode 100644 index 0000000000..76002b2f01 Binary files /dev/null and b/wp-admin/tinymce/plugins/emotions/images/smiley-sealed.gif differ diff --git a/wp-admin/tinymce/plugins/emotions/images/smiley-smile.gif b/wp-admin/tinymce/plugins/emotions/images/smiley-smile.gif new file mode 100644 index 0000000000..8cf2b5daf3 Binary files /dev/null and b/wp-admin/tinymce/plugins/emotions/images/smiley-smile.gif differ diff --git a/wp-admin/tinymce/plugins/emotions/images/smiley-surprised.gif b/wp-admin/tinymce/plugins/emotions/images/smiley-surprised.gif new file mode 100644 index 0000000000..ece78a394e Binary files /dev/null and b/wp-admin/tinymce/plugins/emotions/images/smiley-surprised.gif differ diff --git a/wp-admin/tinymce/plugins/emotions/images/smiley-tongue-out.gif b/wp-admin/tinymce/plugins/emotions/images/smiley-tongue-out.gif new file mode 100644 index 0000000000..16b13a5a6a Binary files /dev/null and b/wp-admin/tinymce/plugins/emotions/images/smiley-tongue-out.gif differ diff --git a/wp-admin/tinymce/plugins/emotions/images/smiley-undecided.gif b/wp-admin/tinymce/plugins/emotions/images/smiley-undecided.gif new file mode 100644 index 0000000000..2aec732fbf Binary files /dev/null and b/wp-admin/tinymce/plugins/emotions/images/smiley-undecided.gif differ diff --git a/wp-admin/tinymce/plugins/emotions/images/smiley-wink.gif b/wp-admin/tinymce/plugins/emotions/images/smiley-wink.gif new file mode 100644 index 0000000000..5d975f6732 Binary files /dev/null and b/wp-admin/tinymce/plugins/emotions/images/smiley-wink.gif differ diff --git a/wp-admin/tinymce/plugins/emotions/images/smiley-yell.gif b/wp-admin/tinymce/plugins/emotions/images/smiley-yell.gif new file mode 100644 index 0000000000..7719bc43d3 Binary files /dev/null and b/wp-admin/tinymce/plugins/emotions/images/smiley-yell.gif differ diff --git a/wp-admin/tinymce/plugins/emotions/langs/cs.js b/wp-admin/tinymce/plugins/emotions/langs/cs.js new file mode 100644 index 0000000000..90d1c8b664 --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/langs/cs.js @@ -0,0 +1,4 @@ +// UK lang variables + +tinyMCELang['lang_insert_emotions_title'] = 'Vloit emotikon'; +tinyMCELang['lang_emotions_desc'] = 'Emotikony'; diff --git a/wp-admin/tinymce/plugins/emotions/langs/de.js b/wp-admin/tinymce/plugins/emotions/langs/de.js new file mode 100644 index 0000000000..e828c7603d --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/langs/de.js @@ -0,0 +1,6 @@ +// DE lang variables + + +tinyMCELang['lang_insert_emotions_title'] = 'Emotion einfügen'; +tinyMCELang['lang_emotions_desc'] = 'Emotion'; + diff --git a/wp-admin/tinymce/plugins/emotions/langs/el.js b/wp-admin/tinymce/plugins/emotions/langs/el.js new file mode 100644 index 0000000000..607433fb08 --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/langs/el.js @@ -0,0 +1,5 @@ +// Greek lang variables by Jacaranda Bill + +tinyMCELang['lang_insert_emotions_title'] = ' emoticon'; +tinyMCELang['lang_emotions_desc'] = ' emoticons'; + diff --git a/wp-admin/tinymce/plugins/emotions/langs/en.js b/wp-admin/tinymce/plugins/emotions/langs/en.js new file mode 100644 index 0000000000..37f549fb40 --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/langs/en.js @@ -0,0 +1,5 @@ +// UK lang variables + +tinyMCELang['lang_insert_emotions_title'] = 'Insert emotion'; +tinyMCELang['lang_emotions_desc'] = 'Emotions'; + diff --git a/wp-admin/tinymce/plugins/emotions/langs/fa.js b/wp-admin/tinymce/plugins/emotions/langs/fa.js new file mode 100644 index 0000000000..fe7db9e6db --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/langs/fa.js @@ -0,0 +1,10 @@ +// IR lang variables +// Persian (Farsi) language pack (for IRAN) +// By: Morteza Zafari +// Lost@LostLord.com +// http://www.LostLord.com + +tinyMCELang['lang_dir'] = 'rtl'; +tinyMCELang['lang_insert_emotions_title'] = 'افزودن شکلک'; +tinyMCELang['lang_emotions_desc'] = 'شکلکها'; + diff --git a/wp-admin/tinymce/plugins/emotions/langs/fr.js b/wp-admin/tinymce/plugins/emotions/langs/fr.js new file mode 100644 index 0000000000..b2dbedb0d6 --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/langs/fr.js @@ -0,0 +1,5 @@ +// French lang variables by Laurent Dran + +tinyMCELang['lang_insert_emotions_title'] = 'Insèrer un émoticon'; +tinyMCELang['lang_emotions_desc'] = 'Émoticons'; + diff --git a/wp-admin/tinymce/plugins/emotions/langs/fr_ca.js b/wp-admin/tinymce/plugins/emotions/langs/fr_ca.js new file mode 100644 index 0000000000..e0fdbb8304 --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/langs/fr_ca.js @@ -0,0 +1,5 @@ +// Canadian French lang variables by Virtuelcom last modification: 2005-06-15 + +tinyMCELang['lang_insert_emotions_title'] = 'Insrer un moticon'; +tinyMCELang['lang_emotions_desc'] = 'moticons'; + diff --git a/wp-admin/tinymce/plugins/emotions/langs/it.js b/wp-admin/tinymce/plugins/emotions/langs/it.js new file mode 100644 index 0000000000..fa93e6be3f --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/langs/it.js @@ -0,0 +1,5 @@ +//IT lang variables + +tinyMCELang['lang_insert_emotions_title'] = 'Inserisci una emoticon'; +tinyMCELang['lang_emotions_desc'] = 'Emoticon'; + diff --git a/wp-admin/tinymce/plugins/emotions/langs/ko.js b/wp-admin/tinymce/plugins/emotions/langs/ko.js new file mode 100644 index 0000000000..654193f2ed --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/langs/ko.js @@ -0,0 +1,5 @@ +// KO lang variables + +tinyMCELang['lang_insert_emotions_title'] = '̸Ƽ ֱ'; +tinyMCELang['lang_emotions_desc'] = '̸Ƽ'; + diff --git a/wp-admin/tinymce/plugins/emotions/langs/nl.js b/wp-admin/tinymce/plugins/emotions/langs/nl.js new file mode 100644 index 0000000000..8713ded488 --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/langs/nl.js @@ -0,0 +1,4 @@ +// NL lang variables + +tinyMCELang['lang_insert_emotions_title'] = 'Emotion invoegen'; +tinyMCELang['lang_emotions_desc'] = 'Smilie'; diff --git a/wp-admin/tinymce/plugins/emotions/langs/pl.js b/wp-admin/tinymce/plugins/emotions/langs/pl.js new file mode 100644 index 0000000000..63996c9afd --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/langs/pl.js @@ -0,0 +1,4 @@ +// PL lang variables + +tinyMCELang['lang_insert_emotions_title'] = 'Wstaw emtoiconę'; +tinyMCELang['lang_emotions_desc'] = 'Emtoicony'; \ No newline at end of file diff --git a/wp-admin/tinymce/plugins/emotions/langs/pt_br.js b/wp-admin/tinymce/plugins/emotions/langs/pt_br.js new file mode 100644 index 0000000000..a9fc32ef07 --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/langs/pt_br.js @@ -0,0 +1,5 @@ +// pt_BR lang variables + +tinyMCELang['lang_insert_emotions_title'] = 'Inserir Emoticon'; +tinyMCELang['lang_emotions_desc'] = 'Emoticons'; + diff --git a/wp-admin/tinymce/plugins/emotions/langs/sv.js b/wp-admin/tinymce/plugins/emotions/langs/sv.js new file mode 100644 index 0000000000..82e1ba330c --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/langs/sv.js @@ -0,0 +1,4 @@ +// SE lang variables + +tinyMCELang['lang_insert_emotions_title'] = 'Klistra in knsla'; +tinyMCELang['lang_emotions_desc'] = 'Knslor'; diff --git a/wp-admin/tinymce/plugins/emotions/langs/zh_cn.js b/wp-admin/tinymce/plugins/emotions/langs/zh_cn.js new file mode 100644 index 0000000000..cdd4896414 --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/langs/zh_cn.js @@ -0,0 +1,6 @@ +// Simplified Chinese lang variables contributed by cube316 (cube316@gmail.com) +// http://www.cube316.net/ ԻȡTinyMCE֧ + +tinyMCELang['lang_insert_emotions_title'] = ''; +tinyMCELang['lang_emotions_desc'] = ''; + diff --git a/wp-admin/tinymce/plugins/emotions/readme.txt b/wp-admin/tinymce/plugins/emotions/readme.txt new file mode 100644 index 0000000000..4fdb78aecd --- /dev/null +++ b/wp-admin/tinymce/plugins/emotions/readme.txt @@ -0,0 +1 @@ +Check the TinyMCE documentation for details on this plugin. diff --git a/wp-admin/tinymce/plugins/iespell/editor_plugin.js b/wp-admin/tinymce/plugins/iespell/editor_plugin.js new file mode 100644 index 0000000000..51c8748d56 --- /dev/null +++ b/wp-admin/tinymce/plugins/iespell/editor_plugin.js @@ -0,0 +1,2 @@ +/* Import plugin specific language pack */ + tinyMCE.importPluginLanguagePack('iespell','cs,el,en,fr_ca,it,ko,sv,zh_cn,fr,de,pl,pt_br,nl');function TinyMCE_iespell_getControlHTML(control_name){if(control_name=="iespell"&&tinyMCE.isMSIE)return '';return "";}function TinyMCE_iespell_execCommand(editor_id,element,command,user_interface,value){if(command=="mceIESpell"){try{var ieSpell=new ActiveXObject("ieSpell.ieSpellExtension");ieSpell.CheckDocumentNode(tinyMCE.getInstanceById(editor_id).contentDocument.documentElement);}catch(e){if(e.number==-2146827859){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;}return false;} \ No newline at end of file diff --git a/wp-admin/tinymce/plugins/iespell/editor_plugin_src.js b/wp-admin/tinymce/plugins/iespell/editor_plugin_src.js new file mode 100644 index 0000000000..e4633b7519 --- /dev/null +++ b/wp-admin/tinymce/plugins/iespell/editor_plugin_src.js @@ -0,0 +1,37 @@ +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('iespell', 'cs,el,en,fr_ca,it,ko,sv,zh_cn,fr,de,pl,pt_br,nl'); + +/** + * Returns the HTML contents of the iespell control. + */ +function TinyMCE_iespell_getControlHTML(control_name) { + // Is it the iespell control and is the brower MSIE. + if (control_name == "iespell" && tinyMCE.isMSIE) + return ''; + + return ""; +} + +/** + * Executes the mceIESpell command. + */ +function TinyMCE_iespell_execCommand(editor_id, element, command, user_interface, value) { + // Handle ieSpellCommand + if (command == "mceIESpell") { + try { + var ieSpell = new ActiveXObject("ieSpell.ieSpellExtension"); + ieSpell.CheckDocumentNode(tinyMCE.getInstanceById(editor_id).contentDocument.documentElement); + } catch (e) { + if (e.number == -2146827859) { + 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; + } + + // Pass to next handler in chain + return false; +} \ No newline at end of file diff --git a/wp-admin/tinymce/plugins/iespell/images/iespell.gif b/wp-admin/tinymce/plugins/iespell/images/iespell.gif new file mode 100644 index 0000000000..46c0c4a66a Binary files /dev/null and b/wp-admin/tinymce/plugins/iespell/images/iespell.gif differ diff --git a/wp-admin/tinymce/plugins/iespell/langs/cs.js b/wp-admin/tinymce/plugins/iespell/langs/cs.js new file mode 100644 index 0000000000..c38a4806cc --- /dev/null +++ b/wp-admin/tinymce/plugins/iespell/langs/cs.js @@ -0,0 +1,4 @@ +// UK lang variables + +tinyMCELang['lang_iespell_desc'] = 'Spustit kontrolu pravopisu'; +tinyMCELang['lang_iespell_download'] = "ieSpell nedetekovn. Kliknte na OK a otevete stahovac strnku." \ No newline at end of file diff --git a/wp-admin/tinymce/plugins/iespell/langs/de.js b/wp-admin/tinymce/plugins/iespell/langs/de.js new file mode 100644 index 0000000000..80a3b02b40 --- /dev/null +++ b/wp-admin/tinymce/plugins/iespell/langs/de.js @@ -0,0 +1,4 @@ +// DE lang variables by Tobias Heer + +tinyMCELang['lang_iespell_desc'] = 'Rechtschreibprüfung'; +tinyMCELang['lang_iespell_download'] = "ieSpell nicht gefunden. Klicken Sie OK um auf die Download Seite zu gelangen." diff --git a/wp-admin/tinymce/plugins/iespell/langs/el.js b/wp-admin/tinymce/plugins/iespell/langs/el.js new file mode 100644 index 0000000000..7925947050 --- /dev/null +++ b/wp-admin/tinymce/plugins/iespell/langs/el.js @@ -0,0 +1,4 @@ +// Greek lang variables by Jacaranda Bill + +tinyMCELang['lang_iespell_desc'] = ' '; +tinyMCELang['lang_iespell_download'] = " ieSpell . OK ." diff --git a/wp-admin/tinymce/plugins/iespell/langs/en.js b/wp-admin/tinymce/plugins/iespell/langs/en.js new file mode 100644 index 0000000000..b7cc3a439f --- /dev/null +++ b/wp-admin/tinymce/plugins/iespell/langs/en.js @@ -0,0 +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/wp-admin/tinymce/plugins/iespell/langs/fr.js b/wp-admin/tinymce/plugins/iespell/langs/fr.js new file mode 100644 index 0000000000..de66fb04ad --- /dev/null +++ b/wp-admin/tinymce/plugins/iespell/langs/fr.js @@ -0,0 +1,4 @@ +// French lang variables by Laurent Dran + +tinyMCELang['lang_iespell_desc'] = 'Executer le vérificateur d\'orthographe'; +tinyMCELang['lang_iespell_download'] = "ieSpell n\'a pas été trouvé. Cliquez sur OK pour aller au site de téléchargement." diff --git a/wp-admin/tinymce/plugins/iespell/langs/fr_ca.js b/wp-admin/tinymce/plugins/iespell/langs/fr_ca.js new file mode 100644 index 0000000000..8328019019 --- /dev/null +++ b/wp-admin/tinymce/plugins/iespell/langs/fr_ca.js @@ -0,0 +1,4 @@ +// Canadian French lang variables by Virtuelcom last modification: 2005-06-15 + +tinyMCELang['lang_iespell_desc'] = 'Executer le vrificateur d\'orthographe'; +tinyMCELang['lang_iespell_download'] = "ieSpell n\'a pas t trouv. Cliquez sur OK pour aller au site de tlchargement."; diff --git a/wp-admin/tinymce/plugins/iespell/langs/it.js b/wp-admin/tinymce/plugins/iespell/langs/it.js new file mode 100644 index 0000000000..5f6e2f05f1 --- /dev/null +++ b/wp-admin/tinymce/plugins/iespell/langs/it.js @@ -0,0 +1,4 @@ +// IT lang variables + +tinyMCELang['lang_iespell_desc'] = 'Avvia il controllo ortografico'; +tinyMCELang['lang_iespell_download'] = "ieSpell non trovato. Clicca OK per andare alla pagina di download." diff --git a/wp-admin/tinymce/plugins/iespell/langs/ko.js b/wp-admin/tinymce/plugins/iespell/langs/ko.js new file mode 100644 index 0000000000..a5bbfe4465 --- /dev/null +++ b/wp-admin/tinymce/plugins/iespell/langs/ko.js @@ -0,0 +1,4 @@ +// KO lang variables + +tinyMCELang['lang_iespell_desc'] = ' ˻ '; +tinyMCELang['lang_iespell_download'] = "ieSpell ã ϴ. OK ٿε ̵մϴ." diff --git a/wp-admin/tinymce/plugins/iespell/langs/nl.js b/wp-admin/tinymce/plugins/iespell/langs/nl.js new file mode 100644 index 0000000000..10b75eb1b4 --- /dev/null +++ b/wp-admin/tinymce/plugins/iespell/langs/nl.js @@ -0,0 +1,4 @@ +// NL lang variables + +tinyMCELang['lang_iespell_desc'] = 'Spelling checker'; +tinyMCELang['lang_iespell_download'] = "ieSpell niet gedetecteerd. Klik OK om naar de download pagina te gaan." \ No newline at end of file diff --git a/wp-admin/tinymce/plugins/iespell/langs/pl.js b/wp-admin/tinymce/plugins/iespell/langs/pl.js new file mode 100644 index 0000000000..9fcb4e3a19 --- /dev/null +++ b/wp-admin/tinymce/plugins/iespell/langs/pl.js @@ -0,0 +1,4 @@ +// PL lang variables + +tinyMCELang['lang_iespell_desc'] = 'Uruchom sprawdzanie pisowni'; +tinyMCELang['lang_iespell_download'] = "Nie wykryto pluginu, kliknij aby przejść do strony z pluginami." \ No newline at end of file diff --git a/wp-admin/tinymce/plugins/iespell/langs/pt_br.js b/wp-admin/tinymce/plugins/iespell/langs/pt_br.js new file mode 100644 index 0000000000..dba6e82a74 --- /dev/null +++ b/wp-admin/tinymce/plugins/iespell/langs/pt_br.js @@ -0,0 +1,4 @@ +// pt_BR lang variables + +tinyMCELang['lang_iespell_desc'] = 'Executar verificao ortogrfica'; +tinyMCELang['lang_iespell_download'] = "Verificador ieSpell no detectado. Click OK para ir pgina de download." diff --git a/wp-admin/tinymce/plugins/iespell/langs/sv.js b/wp-admin/tinymce/plugins/iespell/langs/sv.js new file mode 100644 index 0000000000..2230c1cb99 --- /dev/null +++ b/wp-admin/tinymce/plugins/iespell/langs/sv.js @@ -0,0 +1,4 @@ +// SE lang variables + +tinyMCELang['lang_iespell_desc'] = 'Kr rttstavningskontroll'; +tinyMCELang['lang_iespell_download'] = "ieSpell verkar inte vara installerad. Klicka OK för att ladda hem." diff --git a/wp-admin/tinymce/plugins/iespell/langs/zh_cn.js b/wp-admin/tinymce/plugins/iespell/langs/zh_cn.js new file mode 100644 index 0000000000..35aeba17d4 --- /dev/null +++ b/wp-admin/tinymce/plugins/iespell/langs/zh_cn.js @@ -0,0 +1,5 @@ +// Simplified Chinese lang variables contributed by cube316 (cube316@gmail.com) +// http://www.cube316.net/ ԻȡTinyMCE֧ + +tinyMCELang['lang_iespell_desc'] = 'ƴд'; +tinyMCELang['lang_iespell_download'] = "δ⵽ieSpellƴд飬 OK ǰҳ档" diff --git a/wp-admin/tinymce/plugins/iespell/readme.txt b/wp-admin/tinymce/plugins/iespell/readme.txt new file mode 100644 index 0000000000..4fdb78aecd --- /dev/null +++ b/wp-admin/tinymce/plugins/iespell/readme.txt @@ -0,0 +1 @@ +Check the TinyMCE documentation for details on this plugin. diff --git a/wp-admin/tinymce/plugins/preview/editor_plugin.js b/wp-admin/tinymce/plugins/preview/editor_plugin.js new file mode 100644 index 0000000000..e77d4af58a --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/editor_plugin.js @@ -0,0 +1,2 @@ +/* Import plugin specific language pack */ + tinyMCE.importPluginLanguagePack('preview','cs,de,el,en,fr_ca,it,ko,pt,sv,zh_cn,fa,fr,pl,pt_br,nl');function TinyMCE_preview_getControlHTML(control_name){switch(control_name){case "preview":return '';}return "";}function TinyMCE_preview_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mcePreview":var previewPage=tinyMCE.getParam("plugin_preview_pageurl",null);var previewWidth=tinyMCE.getParam("plugin_preview_width","550");var previewHeight=tinyMCE.getParam("plugin_preview_height","600");if(previewPage){var template=new Array();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=no,toolbar=no,scrollbars=yes,resizable=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+='';html+=tinyMCE.getContent();html+='';html+='';win.document.write(html);win.document.close();}return true;}return false;} \ No newline at end of file diff --git a/wp-admin/tinymce/plugins/preview/editor_plugin_src.js b/wp-admin/tinymce/plugins/preview/editor_plugin_src.js new file mode 100644 index 0000000000..c5748f9d86 --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/editor_plugin_src.js @@ -0,0 +1,62 @@ +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('preview', 'cs,de,el,en,fr_ca,it,ko,pt,sv,zh_cn,fa,fr,pl,pt_br,nl'); + +/** + * Returns the HTML contents of the preview control. + */ +function TinyMCE_preview_getControlHTML(control_name) { + switch (control_name) { + case "preview": + return ''; + } + + return ""; +} + +/** + * Executes the mcePreview command. + */ +function TinyMCE_preview_execCommand(editor_id, element, command, user_interface, value) { + // Handle commands + switch (command) { + case "mcePreview": + var previewPage = tinyMCE.getParam("plugin_preview_pageurl", null); + var previewWidth = tinyMCE.getParam("plugin_preview_width", "550"); + var previewHeight = tinyMCE.getParam("plugin_preview_height", "600"); + + // Use a custom preview page + if (previewPage) { + var template = new Array(); + + 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=no,toolbar=no,scrollbars=yes,resizable=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 += ''; + html += tinyMCE.getContent(); + html += ''; + html += ''; + + win.document.write(html); + win.document.close(); + } + + return true; + } + + // Pass to next handler in chain + return false; +} diff --git a/wp-admin/tinymce/plugins/preview/example.html b/wp-admin/tinymce/plugins/preview/example.html new file mode 100644 index 0000000000..c6f1dfb45e --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/example.html @@ -0,0 +1,14 @@ + + + + +Example of a custom preview page + + + + +Editor contents:
+{$content} + + + diff --git a/wp-admin/tinymce/plugins/preview/images/preview.gif b/wp-admin/tinymce/plugins/preview/images/preview.gif new file mode 100644 index 0000000000..4e7900c319 Binary files /dev/null and b/wp-admin/tinymce/plugins/preview/images/preview.gif differ diff --git a/wp-admin/tinymce/plugins/preview/langs/cs.js b/wp-admin/tinymce/plugins/preview/langs/cs.js new file mode 100644 index 0000000000..27502b4ae2 --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/langs/cs.js @@ -0,0 +1,3 @@ +// UK lang variables + +tinyMCELang['lang_preview_desc'] = 'Nhled'; \ No newline at end of file diff --git a/wp-admin/tinymce/plugins/preview/langs/de.js b/wp-admin/tinymce/plugins/preview/langs/de.js new file mode 100644 index 0000000000..e24e9c4629 --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/langs/de.js @@ -0,0 +1,3 @@ +// DE lang variables by Tobias Heer + +tinyMCELang['lang_preview_desc'] = 'Vorschau'; diff --git a/wp-admin/tinymce/plugins/preview/langs/el.js b/wp-admin/tinymce/plugins/preview/langs/el.js new file mode 100644 index 0000000000..d63358e447 --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/langs/el.js @@ -0,0 +1,3 @@ +// Greek lang variables by Jacaranda Bill + +tinyMCELang['lang_preview_desc'] = ' '; diff --git a/wp-admin/tinymce/plugins/preview/langs/en.js b/wp-admin/tinymce/plugins/preview/langs/en.js new file mode 100644 index 0000000000..d94866db3a --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/langs/en.js @@ -0,0 +1,3 @@ +// UK lang variables + +tinyMCELang['lang_preview_desc'] = 'Preview'; diff --git a/wp-admin/tinymce/plugins/preview/langs/fa.js b/wp-admin/tinymce/plugins/preview/langs/fa.js new file mode 100644 index 0000000000..46877f4b61 --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/langs/fa.js @@ -0,0 +1,8 @@ +// IR lang variables +// Persian (Farsi) language pack (for IRAN) +// By: Morteza Zafari +// Lost@LostLord.com +// http://www.LostLord.com + +tinyMCELang['lang_dir'] = 'rtl'; +tinyMCELang['lang_preview_desc'] = 'پیش نمایش'; diff --git a/wp-admin/tinymce/plugins/preview/langs/fr.js b/wp-admin/tinymce/plugins/preview/langs/fr.js new file mode 100644 index 0000000000..18610dcaa7 --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/langs/fr.js @@ -0,0 +1,3 @@ +// French lang variables by Laurent Dran + +tinyMCELang['lang_preview_desc'] = 'Prévisualisation'; diff --git a/wp-admin/tinymce/plugins/preview/langs/fr_ca.js b/wp-admin/tinymce/plugins/preview/langs/fr_ca.js new file mode 100644 index 0000000000..7ebd62ec20 --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/langs/fr_ca.js @@ -0,0 +1,3 @@ +// Canadian French lang variables by Virtuelcom last modification: 2005-06-15 + +tinyMCELang['lang_preview_desc'] = 'Prvisualisation'; diff --git a/wp-admin/tinymce/plugins/preview/langs/it.js b/wp-admin/tinymce/plugins/preview/langs/it.js new file mode 100644 index 0000000000..7a13b51128 --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/langs/it.js @@ -0,0 +1,3 @@ +// IT lang variables + +tinyMCELang['lang_preview_desc'] = 'Anteprima'; diff --git a/wp-admin/tinymce/plugins/preview/langs/ko.js b/wp-admin/tinymce/plugins/preview/langs/ko.js new file mode 100644 index 0000000000..b3bb1f86a1 --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/langs/ko.js @@ -0,0 +1,3 @@ +// KO lang variables + +tinyMCELang['lang_preview_desc'] = '̸'; diff --git a/wp-admin/tinymce/plugins/preview/langs/nl.js b/wp-admin/tinymce/plugins/preview/langs/nl.js new file mode 100644 index 0000000000..782389f91c --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/langs/nl.js @@ -0,0 +1,3 @@ +// UK lang variables + +tinyMCELang['lang_preview_desc'] = 'Voorbeeld'; \ No newline at end of file diff --git a/wp-admin/tinymce/plugins/preview/langs/pl.js b/wp-admin/tinymce/plugins/preview/langs/pl.js new file mode 100644 index 0000000000..69985390ca --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/langs/pl.js @@ -0,0 +1,4 @@ +// PL lang variables + + +tinyMCELang['lang_preview_desc'] = 'Podgląd'; \ No newline at end of file diff --git a/wp-admin/tinymce/plugins/preview/langs/pt.js b/wp-admin/tinymce/plugins/preview/langs/pt.js new file mode 100644 index 0000000000..bc7e09d02d --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/langs/pt.js @@ -0,0 +1,3 @@ +// UK lang variables + +tinyMCELang['lang_preview_desc'] = 'Pr-visualizao'; diff --git a/wp-admin/tinymce/plugins/preview/langs/pt_br.js b/wp-admin/tinymce/plugins/preview/langs/pt_br.js new file mode 100644 index 0000000000..1a501c6354 --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/langs/pt_br.js @@ -0,0 +1,3 @@ +// pt_BR lang variables + +tinyMCELang['lang_preview_desc'] = 'Visualizar'; diff --git a/wp-admin/tinymce/plugins/preview/langs/sv.js b/wp-admin/tinymce/plugins/preview/langs/sv.js new file mode 100644 index 0000000000..32d58507d8 --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/langs/sv.js @@ -0,0 +1,3 @@ +// SE lang variables + +tinyMCELang['lang_preview_desc'] = 'Frhandsgranska'; diff --git a/wp-admin/tinymce/plugins/preview/langs/zh_cn.js b/wp-admin/tinymce/plugins/preview/langs/zh_cn.js new file mode 100644 index 0000000000..2c8a1a3d87 --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/langs/zh_cn.js @@ -0,0 +1,3 @@ +// Simplified Chinese lang variables contributed by cube316 (cube316@etang.com) + +tinyMCELang['lang_preview_desc'] = 'Ԥ'; diff --git a/wp-admin/tinymce/plugins/preview/readme.txt b/wp-admin/tinymce/plugins/preview/readme.txt new file mode 100644 index 0000000000..4fdb78aecd --- /dev/null +++ b/wp-admin/tinymce/plugins/preview/readme.txt @@ -0,0 +1 @@ +Check the TinyMCE documentation for details on this plugin. diff --git a/wp-admin/tinymce/plugins/save/editor_plugin.js b/wp-admin/tinymce/plugins/save/editor_plugin.js new file mode 100644 index 0000000000..0dfa850a33 --- /dev/null +++ b/wp-admin/tinymce/plugins/save/editor_plugin.js @@ -0,0 +1,2 @@ +/* Import plugin specific language pack */ + tinyMCE.importPluginLanguagePack('save','en,zh_cn,cs,fa,fr_ca,fr,de,pl,pt_br,nl');function TinyMCE_save_getControlHTML(control_name){switch(control_name){case "save":return '';}return "";}function TinyMCE_save_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceSave":var formObj=tinyMCE.selectedInstance.formElement.form;if(formObj){tinyMCE.triggerSave();for(var i=0;i'; + } + return ""; +} + +/** + * Executes the save command. + */ +function TinyMCE_save_execCommand(editor_id, element, command, user_interface, value) { + // Handle commands + switch (command) { + case "mceSave": + var formObj = tinyMCE.selectedInstance.formElement.form; + + if (formObj) { + tinyMCE.triggerSave(); + + // Disable all UI form elements that TinyMCE created + for (var i=0; i + + +About TinyMCE + + + + + + + + + + + +
+
+TinyMCE is a small WYSIWYG editor control for web browsers such as MSIE or Mozilla +that enables you to edit HTML contents in a more user friendly way. It has common +features that are found in most word processors and should not be difficult to +use.
+
+
+ + + + + + +
+ + diff --git a/wp-admin/tinymce/themes/advanced/docs/en/common_buttons.htm b/wp-admin/tinymce/themes/advanced/docs/en/common_buttons.htm new file mode 100644 index 0000000000..c63d7dc435 --- /dev/null +++ b/wp-admin/tinymce/themes/advanced/docs/en/common_buttons.htm @@ -0,0 +1,163 @@ + + + +Common buttons + + + + + + + + + + + +
+
+Below is a short description about each button. +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Bold text style.
Italic text style.
Underline text style.
Strikethrough text style.
Align left.
Align center.
Align right.
Align full.
Unordered list/bullet list.
Ordered list/numbered list
Outdent/decrease indentation.
Indent/incread indentation.
Undo the last operation.
Redo the last operation.
Insert a new link, read more about this function in the Insert + link section.
Unlinks the current selection/removes all selected links.
Insert a new anchor, read more about this function in the Insert anchor section.
Insert a new image, read more about this function in the Insert + image section.
Cleanup code/Removes unwanted formating. This function is useful when + you copy contents from for example a office product.
Shows this help window.
Opens HTML source code editor.
Inserts a new 2x2 table at the current location.
Adds a row above the current one.
Adds a row under the current one.
Removes the row.
Adds a column before the current one.
Adds a column after the current one.
Removes the current column.
Inserts a new horizontal ruler
Removes formatting from the selection.
Makes the selection to be subscript.
Makes the selection to be superscripted.
+
+
+ + + + + + + + diff --git a/wp-admin/tinymce/themes/advanced/docs/en/images/insert_anchor_window.gif b/wp-admin/tinymce/themes/advanced/docs/en/images/insert_anchor_window.gif new file mode 100644 index 0000000000..5b5f528dd5 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/docs/en/images/insert_anchor_window.gif differ diff --git a/wp-admin/tinymce/themes/advanced/docs/en/images/insert_image_window.gif b/wp-admin/tinymce/themes/advanced/docs/en/images/insert_image_window.gif new file mode 100644 index 0000000000..cdc617eab3 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/docs/en/images/insert_image_window.gif differ diff --git a/wp-admin/tinymce/themes/advanced/docs/en/images/insert_link_window.gif b/wp-admin/tinymce/themes/advanced/docs/en/images/insert_link_window.gif new file mode 100644 index 0000000000..7bad7583ab Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/docs/en/images/insert_link_window.gif differ diff --git a/wp-admin/tinymce/themes/advanced/docs/en/images/insert_table_window.gif b/wp-admin/tinymce/themes/advanced/docs/en/images/insert_table_window.gif new file mode 100644 index 0000000000..6a032c5ae8 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/docs/en/images/insert_table_window.gif differ diff --git a/wp-admin/tinymce/themes/advanced/docs/en/index.htm b/wp-admin/tinymce/themes/advanced/docs/en/index.htm new file mode 100644 index 0000000000..0b0526af00 --- /dev/null +++ b/wp-admin/tinymce/themes/advanced/docs/en/index.htm @@ -0,0 +1,27 @@ + + + +Help Index + + + + + + + + + +
+
+Click the links below to go to the different help sections. + +
+ + diff --git a/wp-admin/tinymce/themes/advanced/docs/en/insert_anchor_button.htm b/wp-admin/tinymce/themes/advanced/docs/en/insert_anchor_button.htm new file mode 100644 index 0000000000..e1118a289d --- /dev/null +++ b/wp-admin/tinymce/themes/advanced/docs/en/insert_anchor_button.htm @@ -0,0 +1,33 @@ + + + +Insert anchor button + + + + + + + + + + + +
+
+This button opens a new window with the insert/edit anchor function.
+
+
+
+There are one field in this window, this is where you enter the name of you anchor point. Remember the anchor name needs to be unique.
+
+
+ + + + + + +
+ + diff --git a/wp-admin/tinymce/themes/advanced/docs/en/insert_image_button.htm b/wp-admin/tinymce/themes/advanced/docs/en/insert_image_button.htm new file mode 100644 index 0000000000..e101fff851 --- /dev/null +++ b/wp-admin/tinymce/themes/advanced/docs/en/insert_image_button.htm @@ -0,0 +1,66 @@ + + + +Insert image button + + + + + + + + + + + +
+
+The insert image button opens the window shown below.
+
+
+
+You simply enter a URL to the image you want to link to and enter a image description, +this is then displayed as an alternative text descripton of the image on the page.
+
+Field descriptions:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Image URL URL/path to the image.
Image description Alternative description of image contents.
DimentionsImage width/height.
AlignmentImage alignment, useful when wrapping text around images.
BorderBorder thickness.
VSpaceVertical space, useful when wrapping text around images.
HSpaceHorizontal space, useful when wrapping text around images.
+
+
+ + + + + + +
+ + diff --git a/wp-admin/tinymce/themes/advanced/docs/en/insert_link_button.htm b/wp-admin/tinymce/themes/advanced/docs/en/insert_link_button.htm new file mode 100644 index 0000000000..ddfeb3af09 --- /dev/null +++ b/wp-admin/tinymce/themes/advanced/docs/en/insert_link_button.htm @@ -0,0 +1,34 @@ + + + +Insert link button + + + + + + + + + + + +
+
+This button opens a new window with the insert/edit link function.
+
+
+
+There are two fields in this window the first one "Link URL" is the +URL of the link. The target enables you to select how the link is to be opened.
+
+
+ + + + + + +
+ + diff --git a/wp-admin/tinymce/themes/advanced/docs/en/insert_table_button.htm b/wp-admin/tinymce/themes/advanced/docs/en/insert_table_button.htm new file mode 100644 index 0000000000..d3bd196ed9 --- /dev/null +++ b/wp-admin/tinymce/themes/advanced/docs/en/insert_table_button.htm @@ -0,0 +1,72 @@ + + + +Insert table button + + + + + + + + + + + +
+
+The insert table button opens the window shown below. This action enables you to create tables.
+
+
+
+Field descriptions:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ColumnsNumber of columns in the table.
RowsNumber of rows in the new table.
CellpaddingCellpadding of the table .
CellspacingCellspacing of the table .
AlignmentTable alignment .
BorderBorder thinkness of table.
WidthWidth in pixels of table .
HeightHeight in pixels of table.
ClassStyle or CSS class of table.
+
+
+
+ + + + + + +
+ + diff --git a/wp-admin/tinymce/themes/advanced/docs/en/style.css b/wp-admin/tinymce/themes/advanced/docs/en/style.css new file mode 100644 index 0000000000..722f537a1e --- /dev/null +++ b/wp-admin/tinymce/themes/advanced/docs/en/style.css @@ -0,0 +1,28 @@ +body { background-color: #FFFFFF; } +body, td, .content { font-family: Verdana, Arial, helvetica, sans-serif; font-size: 12px; } +.title { font-family: Verdana, Arial, helvetica, sans-serif; font-size: 16px; font-weight: bold; } +.subtitle { font-size: 12px; font-weight: bold; } + +.toc_ul, .toc_li { margin-left: 8 px; line-height: 16px; } +.step_ol, .step_li { margin-left: 11 px; line-height: 16px; } +img { border: #000000 solid 1px; } + +a:visited { color: #666666; text-decoration: underline; } +a:active { color: #666666; text-decoration: underline; } +a:hover { color: #666666; text-decoration: underline; } +a { color: #666666; text-decoration: underline; } + +.pageheader { border: #E0E0E0 solid 1px; } +.pagefooter { border: #E0E0E0 solid 1px; } +.sample { background-color: #FFFFFF; border: #000000 solid 1px; } +.samplecontent { font-size: 10px; } + +.code { background-color: #FFFFFF; border: #000000 solid 1px; } +.codecontent { font-size: 10px; } +.codecontent a:visited { color: #666666; text-decoration: none; font-weight: bold } +.codecontent a:active { color: #666666; text-decoration: none; font-weight: bold } +.codecontent a:hover { color: #666666; text-decoration: none; font-weight: bold } +.codecontent a { color: #666666; text-decoration: none; font-weight: bold } + +hr { height: 1px; } + diff --git a/wp-admin/tinymce/themes/advanced/editor_content.css b/wp-admin/tinymce/themes/advanced/editor_content.css new file mode 100644 index 0000000000..14b57c55a7 --- /dev/null +++ b/wp-admin/tinymce/themes/advanced/editor_content.css @@ -0,0 +1,19 @@ +body { + padding: .5em; + background: #fff; + color: #000; + font: 13px Verdana, Arial, Helvetica, sans-serif; + line-height: 130%; + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} + +.mceVisualAid { + border: 1px dashed #bbb; +} diff --git a/wp-admin/tinymce/themes/advanced/editor_popup.css b/wp-admin/tinymce/themes/advanced/editor_popup.css new file mode 100644 index 0000000000..353f6617aa --- /dev/null +++ b/wp-admin/tinymce/themes/advanced/editor_popup.css @@ -0,0 +1,108 @@ +body, td { + background-color: #F0F0EE; + font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana; + margin: 1em; +} + + +input { + background: #FFFFFF; + border: 1px solid #cccccc; +} + +input, select, textarea { + border: 1px solid #808080; +} + +.input_noborder { + border: 0px solid #808080; +} + +#insert { + font-weight: bold; +} + +#cancel { + font-weight: bold; +} + +#cancel:hover { + background-color: #c00; +} + +.title { + font-size: 12px; + font-weight: bold; +} + +table.charmap { + border-style: solid; + border-width: 1px; + border-color: #AAAAAA; +} + +td.charmap, td.charmapOver { + color: #000000; + border-color: #AAAAAA; + border-style: solid; + border-width: 1px; + text-align: center; + font-size: 12px; +} + +td.charmapOver { + background-color: #CCCCCC; + cursor: arrow; +} + +a.charmap { + color: #000000; + text-decoration: none +} + +.wordWrapCode { + vertical-align: middle; + border: 1px none #000000; + background-color: transparent; +} + +input.radio { + border: 1px none #000000; + background-color: transparent; + vertical-align: middle; +} + +input.checkbox { + border: 1px none #000000; + background-color: transparent; + vertical-align: middle; +} + +.mceButtonNormal, .mceButtonOver, .mceButtonDown, .mceSeparator, .mceButtonDisabled, .mceButtonSelected { + margin-left: 1px; +} + +.mceButtonNormal { + border-top: 1px solid; + border-left: 1px solid; + border-bottom: 1px solid; + border-right: 1px solid; + border-color: #F0F0EE; + cursor: arrow; +} + +.mceButtonOver { + border: 1px solid #0A246A; + cursor: arrow; + background-color: #B6BDD2; +} + +.mceButtonDown { + cursor: arrow; + border: 1px solid #0A246A; + background-color: #8592B5; +} + +legend { + font-weight: bold; +} diff --git a/wp-admin/tinymce/themes/advanced/editor_template.js b/wp-admin/tinymce/themes/advanced/editor_template.js new file mode 100644 index 0000000000..d8c5e61d64 --- /dev/null +++ b/wp-admin/tinymce/themes/advanced/editor_template.js @@ -0,0 +1,32 @@ +/* Import theme specific language pack */ + tinyMCE.importThemeLanguagePack('advanced');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','{$lang_underline_img}','{$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'],['cut','cut.gif','{$lang_cut_desc}','Cut'],['copy','copy.gif','{$lang_copy_desc}','Copy'],['paste','paste.gif','{$lang_paste_desc}','Paste'],['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'],['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',true],['backcolor','backcolor.gif','{$lang_theme_backcolor_desc}','mceBackColor',true],['charmap','charmap.gif','{$lang_theme_charmap_desc}','mceCharMap'],['visualaid','visualaid.gif','{$lang_theme_visualaid_desc}','mceToggleVisualAid'],['anchor','anchor.gif','{$lang_theme_anchor_desc}','mceInsertAnchor'],['newdocument','newdocument.gif','{$lang_newdocument_desc}','mceNewDocument']];function TinyMCE_advanced_getControlHTML(button_name){var buttonTileMap=new Array('anchor.gif','backcolor.gif','bullist.gif','center.gif','charmap.gif','cleanup.gif','code.gif','copy.gif','custom_1.gif','cut.gif','forecolor.gif','full.gif','help.gif','hr.gif','image.gif','indent.gif','left.gif','link.gif','numlist.gif','outdent.gif','paste.gif','redo.gif','removeformat.gif','right.gif','strikethrough.gif','sub.gif','sup.gif','undo.gif','unlink.gif','visualaid.gif');for(var i=0;i';}}}return '';}}switch(button_name){case "formatselect":var html='';return html;case "styleselect":return '';case "fontselect":return '';case "fontsizeselect":return '';case "|":case "separator":return '';case "spacer":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']=210;template['height']=200;tinyMCE.openWindow(template,{editor_id:editor_id,command:"forecolor",input_color:inputColor});return true;case "mceBackColor":var template=new Array();var inputColor=TinyMCE_advanced_foreColor;if(!inputColor){inputColor="#000000";}template['file']='color_picker.htm';template['width']=210;template['height']=200;tinyMCE.openWindow(template,{editor_id:editor_id,command:"HiliteColor",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",500);template['height']=tinyMCE.getParam("theme_advanced_source_editor_height",400);tinyMCE.openWindow(template,{editor_id:editor_id,resizable:"yes",scrollbars:"no"});return true;case "mceCharMap":var template=new Array();template['file']='charmap.htm';template['width']=550;template['height']=280;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case "mceInsertAnchor":var template=new Array();template['file']='anchor.htm';template['width']=320;template['height']=130;tinyMCE.openWindow(template,{editor_id:editor_id,name:TinyMCE_advanced_anchorName,action:(TinyMCE_advanced_anchorName==""?"insert":"update")});return true;case "mceNewDocument":if(confirm(tinyMCE.getLang('lang_newdocument')))tinyMCE.execInstanceCommand(editor_id,'mceSetContent',false,'');return true;}return false;}function TinyMCE_advanced_getEditorTemplate(settings,editorId){function removeFromArray(in_array,remove_array){var outArray=new Array();for(var i=0;i'+key+'';}TinyMCE_advanced_autoImportCSSClasses=false;}switch(layoutManager){case "SimpleLayout":var toolbarHTML="";var toolbarLocation=tinyMCE.getParam("theme_advanced_toolbar_location","bottom");var toolbarAlign=tinyMCE.getParam("theme_advanced_toolbar_align","center");var pathLocation=tinyMCE.getParam("theme_advanced_path_location","none");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,','));buttonNamesRow1=addToArray(tinyMCE.getParam("theme_advanced_buttons1_add_before","",true,','),buttonNamesRow1);for(var i=0;i0){toolbarHTML+="
";deltaHeight-=23;}var buttonNamesRow2=tinyMCE.getParam("theme_advanced_buttons2","bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",true,',');buttonNamesRow2=removeFromArray(buttonNamesRow2,tinyMCE.getParam("theme_advanced_disable","",true,','));buttonNamesRow2=addToArray(buttonNamesRow2,tinyMCE.getParam("theme_advanced_buttons2_add","",true,','));buttonNamesRow2=addToArray(tinyMCE.getParam("theme_advanced_buttons2_add_before","",true,','),buttonNamesRow2);for(var i=0;i0){toolbarHTML+="
";deltaHeight-=23;}var buttonNamesRow3=tinyMCE.getParam("theme_advanced_buttons3","hr,removeformat,visualaid,separator,sub,sup,separator,charmap",true,',');buttonNamesRow3=removeFromArray(buttonNamesRow3,tinyMCE.getParam("theme_advanced_disable","",true,','));buttonNamesRow3=addToArray(buttonNamesRow3,tinyMCE.getParam("theme_advanced_buttons3_add","",true,','));buttonNamesRow3=addToArray(tinyMCE.getParam("theme_advanced_buttons3_add_before","",true,','),buttonNamesRow3);for(var i=0;i0){deltaHeight-=20;}template['html']='';if(toolbarLocation=="top"){template['html']+='';}if(pathLocation=="top"){template['html']+='';deltaHeight-=23;}template['html']+='';if(toolbarLocation=="bottom"){template['html']+='';}if(toolbarLocation=="external"){var bod=document.body;var elm=document.createElement("div");toolbarHTML=tinyMCE.replaceVars(toolbarHTML,tinyMCE.settings);toolbarHTML=tinyMCE.replaceVars(toolbarHTML,tinyMCELang);toolbarHTML=tinyMCE.replaceVar(toolbarHTML,'style_select_options',styleSelectHTML);toolbarHTML=tinyMCE.replaceVar(toolbarHTML,"editor_id",editorId);toolbarHTML=tinyMCE.replaceVar(toolbarHTML,"default_document",tinyMCE.baseURL+"/blank.htm");elm.className="mceToolbarExternal";elm.id="mceExternalToolbar";elm.innerHTML='
'+toolbarHTML+'
'+pathHTML+'
'+toolbarHTML+'
'+toolbarHTML+'
';bod.appendChild(elm);bod.style.marginTop=elm.offsetHeight+"px";tinyMCE.isExternalToolbar=true;}else{tinyMCE.isExternalToolbar=false;}if(pathLocation=="bottom"){template['html']+=''+pathHTML+'';deltaHeight-=23;}template['html']+='';break;case "RowLayout":template['html']='';var containers=tinyMCE.getParam("theme_advanced_containers","",true,",");var defaultContainerCSS=tinyMCE.getParam("theme_advanced_containers_default_class","container");var defaultContainerAlign=tinyMCE.getParam("theme_advanced_containers_default_align","center");for(var i=0;i';}else if(containers[i]=="mceElementpath"){var pathClass="mcePath";if(i==containers.length-1){pathClass="mcePathBottom";}else if(i==0){pathClass="mcePathTop";}else{deltaHeight-=2;}template['html']+='';deltaHeight-=22;}else{var curContainer=tinyMCE.getParam("theme_advanced_container_"+containers[i],"",true,',');var curContainerHTML="";var curAlign=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align",defaultContainerAlign);var curCSS=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_class",defaultContainerCSS);for(var j=0;j0){curContainerHTML+="
";deltaHeight-=23;}template['html']+='
';}}template['html']+='
\ + \ +
'+pathHTML+'
'+curContainerHTML+'
';break;case "BorderLayout":break;case "CustomLayout":var customLayout=tinyMCE.getParam("theme_advanced_custom_layout","");if(customLayout!=""&&eval("typeof("+customLayout+")")!="undefined"){template=eval(customLayout+"(template);");}break;default:alert('UNDEFINED LAYOUT MANAGER! PLEASE CHECK YOUR TINYMCE CONFIG!');break;}template['html']=tinyMCE.replaceVar(template['html'],'style_select_options',styleSelectHTML);template['delta_width']=0;template['delta_height']=deltaHeight;return template;}function TinyMCE_advanced_getInsertLinkTemplate(){var template=new Array();template['file']='link.htm';template['width']=300;template['height']=150;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?src={$src}';template['width']=340;template['height']=280;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_handleNodeChange(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){function selectByValue(select_elm,value){if(select_elm){for(var i=0;i=0;i--){var nodeName=path[i].nodeName.toLowerCase();var nodeData="";if(nodeName=="b"){nodeName="strong";}if(nodeName=="i"){nodeName="em";}if(getAttrib(path[i],'id')!=""){nodeData+="id: "+path[i].getAttribute('id')+" ";}if(getAttrib(path[i],'class')!=""){nodeData+="class: "+path[i].getAttribute('class')+" ";}if(getAttrib(path[i],'className')!=""){nodeData+="class: "+path[i].getAttribute('className')+" ";}if(getAttrib(path[i],'src')!=""){nodeData+="src: "+path[i].getAttribute('src')+" ";}if(getAttrib(path[i],'href')!=""){nodeData+="href: "+path[i].getAttribute('href')+" ";}if(nodeName=="img"&&getAttrib(path[i],'name')=="mce_plugin_flash"){nodeName="flash";nodeData="";}if(getAttrib(path[i],'name').indexOf("mce_")!=0){if(getAttrib(path[i],"className")!=""){nodeName+="."+getAttrib(path[i],"className");}else if(getAttrib(path[i],"class")!=""){nodeName+="."+getAttrib(path[i],"class");}}if(tinyMCE.isMSIE){html+=''+nodeName+'';}else{html+=''+nodeName+'';}if(i>0){html+=" » ";}}pathElm.innerHTML=html+" ";}var colorElm=tinyMCE.getParentElement(node,"font","color");if(colorElm){TinyMCE_advanced_foreColor=""+colorElm.color.toUpperCase();}tinyMCE.switchClassSticky(editor_id+'_justifyleft','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_justifyright','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_justifycenter','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_justifyfull','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_underline','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_numlist','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_sub','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_sup','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_anchor','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_link','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_unlink','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_outdent','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_image','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_hr','mceButtonNormal');var anchorName=tinyMCE.getParentElement(node,"a","name");TinyMCE_advanced_anchorName="";if(anchorName){TinyMCE_advanced_anchorName=anchorName.getAttribute("name");tinyMCE.switchClassSticky(editor_id+'_anchor','mceButtonSelected');}var anchorLink=tinyMCE.getParentElement(node,"a","href");if(anchorLink||any_selection){tinyMCE.switchClassSticky(editor_id+'_link',anchorLink?'mceButtonSelected':'mceButtonNormal',false);tinyMCE.switchClassSticky(editor_id+'_unlink',anchorLink?'mceButtonSelected':'mceButtonNormal',false);}tinyMCE.switchClassSticky(editor_id+'_visualaid',visual_aid?'mceButtonSelected':'mceButtonNormal',false);if(undo_levels!=-1){tinyMCE.switchClassSticky(editor_id+'_undo','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_redo','mceButtonDisabled',true);}if(tinyMCE.getParentElement(node,"li,blockquote")){tinyMCE.switchClassSticky(editor_id+'_outdent','mceButtonNormal',false);}if(undo_index!=-1&&(undo_index0)){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&&getAttrib(elm,"size")!=""){selectByValue(selectElm,elm.getAttribute("size"));}else{selectByValue(selectElm,"0");}}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));if(tinyMCE.isGecko&&node.nodeType==3){var inst=tinyMCE.getInstanceById(editor_id);var doc=inst.getDoc();if(doc.queryCommandState("Bold")){tinyMCE.switchClassSticky(editor_id+'_bold','mceButtonSelected');}if(doc.queryCommandState("Italic")){tinyMCE.switchClassSticky(editor_id+'_italic','mceButtonSelected');}if(doc.queryCommandState("Underline")&&(node.parentNode==null||node.parentNode.nodeName!="A")){tinyMCE.switchClassSticky(editor_id+'_underline','mceButtonSelected');}if(doc.queryCommandState("Strikethrough")){tinyMCE.switchClassSticky(editor_id+'_strikethrough','mceButtonSelected');}}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;case "hr":tinyMCE.switchClassSticky(editor_id+'_hr','mceButtonSelected');break;case "img":if(getAttrib(node,'name').indexOf('mce_')!=0){tinyMCE.switchClassSticky(editor_id+'_image','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/wp-admin/tinymce/themes/advanced/editor_template_src.js b/wp-admin/tinymce/themes/advanced/editor_template_src.js new file mode 100644 index 0000000000..00ee9b7835 --- /dev/null +++ b/wp-admin/tinymce/themes/advanced/editor_template_src.js @@ -0,0 +1,998 @@ +/* Import theme specific language pack */ +tinyMCE.importThemeLanguagePack('advanced'); + +// Variable declarations +var TinyMCE_advanced_autoImportCSSClasses = true; +var TinyMCE_advanced_foreColor = "#000000"; +var TinyMCE_advanced_anchorName = ""; +var TinyMCE_advanced_buttons = [ + // Control id, button img, button title, command, user_interface, value + ['bold', '{$lang_bold_img}', '{$lang_bold_desc}', 'Bold'], + ['italic', '{$lang_italic_img}', '{$lang_italic_desc}', 'Italic'], + ['underline', '{$lang_underline_img}', '{$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'], + ['cut', 'cut.gif', '{$lang_cut_desc}', 'Cut'], + ['copy', 'copy.gif', '{$lang_copy_desc}', 'Copy'], + ['paste', 'paste.gif', '{$lang_paste_desc}', 'Paste'], + ['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'], + ['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', true], + ['backcolor', 'backcolor.gif', '{$lang_theme_backcolor_desc}', 'mceBackColor', true], + ['charmap', 'charmap.gif', '{$lang_theme_charmap_desc}', 'mceCharMap'], + ['visualaid', 'visualaid.gif', '{$lang_theme_visualaid_desc}', 'mceToggleVisualAid'], + ['anchor', 'anchor.gif', '{$lang_theme_anchor_desc}', 'mceInsertAnchor'], + ['newdocument', 'newdocument.gif', '{$lang_newdocument_desc}', 'mceNewDocument'] +]; + +/** + * Returns HTML code for the specificed control. + */ +function TinyMCE_advanced_getControlHTML(button_name) +{ + var buttonTileMap = new Array('anchor.gif','backcolor.gif','bullist.gif','center.gif', + 'charmap.gif','cleanup.gif','code.gif','copy.gif','custom_1.gif', + 'cut.gif','forecolor.gif','full.gif','help.gif','hr.gif', + 'image.gif','indent.gif','left.gif','link.gif','numlist.gif', + 'outdent.gif','paste.gif','redo.gif','removeformat.gif', + 'right.gif','strikethrough.gif','sub.gif','sup.gif','undo.gif', + 'unlink.gif','visualaid.gif'); + + // Lookup button in button list + for (var i=0; i'; + } + } + } + + // Old style + return ''; + } + } + + // Custom controlls other than buttons + switch (button_name) + { + case "formatselect": + var html = ''; + //formatselect + return html; + + case "styleselect": + //styleselect + return ''; + + case "fontselect": + //fontselect + return ''; + + case "fontsizeselect": + //fontsizeselect + return ''; + + case "|": + case "separator": + return ''; + + case "spacer": + return ''; + + case "rowseparator": + return '
'; + } + + return ""; +} + +/** + * Theme specific exec command handeling. + */ +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'] = 210; + template['height'] = 200; + + tinyMCE.openWindow(template, {editor_id : editor_id, command : "forecolor", input_color : inputColor}); + //mceForeColor + return true; + + case "mceBackColor": + var template = new Array(); + var inputColor = TinyMCE_advanced_foreColor; + + if (!inputColor) + { + inputColor = "#000000"; + } + + template['file'] = 'color_picker.htm'; + template['width'] = 210; + template['height'] = 200; + + tinyMCE.openWindow(template, {editor_id : editor_id, command : "HiliteColor", input_color : inputColor}); + //mceBackColor + return true; + + case "mceCodeEditor": + var template = new Array(); + + template['file'] = 'source_editor.htm'; + template['width'] = tinyMCE.getParam("theme_advanced_source_editor_width", 500); + template['height'] = tinyMCE.getParam("theme_advanced_source_editor_height", 400); + + tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "no"}); + //mceCodeEditor + return true; + + case "mceCharMap": + var template = new Array(); + + template['file'] = 'charmap.htm'; + template['width'] = 550; + template['height'] = 280; + + tinyMCE.openWindow(template, {editor_id : editor_id}); + //mceCharMap + return true; + + case "mceInsertAnchor": + var template = new Array(); + + template['file'] = 'anchor.htm'; + template['width'] = 320; + template['height'] = 130; + + tinyMCE.openWindow(template, {editor_id : editor_id, name : TinyMCE_advanced_anchorName, action : (TinyMCE_advanced_anchorName == "" ? "insert" : "update")}); + //mceInsertAnchor + return true; + + case "mceNewDocument": + if (confirm(tinyMCE.getLang('lang_newdocument'))) + tinyMCE.execInstanceCommand(editor_id, 'mceSetContent', false, ''); + + return true; + } + + // Default behavior + return false; +} + +/** + * Editor instance template function. + */ +function TinyMCE_advanced_getEditorTemplate(settings, editorId) +{ + function removeFromArray(in_array, remove_array) + { + var outArray = new Array(); + + for (var i=0; i' + key + ''; + } + + TinyMCE_advanced_autoImportCSSClasses = false; + } + + switch(layoutManager) + { + case "SimpleLayout" : //the default TinyMCE Layout (for backwards compatibility)... + var toolbarHTML = ""; + var toolbarLocation = tinyMCE.getParam("theme_advanced_toolbar_location", "bottom"); + var toolbarAlign = tinyMCE.getParam("theme_advanced_toolbar_align", "center"); + var pathLocation = tinyMCE.getParam("theme_advanced_path_location", "none"); + + // Render row 1 + 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, ',')); + buttonNamesRow1 = addToArray(tinyMCE.getParam("theme_advanced_buttons1_add_before", "", true, ','), buttonNamesRow1); + + for (var i=0; i 0) + { + toolbarHTML += "
"; + deltaHeight -= 23; + } + + // Render row 2 + var buttonNamesRow2 = tinyMCE.getParam("theme_advanced_buttons2", "bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code", true, ','); + buttonNamesRow2 = removeFromArray(buttonNamesRow2, tinyMCE.getParam("theme_advanced_disable", "", true, ',')); + buttonNamesRow2 = addToArray(buttonNamesRow2, tinyMCE.getParam("theme_advanced_buttons2_add", "", true, ',')); + buttonNamesRow2 = addToArray(tinyMCE.getParam("theme_advanced_buttons2_add_before", "", true, ','), buttonNamesRow2); + + for (var i=0; i 0) + { + toolbarHTML += "
"; + deltaHeight -= 23; + } + + // Render row 3 + var buttonNamesRow3 = tinyMCE.getParam("theme_advanced_buttons3", "hr,removeformat,visualaid,separator,sub,sup,separator,charmap", true, ','); + buttonNamesRow3 = removeFromArray(buttonNamesRow3, tinyMCE.getParam("theme_advanced_disable", "", true, ',')); + buttonNamesRow3 = addToArray(buttonNamesRow3, tinyMCE.getParam("theme_advanced_buttons3_add", "", true, ',')); + buttonNamesRow3 = addToArray(tinyMCE.getParam("theme_advanced_buttons3_add_before", "", true, ','), buttonNamesRow3); + + for (var i=0; i 0) + { + deltaHeight -= 20; + } + + // Setup template html + template['html'] = ''; + + if (toolbarLocation == "top") + { + template['html'] += ''; + } + + if (pathLocation == "top") + { + template['html'] += ''; + deltaHeight -= 23; + } + + template['html'] += ''; + + if (toolbarLocation == "bottom") + { + template['html'] += ''; + } + + // External toolbar changes + if (toolbarLocation == "external") + { + var bod = document.body; + var elm = document.createElement ("div"); + + toolbarHTML = tinyMCE.replaceVars(toolbarHTML, tinyMCE.settings); + toolbarHTML = tinyMCE.replaceVars(toolbarHTML, tinyMCELang); + toolbarHTML = tinyMCE.replaceVar(toolbarHTML, 'style_select_options', styleSelectHTML); + toolbarHTML = tinyMCE.replaceVar(toolbarHTML, "editor_id", editorId); + toolbarHTML = tinyMCE.replaceVar(toolbarHTML, "default_document", tinyMCE.baseURL + "/blank.htm"); + + elm.className = "mceToolbarExternal"; + elm.id = "mceExternalToolbar"; + elm.innerHTML = '
' + toolbarHTML + '
' + pathHTML + '
' + toolbarHTML + '
'+toolbarHTML+'
'; + bod.appendChild (elm); + bod.style.marginTop = elm.offsetHeight + "px"; + + tinyMCE.isExternalToolbar = true; + + //template['html'] = '
'+toolbarHTML+'
' + template["html"]; + } + else + { + tinyMCE.isExternalToolbar = false; + } + + if (pathLocation == "bottom") + { + template['html'] += '' + pathHTML + ''; + deltaHeight -= 23; + } + + template['html'] += ''; + //"SimpleLayout" + break; + + case "RowLayout" : //Container Layout - containers defined in "theme_advanced_containers" are rendered from top to bottom. + template['html'] = ''; + + var containers = tinyMCE.getParam("theme_advanced_containers", "", true, ","); + var defaultContainerCSS = tinyMCE.getParam("theme_advanced_containers_default_class", "container"); + var defaultContainerAlign = tinyMCE.getParam("theme_advanced_containers_default_align", "center"); + + //Render Containers: + for (var i = 0; i < containers.length; i++) + { + if (containers[i] == "mceEditor") //Exceptions for mceEditor and ... + { + template['html'] += ''; + } + else if (containers[i] == "mceElementpath") // ... mceElementpath: + { + var pathClass = "mcePath"; + + if (i == containers.length-1) + { + pathClass = "mcePathBottom"; + } + else if (i == 0) + { + pathClass = "mcePathTop"; + } + else + { + deltaHeight-=2; + } + + template['html'] += ''; + deltaHeight -= 22; + } + else //Render normal Container: + { + var curContainer = tinyMCE.getParam("theme_advanced_container_"+containers[i], "", true, ','); + var curContainerHTML = ""; + var curAlign = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align", defaultContainerAlign); + var curCSS = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_class", defaultContainerCSS); + + for (var j=0; j 0) + { + curContainerHTML += "
"; + deltaHeight -= 23; + } + + template['html'] += '
'; + } + } + + template['html'] += '
\ + \ +
' + pathHTML + '
' + curContainerHTML + '
'; + //RowLayout + break; + + case "BorderLayout" : //will be like java.awt.BorderLayout of SUN Java... + // Not implemented yet... + break; + + case "CustomLayout" : //User defined layout callback... + var customLayout = tinyMCE.getParam("theme_advanced_custom_layout",""); + + if (customLayout != "" && eval("typeof(" + customLayout + ")") != "undefined") + { + template = eval(customLayout + "(template);"); + } + break; + + default: + alert('UNDEFINED LAYOUT MANAGER! PLEASE CHECK YOUR TINYMCE CONFIG!'); + //CustomLayout + break; + } + + template['html'] = tinyMCE.replaceVar(template['html'], 'style_select_options', styleSelectHTML); + template['delta_width'] = 0; + template['delta_height'] = deltaHeight; + + return template; +} + +/** + * Insert link template function. + */ +function TinyMCE_advanced_getInsertLinkTemplate() +{ + var template = new Array(); + + template['file'] = 'link.htm'; + template['width'] = 300; + template['height'] = 150; + + // Language specific width and height addons + template['width'] += tinyMCE.getLang('lang_insert_link_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_insert_link_delta_height', 0); + + return template; +}; + +/** + * Insert image template function. + */ +function TinyMCE_advanced_getInsertImageTemplate() +{ + var template = new Array(); + + template['file'] = 'image.htm?src={$src}'; + template['width'] = 340; + template['height'] = 280; + + // Language specific width and height addons + template['width'] += tinyMCE.getLang('lang_insert_image_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_insert_image_delta_height', 0); + + return template; +}; + +/** + * Node change handler. + */ +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; i=0; i--) + { + var nodeName = path[i].nodeName.toLowerCase(); + var nodeData = ""; + + if (nodeName == "b") + { + nodeName = "strong"; + } + + if (nodeName == "i") + { + nodeName = "em"; + } + + if (getAttrib(path[i], 'id') != "") + { + nodeData += "id: " + path[i].getAttribute('id') + " "; + } + + if (getAttrib(path[i], 'class') != "") + { + nodeData += "class: " + path[i].getAttribute('class') + " "; + } + + if (getAttrib(path[i], 'className') != "") + { + nodeData += "class: " + path[i].getAttribute('className') + " "; + } + + if (getAttrib(path[i], 'src') != "") + { + nodeData += "src: " + path[i].getAttribute('src') + " "; + } + + if (getAttrib(path[i], 'href') != "") + { + nodeData += "href: " + path[i].getAttribute('href') + " "; + } + + if (nodeName == "img" && getAttrib(path[i], 'name') == "mce_plugin_flash") + { + nodeName = "flash"; + nodeData = ""; + } + + if (getAttrib(path[i], 'name').indexOf("mce_") != 0) + { + if (getAttrib(path[i], "className") != "") + { + nodeName += "." + getAttrib(path[i], "className"); + } + else if (getAttrib(path[i], "class") != "") + { + nodeName += "." + getAttrib(path[i], "class"); + } + } + + if (tinyMCE.isMSIE) + { + html += '' + nodeName + ''; + } + else + { + html += '' + nodeName + ''; + } + + if (i > 0) + { + html += " » "; + } + } + + pathElm.innerHTML = html + " "; + } + + // Get element color + var colorElm = tinyMCE.getParentElement(node, "font", "color"); + + if (colorElm) + { + TinyMCE_advanced_foreColor = "" + colorElm.color.toUpperCase(); + } + + // Reset old states + tinyMCE.switchClassSticky(editor_id + '_justifyleft', 'mceButtonNormal'); + tinyMCE.switchClassSticky(editor_id + '_justifyright', 'mceButtonNormal'); + tinyMCE.switchClassSticky(editor_id + '_justifycenter', 'mceButtonNormal'); + tinyMCE.switchClassSticky(editor_id + '_justifyfull', 'mceButtonNormal'); + tinyMCE.switchClassSticky(editor_id + '_bold', 'mceButtonNormal'); + tinyMCE.switchClassSticky(editor_id + '_italic', 'mceButtonNormal'); + tinyMCE.switchClassSticky(editor_id + '_underline', 'mceButtonNormal'); + tinyMCE.switchClassSticky(editor_id + '_strikethrough', 'mceButtonNormal'); + tinyMCE.switchClassSticky(editor_id + '_bullist', 'mceButtonNormal'); + tinyMCE.switchClassSticky(editor_id + '_numlist', 'mceButtonNormal'); + tinyMCE.switchClassSticky(editor_id + '_sub', 'mceButtonNormal'); + tinyMCE.switchClassSticky(editor_id + '_sup', 'mceButtonNormal'); + tinyMCE.switchClassSticky(editor_id + '_anchor', 'mceButtonNormal'); + tinyMCE.switchClassSticky(editor_id + '_link', 'mceButtonDisabled', true); + tinyMCE.switchClassSticky(editor_id + '_unlink', 'mceButtonDisabled', true); + tinyMCE.switchClassSticky(editor_id + '_outdent', 'mceButtonDisabled', true); + tinyMCE.switchClassSticky(editor_id + '_image', 'mceButtonNormal'); + tinyMCE.switchClassSticky(editor_id + '_hr', 'mceButtonNormal'); + + // Get anchor name + var anchorName = tinyMCE.getParentElement(node, "a", "name"); + + TinyMCE_advanced_anchorName = ""; + + if (anchorName) + { + TinyMCE_advanced_anchorName = anchorName.getAttribute("name"); + tinyMCE.switchClassSticky(editor_id + '_anchor', 'mceButtonSelected'); + } + + // Get link + var anchorLink = tinyMCE.getParentElement(node, "a", "href"); + + if (anchorLink || any_selection) + { + tinyMCE.switchClassSticky(editor_id + '_link', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal', false); + tinyMCE.switchClassSticky(editor_id + '_unlink', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal', false); + } + + // Handle visual aid + tinyMCE.switchClassSticky(editor_id + '_visualaid', visual_aid ? 'mceButtonSelected' : 'mceButtonNormal', false); + + if (undo_levels != -1) + { + tinyMCE.switchClassSticky(editor_id + '_undo', 'mceButtonDisabled', true); + tinyMCE.switchClassSticky(editor_id + '_redo', 'mceButtonDisabled', true); + } + + // Within li, blockquote + if (tinyMCE.getParentElement(node, "li,blockquote")) + { + tinyMCE.switchClassSticky(editor_id + '_outdent', 'mceButtonNormal', false); + } + + // Has redo levels + if (undo_index != -1 && (undo_index < undo_levels-1 && undo_levels > 0)) + { + tinyMCE.switchClassSticky(editor_id + '_redo', 'mceButtonNormal', false); + } + + // Has undo levels + if (undo_index != -1 && (undo_index > 0 && undo_levels > 0)) + { + tinyMCE.switchClassSticky(editor_id + '_undo', 'mceButtonNormal', false); + } + + // Select class in select box + 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, ""); + } + } + + // Select fontselect + 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, ""); + } + } + + // Select fontsize + var selectElm = document.getElementById(editor_id + "_fontSizeSelect"); + + if (selectElm) + { + var elm = tinyMCE.getParentElement(node, "font", "size"); + + if (elm && getAttrib(elm, "size") != "") + { + selectByValue(selectElm, elm.getAttribute("size")); + } + else + { + selectByValue(selectElm, "0"); + } + } + + // Handle align attributes + 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 special text + if (tinyMCE.isGecko && node.nodeType == 3) + { + var inst = tinyMCE.getInstanceById(editor_id); + var doc = inst.getDoc(); + + if (doc.queryCommandState("Bold")) + { + tinyMCE.switchClassSticky(editor_id + '_bold', 'mceButtonSelected'); + } + + if (doc.queryCommandState("Italic")) + { + tinyMCE.switchClassSticky(editor_id + '_italic', 'mceButtonSelected'); + } + + if (doc.queryCommandState("Underline") && + (node.parentNode == null || node.parentNode.nodeName != "A")) + { + tinyMCE.switchClassSticky(editor_id + '_underline', 'mceButtonSelected'); + } + + if (doc.queryCommandState("Strikethrough")) + { + tinyMCE.switchClassSticky(editor_id + '_strikethrough', 'mceButtonSelected'); + } + } + + // Handle elements + 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; + + case "hr": + tinyMCE.switchClassSticky(editor_id + '_hr', 'mceButtonSelected'); + break; + + case "img": + if (getAttrib(node, 'name').indexOf('mce_') != 0) + { + tinyMCE.switchClassSticky(editor_id + '_image', 'mceButtonSelected'); + } + break; + } + } while ((node = node.parentNode)); +}; + +// This function auto imports CSS classes into the class selection droplist +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; i 0) + { + selectElm.setAttribute('cssImported', 'true'); + } + } +}; diff --git a/wp-admin/tinymce/themes/advanced/editor_ui.css b/wp-admin/tinymce/themes/advanced/editor_ui.css new file mode 100644 index 0000000000..fd0bd767b3 --- /dev/null +++ b/wp-admin/tinymce/themes/advanced/editor_ui.css @@ -0,0 +1,199 @@ +.mceButtonNormal, .mceButtonOver, .mceButtonDown, .mceSeparator, .mceButtonDisabled, .mceButtonSelected { + margin-top: 1px; + margin-left: 1px; +} + +.mceButtonNormal { + border-top: 1px solid; + border-left: 1px solid; + border-bottom: 1px solid; + border-right: 1px solid; + border-color: #F0F0EE; + cursor: arrow; +} + +.mceButtonOver { +/* border-top: 1px solid buttonhighlight; + border-left: 1px solid buttonhighlight; + border-bottom: 1px solid buttonshadow; + border-right: 1px solid buttonshadow;*/ + border: 1px solid #0A246A; + cursor: arrow; + background-color: #B6BDD2; +} + +.mceButtonDown { +/* border-bottom: 1px solid buttonhighlight; + border-right: 1px solid buttonhighlight; + border-top: 1px solid buttonshadow; + border-left: 1px solid buttonshadow;*/ + cursor: arrow; + border: 1px solid #0A246A; + background-color: #8592B5; +} + +.mceButtonSelected { + border: 1px solid; + border-color: #C0C0BB; + cursor: arrow; +} + +.mceButtonDisabled { + filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); + -moz-opacity:0.3; + opacity: 0.3; + border-top: 1px solid; + border-left: 1px solid; + border-bottom: 1px solid; + border-right: 1px solid; + border-color: #F0F0EE; + cursor: arrow; +} + +.mceSeparator { + border-top: 1px solid buttonhighlight; + border-left: 1px solid buttonhighlight; + border-bottom: 1px solid buttonshadow; + border-right: 1px solid buttonshadow; + margin-right: 2px; + margin-left: 2px; +} + +.mceSeparatorLine { + margin:2px; + margin-left: 4px; + background-color: #F0F0EE; + border-top: 1px solid buttonshadow; + border-left: 1px solid buttonshadow; + border-bottom: 1px solid buttonhighlight; + border-right: 1px solid buttonhighlight; + width: 0px; + height: 15px; +} + +.mceSelectList { + font-family: "MS Sans Serif"; + font-size: 7pt; + font-weight: normal; + margin-top: 3px; + padding: 0px; + display: inline; + vertical-align: top; + background-color: #F0F0EE +} + +.mceLabel, .mceLabelDisabled { + font-family: "MS Sans Serif"; + font-size: 9pt; +} + +.mceLabel { + color: #000000; +} + +.mceLabelDisabled { + cursor: text; + color: #999999; +} + +.mceEditor { + background: #F0F0EE; + border: 1px solid #cccccc; +} + +.mceEditorArea { + font-family: "MS Sans Serif"; + background: #FFFFFF; +} + +.mceToolbarTop, .mceToolbarBottom { + background: #F0F0EE; +} + +.mceToolbarTop { + border-bottom: 1px solid #cccccc; +} + +.mceToolbarBottom { + border-top: 1px solid #cccccc; +} + +.mcePathTop, .mcePathBottom, .mcePath { + font-family: "MS Sans Serif"; + font-size: 9pt; + padding: 2px; + height: 20px; +} + +.mcePathTop { + border-bottom: 1px solid #cccccc; +} + +.mcePathBottom { + border-top: 1px solid #cccccc; +} + +.mcePathItem, .mcePathItem:link, .mcePathItem:visited, .mcePathItem:hover { + text-decoration: none; + font-family: "MS Sans Serif"; + font-size: 9pt; + color: #000000; +} + +.mcePathItem:hover { + text-decoration: underline; +} + +.mcePath { + border-bottom: 1px solid #cccccc; +} + +.mceDialog { + position: absolute; + left: 100px; + top: 100px; + z-index: 1000; +} + +.mceDialogHeader { + background: #F0F0EE; + width: 100%; + height: 16px; + margin: 0px; + padding: 0px; + border: 1px solid black; + border-bottom: 0px; +} + +.mceDialogTitle { + float: left; + font-family: "MS Sans Serif"; + font-size: 9pt; + height: 14px; +} + +.mceDialogClose { + float: right; + width: 16px; + height: 16px; + background-image: url('images/close.gif'); + background-repeat: no-repeat; + background-position: 0px 1px; + margin: 0px; + padding: 0px; +} + +.mceDialogClose a { + width: 16px; + height: 14px; + display: block; + font-family: "MS Sans Serif"; + font-size: 9pt; + margin: 0px; + padding: 0px; +} + +.mceDialogIFrameWrapper { + border: 1px solid black; + clear: both; +} diff --git a/wp-admin/tinymce/themes/advanced/image.htm b/wp-admin/tinymce/themes/advanced/image.htm new file mode 100644 index 0000000000..dc0068913e --- /dev/null +++ b/wp-admin/tinymce/themes/advanced/image.htm @@ -0,0 +1,185 @@ + + +{$lang_insert_image_title} + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{$lang_insert_image_title}
{$lang_insert_image_src}: + + + + +
{$lang_insert_image_alt}:
{$lang_insert_image_align}:
{$lang_insert_image_dimensions}: + x +
{$lang_insert_image_border}:
{$lang_insert_image_vspace}:
{$lang_insert_image_hspace}:
+ + + diff --git a/wp-admin/tinymce/themes/advanced/images/Thumbs.db b/wp-admin/tinymce/themes/advanced/images/Thumbs.db new file mode 100644 index 0000000000..06cf975f6e Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/Thumbs.db differ diff --git a/wp-admin/tinymce/themes/advanced/images/anchor.gif b/wp-admin/tinymce/themes/advanced/images/anchor.gif new file mode 100644 index 0000000000..ae7b2f3959 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/anchor.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/backcolor.gif b/wp-admin/tinymce/themes/advanced/images/backcolor.gif new file mode 100644 index 0000000000..d44277dd6c Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/backcolor.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/bold.gif b/wp-admin/tinymce/themes/advanced/images/bold.gif new file mode 100644 index 0000000000..31f004b24f Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/bold.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/bold_de_se.gif b/wp-admin/tinymce/themes/advanced/images/bold_de_se.gif new file mode 100644 index 0000000000..2d86b00314 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/bold_de_se.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/bold_fr.gif b/wp-admin/tinymce/themes/advanced/images/bold_fr.gif new file mode 100644 index 0000000000..7782282838 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/bold_fr.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/bold_ru.gif b/wp-admin/tinymce/themes/advanced/images/bold_ru.gif new file mode 100644 index 0000000000..c9e89b27e5 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/bold_ru.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/browse.gif b/wp-admin/tinymce/themes/advanced/images/browse.gif new file mode 100644 index 0000000000..590f2de43f Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/browse.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/bullist.gif b/wp-admin/tinymce/themes/advanced/images/bullist.gif new file mode 100644 index 0000000000..12d0ec2299 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/bullist.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/buttons.gif b/wp-admin/tinymce/themes/advanced/images/buttons.gif new file mode 100644 index 0000000000..b5e454c17e Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/buttons.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/center.gif b/wp-admin/tinymce/themes/advanced/images/center.gif new file mode 100644 index 0000000000..a9e13e004c Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/center.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/charmap.gif b/wp-admin/tinymce/themes/advanced/images/charmap.gif new file mode 100644 index 0000000000..b826f88823 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/charmap.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/cleanup.gif b/wp-admin/tinymce/themes/advanced/images/cleanup.gif new file mode 100644 index 0000000000..87b8f87a2f Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/cleanup.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/close.gif b/wp-admin/tinymce/themes/advanced/images/close.gif new file mode 100644 index 0000000000..78883bd7f8 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/close.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/code.gif b/wp-admin/tinymce/themes/advanced/images/code.gif new file mode 100644 index 0000000000..e16da11e91 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/code.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/copy.gif b/wp-admin/tinymce/themes/advanced/images/copy.gif new file mode 100644 index 0000000000..f0b51871e2 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/copy.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/custom_1.gif b/wp-admin/tinymce/themes/advanced/images/custom_1.gif new file mode 100644 index 0000000000..5e385c0549 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/custom_1.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/cut.gif b/wp-admin/tinymce/themes/advanced/images/cut.gif new file mode 100644 index 0000000000..6a969e55bd Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/cut.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/forecolor.gif b/wp-admin/tinymce/themes/advanced/images/forecolor.gif new file mode 100644 index 0000000000..db21e1cbee Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/forecolor.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/full.gif b/wp-admin/tinymce/themes/advanced/images/full.gif new file mode 100644 index 0000000000..5a78c63067 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/full.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/help.gif b/wp-admin/tinymce/themes/advanced/images/help.gif new file mode 100644 index 0000000000..a5d67714bc Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/help.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/hr.gif b/wp-admin/tinymce/themes/advanced/images/hr.gif new file mode 100644 index 0000000000..8e6b34dc68 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/hr.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/image.gif b/wp-admin/tinymce/themes/advanced/images/image.gif new file mode 100644 index 0000000000..36109de73c Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/image.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/indent.gif b/wp-admin/tinymce/themes/advanced/images/indent.gif new file mode 100644 index 0000000000..7a17288c55 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/indent.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/italic.gif b/wp-admin/tinymce/themes/advanced/images/italic.gif new file mode 100644 index 0000000000..ec03278f34 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/italic.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/italic_de_se.gif b/wp-admin/tinymce/themes/advanced/images/italic_de_se.gif new file mode 100644 index 0000000000..6ce0d8d466 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/italic_de_se.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/italic_ru.gif b/wp-admin/tinymce/themes/advanced/images/italic_ru.gif new file mode 100644 index 0000000000..5c2f7fec27 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/italic_ru.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/left.gif b/wp-admin/tinymce/themes/advanced/images/left.gif new file mode 100644 index 0000000000..4225e00775 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/left.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/link.gif b/wp-admin/tinymce/themes/advanced/images/link.gif new file mode 100644 index 0000000000..0de427490e Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/link.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/newdocument.gif b/wp-admin/tinymce/themes/advanced/images/newdocument.gif new file mode 100644 index 0000000000..79a93da5cc Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/newdocument.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/numlist.gif b/wp-admin/tinymce/themes/advanced/images/numlist.gif new file mode 100644 index 0000000000..7ff907be75 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/numlist.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/outdent.gif b/wp-admin/tinymce/themes/advanced/images/outdent.gif new file mode 100644 index 0000000000..53e89a77f4 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/outdent.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/paste.gif b/wp-admin/tinymce/themes/advanced/images/paste.gif new file mode 100644 index 0000000000..a676604cf6 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/paste.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/redo.gif b/wp-admin/tinymce/themes/advanced/images/redo.gif new file mode 100644 index 0000000000..26a146bdaf Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/redo.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/removeformat.gif b/wp-admin/tinymce/themes/advanced/images/removeformat.gif new file mode 100644 index 0000000000..38a9cdf96c Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/removeformat.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/right.gif b/wp-admin/tinymce/themes/advanced/images/right.gif new file mode 100644 index 0000000000..88bfaf2542 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/right.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/spacer.gif b/wp-admin/tinymce/themes/advanced/images/spacer.gif new file mode 100644 index 0000000000..fc2560981e Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/spacer.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/strikethrough.gif b/wp-admin/tinymce/themes/advanced/images/strikethrough.gif new file mode 100644 index 0000000000..ce7b65304e Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/strikethrough.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/sub.gif b/wp-admin/tinymce/themes/advanced/images/sub.gif new file mode 100644 index 0000000000..481840702b Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/sub.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/sup.gif b/wp-admin/tinymce/themes/advanced/images/sup.gif new file mode 100644 index 0000000000..03f8efc63d Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/sup.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/table.gif b/wp-admin/tinymce/themes/advanced/images/table.gif new file mode 100644 index 0000000000..f8a00544a9 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/table.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/table_delete_col.gif b/wp-admin/tinymce/themes/advanced/images/table_delete_col.gif new file mode 100644 index 0000000000..0b2f0fb612 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/table_delete_col.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/table_delete_row.gif b/wp-admin/tinymce/themes/advanced/images/table_delete_row.gif new file mode 100644 index 0000000000..1997065fb2 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/table_delete_row.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/table_insert_col_after.gif b/wp-admin/tinymce/themes/advanced/images/table_insert_col_after.gif new file mode 100644 index 0000000000..c30dafab6f Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/table_insert_col_after.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/table_insert_col_before.gif b/wp-admin/tinymce/themes/advanced/images/table_insert_col_before.gif new file mode 100644 index 0000000000..5d1ff37afe Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/table_insert_col_before.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/table_insert_row_after.gif b/wp-admin/tinymce/themes/advanced/images/table_insert_row_after.gif new file mode 100644 index 0000000000..c3aa15f93a Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/table_insert_row_after.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/table_insert_row_before.gif b/wp-admin/tinymce/themes/advanced/images/table_insert_row_before.gif new file mode 100644 index 0000000000..c3271e5493 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/table_insert_row_before.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/underline.gif b/wp-admin/tinymce/themes/advanced/images/underline.gif new file mode 100644 index 0000000000..d6b8afdabd Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/underline.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/underline_fr.gif b/wp-admin/tinymce/themes/advanced/images/underline_fr.gif new file mode 100644 index 0000000000..a8e3018a18 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/underline_fr.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/underline_ru.gif b/wp-admin/tinymce/themes/advanced/images/underline_ru.gif new file mode 100644 index 0000000000..2a517e8b6b Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/underline_ru.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/undo.gif b/wp-admin/tinymce/themes/advanced/images/undo.gif new file mode 100644 index 0000000000..b0722d06c6 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/undo.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/unlink.gif b/wp-admin/tinymce/themes/advanced/images/unlink.gif new file mode 100644 index 0000000000..dd073a2b44 Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/unlink.gif differ diff --git a/wp-admin/tinymce/themes/advanced/images/visualaid.gif b/wp-admin/tinymce/themes/advanced/images/visualaid.gif new file mode 100644 index 0000000000..188b3487ad Binary files /dev/null and b/wp-admin/tinymce/themes/advanced/images/visualaid.gif differ diff --git a/wp-admin/tinymce/themes/advanced/langs/en.js b/wp-admin/tinymce/themes/advanced/langs/en.js new file mode 100644 index 0000000000..33067479e8 --- /dev/null +++ b/wp-admin/tinymce/themes/advanced/langs/en.js @@ -0,0 +1,62 @@ +// UK lang variables + +tinyMCELang['lang_theme_style_select'] = '-- Styles --'; +tinyMCELang['lang_theme_code_desc'] = 'Edit HTML Source'; +tinyMCELang['lang_theme_code_title'] = 'HTML Source Editor'; +tinyMCELang['lang_theme_code_wordwrap'] = 'Word wrap'; +tinyMCELang['lang_theme_sub_desc'] = 'Subscript'; +tinyMCELang['lang_theme_sup_desc'] = 'Superscript'; +tinyMCELang['lang_theme_hr_desc'] = 'Insert horizontal ruler'; +tinyMCELang['lang_theme_removeformat_desc'] = 'Remove formatting'; +tinyMCELang['lang_theme_custom1_desc'] = 'Your custom description here'; +tinyMCELang['lang_insert_image_border'] = 'Border'; +tinyMCELang['lang_insert_image_dimensions'] = 'Dimensions'; +tinyMCELang['lang_insert_image_vspace'] = 'VSpace'; +tinyMCELang['lang_insert_image_hspace'] = 'HSpace'; +tinyMCELang['lang_insert_image_align'] = 'Alignment'; +tinyMCELang['lang_insert_image_align_default'] = 'Default'; +tinyMCELang['lang_insert_image_align_baseline'] = 'Baseline'; +tinyMCELang['lang_insert_image_align_top'] = 'Top'; +tinyMCELang['lang_insert_image_align_middle'] = 'Middle'; +tinyMCELang['lang_insert_image_align_bottom'] = 'Bottom'; +tinyMCELang['lang_insert_image_align_texttop'] = 'TextTop'; +tinyMCELang['lang_insert_image_align_absmiddle'] = 'Absolute Middle'; +tinyMCELang['lang_insert_image_align_absbottom'] = 'Absolute Bottom'; +tinyMCELang['lang_insert_image_align_left'] = 'Left'; +tinyMCELang['lang_insert_image_align_right'] = 'Right'; +tinyMCELang['lang_theme_font_size'] = 'Font size'; +tinyMCELang['lang_theme_fontdefault'] = '-- Font family --'; +tinyMCELang['lang_theme_block'] = '-- Format --'; +tinyMCELang['lang_theme_paragraph'] = 'Paragraph'; +tinyMCELang['lang_theme_div'] = 'Div'; +tinyMCELang['lang_theme_address'] = 'Address'; +tinyMCELang['lang_theme_pre'] = 'Preformatted'; +tinyMCELang['lang_theme_h1'] = 'Heading 1'; +tinyMCELang['lang_theme_h2'] = 'Heading 2'; +tinyMCELang['lang_theme_h3'] = 'Heading 3'; +tinyMCELang['lang_theme_h4'] = 'Heading 4'; +tinyMCELang['lang_theme_h5'] = 'Heading 5'; +tinyMCELang['lang_theme_h6'] = 'Heading 6'; +tinyMCELang['lang_theme_colorpicker_title'] = 'Select a color'; +tinyMCELang['lang_theme_colorpicker_apply'] = 'Apply'; +tinyMCELang['lang_theme_forecolor_desc'] = 'Select text color'; +tinyMCELang['lang_theme_backcolor_desc'] = 'Select background color'; +tinyMCELang['lang_theme_charmap_title'] = 'Select custom character'; +tinyMCELang['lang_theme_charmap_desc'] = 'Insert custom character'; +tinyMCELang['lang_theme_visualaid_desc'] = 'Toggle guidelines/invisible elements'; +tinyMCELang['lang_insert_anchor_title'] = 'Insert/edit anchor'; +tinyMCELang['lang_insert_anchor_name'] = 'Anchor name'; +tinyMCELang['lang_theme_anchor_desc'] = 'Insert/edit anchor'; +tinyMCELang['lang_theme_insert_link_titlefield'] = 'Title'; +tinyMCELang['lang_theme_clipboard_msg'] = 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?'; +tinyMCELang['lang_theme_path'] = 'Path'; +tinyMCELang['lang_cut_desc'] = 'Cut'; +tinyMCELang['lang_copy_desc'] = 'Copy'; +tinyMCELang['lang_paste_desc'] = 'Paste'; +tinyMCELang['lang_link_list'] = 'Link list'; +tinyMCELang['lang_image_list'] = 'Image list'; +tinyMCELang['lang_browse'] = 'Browse'; +tinyMCELang['lang_image_props_desc'] = 'Image properties'; +tinyMCELang['lang_newdocument_desc'] = 'New document'; +tinyMCELang['lang_class'] = 'Class'; +tinyMCELang['lang_newdocument'] = 'Are you sure you want clear all contents?'; diff --git a/wp-admin/tinymce/themes/advanced/link.htm b/wp-admin/tinymce/themes/advanced/link.htm new file mode 100644 index 0000000000..fc8311ce88 --- /dev/null +++ b/wp-admin/tinymce/themes/advanced/link.htm @@ -0,0 +1,187 @@ + + +{$lang_insert_link_title} + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{$lang_insert_link_title}
{$lang_insert_link_url}: + + + + +
{$lang_insert_link_target}:
{$lang_theme_insert_link_titlefield}:
+
+ + diff --git a/wp-admin/tinymce/themes/advanced/source_editor.htm b/wp-admin/tinymce/themes/advanced/source_editor.htm new file mode 100644 index 0000000000..235470bcc9 --- /dev/null +++ b/wp-admin/tinymce/themes/advanced/source_editor.htm @@ -0,0 +1,86 @@ + + +{$lang_theme_code_title} + + + + + +
+ + + + + + + + + + + +
{$lang_theme_code_title}
+ +
+
+ + diff --git a/wp-admin/tinymce/tiny_mce.js b/wp-admin/tinymce/tiny_mce.js new file mode 100644 index 0000000000..748a4c190f --- /dev/null +++ b/wp-admin/tinymce/tiny_mce.js @@ -0,0 +1,12 @@ +/** + * $RCSfile: tiny_mce.js,v $ + * $Revision: 1.256 $ + * $Date: 2005/06/23 12:04:39 $ + * + * @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.loadedFiles=new Array();this.configs=new Array();this.currentConfig=0;this.eventHandlers=new Array();this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.isMSIE5=this.isMSIE&&(navigator.userAgent.indexOf('MSIE 5')!=-1);this.isMSIE5_0=this.isMSIE&&(navigator.userAgent.indexOf('MSIE 5.0')!=-1);this.isGecko=navigator.userAgent.indexOf('Gecko')!=-1;this.isSafari=navigator.userAgent.indexOf('Safari')!=-1;this.isMac=navigator.userAgent.indexOf('Mac')!=-1;this.dialogCounter=0;this.idCounter=0;};TinyMCE.prototype.defParam=function(key,def_val){this.settings[key]=tinyMCE.getParam(key,def_val);};TinyMCE.prototype.init=function(settings){var theme;this.settings=settings;if(typeof(document.execCommand)=='undefined')return;if(!tinyMCE.baseURL){var elements=document.getElementsByTagName('script');for(var i=0;i');this.loadedFiles[this.loadedFiles.length]=url;};TinyMCE.prototype.loadCSS=function(url){for(var i=0;i');this.loadedFiles[this.loadedFiles.length]=url;};TinyMCE.prototype.importCSS=function(doc,css_file){if(tinyMCE.isMSIE)var styleSheet=doc.createStyleSheet(css_file);else{var elm=doc.createElement("link");elm.rel="stylesheet";elm.href=css_file;if(headArr=doc.getElementsByTagName("head"))headArr[0].appendChild(elm);}};TinyMCE.prototype.confirmAdd=function(e,settings){var elm=tinyMCE.isMSIE?event.srcElement:e.target;var elementId=elm.name?elm.name:elm.id;tinyMCE.settings=settings;if(!elm.getAttribute('mce_noask')&&confirm(tinyMCELang['lang_edit_confirm']))tinyMCE.addMCEControl(elm,elementId);elm.setAttribute('mce_noask','true');};TinyMCE.prototype.updateContent=function(form_element_name){var formElement=document.getElementById(form_element_name);for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];inst.switchSettings();if(inst.formElement==formElement){var doc=inst.getDoc();tinyMCE._setHTML(doc,inst.formElement.value);if(!tinyMCE.isMSIE)doc.body.innerHTML=tinyMCE._cleanupHTML(doc,this.settings,doc.body,inst.visualAid);}}};TinyMCE.prototype.addMCEControl=function(replace_element,form_element_name,target_document){var id="mce_editor_"+tinyMCE.idCounter++;var inst=new TinyMCEControl(tinyMCE.settings);inst.editorId=id;this.instances[id]=inst;inst.onAdd(replace_element,form_element_name,target_document);};TinyMCE.prototype.triggerSave=function(skip_cleanup,skip_callback){for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];inst.switchSettings();tinyMCE.settings['preformatted']=false;if(typeof(skip_cleanup)=="undefined")skip_cleanup=false;if(typeof(skip_callback)=="undefined")skip_callback=false;tinyMCE._setHTML(inst.getDoc(),inst.getBody().innerHTML);var htm=skip_cleanup?inst.getBody().innerHTML:tinyMCE._cleanupHTML(inst.getDoc(),this.settings,inst.getBody(),this.visualAid,true);if(tinyMCE.settings["encoding"]=="xml"||tinyMCE.settings["encoding"]=="html")htm=tinyMCE.convertStringToXML(htm);if(!skip_callback&&tinyMCE.settings['save_callback']!="")var content=eval(tinyMCE.settings['save_callback']+"(inst.formTargetElementId,htm,inst.getBody());");if((typeof(content)!="undefined")&&content!=null)htm=content;htm=tinyMCE.regexpReplace(htm,"(","(","gi");htm=tinyMCE.regexpReplace(htm,")",")","gi");htm=tinyMCE.regexpReplace(htm,";",";","gi");htm=tinyMCE.regexpReplace(htm,""",""","gi");htm=tinyMCE.regexpReplace(htm,"^","^","gi");if(inst.formElement)inst.formElement.value=htm;}};TinyMCE.prototype._convertOnClick=function(node){if(tinyMCE.isMSIE5)return;var elms=node.getElementsByTagName("a");for(var i=0;i","gi");content=tinyMCE.regexpReplace(content,"\r","
","gi");content=tinyMCE.regexpReplace(content,"\n","
","gi");}content=tinyMCE._customCleanup("insert_to_editor",content);if(tinyMCE.isMSIE){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 body=document.frames[editor_id].document.body;tinyMCE.addEvent(body,"beforepaste",TinyMCE.prototype.eventPatch);tinyMCE.addEvent(body,"beforecut",TinyMCE.prototype.eventPatch);tinyMCE.addEvent(body,"paste",TinyMCE.prototype.eventPatch);body.editorId=editor_id;}if(!tinyMCE.isMSIE){var contentElement=inst.getDoc().createElement("body");var doc=inst.getDoc();contentElement.innerHTML=content;if(tinyMCE.settings['force_p_newlines'])content=content.replace(new RegExp('<>','g'),"");if(tinyMCE.settings['cleanup_on_startup'])inst.getBody().innerHTML=tinyMCE._cleanupHTML(doc,this.settings,contentElement);else{content=tinyMCE.regexpReplace(content,"","","gi");content=tinyMCE.regexpReplace(content,"","","gi");inst.getBody().innerHTML=content;}inst.convertAllRelativeURLs();}else{if(tinyMCE.settings['cleanup_on_startup']){tinyMCE._setHTML(inst.getDoc(),content);eval('try {inst.getBody().innerHTML = tinyMCE._cleanupHTML(inst.contentDocument, this.settings, inst.getBody());} catch(e) {}');}else tinyMCE._setHTML(inst.getDoc(),content);}tinyMCE._convertOnClick(inst.getBody());var parentElm=document.getElementById(inst.editorId+'_parent');if(parentElm.lastChild.nodeName.toLowerCase()=="input")inst.formElement=parentElm.lastChild;else inst.formElement=parentElm.nextSibling;tinyMCE.handleVisualAid(inst.getBody(),true,tinyMCE.settings['visual']);tinyMCE.executeCallback('setupcontent_callback','_setupContent',0,editor_id,inst.getBody(),inst.getDoc());if(!tinyMCE.isMSIE)TinyMCE.prototype.addEventHandlers(editor_id);inst.startContent=inst.getBody().innerHTML;tinyMCE.selectedInstance=inst;tinyMCE.selectedElement=inst.contentWindow.document.body;tinyMCE.triggerNodeChange(false,true);tinyMCE._customCleanup("insert_to_editor_dom",inst.contentWindow.document.body);};TinyMCE.prototype.cancelEvent=function(e){if(tinyMCE.isMSIE){e.returnValue=false;e.cancelBubble=true;}else e.preventDefault();};TinyMCE.prototype.removeTinyMCEFormElements=function(form_obj){for(var i=0;i");rng.collapse(false);rng.select();tinyMCE.triggerNodeChange(false);return false;}}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;if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.switchSettings();if(tinyMCE.isGecko&&tinyMCE.settings['force_p_newlines']&&(e.keyCode==8||e.keyCode==46)&&!e.shiftKey){if(tinyMCE.selectedInstance._handleBackSpace(e.type)){e.preventDefault();return false;}}tinyMCE.selectedElement=null;tinyMCE.selectedNode=null;var elm=tinyMCE.selectedInstance.getFocusElement();tinyMCE.linkElement=tinyMCE.getParentElement(elm,"a");tinyMCE.imgElement=tinyMCE.getParentElement(elm,"img");tinyMCE.selectedElement=elm;if(tinyMCE.isGecko&&e.type=="keyup"&&e.keyCode==9)tinyMCE.handleVisualAid(tinyMCE.selectedInstance.getBody(),true,tinyMCE.settings['visual']);if(tinyMCE.isGecko&&tinyMCE.settings['document_base_url']!=""+document.location.href&&e.type=="keyup"&&e.ctrlKey&&e.keyCode==86)tinyMCE.selectedInstance.fixBrokenURLs();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 keys=new Array(8,46);for(var i=0;i0){for(var i=0;i"+this.convertStringToXML(String.fromCharCode(160))+"";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{if(openTag)output+="<"+elementName+elementAttribs+">";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+"]";}};TinyMCE.prototype.convertStringToXML=function(html_data){var output="";for(var i=0;i127)output+='&#'+chr+";";else output+=String.fromCharCode(chr);continue;}if(tinyMCE.settings['entity_encoding']=="raw"){output+=String.fromCharCode(chr);continue;}if(typeof(tinyMCE.cleanup_entities["c"+chr])!='undefined'&&tinyMCE.cleanup_entities["c"+chr]!='')output+='&'+tinyMCE.cleanup_entities["c"+chr]+';';else output+=''+String.fromCharCode(chr);}return output;};TinyMCE.prototype._getCleanupElementName=function(chunk){var pos;if(chunk.charAt(0)=='+')chunk=chunk.substring(1);if((pos=chunk.indexOf('/'))!=-1)chunk=chunk.substring(0,pos);if((pos=chunk.indexOf('['))!=-1)chunk=chunk.substring(0,pos);return chunk;};TinyMCE.prototype._initCleanup=function(){var validElements=tinyMCE.settings["valid_elements"];validElements=validElements.split(',');var extendedValidElements=tinyMCE.settings["extended_valid_elements"];extendedValidElements=extendedValidElements.split(',');for(var i=0;i[ \n\r]*
[ \n\r]*

','
','gi');element.innerHTML=tinyMCE.regexpReplace(element.innerHTML,'','','gi');}var html=this.cleanupNode(element);if(tinyMCE.settings['debug'])alert("Cleanup process executed in: "+(new Date().getTime()-startTime)+" ms.");html=tinyMCE.regexpReplace(html,'


','
');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(tinyMCE.settings['force_p_newlines']){var re=new RegExp('<>','g');html=html.replace(re,"");}if(tinyMCE.settings['remove_linebreaks'])html=html.replace(new RegExp('\r|\n','g'),' ');html=tinyMCE._customCleanup(on_save?"get_from_editor":"insert_to_editor",html);var chk=tinyMCE.regexpReplace(html,"[ \t\r\n]","").toLowerCase();if(chk=="
"||chk=="
"||chk=="

 

"||chk=="

 

"||chk=="

")html="";if(tinyMCE.settings["preformatted"])return "
"+html+"
";return html;};TinyMCE.prototype.setAttrib=function(element,name,value,no_fix_value){if(!no_fix_value&&value!=null){var re=new RegExp('[^0-9%]','g');value=value.replace(re,'');}if(value!=null&&value!="")element.setAttribute(name,value);else element.removeAttribute(name);if(value!=null&&value!="")element.setAttribute(name,value);else element.removeAttribute(name);};TinyMCE.prototype.insertLink=function(href,target,title,onclick,style_class){this.execCommand("mceAddUndoLevel");if(this.selectedInstance&&this.selectedElement&&this.selectedElement.nodeName.toLowerCase()=="img"){var doc=this.selectedInstance.getDoc();var linkElement=tinyMCE.getParentElement(this.selectedElement,"a");var newLink=false;if(!linkElement){linkElement=doc.createElement("a");newLink=true;}href=eval(tinyMCE.settings['urlconverter_callback']+"(href, linkElement);");tinyMCE.setAttrib(linkElement,'href',href);tinyMCE.setAttrib(linkElement,'target',target);tinyMCE.setAttrib(linkElement,'title',title);tinyMCE.setAttrib(linkElement,'mce_onclick',onclick);tinyMCE.setAttrib(linkElement,'class',style_class);if(newLink){linkElement.appendChild(this.selectedElement.cloneNode(true));this.selectedElement.parentNode.replaceChild(linkElement,this.selectedElement);}return;}if(!this.linkElement&&this.selectedInstance){if(tinyMCE.isSafari){tinyMCE.execCommand("mceInsertContent",false,''+this.selectedInstance.getSelectedHTML()+'');}else 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';tinyMCE.execCommand("mceInsertContent",false,html);}else{if(!this.imgElement&&this.selectedInstance){if(tinyMCE.isSafari)tinyMCE.execCommand("mceInsertContent",false,'');else this.selectedInstance.contentDocument.execCommand("insertimage",false,"#mce_temp_url#");tinyMCE.imgElement=this.getElementByAttributeValue(this.selectedInstance.contentDocument.body,"img","src","#mce_temp_url#");}}if(this.imgElement){var needsRepaint=false;src=eval(tinyMCE.settings['urlconverter_callback']+"(src, tinyMCE.imgElement);");if(onmouseover&&onmouseover!="")onmouseover="this.src='"+eval(tinyMCE.settings['urlconverter_callback']+"(onmouseover, tinyMCE.imgElement);")+"';";if(onmouseout&&onmouseout!="")onmouseout="this.src='"+eval(tinyMCE.settings['urlconverter_callback']+"(onmouseout, tinyMCE.imgElement);")+"';";if(typeof(title)=="undefined")title=alt;if(width!=this.imgElement.getAttribute("width")||height!=this.imgElement.getAttribute("height")||align!=this.imgElement.getAttribute("align"))needsRepaint=true;tinyMCE.setAttrib(this.imgElement,'src',src);tinyMCE.setAttrib(this.imgElement,'mce_real_src',src);tinyMCE.setAttrib(this.imgElement,'alt',alt);tinyMCE.setAttrib(this.imgElement,'title',title);tinyMCE.setAttrib(this.imgElement,'align',align);tinyMCE.setAttrib(this.imgElement,'border',border,true);tinyMCE.setAttrib(this.imgElement,'hspace',hspace,true);tinyMCE.setAttrib(this.imgElement,'vspace',vspace,true);tinyMCE.setAttrib(this.imgElement,'width',width,true);tinyMCE.setAttrib(this.imgElement,'height',height,true);tinyMCE.setAttrib(this.imgElement,'onmouseover',onmouseover);tinyMCE.setAttrib(this.imgElement,'onmouseout',onmouseout);if(width&&width!="")this.imgElement.style.pixelWidth=width;if(height&&height!="")this.imgElement.style.pixelHeight=height;if(needsRepaint)tinyMCE.selectedInstance.repaint();}};TinyMCE.prototype.getElementByAttributeValue=function(node,element_name,attrib,value){var elements=this.getElementsByAttributeValue(node,element_name,attrib,value);if(elements.length==0)return null;return elements[0];};TinyMCE.prototype.getElementsByAttributeValue=function(node,element_name,attrib,value){var elements=new Array();if(node&&node.nodeName.toLowerCase()==element_name){if(node.getAttribute(attrib)&&node.getAttribute(attrib).indexOf(value)!=-1)elements[elements.length]=node;}if(node.hasChildNodes){for(var x=0,n=node.childNodes.length;x=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;i=0;i--){if(baseURLParts[i].length==0)continue;newBaseURLParts[newBaseURLParts.length]=baseURLParts[i];}baseURLParts=newBaseURLParts.reverse();var newRelURLParts=new Array();var numBack=0;for(var i=relURLParts.length-1;i>=0;i--){if(relURLParts[i].length==0||relURLParts[i]==".")continue;if(relURLParts[i]=='..'){numBack++;continue;}if(numBack>0){numBack--;continue;}newRelURLParts[newRelURLParts.length]=relURLParts[i];}relURLParts=newRelURLParts.reverse();var len=baseURLParts.length-numBack;var absPath=(len<=0?"":"/")+baseURLParts.slice(0,len).join('/')+"/"+relURLParts.join('/');var start="",end="";if(baseURL['protocol'])start+=baseURL['protocol']+"://";if(baseURL['host'])start+=baseURL['host'];if(baseURL['port'])start+=":"+baseURL['port'];if(relURL['query'])end+="?"+relURL['query'];if(relURL['anchor'])end+="#"+relURL['anchor'];if(relative_url.charAt(relative_url.length-1)=="/")end+="/";return start+absPath+end;};TinyMCE.prototype.getParam=function(name,default_value,strip_whitespace,split_chr){var value=(typeof(this.settings[name])=="undefined")?default_value:this.settings[name];if(value=="true"||value=="false")return(value=="true");if(strip_whitespace)value=tinyMCE.regexpReplace(value,"[ \t\r\n]","");if(typeof(split_chr)!="undefined"&&split_chr!=null){value=value.split(split_chr);var outArray=new Array();for(var i=0;i0);if(tinyMCE.settings['custom_undo_redo']){undoIndex=inst.undoIndex;undoLevels=inst.undoLevels.length;}tinyMCE.executeCallback('handleNodeChangeCallback','_handleNodeChange',0,editorId,elm,undoIndex,undoLevels,inst.visualAid,anySelection);}}if(this.selectedInstance&&(typeof(focus)=="undefined"||focus))this.selectedInstance.contentWindow.focus();};TinyMCE.prototype._customCleanup=function(type,content){var customCleanup=tinyMCE.settings['cleanup_callback'];if(customCleanup!=""&&eval("typeof("+customCleanup+")")!="undefined")content=eval(customCleanup+"(type, content);");var plugins=tinyMCE.getParam('plugins','',true,',');for(var i=0;i';div.innerHTML=html;document.body.appendChild(div);tinyMCE._currentDialog=id;}}}};TinyMCE.prototype.closeDialog=function(){if(tinyMCE.settings["dialog_type"]=="div"){var div=document.getElementById(tinyMCE._currentDialog);if(div)div.parentNode.removeChild(div);}else window.close();};TinyMCE.prototype.getVisualAidClass=function(class_name,state){var aidClass=tinyMCE.settings['visual_table_class'];if(typeof(state)=="undefined")state=tinyMCE.settings['visual'];var classNames=new Array();var ar=class_name.split(' ');for(var i=0;i0)className+=" ";className+=classNames[i];}return className;};TinyMCE.prototype.handleVisualAid=function(element,deep,state){if(!element)return;var tableElement=null;switch(element.nodeName.toLowerCase()){case "table":var oldW=element.style.width;var oldH=element.style.height;element.className=tinyMCE.getVisualAidClass(element.className,state&&element.getAttribute("border")==0);element.style.width=oldW;element.style.height=oldH;for(var y=0;y

','g');html_content=html_content.replace(re,"
");}try{doc.body.innerHTML=html_content;}catch(e){if(this.isMSIE)doc.body.createTextRange().pasteHTML(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;}};TinyMCE.prototype.getImageSrc=function(str){var pos=-1;if(!str)return "";if((pos=str.indexOf('this.src='))!=-1){var src=str.substring(pos+10);src=src.substring(0,src.indexOf('\''));return src;}return "";};TinyMCE.prototype._getElementById=function(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 new Array();for(var i=0;i0)tinyMCE.cssClasses=output;return output;};TinyMCE.prototype.regexpReplace=function(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);};TinyMCE.prototype.cleanupEventStr=function(str){str=""+str;str=str.replace('function anonymous()\n{\n','');str=str.replace('\n}','');return str;};TinyMCE.prototype.getAbsPosition=function(node){var pos=new Object();pos.absLeft=pos.absTop=0;var parentNode=node;while(parentNode){pos.absLeft+=parentNode.offsetLeft;pos.absTop+=parentNode.offsetTop;parentNode=parentNode.offsetParent;}return pos;};TinyMCE.prototype.openFileBrowser=function(field_name,url,type,win){var cb=tinyMCE.getParam("file_browser_callback");this.setWindowArg("window",win);if(eval('typeof('+cb+')')=="undefined")alert("Callback function: "+cb+" could not be found.");else eval(cb+"(field_name, url, type, win);");};TinyMCE.prototype.getControlHTML=function(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+"');");};TinyMCE.prototype._themeExecCommand=function(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;};TinyMCE.prototype._getThemeFunction=function(suffix,skip_plugins){if(skip_plugins)return 'TinyMCE_'+tinyMCE.settings['theme']+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;};TinyMCE.prototype.isFunc=function(func_name){if(func_name==null||func_name=="")return false;return eval("typeof("+func_name+")")!="undefined";};TinyMCE.prototype.exec=function(func_name,args){var str=func_name+'(';for(var i=3;i1&&tinyMCE.currentConfig!=this.settings['index']){tinyMCE.settings=this.settings;tinyMCE.currentConfig=this.settings['index'];}};TinyMCEControl.prototype.fixBrokenURLs=function(){var body=this.getBody();var elms=body.getElementsByTagName("img");for(var i=0;i0)rng.selectNodeContents(nodes[0]);else rng.selectNodeContents(node);}else rng.selectNode(node);if(collapse){if(!to_start&&node.nodeType==3){rng.setStart(node,node.nodeValue.length);rng.setEnd(node,node.nodeValue.length);}else rng.collapse(to_start);}sel.removeAllRanges();sel.addRange(rng);}this.scrollToNode(node);tinyMCE.selectedElement=null;if(node.nodeType==1)tinyMCE.selectedElement=node;};TinyMCEControl.prototype.scrollToNode=function(node){var pos=tinyMCE.getAbsPosition(node);var doc=this.getDoc();var scrollX=doc.body.scrollLeft+doc.documentElement.scrollLeft;var scrollY=doc.body.scrollTop+doc.documentElement.scrollTop;var height=tinyMCE.isMSIE?document.getElementById(this.editorId).style.pixelHeight:this.targetElement.clientHeight;if(!tinyMCE.settings['auto_resize']&&!(node.absTop>scrollY&&node.absTop<(scrollY-25+height)))this.contentWindow.scrollTo(pos.absLeft,pos.absTop-height+25);};TinyMCEControl.prototype.getBody=function(){return this.getDoc().body;};TinyMCEControl.prototype.getDoc=function(){return this.contentWindow.document;};TinyMCEControl.prototype.getWin=function(){return this.contentWindow;};TinyMCEControl.prototype.getSel=function(){if(tinyMCE.isMSIE)return this.getDoc().selection;var sel=this.contentWindow.getSelection();if(tinyMCE.isSafari&&!sel.getRangeAt){var newSel=new Object();var doc=this.getDoc();function getRangeAt(idx){var rng=new Object();rng.startContainer=this.focusNode;rng.endContainer=this.anchorNode;rng.commonAncestorContainer=this.focusNode;rng.createContextualFragment=function(html){if(html.charAt(0)=='<'){var elm=doc.createElement("div");elm.innerHTML=html;return elm.firstChild;}return doc.createTextNode("UNSUPPORTED, DUE TO LIMITATIONS IN SAFARI!");};rng.deleteContents=function(){doc.execCommand("Delete",false,"");};return rng;}newSel.focusNode=sel.baseNode;newSel.focusOffset=sel.baseOffset;newSel.anchorNode=sel.extentNode;newSel.anchorOffset=sel.extentOffset;newSel.getRangeAt=getRangeAt;newSel.text=""+sel;newSel.realSelection=sel;newSel.toString=function(){return this.text;};return newSel;}return sel;};TinyMCEControl.prototype.getRng=function(){var sel=this.getSel();if(sel==null)return null;if(tinyMCE.isMSIE)return sel.createRange();if(tinyMCE.isSafari){var rng=this.getDoc().createRange();var sel=this.getSel().realSelection;rng.setStart(sel.baseNode,sel.baseOffset);rng.setEnd(sel.extentNode,sel.extentOffset);return rng;}return this.getSel().getRangeAt(0);};TinyMCEControl.prototype._insertPara=function(e){function isEmpty(para){function isEmptyHTML(html){return html.replace(new RegExp('[ \t\r\n]+','g'),'').toLowerCase()=="";}if(para.getElementsByTagName("img").length>0)return false;if(para.getElementsByTagName("table").length>0)return false;if(para.getElementsByTagName("hr").length>0)return false;var nodes=tinyMCE.getNodeTree(para,new Array(),3);for(var i=0;i <"+blockName+"> ";paraAfter=body.childNodes[1];}this.selectNode(paraAfter,true,true);return true;}if(startChop.nodeName==blockName)rngBefore.setStart(startChop,0);else rngBefore.setStartBefore(startChop);rngBefore.setEnd(startNode,startOffset);paraBefore.appendChild(rngBefore.cloneContents());rngAfter.setEndAfter(endChop);rngAfter.setStart(endNode,endOffset);var contents=rngAfter.cloneContents();if(contents.firstChild&&contents.firstChild.nodeName==blockName){var nodes=contents.firstChild.childNodes;for(var i=0;i0)rng.pasteHTML('
'+rng.htmlText+"
");tinyMCE.triggerNodeChange();return;}}}switch(command){case "mceStoreSelection":this.selectionBookmark=this.getBookmark();break;case "mceRestoreSelection":this.moveToBookmark(this.selectionBookmark);break;case "InsertUnorderedList":case "InsertOrderedList":var tag=(command=="InsertUnorderedList")?"ul":"ol";if(tinyMCE.isSafari)this.execCommand("mceInsertContent",false,"<"+tag+">
  •  
  • <"+tag+">");else this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();break;case "Strikethrough":if(tinyMCE.isSafari)this.execCommand("mceInsertContent",false,""+this.getSelectedHTML()+"");else this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();break;case "mceSelectNode":this.selectNode(value);tinyMCE.triggerNodeChange();tinyMCE.selectedNode=value;break;case "FormatBlock":if(value==null||value==""){var elm=tinyMCE.getParentElement(this.getFocusElement(),"p,div,h1,h2,h3,h4,h5,h6,pre,address");if(elm)this.execCommand("mceRemoveNode",false,elm);}else this.getDoc().execCommand("FormatBlock",false,value);tinyMCE.triggerNodeChange();break;case "mceRemoveNode":if(!value)value=tinyMCE.getParentElement(this.getFocusElement());if(tinyMCE.isMSIE){value.outerHTML=value.innerHTML;}else{var rng=value.ownerDocument.createRange();rng.setStartBefore(value);rng.setEndAfter(value);rng.deleteContents();rng.insertNode(rng.createContextualFragment(value.innerHTML));}tinyMCE.triggerNodeChange();break;case "mceSelectNodeDepth":var parentNode=this.getFocusElement();for(var i=0;parentNode;i++){if(parentNode.nodeName.toLowerCase()=="body")break;if(parentNode.nodeName.toLowerCase()=="#text"){i--;parentNode=parentNode.parentNode;continue;}if(i==value){this.selectNode(parentNode,false);tinyMCE.triggerNodeChange();tinyMCE.selectedNode=parentNode;return;}parentNode=parentNode.parentNode;}break;case "HiliteColor":if(tinyMCE.isGecko){this.getDoc().execCommand("useCSS",false,false);this.getDoc().execCommand('hilitecolor',false,value);this.getDoc().execCommand("useCSS",false,true);}else this.getDoc().execCommand('BackColor',false,value);break;case "Cut":case "Copy":case "Paste":var cmdFailed=false;eval('try {this.getDoc().execCommand(command, user_interface, value);} catch (e) {cmdFailed = true;}');if(tinyMCE.isGecko&&cmdFailed){if(confirm(tinyMCE.getLang('lang_clipboard_msg')))window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html','mceExternal');return;}else tinyMCE.triggerNodeChange();break;case "mceSetContent":if(!value)value="";value=tinyMCE._customCleanup("insert_to_editor",value);tinyMCE._setHTML(doc,value);doc.body.innerHTML=tinyMCE._cleanupHTML(doc,tinyMCE.settings,doc.body);tinyMCE.handleVisualAid(doc.body,true,this.visualAid);return true;case "mceLink":var selectedText="";if(tinyMCE.isMSIE){var rng=doc.selection.createRange();selectedText=rng.text;}else selectedText=this.getSel().toString();if(!tinyMCE.linkElement){if((tinyMCE.selectedElement.nodeName.toLowerCase()!="img")&&(selectedText.length<=0))return;}var href="",target="",title="",onclick="",action="insert",style_class="";if(tinyMCE.selectedElement.nodeName.toLowerCase()=="a")tinyMCE.linkElement=tinyMCE.selectedElement;if(tinyMCE.linkElement!=null&&tinyMCE.getAttrib(tinyMCE.linkElement,'href')=="")tinyMCE.linkElement=null;if(tinyMCE.linkElement){href=tinyMCE.getAttrib(tinyMCE.linkElement,'href');target=tinyMCE.getAttrib(tinyMCE.linkElement,'target');title=tinyMCE.getAttrib(tinyMCE.linkElement,'title');onclick=tinyMCE.getAttrib(tinyMCE.linkElement,'mce_onclick');style_class=tinyMCE.getAttrib(tinyMCE.linkElement,'class');if(onclick=="")onclick=tinyMCE.getAttrib(tinyMCE.linkElement,'onclick');onclick=tinyMCE.cleanupEventStr(onclick);mceRealHref=tinyMCE.getAttrib(tinyMCE.linkElement,'mce_real_href');if(mceRealHref!="")href=mceRealHref;href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement, true);");action="update";}if(this.settings['insertlink_callback']){var returnVal=eval(this.settings['insertlink_callback']+"(href, target, title, onclick, action, style_class);");if(returnVal&&returnVal['href'])tinyMCE.insertLink(returnVal['href'],returnVal['target'],returnVal['title'],returnVal['onclick'],returnVal['style_class']);}else{tinyMCE.openWindow(this.insertLinkTemplate,{href:href,target:target,title:title,onclick:onclick,action:action,className:style_class});}break;case "mceImage":var src="",alt="",border="",hspace="",vspace="",width="",height="",align="";var title="",onmouseover="",onmouseout="",action="insert";var img=tinyMCE.imgElement;if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img"){img=tinyMCE.selectedElement;tinyMCE.imgElement=img;}if(img){if(tinyMCE.getAttrib(img,'name').indexOf('mce_')==0)return;src=tinyMCE.getAttrib(img,'src');alt=tinyMCE.getAttrib(img,'alt');if(alt=="")alt=tinyMCE.getAttrib(img,'title');if(tinyMCE.isGecko){var w=img.style.width;if(w!=null&&w!="")img.setAttribute("width",w);var h=img.style.height;if(h!=null&&h!="")img.setAttribute("height",h);}border=tinyMCE.getAttrib(img,'border');hspace=tinyMCE.getAttrib(img,'hspace');vspace=tinyMCE.getAttrib(img,'vspace');width=tinyMCE.getAttrib(img,'width');height=tinyMCE.getAttrib(img,'height');align=tinyMCE.getAttrib(img,'align');onmouseover=tinyMCE.getAttrib(img,'onmouseover');onmouseout=tinyMCE.getAttrib(img,'onmouseout');title=tinyMCE.getAttrib(img,'title');if(tinyMCE.isMSIE){width=img.attributes['width'].specified?width:"";height=img.attributes['height'].specified?height:"";}onmouseover=tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseover));onmouseout=tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseout));mceRealSrc=tinyMCE.getAttrib(img,'mce_real_src');if(mceRealSrc!="")src=mceRealSrc;src=eval(tinyMCE.settings['urlconverter_callback']+"(src, img, true);");if(onmouseover!="")onmouseover=eval(tinyMCE.settings['urlconverter_callback']+"(onmouseover, img, true);");if(onmouseout!="")onmouseout=eval(tinyMCE.settings['urlconverter_callback']+"(onmouseout, img, true);");action="update";}if(this.settings['insertimage_callback']){var returnVal=eval(this.settings['insertimage_callback']+"(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);");if(returnVal&&returnVal['src'])tinyMCE.insertImage(returnVal['src'],returnVal['alt'],returnVal['border'],returnVal['hspace'],returnVal['vspace'],returnVal['width'],returnVal['height'],returnVal['align'],returnVal['title'],returnVal['onmouseover'],returnVal['onmouseout']);}else tinyMCE.openWindow(this.insertImageTemplate,{src:src,alt:alt,border:border,hspace:hspace,vspace:vspace,width:width,height:height,align:align,title:title,onmouseover:onmouseover,onmouseout:onmouseout,action:action});break;case "mceCleanupWord":if(tinyMCE.isMSIE){var html=this.getBody().createTextRange().htmlText;if(html.indexOf('="mso')!=-1){tinyMCE._setHTML(this.contentDocument,this.getBody().innerHTML);html=tinyMCE._cleanupHTML(this.contentDocument,this.settings,this.getBody(),this.visualAid);}this.getBody().innerHTML=html;}break;case "mceCleanup":tinyMCE._setHTML(this.contentDocument,this.getBody().innerHTML);this.getBody().innerHTML=tinyMCE._cleanupHTML(this.contentDocument,this.settings,this.getBody(),this.visualAid);tinyMCE.handleVisualAid(this.getBody(),true,this.visualAid);this.repaint();tinyMCE.triggerNodeChange();break;case "mceAnchor":if(!user_interface){var aElm=tinyMCE.getParentElement(this.getFocusElement(),"a","name");if(aElm){if(value==null||value==""){if(tinyMCE.isMSIE){aElm.outerHTML=aElm.innerHTML;}else{var rng=aElm.ownerDocument.createRange();rng.setStartBefore(aElm);rng.setEndAfter(aElm);rng.deleteContents();rng.insertNode(rng.createContextualFragment(aElm.innerHTML));}}else aElm.setAttribute('name',value);}else{this.getDoc().execCommand("fontname",false,"#mce_temp_font#");var elementArray=tinyMCE.getElementsByAttributeValue(this.getBody(),"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 rng=doc.selection.createRange();selectedText=(rng.text&&rng.text.length>0);}else selectedText=(this.getSel().toString().length>0);if(tinyMCE.selectedNode)tinyMCE.selectedElement=tinyMCE.selectedNode;if(selectedText&&!tinyMCE.selectedNode){this.getDoc().execCommand("RemoveFormat",false,null);if(value==null)return this.execCommand("RemoveFormat",false,null);this.getDoc().execCommand("fontname",false,"#mce_temp_font#");var elementArray=tinyMCE.getElementsByAttributeValue(this.getBody(),"font","face","#mce_temp_font#");for(var x=0;xcustomUndoLevels){for(var i=0;i0){this.undoIndex--;this.getBody().innerHTML=this.undoLevels[this.undoIndex];}tinyMCE.triggerNodeChange();}else this.getDoc().execCommand(command,user_interface,value);break;case "Redo":if(tinyMCE.settings['custom_undo_redo']){if(this.undoIndex<(this.undoLevels.length-1)){this.undoIndex++;this.getBody().innerHTML=this.undoLevels[this.undoIndex];}tinyMCE.triggerNodeChange();}else this.getDoc().execCommand(command,user_interface,value);break;case "mceToggleVisualAid":this.visualAid=!this.visualAid;tinyMCE.handleVisualAid(this.getBody(),true,this.visualAid);tinyMCE.triggerNodeChange();break;case "removeformat":var text=this.getSelectedText();if(tinyMCE.isMSIE){try{win.focus();var rng=doc.selection.createRange();rng.execCommand("RemoveFormat",false,null);rng.pasteHTML(rng.text);}catch(e){}}else this.getDoc().execCommand(command,user_interface,value);if(text.length==0)this.execCommand("mceSetCSSClass",false,"");tinyMCE.triggerNodeChange();break;default:this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();}};TinyMCEControl.prototype.queryCommandValue=function(command){return this.getDoc().queryCommandValue(command);};TinyMCEControl.prototype.queryCommandState=function(command){return this.getDoc().queryCommandState(command);};TinyMCEControl.prototype.onAdd=function(replace_element,form_element_name,target_document){var targetDoc=target_document?target_document:document;this.targetDoc=targetDoc;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('_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',true);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;if(this.settings['width']==0)this.settings['width']=replace_element.style.width;if(this.settings['height']==0)this.settings['height']=replace_element.style.height;if(this.settings['width']==0)this.settings['width']=320;if(this.settings['height']==0)this.settings['height']=240;this.settings['area_width']=parseInt(this.settings['width']);this.settings['area_height']=parseInt(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.formTargetElementId=form_element_name;if(replace_element.nodeName.toLowerCase()=="textarea")this.startContent=replace_element.value;else this.startContent=replace_element.innerHTML;if(replace_element.nodeName.toLowerCase()!="textarea"){this.oldTargetElement=replace_element.cloneNode(true);if(tinyMCE.settings['debug'])html+='';else 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;}else{html+='';this.oldTargetElement=replace_element;if(!tinyMCE.settings['debug'])this.oldTargetElement.style.display="none";if(!tinyMCE.isMSIE){var rng=replace_element.ownerDocument.createRange();rng.setStartBefore(replace_element);var fragment=rng.createContextualFragment(html);replace_element.parentNode.insertBefore(fragment,replace_element);}else replace_element.insertAdjacentHTML("beforeBegin",html);}var dynamicIFrame=false;var tElm=targetDoc.getElementById(this.editorId);if(!tinyMCE.isMSIE){if(tElm&&tElm.nodeName.toLowerCase()=="span"){tElm=tinyMCE._createIFrame(tElm);dynamicIFrame=true;}this.targetElement=tElm;this.iframeElement=tElm;this.contentDocument=tElm.contentDocument;this.contentWindow=tElm.contentWindow;}else{if(tElm&&tElm.nodeName.toLowerCase()=="span")tElm=tinyMCE._createIFrame(tElm);else tElm=targetDoc.frames[this.editorId];this.targetElement=tElm;this.iframeElement=targetDoc.getElementById(this.editorId);this.contentDocument=tElm.window.document;this.contentWindow=tElm.window;this.getDoc().designMode="on";}var doc=this.contentDocument;if(dynamicIFrame){var html=""+''+''+''+''+'blank_page'+''+''+''+''+'';try{this.getDoc().designMode="on";doc.open();doc.write(html);doc.close();}catch(e){this.getDoc().location.href=tinyMCE.baseURL+"/blank.htm";}}if(tinyMCE.isMSIE)window.setTimeout("TinyMCE.prototype.addEventHandlers('"+this.editorId+"');",1);tinyMCE.setupContent(this.editorId,true);return true;};TinyMCEControl.prototype.getFocusElement=function(){if(tinyMCE.isMSIE){var doc=this.getDoc();var rng=doc.selection.createRange();if(rng.collapse)rng.collapse(true);var elm=rng.item?rng.item(0):rng.parentElement();}else{var sel=this.getSel();var elm=(sel&&sel.anchorNode)?sel.anchorNode:null;if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img")elm=tinyMCE.selectedElement;}return elm;};var tinyMCE=new TinyMCE();var tinyMCELang=new Array();function debug(){var msg="";var elm=document.getElementById("tinymce_debug");if(!elm){var debugDiv=document.createElement("div");debugDiv.setAttribute("className","debugger");debugDiv.className="debugger";debugDiv.innerHTML='\ + Debug output:\ + ';document.body.appendChild(debugDiv);elm=document.getElementById("tinymce_debug");}var args=this.debug.arguments;for(var i=0;i + +var TinyMCECompressed_settings = null; + +function TinyMCECompressed() { +} + +TinyMCECompressed.prototype.init = function(settings) { + var elements = document.getElementsByTagName('script'); + var scriptURL = ""; + + for (var i=0; i'); + + TinyMCECompressed_settings = settings; +} + +var tinyMCE = new TinyMCECompressed(); diff --git a/wp-admin/tinymce/tiny_mce_popup.js b/wp-admin/tinymce/tiny_mce_popup.js new file mode 100644 index 0000000000..8b03e501d0 --- /dev/null +++ b/wp-admin/tinymce/tiny_mce_popup.js @@ -0,0 +1,96 @@ +// Get tinyMCE window +var win = window.opener ? window.opener : window.dialogArguments; + +var tinyMCE = null; +var tinyMCELang = null; + +// Use top window if not defined +if (!win) + win = top; + +var tinyMCE = win.tinyMCE; +var tinyMCELang = win.tinyMCELang; + +if (!tinyMCE) + alert("tinyMCE object reference not found from popup."); + +// Setup window openerer +window.opener = win; + +// Setup title +var re = new RegExp('{|\\\$|}', 'g'); +var title = document.title.replace(re, ""); +if (typeof tinyMCELang[title] != "undefined") { + var divElm = document.createElement("div"); + divElm.innerHTML = tinyMCELang[title]; + document.title = divElm.innerHTML; +} + +// Setup dir +if (tinyMCELang['lang_dir']) + document.dir = tinyMCELang['lang_dir']; + +function TinyMCEPlugin_onLoad() { + if (tinyMCE.getWindowArg('mce_replacevariables', true)) + document.body.innerHTML = tinyMCE.applyTemplate(document.body.innerHTML, tinyMCE.windowArgs); + + // Auto resize window + if (tinyMCE.getWindowArg('mce_windowresize', true)) + TinyMCEPopup_autoResize(); + + if (tinyMCE.settings["dialog_type"] == "window") + window.focus(); +} + +function TinyMCEPopup_autoResize() { + // Div mode, skip resize + if (tinyMCE.settings["dialog_type"] == "div") + return; + + var isMSIE = (navigator.appName == "Microsoft Internet Explorer"); + var isOpera = (navigator.userAgent.indexOf("Opera") != -1); + + if (isOpera) + return; + + if (isMSIE) { + try { window.resizeTo(10, 10); } catch (e) {} + + var elm = document.body; + var width = elm.offsetWidth; + var height = elm.offsetHeight; + var dx = (elm.scrollWidth - width) + 4; + var dy = elm.scrollHeight - height; + + try { window.resizeBy(dx, dy); } catch (e) {} + } else { + window.scrollBy(1000, 1000); + if (window.scrollX > 0 || window.scrollY > 0) { + window.resizeBy(window.innerWidth * 2, window.innerHeight * 2); + window.sizeToContent(); + window.scrollTo(0, 0); + var x = parseInt(screen.width / 2.0) - (window.outerWidth / 2.0); + var y = parseInt(screen.height / 2.0) - (window.outerHeight / 2.0); + window.moveTo(x, y); + } + } +} + +// Re-patch it +if (tinyMCE.settings["dialog_type"] == "window") { + tinyMCE.closeDialog = function() { + // Remove div or close window + if (tinyMCE.settings["dialog_type"] == "div") { + var div = document.getElementById(tinyMCE._currentDialog); + if (div) + div.parentNode.removeChild(div); + } else + window.close(); + }; +} + +// Add onload trigger +tinyMCE.addEvent(window, "load", TinyMCEPlugin_onLoad); + +// Output Popup CSS class +document.write(''); diff --git a/wp-admin/tinymce/tiny_mce_src.js b/wp-admin/tinymce/tiny_mce_src.js new file mode 100644 index 0000000000..0d195d0fe6 --- /dev/null +++ b/wp-admin/tinymce/tiny_mce_src.js @@ -0,0 +1,5001 @@ +/** + * $RCSfile: tiny_mce_src.js,v $ + * $Revision: 1.215 $ + * $Date: 2005/06/23 12:04:41 $ + * + * @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.loadedFiles = new Array(); + this.configs = new Array(); + this.currentConfig = 0; + this.eventHandlers = new Array(); + + // Browser check + this.isMSIE = (navigator.appName == "Microsoft Internet Explorer"); + this.isMSIE5 = this.isMSIE && (navigator.userAgent.indexOf('MSIE 5') != -1); + this.isMSIE5_0 = this.isMSIE && (navigator.userAgent.indexOf('MSIE 5.0') != -1); + this.isGecko = navigator.userAgent.indexOf('Gecko') != -1; + this.isSafari = navigator.userAgent.indexOf('Safari') != -1; + this.isMac = navigator.userAgent.indexOf('Mac') != -1; + this.dialogCounter = 0; + + // TinyMCE editor id instance counter + this.idCounter = 0; +}; + +TinyMCE.prototype.defParam = function(key, def_val) { + this.settings[key] = tinyMCE.getParam(key, def_val); +}; + +TinyMCE.prototype.init = function(settings) { + var theme; + + this.settings = settings; + + // Check if valid browser has execcommand support + if (typeof(document.execCommand) == 'undefined') + return; + + // Get script base path + if (!tinyMCE.baseURL) { + var elements = document.getElementsByTagName('script'); + + for (var i=0; i'); + + this.loadedFiles[this.loadedFiles.length] = url; +}; + +TinyMCE.prototype.loadCSS = function(url) { + for (var i=0; i'); + + this.loadedFiles[this.loadedFiles.length] = url; +}; + +TinyMCE.prototype.importCSS = function(doc, css_file) { + if (tinyMCE.isMSIE) + var styleSheet = doc.createStyleSheet(css_file); + else { + var elm = doc.createElement("link"); + + elm.rel = "stylesheet"; + elm.href = css_file; + + if (headArr = doc.getElementsByTagName("head")) + headArr[0].appendChild(elm); + } +}; + +TinyMCE.prototype.confirmAdd = function(e, settings) { + var elm = tinyMCE.isMSIE ? event.srcElement : e.target; + var elementId = elm.name ? elm.name : elm.id; + + tinyMCE.settings = settings; + + if (!elm.getAttribute('mce_noask') && confirm(tinyMCELang['lang_edit_confirm'])) + tinyMCE.addMCEControl(elm, elementId); + + elm.setAttribute('mce_noask', 'true'); +}; + +TinyMCE.prototype.updateContent = function(form_element_name) { + // Find MCE instance linked to given form element and copy it's value + var formElement = document.getElementById(form_element_name); + for (var n in tinyMCE.instances) { + var inst = tinyMCE.instances[n]; + + inst.switchSettings(); + + if (inst.formElement == formElement) { + var doc = inst.getDoc(); + + tinyMCE._setHTML(doc, inst.formElement.value); + + if (!tinyMCE.isMSIE) + doc.body.innerHTML = tinyMCE._cleanupHTML(doc, this.settings, doc.body, inst.visualAid); + } + } +}; + +TinyMCE.prototype.addMCEControl = function(replace_element, form_element_name, target_document) { + var id = "mce_editor_" + tinyMCE.idCounter++; + var inst = new TinyMCEControl(tinyMCE.settings); + + inst.editorId = id; + this.instances[id] = inst; + + inst.onAdd(replace_element, form_element_name, target_document); +}; + +TinyMCE.prototype.triggerSave = function(skip_cleanup, skip_callback) { + // Cleanup and set all form fields + for (var n in tinyMCE.instances) { + var inst = tinyMCE.instances[n]; + + inst.switchSettings(); + + tinyMCE.settings['preformatted'] = false; + + // Default to false + if (typeof(skip_cleanup) == "undefined") + skip_cleanup = false; + + // Default to false + if (typeof(skip_callback) == "undefined") + skip_callback = false; + + tinyMCE._setHTML(inst.getDoc(), inst.getBody().innerHTML); + + var htm = skip_cleanup ? inst.getBody().innerHTML : tinyMCE._cleanupHTML(inst.getDoc(), this.settings, inst.getBody(), this.visualAid, true); + + //var htm = tinyMCE._cleanupHTML(inst.getDoc(), tinyMCE.settings, inst.getBody(), false, true); + + if (tinyMCE.settings["encoding"] == "xml" || tinyMCE.settings["encoding"] == "html") + htm = tinyMCE.convertStringToXML(htm); + + if (!skip_callback && tinyMCE.settings['save_callback'] != "") + var content = eval(tinyMCE.settings['save_callback'] + "(inst.formTargetElementId,htm,inst.getBody());"); + + // Use callback content if available + if ((typeof(content) != "undefined") && content != null) + htm = content; + + // Replace some weird entities (Bug: #1056343) + htm = tinyMCE.regexpReplace(htm, "(", "(", "gi"); + htm = tinyMCE.regexpReplace(htm, ")", ")", "gi"); + htm = tinyMCE.regexpReplace(htm, ";", ";", "gi"); + htm = tinyMCE.regexpReplace(htm, """, """, "gi"); + htm = tinyMCE.regexpReplace(htm, "^", "^", "gi"); + + if (inst.formElement) + inst.formElement.value = htm; + } +}; + +TinyMCE.prototype._convertOnClick = function(node) { + // Skip on MSIE < 6+ + if (tinyMCE.isMSIE5) + return; + + // Convert all onclick to mce_onclick + var elms = node.getElementsByTagName("a"); + for (var i=0; i", "gi"); + content = tinyMCE.regexpReplace(content, "\r", "
    ", "gi"); + content = tinyMCE.regexpReplace(content, "\n", "
    ", "gi"); + } + + // Call custom cleanup code + content = tinyMCE._customCleanup("insert_to_editor", content); + + if (tinyMCE.isMSIE) { + // 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 body = document.frames[editor_id].document.body; + + tinyMCE.addEvent(body, "beforepaste", TinyMCE.prototype.eventPatch); + tinyMCE.addEvent(body, "beforecut", TinyMCE.prototype.eventPatch); + tinyMCE.addEvent(body, "paste", TinyMCE.prototype.eventPatch); + + body.editorId = editor_id; + } + + // Fix for bug #958637 + if (!tinyMCE.isMSIE) { + var contentElement = inst.getDoc().createElement("body"); + var doc = inst.getDoc(); + + contentElement.innerHTML = content; + + // Remove weridness! + if (tinyMCE.settings['force_p_newlines']) + content = content.replace(new RegExp('<>', 'g'), ""); + + if (tinyMCE.settings['cleanup_on_startup']) + inst.getBody().innerHTML = tinyMCE._cleanupHTML(doc, this.settings, contentElement); + else { + // Convert all strong/em to b/i + content = tinyMCE.regexpReplace(content, "", "", "gi"); + content = tinyMCE.regexpReplace(content, "", "", "gi"); + inst.getBody().innerHTML = content; + } + + inst.convertAllRelativeURLs(); + } else { + if (tinyMCE.settings['cleanup_on_startup']) { + tinyMCE._setHTML(inst.getDoc(), content); + + // Produces permission denied error in MSIE 5.5 + eval('try {inst.getBody().innerHTML = tinyMCE._cleanupHTML(inst.contentDocument, this.settings, inst.getBody());} catch(e) {}'); + } else + tinyMCE._setHTML(inst.getDoc(), content); + } + + tinyMCE._convertOnClick(inst.getBody()); + + // Fix for bug #957681 + //inst.getDoc().designMode = inst.getDoc().designMode; + + // Setup element references + var parentElm = document.getElementById(inst.editorId + '_parent'); + if (parentElm.lastChild.nodeName.toLowerCase() == "input") + inst.formElement = parentElm.lastChild; + else + inst.formElement = parentElm.nextSibling; + + tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual']); + tinyMCE.executeCallback('setupcontent_callback', '_setupContent', 0, editor_id, inst.getBody(), inst.getDoc()); + + // Re-add design mode on mozilla + if (!tinyMCE.isMSIE) + TinyMCE.prototype.addEventHandlers(editor_id); + + inst.startContent = inst.getBody().innerHTML; + + // Trigger node change, this call locks buttons for tables and so forth + tinyMCE.selectedInstance = inst; + tinyMCE.selectedElement = inst.contentWindow.document.body; + tinyMCE.triggerNodeChange(false, true); + + // Call custom DOM cleanup + tinyMCE._customCleanup("insert_to_editor_dom", inst.contentWindow.document.body); +}; + +TinyMCE.prototype.cancelEvent = function(e) { + if (tinyMCE.isMSIE) { + e.returnValue = false; + e.cancelBubble = true; + } else + e.preventDefault(); +}; + +TinyMCE.prototype.removeTinyMCEFormElements = function(form_obj) { + // Disable all UI form elements that TinyMCE created + for (var i=0; i"); + rng.collapse(false); + rng.select(); + + tinyMCE.triggerNodeChange(false); + return false; + } + } + + // Backspace or delete + 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; + + if (tinyMCE.selectedInstance) + tinyMCE.selectedInstance.switchSettings(); + + // Handle backspace + if (tinyMCE.isGecko && tinyMCE.settings['force_p_newlines'] && (e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) { + // Insert P element instead of BR + if (tinyMCE.selectedInstance._handleBackSpace(e.type)) { + // Cancel event + e.preventDefault(); + return false; + } + } + + tinyMCE.selectedElement = null; + tinyMCE.selectedNode = null; + var elm = tinyMCE.selectedInstance.getFocusElement(); + tinyMCE.linkElement = tinyMCE.getParentElement(elm, "a"); + tinyMCE.imgElement = tinyMCE.getParentElement(elm, "img"); + tinyMCE.selectedElement = elm; + + // Update visualaids on tabs + if (tinyMCE.isGecko && e.type == "keyup" && e.keyCode == 9) + tinyMCE.handleVisualAid(tinyMCE.selectedInstance.getBody(), true, tinyMCE.settings['visual']); + + // Run image/link fix on Gecko if diffrent document base on paste + if (tinyMCE.isGecko && tinyMCE.settings['document_base_url'] != "" + document.location.href && e.type == "keyup" && e.ctrlKey && e.keyCode == 86) + tinyMCE.selectedInstance.fixBrokenURLs(); + + // Insert space instead of   +/* if (e.type == "keydown" && e.keyCode == 32) { + if (tinyMCE.selectedInstance._insertSpace()) { + // Cancel event + e.returnValue = false; + e.cancelBubble = true; + return false; + } + }*/ + + // MSIE custom key handling + if (tinyMCE.isMSIE && tinyMCE.settings['custom_undo_redo']) { + // Check if it's a position key press + var keys = new Array(13,45,36,35,33,34,37,38,39,40); + var posKey = false; + for (var i=0; i 18 && e.keyCode != 255)) { + tinyMCE.selectedInstance.execCommand("mceAddUndoLevel"); + tinyMCE.selectedInstance.typing = true; + tinyMCE.triggerNodeChange(false); + } + + if (posKey && e.type == "keyup") + tinyMCE.triggerNodeChange(false); + + var keys = new Array(8,46); // Backspace,Delete + for (var i=0; i 0) { + for (var i=0; i" + this.convertStringToXML(String.fromCharCode(160)) + ""; + + // Is MSIE script element + if (tinyMCE.isMSIE && elementName == "script") + return "<" + elementName + elementAttribs + ">" + node.text + ""; + + // Clean up children + if (node.hasChildNodes()) { + // Force BR + if (elementName == "p" && tinyMCE.cleanup_force_br_newlines) + output += ""; + else + output += "<" + elementName + elementAttribs + ">"; + + for (var i=0; i"; + } else { + // Allways leave anchor elements open + if (openTag) + output += "<" + elementName + elementAttribs + ">"; + else { + // No children + output += "<" + elementName + elementAttribs + " />"; + } + } + + return output; + + case 3: // Text + // Do not convert script elements + if (node.parentNode.nodeName.toLowerCase() == "script") + return node.nodeValue; + + return this.convertStringToXML(node.nodeValue); + + case 8: // Comment + return ""; + + default: // Unknown + return "[UNKNOWN NODETYPE " + node.nodeType + "]"; + } +}; + +TinyMCE.prototype.convertStringToXML = function(html_data) { + var output = ""; + + for (var i=0; i 127) + output += '&#' + chr + ";"; + else + output += String.fromCharCode(chr); + + continue; + } + + // Raw entities + if (tinyMCE.settings['entity_encoding'] == "raw") { + output += String.fromCharCode(chr); + continue; + } + + // Named entities + if (typeof(tinyMCE.cleanup_entities["c" + chr]) != 'undefined' && tinyMCE.cleanup_entities["c" + chr] != '') + output += '&' + tinyMCE.cleanup_entities["c" + chr] + ';'; + else + output += '' + String.fromCharCode(chr); + } + + return output; +}; + +TinyMCE.prototype._getCleanupElementName = function(chunk) { + var pos; + + if (chunk.charAt(0) == '+') + chunk = chunk.substring(1); + + if ((pos = chunk.indexOf('/')) != -1) + chunk = chunk.substring(0, pos); + + if ((pos = chunk.indexOf('[')) != -1) + chunk = chunk.substring(0, pos); + + return chunk; +}; + +TinyMCE.prototype._initCleanup = function() { + // Parse valid elements and attributes + var validElements = tinyMCE.settings["valid_elements"]; + validElements = validElements.split(','); + + // Handle extended valid elements + var extendedValidElements = tinyMCE.settings["extended_valid_elements"]; + extendedValidElements = extendedValidElements.split(','); + for (var i=0; i[ \n\r]*
    [ \n\r]*

    ', '
    ', 'gi'); + element.innerHTML = tinyMCE.regexpReplace(element.innerHTML, '', '', 'gi'); + } + + var html = this.cleanupNode(element); + + if (tinyMCE.settings['debug']) + alert("Cleanup process executed in: " + (new Date().getTime()-startTime) + " ms."); + + // Remove pesky HR paragraphs + html = tinyMCE.regexpReplace(html, '


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

     


     

    ', '
    '); + + // Remove some mozilla crap + 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 (tinyMCE.settings['force_p_newlines']) { + // Remove weridness! + var re = new RegExp('<>', 'g'); + html = html.replace(re, ""); + } + + if (tinyMCE.settings['remove_linebreaks']) + html = html.replace(new RegExp('\r|\n', 'g'), ' '); + + // Call custom cleanup code + html = tinyMCE._customCleanup(on_save ? "get_from_editor" : "insert_to_editor", html); + + // Emtpy node, return empty + var chk = tinyMCE.regexpReplace(html, "[ \t\r\n]", "").toLowerCase(); + if (chk == "
    " || chk == "
    " || chk == "

     

    " || chk == "

     

    " || chk == "

    ") + html = ""; + + if (tinyMCE.settings["preformatted"]) + return "
    " + html + "
    "; + + return html; +}; + +TinyMCE.prototype.setAttrib = function(element, name, value, no_fix_value) { + if (!no_fix_value && value != null) { + var re = new RegExp('[^0-9%]', 'g'); + value = value.replace(re, ''); + } + + if (value != null && value != "") + element.setAttribute(name, value); + else + element.removeAttribute(name); + + if (value != null && value != "") + element.setAttribute(name, value); + else + element.removeAttribute(name); +}; + +TinyMCE.prototype.insertLink = function(href, target, title, onclick, style_class) { + this.execCommand("mceAddUndoLevel"); + + if (this.selectedInstance && this.selectedElement && this.selectedElement.nodeName.toLowerCase() == "img") { + var doc = this.selectedInstance.getDoc(); + var linkElement = tinyMCE.getParentElement(this.selectedElement, "a"); + var newLink = false; + + if (!linkElement) { + linkElement = doc.createElement("a"); + newLink = true; + } + + href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, linkElement);"); + tinyMCE.setAttrib(linkElement, 'href', href); + tinyMCE.setAttrib(linkElement, 'target', target); + tinyMCE.setAttrib(linkElement, 'title', title); + tinyMCE.setAttrib(linkElement, 'mce_onclick', onclick); + tinyMCE.setAttrib(linkElement, 'class', style_class); + + if (newLink) { + linkElement.appendChild(this.selectedElement.cloneNode(true)); + this.selectedElement.parentNode.replaceChild(linkElement, this.selectedElement); + } + + return; + } + + if (!this.linkElement && this.selectedInstance) { + if (tinyMCE.isSafari) { + tinyMCE.execCommand("mceInsertContent", false, '' + this.selectedInstance.getSelectedHTML() + ''); + } else + 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'; + + tinyMCE.execCommand("mceInsertContent", false, html); + } else { + if (!this.imgElement && this.selectedInstance) { + if (tinyMCE.isSafari) + tinyMCE.execCommand("mceInsertContent", false, ''); + else + this.selectedInstance.contentDocument.execCommand("insertimage", false, "#mce_temp_url#"); + + tinyMCE.imgElement = this.getElementByAttributeValue(this.selectedInstance.contentDocument.body, "img", "src", "#mce_temp_url#"); + } + } + + if (this.imgElement) { + var needsRepaint = false; + + src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, tinyMCE.imgElement);"); + + if (onmouseover && onmouseover != "") + onmouseover = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, tinyMCE.imgElement);") + "';"; + + if (onmouseout && onmouseout != "") + onmouseout = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, tinyMCE.imgElement);") + "';"; + + // Use alt as title if it's undefined + if (typeof(title) == "undefined") + title = alt; + + if (width != this.imgElement.getAttribute("width") || height != this.imgElement.getAttribute("height") || align != this.imgElement.getAttribute("align")) + needsRepaint = true; + + tinyMCE.setAttrib(this.imgElement, 'src', src); + tinyMCE.setAttrib(this.imgElement, 'mce_real_src', src); + tinyMCE.setAttrib(this.imgElement, 'alt', alt); + tinyMCE.setAttrib(this.imgElement, 'title', title); + tinyMCE.setAttrib(this.imgElement, 'align', align); + tinyMCE.setAttrib(this.imgElement, 'border', border, true); + tinyMCE.setAttrib(this.imgElement, 'hspace', hspace, true); + tinyMCE.setAttrib(this.imgElement, 'vspace', vspace, true); + tinyMCE.setAttrib(this.imgElement, 'width', width, true); + tinyMCE.setAttrib(this.imgElement, 'height', height, true); + tinyMCE.setAttrib(this.imgElement, 'onmouseover', onmouseover); + tinyMCE.setAttrib(this.imgElement, 'onmouseout', onmouseout); + + // Fix for bug #989846 - Image resize bug + if (width && width != "") + this.imgElement.style.pixelWidth = width; + + if (height && height != "") + this.imgElement.style.pixelHeight = height; + + if (needsRepaint) + tinyMCE.selectedInstance.repaint(); + } +}; + +TinyMCE.prototype.getElementByAttributeValue = function(node, element_name, attrib, value) { + var elements = this.getElementsByAttributeValue(node, element_name, attrib, value); + if (elements.length == 0) + return null; + + return elements[0]; +}; + +TinyMCE.prototype.getElementsByAttributeValue = function(node, element_name, attrib, value) { + var elements = new Array(); + + if (node && node.nodeName.toLowerCase() == element_name) { + if (node.getAttribute(attrib) && node.getAttribute(attrib).indexOf(value) != -1) + elements[elements.length] = node; + } + + if (node.hasChildNodes) { + for (var x=0, n=node.childNodes.length; x= strTok2.length) { + for (var i=0; i= strTok2.length || strTok1[i] != strTok2[i]) { + breakPoint = i + 1; + break; + } + } + } + + if (strTok1.length < strTok2.length) { + for (var i=0; i= 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; i=0; i--) { + if (baseURLParts[i].length == 0) + continue; + + newBaseURLParts[newBaseURLParts.length] = baseURLParts[i]; + } + baseURLParts = newBaseURLParts.reverse(); + + // Merge relURLParts chunks + var newRelURLParts = new Array(); + var numBack = 0; + for (var i=relURLParts.length-1; i>=0; i--) { + if (relURLParts[i].length == 0 || relURLParts[i] == ".") + continue; + + if (relURLParts[i] == '..') { + numBack++; + continue; + } + + if (numBack > 0) { + numBack--; + continue; + } + + newRelURLParts[newRelURLParts.length] = relURLParts[i]; + } + + relURLParts = newRelURLParts.reverse(); + + // Remove end from absolute path + var len = baseURLParts.length-numBack; + var absPath = (len <= 0 ? "" : "/") + baseURLParts.slice(0, len).join('/') + "/" + relURLParts.join('/'); + var start = "", end = ""; + + // Build start part + if (baseURL['protocol']) + start += baseURL['protocol'] + "://"; + + if (baseURL['host']) + start += baseURL['host']; + + if (baseURL['port']) + start += ":" + baseURL['port']; + + // Build end part + if (relURL['query']) + end += "?" + relURL['query']; + + if (relURL['anchor']) + end += "#" + relURL['anchor']; + + // Re-add trailing slash if it's removed + if (relative_url.charAt(relative_url.length-1) == "/") + end += "/"; + + return start + absPath + end; +}; + +TinyMCE.prototype.getParam = function(name, default_value, strip_whitespace, split_chr) { + var value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name]; + + // Fix bool values + if (value == "true" || value == "false") + return (value == "true"); + + if (strip_whitespace) + value = tinyMCE.regexpReplace(value, "[ \t\r\n]", ""); + + if (typeof(split_chr) != "undefined" && split_chr != null) { + value = value.split(split_chr); + var outArray = new Array(); + + for (var i=0; i 0); + + if (tinyMCE.settings['custom_undo_redo']) { + undoIndex = inst.undoIndex; + undoLevels = inst.undoLevels.length; + } + + tinyMCE.executeCallback('handleNodeChangeCallback', '_handleNodeChange', 0, editorId, elm, undoIndex, undoLevels, inst.visualAid, anySelection); + } + } + + if (this.selectedInstance && (typeof(focus) == "undefined" || focus)) + this.selectedInstance.contentWindow.focus(); +}; + +TinyMCE.prototype._customCleanup = function(type, content) { + // Call custom cleanup + var customCleanup = tinyMCE.settings['cleanup_callback']; + if (customCleanup != "" && eval("typeof(" + customCleanup + ")") != "undefined") + content = eval(customCleanup + "(type, content);"); + + // Trigger plugin cleanups + var plugins = tinyMCE.getParam('plugins', '', true, ','); + for (var i=0; i'; + + div.innerHTML = html; + + document.body.appendChild(div); + + tinyMCE._currentDialog = id; + } + } + } +}; + +TinyMCE.prototype.closeDialog = function() { + // Remove div or close window + if (tinyMCE.settings["dialog_type"] == "div") { + var div = document.getElementById(tinyMCE._currentDialog); + if (div) + div.parentNode.removeChild(div); + } else + window.close(); +}; + +TinyMCE.prototype.getVisualAidClass = function(class_name, state) { + var aidClass = tinyMCE.settings['visual_table_class']; + + if (typeof(state) == "undefined") + state = tinyMCE.settings['visual']; + + // Split + var classNames = new Array(); + var ar = class_name.split(' '); + for (var i=0; i 0) + className += " "; + + className += classNames[i]; + } + + return className; +}; + +TinyMCE.prototype.handleVisualAid = function(element, deep, state) { + if (!element) + return; + + var tableElement = null; + + switch (element.nodeName.toLowerCase()) { + case "table": + var oldW = element.style.width; + var oldH = element.style.height; + + element.className = tinyMCE.getVisualAidClass(element.className, state && element.getAttribute("border") == 0); + + element.style.width = oldW; + element.style.height = oldH; + + for (var y=0; y'; + return; + } + + break;*/ + } + + if (deep && element.hasChildNodes()) { + for (var i=0; i

    breaks runtime? + if (tinyMCE.isMSIE) { + var re = new RegExp('


    ', 'g'); + html_content = html_content.replace(re, "
    "); + } + + // Try innerHTML if it fails use pasteHTML in MSIE + try { + doc.body.innerHTML = html_content; + } catch (e) { + if (this.isMSIE) + doc.body.createTextRange().pasteHTML(html_content); + } + + // Content duplication bug fix + if (tinyMCE.isMSIE && tinyMCE.settings['fix_content_duplication']) { + // Remove P elements in P elements + 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*)?", "

    "); + } + + // Always set the htmlText output + doc.body.innerHTML = html; + } +}; + +TinyMCE.prototype.getImageSrc = function(str) { + var pos = -1; + + if (!str) + return ""; + + if ((pos = str.indexOf('this.src=')) != -1) { + var src = str.substring(pos + 10); + + src = src.substring(0, src.indexOf('\'')); + + return src; + } + + return ""; +}; + +TinyMCE.prototype._getElementById = function(element_id) { + var elm = document.getElementById(element_id); + if (!elm) { + // Check for element in forms + for (var j=0; j 0) { + var csses = null; + + // Just ignore any errors + eval("try {var csses = tinyMCE.isMSIE ? doc.styleSheets(0).rules : doc.styleSheets[0].cssRules;} catch(e) {}"); + if (!csses) + return new Array(); + + for (var i=0; i 0) + tinyMCE.cssClasses = output; + + return output; +}; + +TinyMCE.prototype.regexpReplace = function(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); +}; + +TinyMCE.prototype.cleanupEventStr = function(str) { + str = "" + str; + str = str.replace('function anonymous()\n{\n', ''); + str = str.replace('\n}', ''); + + return str; +}; + +TinyMCE.prototype.getAbsPosition = function(node) { + var pos = new Object(); + + pos.absLeft = pos.absTop = 0; + + var parentNode = node; + while (parentNode) { + pos.absLeft += parentNode.offsetLeft; + pos.absTop += parentNode.offsetTop; + + parentNode = parentNode.offsetParent; + } + + return pos; +}; + +TinyMCE.prototype.openFileBrowser = function(field_name, url, type, win) { + var cb = tinyMCE.getParam("file_browser_callback"); + + this.setWindowArg("window", win); + + // Call to external callback + if(eval('typeof('+cb+')') == "undefined") + alert("Callback function: " + cb + " could not be found."); + else + eval(cb + "(field_name, url, type, win);"); +}; + +TinyMCE.prototype.getControlHTML = function(control_name) { + var themePlugins = tinyMCE.getParam('plugins', '', true, ','); + var templateFunction; + + // Is it defined in any plugins + 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 + "');"); +}; + +TinyMCE.prototype._themeExecCommand = function(editor_id, element, command, user_interface, value) { + var themePlugins = tinyMCE.getParam('plugins', '', true, ','); + var templateFunction; + + // Is it defined in any plugins + 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; + } + } + + // Theme funtion + templateFunction = 'TinyMCE_' + tinyMCE.settings['theme'] + "_execCommand"; + if (eval("typeof(" + templateFunction + ")") != 'undefined') + return eval(templateFunction + "(editor_id, element, command, user_interface, value);"); + + // Pass to normal + return false; +}; + +TinyMCE.prototype._getThemeFunction = function(suffix, skip_plugins) { + if (skip_plugins) + return 'TinyMCE_' + tinyMCE.settings['theme'] + suffix; + + var themePlugins = tinyMCE.getParam('plugins', '', true, ','); + var templateFunction; + + // Is it defined in any plugins + 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; +}; + + +TinyMCE.prototype.isFunc = function(func_name) { + if (func_name == null || func_name == "") + return false; + + return eval("typeof(" + func_name + ")") != "undefined"; +}; + +TinyMCE.prototype.exec = function(func_name, args) { + var str = func_name + '('; + + // Add all arguments + for (var i=3; i 1 && tinyMCE.currentConfig != this.settings['index']) { + tinyMCE.settings = this.settings; + tinyMCE.currentConfig = this.settings['index']; + } +}; + +TinyMCEControl.prototype.fixBrokenURLs = function() { + var body = this.getBody(); + + var elms = body.getElementsByTagName("img"); + for (var i=0; i 0) + rng.selectNodeContents(nodes[0]); + else + rng.selectNodeContents(node); + } else + rng.selectNode(node); + + if (collapse) { + // Special treatment of textnode collapse + if (!to_start && node.nodeType == 3) { + rng.setStart(node, node.nodeValue.length); + rng.setEnd(node, node.nodeValue.length); + } else + rng.collapse(to_start); + } + + sel.removeAllRanges(); + sel.addRange(rng); + } + + this.scrollToNode(node); + + // Set selected element + tinyMCE.selectedElement = null; + if (node.nodeType == 1) + tinyMCE.selectedElement = node; +}; + +TinyMCEControl.prototype.scrollToNode = function(node) { + // Scroll to node position + var pos = tinyMCE.getAbsPosition(node); + var doc = this.getDoc(); + var scrollX = doc.body.scrollLeft + doc.documentElement.scrollLeft; + var scrollY = doc.body.scrollTop + doc.documentElement.scrollTop; + var height = tinyMCE.isMSIE ? document.getElementById(this.editorId).style.pixelHeight : this.targetElement.clientHeight; + + // Only scroll if out of visible area + if (!tinyMCE.settings['auto_resize'] && !(node.absTop > scrollY && node.absTop < (scrollY - 25 + height))) + this.contentWindow.scrollTo(pos.absLeft, pos.absTop - height + 25); +}; + +TinyMCEControl.prototype.getBody = function() { + return this.getDoc().body; +}; + +TinyMCEControl.prototype.getDoc = function() { + return this.contentWindow.document; +}; + +TinyMCEControl.prototype.getWin = function() { + return this.contentWindow; +}; + +TinyMCEControl.prototype.getSel = function() { + if (tinyMCE.isMSIE) + return this.getDoc().selection; + + var sel = this.contentWindow.getSelection(); + + // Fake getRangeAt + if (tinyMCE.isSafari && !sel.getRangeAt) { + var newSel = new Object(); + var doc = this.getDoc(); + + function getRangeAt(idx) { + var rng = new Object(); + + rng.startContainer = this.focusNode; + rng.endContainer = this.anchorNode; + rng.commonAncestorContainer = this.focusNode; + rng.createContextualFragment = function (html) { + // Seems to be a tag + if (html.charAt(0) == '<') { + var elm = doc.createElement("div"); + + elm.innerHTML = html; + + return elm.firstChild; + } + + return doc.createTextNode("UNSUPPORTED, DUE TO LIMITATIONS IN SAFARI!"); + }; + + rng.deleteContents = function () { + doc.execCommand("Delete", false, ""); + }; + + return rng; + } + + // Patch selection + + newSel.focusNode = sel.baseNode; + newSel.focusOffset = sel.baseOffset; + newSel.anchorNode = sel.extentNode; + newSel.anchorOffset = sel.extentOffset; + newSel.getRangeAt = getRangeAt; + newSel.text = "" + sel; + newSel.realSelection = sel; + + newSel.toString = function () {return this.text;}; + + return newSel; + } + + return sel; +}; + +TinyMCEControl.prototype.getRng = function() { + var sel = this.getSel(); + if (sel == null) + return null; + + if (tinyMCE.isMSIE) + return sel.createRange(); + + if (tinyMCE.isSafari) { + var rng = this.getDoc().createRange(); + var sel = this.getSel().realSelection; + + rng.setStart(sel.baseNode, sel.baseOffset); + rng.setEnd(sel.extentNode, sel.extentOffset); + + return rng; + } + + return this.getSel().getRangeAt(0); +}; + +TinyMCEControl.prototype._insertPara = function(e) { + function isEmpty(para) { + function isEmptyHTML(html) { + return html.replace(new RegExp('[ \t\r\n]+', 'g'), '').toLowerCase() == ""; + } + + // Check for images + if (para.getElementsByTagName("img").length > 0) + return false; + + // Check for tables + if (para.getElementsByTagName("table").length > 0) + return false; + + // Check for HRs + if (para.getElementsByTagName("hr").length > 0) + return false; + + // Check all textnodes + var nodes = tinyMCE.getNodeTree(para, new Array(), 3); + for (var i=0; i <" + blockName + "> "; + paraAfter = body.childNodes[1]; + } + + this.selectNode(paraAfter, true, true); + + return true; + } + + // Place first part within new paragraph + if (startChop.nodeName == blockName) + rngBefore.setStart(startChop, 0); + else + rngBefore.setStartBefore(startChop); + rngBefore.setEnd(startNode, startOffset); + paraBefore.appendChild(rngBefore.cloneContents()); + + // Place secound part within new paragraph + rngAfter.setEndAfter(endChop); + rngAfter.setStart(endNode, endOffset); + var contents = rngAfter.cloneContents(); + if (contents.firstChild && contents.firstChild.nodeName == blockName) { + var nodes = contents.firstChild.childNodes; + for (var i=0; i 0) + rng.pasteHTML('
    ' + rng.htmlText + "
    "); + + tinyMCE.triggerNodeChange(); + return; + } + } + } + + switch (command) { + case "mceStoreSelection": + this.selectionBookmark = this.getBookmark(); + break; + + case "mceRestoreSelection": + this.moveToBookmark(this.selectionBookmark); + break; + + case "InsertUnorderedList": + case "InsertOrderedList": + var tag = (command == "InsertUnorderedList") ? "ul" : "ol"; + + if (tinyMCE.isSafari) + this.execCommand("mceInsertContent", false, "<" + tag + ">
  •  
  • <" + tag + ">"); + else + this.getDoc().execCommand(command, user_interface, value); + + tinyMCE.triggerNodeChange(); + break; + + case "Strikethrough": + if (tinyMCE.isSafari) + this.execCommand("mceInsertContent", false, "" + this.getSelectedHTML() + ""); + else + this.getDoc().execCommand(command, user_interface, value); + + tinyMCE.triggerNodeChange(); + break; + + case "mceSelectNode": + this.selectNode(value); + tinyMCE.triggerNodeChange(); + tinyMCE.selectedNode = value; + break; + + case "FormatBlock": + if (value == null || value == "") { + var elm = tinyMCE.getParentElement(this.getFocusElement(), "p,div,h1,h2,h3,h4,h5,h6,pre,address"); + + if (elm) + this.execCommand("mceRemoveNode", false, elm); + } else + this.getDoc().execCommand("FormatBlock", false, value); + + tinyMCE.triggerNodeChange(); + + break; + + case "mceRemoveNode": + if (!value) + value = tinyMCE.getParentElement(this.getFocusElement()); + + if (tinyMCE.isMSIE) { + value.outerHTML = value.innerHTML; + } else { + var rng = value.ownerDocument.createRange(); + rng.setStartBefore(value); + rng.setEndAfter(value); + rng.deleteContents(); + rng.insertNode(rng.createContextualFragment(value.innerHTML)); + } + + tinyMCE.triggerNodeChange(); + + break; + + case "mceSelectNodeDepth": + var parentNode = this.getFocusElement(); + for (var i=0; parentNode; i++) { + if (parentNode.nodeName.toLowerCase() == "body") + break; + + if (parentNode.nodeName.toLowerCase() == "#text") { + i--; + parentNode = parentNode.parentNode; + continue; + } + + if (i == value) { + this.selectNode(parentNode, false); + tinyMCE.triggerNodeChange(); + tinyMCE.selectedNode = parentNode; + return; + } + + parentNode = parentNode.parentNode; + } + + break; + + case "HiliteColor": + if (tinyMCE.isGecko) { + this.getDoc().execCommand("useCSS", false, false); + this.getDoc().execCommand('hilitecolor', false, value); + this.getDoc().execCommand("useCSS", false, true); + } else + this.getDoc().execCommand('BackColor', false, value); + + break; + + case "Cut": + case "Copy": + case "Paste": + var cmdFailed = false; + + // Try executing command + eval('try {this.getDoc().execCommand(command, user_interface, value);} catch (e) {cmdFailed = true;}'); + + // Alert error in gecko if command failed + if (tinyMCE.isGecko && cmdFailed) { + // Confirm more info + if (confirm(tinyMCE.getLang('lang_clipboard_msg'))) + window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', 'mceExternal'); + + return; + } else + tinyMCE.triggerNodeChange(); + break; + + case "mceSetContent": + if (!value) + value = ""; + + // Call custom cleanup code + value = tinyMCE._customCleanup("insert_to_editor", value); + tinyMCE._setHTML(doc, value); + doc.body.innerHTML = tinyMCE._cleanupHTML(doc, tinyMCE.settings, doc.body); + tinyMCE.handleVisualAid(doc.body, true, this.visualAid); + return true; + + case "mceLink": + var selectedText = ""; + + if (tinyMCE.isMSIE) { + var rng = doc.selection.createRange(); + selectedText = rng.text; + } else + selectedText = this.getSel().toString(); + + if (!tinyMCE.linkElement) { + if ((tinyMCE.selectedElement.nodeName.toLowerCase() != "img") && (selectedText.length <= 0)) + return; + } + + var href = "", target = "", title = "", onclick = "", action = "insert", style_class = ""; + + if (tinyMCE.selectedElement.nodeName.toLowerCase() == "a") + tinyMCE.linkElement = tinyMCE.selectedElement; + + // Is anchor not a link + if (tinyMCE.linkElement != null && tinyMCE.getAttrib(tinyMCE.linkElement, 'href') == "") + tinyMCE.linkElement = null; + + if (tinyMCE.linkElement) { + href = tinyMCE.getAttrib(tinyMCE.linkElement, 'href'); + target = tinyMCE.getAttrib(tinyMCE.linkElement, 'target'); + title = tinyMCE.getAttrib(tinyMCE.linkElement, 'title'); + onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'mce_onclick'); + style_class = tinyMCE.getAttrib(tinyMCE.linkElement, 'class'); + + // Try old onclick to if copy/pasted content + if (onclick == "") + onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick'); + + onclick = tinyMCE.cleanupEventStr(onclick); + + // Fix for drag-drop/copy paste bug in Mozilla + mceRealHref = tinyMCE.getAttrib(tinyMCE.linkElement, 'mce_real_href'); + if (mceRealHref != "") + href = mceRealHref; + + href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);"); + action = "update"; + } + + if (this.settings['insertlink_callback']) { + var returnVal = eval(this.settings['insertlink_callback'] + "(href, target, title, onclick, action, style_class);"); + if (returnVal && returnVal['href']) + tinyMCE.insertLink(returnVal['href'], returnVal['target'], returnVal['title'], returnVal['onclick'], returnVal['style_class']); + } else { + tinyMCE.openWindow(this.insertLinkTemplate, {href : href, target : target, title : title, onclick : onclick, action : action, className : style_class}); + } + break; + + case "mceImage": + var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = ""; + var title = "", onmouseover = "", onmouseout = "", action = "insert"; + var img = tinyMCE.imgElement; + + if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") { + img = tinyMCE.selectedElement; + tinyMCE.imgElement = img; + } + + if (img) { + // Is it a internal MCE visual aid image, then skip this one. + if (tinyMCE.getAttrib(img, 'name').indexOf('mce_') == 0) + return; + + src = tinyMCE.getAttrib(img, 'src'); + alt = tinyMCE.getAttrib(img, 'alt'); + + // Try polling out the title + if (alt == "") + alt = tinyMCE.getAttrib(img, 'title'); + + // Fix width/height attributes if the styles is specified + if (tinyMCE.isGecko) { + var w = img.style.width; + if (w != null && w != "") + img.setAttribute("width", w); + + var h = img.style.height; + if (h != null && h != "") + img.setAttribute("height", h); + } + + border = tinyMCE.getAttrib(img, 'border'); + hspace = tinyMCE.getAttrib(img, 'hspace'); + vspace = tinyMCE.getAttrib(img, 'vspace'); + width = tinyMCE.getAttrib(img, 'width'); + height = tinyMCE.getAttrib(img, 'height'); + align = tinyMCE.getAttrib(img, 'align'); + onmouseover = tinyMCE.getAttrib(img, 'onmouseover'); + onmouseout = tinyMCE.getAttrib(img, 'onmouseout'); + title = tinyMCE.getAttrib(img, 'title'); + + // Is realy specified? + if (tinyMCE.isMSIE) { + width = img.attributes['width'].specified ? width : ""; + height = img.attributes['height'].specified ? height : ""; + } + + onmouseover = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseover)); + onmouseout = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseout)); + + // Fix for drag-drop/copy paste bug in Mozilla + mceRealSrc = tinyMCE.getAttrib(img, 'mce_real_src'); + if (mceRealSrc != "") + src = mceRealSrc; + + src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);"); + + if (onmouseover != "") + onmouseover = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, img, true);"); + + if (onmouseout != "") + onmouseout = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, img, true);"); + + action = "update"; + } + + if (this.settings['insertimage_callback']) { + var returnVal = eval(this.settings['insertimage_callback'] + "(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);"); + if (returnVal && returnVal['src']) + tinyMCE.insertImage(returnVal['src'], returnVal['alt'], returnVal['border'], returnVal['hspace'], returnVal['vspace'], returnVal['width'], returnVal['height'], returnVal['align'], returnVal['title'], returnVal['onmouseover'], returnVal['onmouseout']); + } else + tinyMCE.openWindow(this.insertImageTemplate, {src : src, alt : alt, border : border, hspace : hspace, vspace : vspace, width : width, height : height, align : align, title : title, onmouseover : onmouseover, onmouseout : onmouseout, action : action}); + break; + + case "mceCleanupWord": + if (tinyMCE.isMSIE) { + var html = this.getBody().createTextRange().htmlText; + + if (html.indexOf('="mso') != -1) { + tinyMCE._setHTML(this.contentDocument, this.getBody().innerHTML); + html = tinyMCE._cleanupHTML(this.contentDocument, this.settings, this.getBody(), this.visualAid); + } + + this.getBody().innerHTML = html; + } + break; + + case "mceCleanup": + tinyMCE._setHTML(this.contentDocument, this.getBody().innerHTML); + this.getBody().innerHTML = tinyMCE._cleanupHTML(this.contentDocument, this.settings, this.getBody(), this.visualAid); + tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid); + this.repaint(); + tinyMCE.triggerNodeChange(); + break; + + case "mceAnchor": + if (!user_interface) { + var aElm = tinyMCE.getParentElement(this.getFocusElement(), "a", "name"); + if (aElm) { + if (value == null || value == "") { + if (tinyMCE.isMSIE) { + aElm.outerHTML = aElm.innerHTML; + } else { + var rng = aElm.ownerDocument.createRange(); + rng.setStartBefore(aElm); + rng.setEndAfter(aElm); + rng.deleteContents(); + rng.insertNode(rng.createContextualFragment(aElm.innerHTML)); + } + } else + aElm.setAttribute('name', value); + } else { + this.getDoc().execCommand("fontname", false, "#mce_temp_font#"); + var elementArray = tinyMCE.getElementsByAttributeValue(this.getBody(), "font", "face", "#mce_temp_font#"); + for (var x=0; x 0) { + 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 rng = doc.selection.createRange(); + selectedText = (rng.text && rng.text.length > 0); + } else + selectedText = (this.getSel().toString().length > 0); + + // Use selectedNode instead if defined + if (tinyMCE.selectedNode) + tinyMCE.selectedElement = tinyMCE.selectedNode; + + if (selectedText && !tinyMCE.selectedNode) { + this.getDoc().execCommand("RemoveFormat", false, null); + if (value == null) + return this.execCommand("RemoveFormat", false, null); + + this.getDoc().execCommand("fontname", false, "#mce_temp_font#"); + var elementArray = tinyMCE.getElementsByAttributeValue(this.getBody(), "font", "face", "#mce_temp_font#"); + + // Change them all + for (var x=0; x customUndoLevels) { + for (var i=0; i 0) { + this.undoIndex--; + this.getBody().innerHTML = this.undoLevels[this.undoIndex]; + } + + // debug("Undo - undo levels:" + this.undoLevels.length + ", undo index: " + this.undoIndex); + tinyMCE.triggerNodeChange(); + } else + this.getDoc().execCommand(command, user_interface, value); + break; + + case "Redo": + if (tinyMCE.settings['custom_undo_redo']) { + if (this.undoIndex < (this.undoLevels.length-1)) { + this.undoIndex++; + this.getBody().innerHTML = this.undoLevels[this.undoIndex]; + // debug("Redo - undo levels:" + this.undoLevels.length + ", undo index: " + this.undoIndex); + } + + tinyMCE.triggerNodeChange(); + } else + this.getDoc().execCommand(command, user_interface, value); + break; + + case "mceToggleVisualAid": + this.visualAid = !this.visualAid; + tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid); + tinyMCE.triggerNodeChange(); + break; + + case "removeformat": + var text = this.getSelectedText(); + + if (tinyMCE.isMSIE) { + try { + win.focus(); + var rng = doc.selection.createRange(); + rng.execCommand("RemoveFormat", false, null); + rng.pasteHTML(rng.text); + } catch (e) { + // Do nothing + } + } else + this.getDoc().execCommand(command, user_interface, value); + + // Remove class + if (text.length == 0) + this.execCommand("mceSetCSSClass", false, ""); + + tinyMCE.triggerNodeChange(); + break; + + default: + this.getDoc().execCommand(command, user_interface, value); + tinyMCE.triggerNodeChange(); + } +}; + +TinyMCEControl.prototype.queryCommandValue = function(command) { + return this.getDoc().queryCommandValue(command); +}; + +TinyMCEControl.prototype.queryCommandState = function(command) { + return this.getDoc().queryCommandState(command); +}; + +TinyMCEControl.prototype.onAdd = function(replace_element, form_element_name, target_document) { + var targetDoc = target_document ? target_document : document; + + this.targetDoc = targetDoc; + + 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('_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', true); + 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']; + + // Set default width, height + if (this.settings['width'] == -1) + this.settings['width'] = replace_element.offsetWidth; + + if (this.settings['height'] == -1) + this.settings['height'] = replace_element.offsetHeight; + + // Try the style width + if (this.settings['width'] == 0) + this.settings['width'] = replace_element.style.width; + + // Try the style height + if (this.settings['height'] == 0) + this.settings['height'] = replace_element.style.height; + + // If no width/height then default to 320x240, better than nothing + if (this.settings['width'] == 0) + this.settings['width'] = 320; + + if (this.settings['height'] == 0) + this.settings['height'] = 240; + + this.settings['area_width'] = parseInt(this.settings['width']); + this.settings['area_height'] = parseInt(this.settings['height']); + this.settings['area_width'] += deltaWidth; + this.settings['area_height'] += deltaHeight; + + // Special % handling + 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.formTargetElementId = form_element_name; + + // Get replace_element contents + if (replace_element.nodeName.toLowerCase() == "textarea") + this.startContent = replace_element.value; + else + this.startContent = replace_element.innerHTML; + + // If not text area + if (replace_element.nodeName.toLowerCase() != "textarea") { + this.oldTargetElement = replace_element.cloneNode(true); + + // Debug mode + if (tinyMCE.settings['debug']) + html += ''; + else + html += ''; + + html += ''; + + // Output HTML and set editable + 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; + } else { + html += ''; + + // Just hide the textarea element + this.oldTargetElement = replace_element; + + if (!tinyMCE.settings['debug']) + this.oldTargetElement.style.display = "none"; + + // Output HTML and set editable + if (!tinyMCE.isMSIE) { + var rng = replace_element.ownerDocument.createRange(); + rng.setStartBefore(replace_element); + + var fragment = rng.createContextualFragment(html); + replace_element.parentNode.insertBefore(fragment, replace_element); + } else + replace_element.insertAdjacentHTML("beforeBegin", html); + } + + // Setup iframe + var dynamicIFrame = false; + var tElm = targetDoc.getElementById(this.editorId); + + if (!tinyMCE.isMSIE) { + if (tElm && tElm.nodeName.toLowerCase() == "span") { + tElm = tinyMCE._createIFrame(tElm); + dynamicIFrame = true; + } + + this.targetElement = tElm; + this.iframeElement = tElm; + this.contentDocument = tElm.contentDocument; + this.contentWindow = tElm.contentWindow; + + //this.getDoc().designMode = "on"; + } else { + if (tElm && tElm.nodeName.toLowerCase() == "span") + tElm = tinyMCE._createIFrame(tElm); + else + tElm = targetDoc.frames[this.editorId]; + + this.targetElement = tElm; + this.iframeElement = targetDoc.getElementById(this.editorId); + this.contentDocument = tElm.window.document; + this.contentWindow = tElm.window; + this.getDoc().designMode = "on"; + } + + // Setup base HTML + var doc = this.contentDocument; + if (dynamicIFrame) { + var html = "" + + '' + + '' + + '' + + '' + + 'blank_page' + + '' + + '' + + '' + + '' + + ''; + + try { + this.getDoc().designMode = "on"; + doc.open(); + doc.write(html); + doc.close(); + } catch (e) { + // Failed Mozilla 1.3 + this.getDoc().location.href = tinyMCE.baseURL + "/blank.htm"; + } + } + + // 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.prototype.addEventHandlers('" + this.editorId + "');", 1); + + tinyMCE.setupContent(this.editorId, true); + + return true; +}; + +TinyMCEControl.prototype.getFocusElement = function() { + if (tinyMCE.isMSIE) { + var doc = this.getDoc(); + var rng = doc.selection.createRange(); + + if (rng.collapse) + rng.collapse(true); + + var elm = rng.item ? rng.item(0) : rng.parentElement(); + } else { + var sel = this.getSel(); + var elm = (sel && sel.anchorNode) ? sel.anchorNode : null; + + if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") + elm = tinyMCE.selectedElement; + } + + return elm; +}; + +// Global instances +var tinyMCE = new TinyMCE(); +var tinyMCELang = new Array(); + +function debug() { + var msg = ""; + + var elm = document.getElementById("tinymce_debug"); + if (!elm) { + var debugDiv = document.createElement("div"); + debugDiv.setAttribute("className", "debugger"); + debugDiv.className = "debugger"; + debugDiv.innerHTML = '\ + Debug output:\ + '; + + document.body.appendChild(debugDiv); + elm = document.getElementById("tinymce_debug"); + } + + var args = this.debug.arguments; + for (var i=0; i