'))!=-1){tinyMCE.execCommand("Delete");var node=tinyMCE.selectedInstance.getFocusElement();var breakElms=new Array();do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY")break;breakElms[breakElms.length]=node;}}while(node=node.parentNode);var before="",after="
";before+=content.substring(0,pos);for(var i=0;i";after+="<"+breakElms[(breakElms.length-1)-i].nodeName+">";}before+="";content=before+content.substring(pos+7)+after;}}if(tinyMCE.getParam("paste_create_linebreaks",true)){content=tinyMCE.regexpReplace(content,"\r\n"," ","gi");content=tinyMCE.regexpReplace(content,"\r"," ","gi");content=tinyMCE.regexpReplace(content,"\n"," ","gi");}}tinyMCE.execCommand("mceInsertRawHTML",false,content);}}function TinyMCE_paste__insertWordContent(content){if(content&&content.length>0){var bull=String.fromCharCode(8226);var middot=String.fromCharCode(183);var rl=tinyMCE.getParam("paste_replace_list",'\u2122,TM ,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i(.*?)<\/p>','gi'),'$1
');}content=content.replace(new RegExp('tab-stops: list [0-9]+.0pt">','gi'),'">'+"--list--");content=content.replace(new RegExp(bull+"(.*?) ","gi"),""+middot+"$1
");content=content.replace(new RegExp('','gi'),""+bull);content=content.replace(/<\/o:p>/gi,"");content=content.replace(new RegExp(' ]*>/gi,"");content=content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)','gi'),"<$1$3");content=content.replace(/<\/?font[^>]*>/gi,"");switch(tinyMCE.getParam("paste_strip_class_attributes","all")){case "all":content=content.replace(/<(\w[^>]*)class=([^|>]*)([^>]*)/gi,"<$1$3");break;case "mso":content=content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)','gi'),"<$1$3");break;}content=content.replace(new RegExp('href="?'+TinyMCE_paste__reEscape(""+document.location)+'','gi'),'href="'+tinyMCE.settings['document_base_url']);content=content.replace(/<(\w[^>]*)lang=([^|>]*)([^>]*)/gi,"<$1$3");content=content.replace(/<\\?\?xml[^>]*>/gi,"");content=content.replace(/<\/?\w+:[^>]*>/gi,"");content=content.replace(/--page break--\s* <\/p>/gi,"");content=content.replace(/--page break--/gi,"");if(!tinyMCE.settings['force_p_newlines']){content=content.replace('','','gi');content=content.replace('
',' ','gi');}if(!tinyMCE.isMSIE&&!tinyMCE.settings['force_p_newlines']){content=content.replace(/<\/?p[^>]*>/gi,"");}content=content.replace(/<\/?div[^>]*>/gi,"");if(tinyMCE.getParam("paste_convert_middot_lists",true)){var div=document.createElement("div");div.innerHTML=content;var className=tinyMCE.getParam("paste_unindented_list_class","unIndentedList");while(TinyMCE_paste_convertMiddots(div,"--list--"));while(TinyMCE_paste_convertMiddots(div,middot,className));while(TinyMCE_paste_convertMiddots(div,bull));content=div.innerHTML;}if(tinyMCE.getParam("paste_convert_headers_to_strong",false)){content=content.replace(/ <\/h[1-6]>/gi,'
');content=content.replace(//gi,'');content=content.replace(/<\/h[1-6]>/gi,'
');content=content.replace(/ <\/b>/gi,' ');content=content.replace(/^( )*/gi,'');}content=content.replace(/--list--/gi,"");tinyMCE.execCommand("mceInsertContent",false,content);tinyMCE.execCommand("mceCleanup");}}function TinyMCE_paste__reEscape(s){var l="?.\\*[](){}+^$:";var o="";for(var i=0;i0)TinyMCE_PastePlugin._insertWordContent(html);}else{var template=new Array();template['file']='../../plugins/paste/pasteword.htm';template['width']=450;template['height']=400;var plain_text="";tinyMCE.openWindow(template,{editor_id:editor_id,plain_text:plain_text,resizable:"yes",scrollbars:"no",inline:"yes",mceDo:'insert'});}}else TinyMCE_PastePlugin._insertWordContent(value);return true;case"mceSelectAll":tinyMCE.execInstanceCommand(editor_id,'selectall');return true;}return false;},_handlePasteEvent:function(e){switch(e.type){case"paste":var html=TinyMCE_PastePlugin._clipboardHTML();var r,inst=tinyMCE.selectedInstance;if(inst&&(r=inst.getRng())&&r.text.length>0)tinyMCE.execCommand('delete');if(html&&html.length>0)tinyMCE.execCommand('mcePasteWord',false,html);tinyMCE.cancelEvent(e);return false;}return true;},_insertText:function(content,bLinebreaks){if(content&&content.length>0){if(bLinebreaks){if(tinyMCE.getParam("paste_create_paragraphs",true)){var rl=tinyMCE.getParam("paste_replace_list",'\u2122,TM ,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i","gi");content=tinyMCE.regexpReplace(content,"\r\r","
","gi");content=tinyMCE.regexpReplace(content,"\n\n","
","gi");if((pos=content.indexOf('
'))!=-1){tinyMCE.execCommand("Delete");var node=tinyMCE.selectedInstance.getFocusElement();var breakElms=new Array();do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY")break;breakElms[breakElms.length]=node;}}while(node=node.parentNode);var before="",after="
";before+=content.substring(0,pos);for(var i=0;i";after+="<"+breakElms[(breakElms.length-1)-i].nodeName+">";}before+="";content=before+content.substring(pos+7)+after;}}if(tinyMCE.getParam("paste_create_linebreaks",true)){content=tinyMCE.regexpReplace(content,"\r\n"," ","gi");content=tinyMCE.regexpReplace(content,"\r"," ","gi");content=tinyMCE.regexpReplace(content,"\n"," ","gi");}}tinyMCE.execCommand("mceInsertRawHTML",false,content);}},_insertWordContent:function(content){if(content&&content.length>0){var bull=String.fromCharCode(8226);var middot=String.fromCharCode(183);var cb;if((cb=tinyMCE.getParam("paste_insert_word_content_callback",""))!="")content=eval(cb+"('before', content)");var rl=tinyMCE.getParam("paste_replace_list",'\u2122,TM ,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i(.*?)<\/p>','gi'),'$1
');}content=content.replace(new RegExp('tab-stops: list [0-9]+.0pt">','gi'),'">'+"--list--");content=content.replace(new RegExp(bull+"(.*?) ","gi"),""+middot+"$1
");content=content.replace(new RegExp('','gi'),""+bull);content=content.replace(/<\/o:p>/gi,"");content=content.replace(new RegExp(' ]*>/gi,"");if(tinyMCE.getParam("paste_remove_styles",true))content=content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)','gi'),"<$1$3");content=content.replace(/<\/?font[^>]*>/gi,"");switch(tinyMCE.getParam("paste_strip_class_attributes","all")){case"all":content=content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");break;case"mso":content=content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)','gi'),"<$1$3");break;}content=content.replace(new RegExp('href="?'+TinyMCE_PastePlugin._reEscape(""+document.location)+'','gi'),'href="'+tinyMCE.settings['document_base_url']);content=content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");content=content.replace(/<\\?\?xml[^>]*>/gi,"");content=content.replace(/<\/?\w+:[^>]*>/gi,"");content=content.replace(/-- page break --\s* <\/p>/gi,"");content=content.replace(/-- page break --/gi,"");if(!tinyMCE.settings['force_p_newlines']){content=content.replace('','','gi');content=content.replace('
',' ','gi');}if(!tinyMCE.isMSIE&&!tinyMCE.settings['force_p_newlines']){content=content.replace(/<\/?p[^>]*>/gi,"");}content=content.replace(/<\/?div[^>]*>/gi,"");if(tinyMCE.getParam("paste_convert_middot_lists",true)){var div=document.createElement("div");div.innerHTML=content;var className=tinyMCE.getParam("paste_unindented_list_class","unIndentedList");while(TinyMCE_PastePlugin._convertMiddots(div,"--list--"));while(TinyMCE_PastePlugin._convertMiddots(div,middot,className));while(TinyMCE_PastePlugin._convertMiddots(div,bull));content=div.innerHTML;}if(tinyMCE.getParam("paste_convert_headers_to_strong",false)){content=content.replace(/ <\/h[1-6]>/gi,'
');content=content.replace(//gi,'');content=content.replace(/<\/h[1-6]>/gi,'
');content=content.replace(/ <\/b>/gi,' ');content=content.replace(/^( )*/gi,'');}content=content.replace(/--list--/gi,"");if((cb=tinyMCE.getParam("paste_insert_word_content_callback",""))!="")content=eval(cb+"('after', content)");tinyMCE.execCommand("mceInsertContent",false,content);window.setTimeout('tinyMCE.execCommand("mceCleanup");',1);}},_reEscape:function(s){var l="?.\\*[](){}+^$:";var o="";for(var i=0;i 0)
- tinyMCE.execCommand('mcePasteWord', false, html);
+ return '';
+ },
- tinyMCE.cancelEvent(e);
- return false;
- }
+ execCommand : function(editor_id, element, command, user_interface, value) {
+ switch (command) {
+ case "mcePasteText":
+ if (user_interface) {
+ if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && !tinyMCE.getParam('paste_use_dialog', false))
+ TinyMCE_PastePlugin._insertText(clipboardData.getData("Text"), true);
+ else {
+ var template = new Array();
+ template['file'] = '../../plugins/paste/pastetext.htm'; // Relative to theme
+ template['width'] = 450;
+ template['height'] = 400;
+ var plain_text = "";
+ tinyMCE.openWindow(template, {editor_id : editor_id, plain_text: plain_text, resizable : "yes", scrollbars : "no", inline : "yes", mceDo : 'insert'});
+ }
+ } else
+ TinyMCE_PastePlugin._insertText(value['html'], value['linebreaks']);
+
+ return true;
+
+ case "mcePasteWord":
+ if (user_interface) {
+ if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && !tinyMCE.getParam('paste_use_dialog', false)) {
+ var html = TinyMCE_PastePlugin._clipboardHTML();
+
+ if (html && html.length > 0)
+ TinyMCE_PastePlugin._insertWordContent(html);
+ } else {
+ var template = new Array();
+ template['file'] = '../../plugins/paste/pasteword.htm'; // Relative to theme
+ template['width'] = 450;
+ template['height'] = 400;
+ var plain_text = "";
+ tinyMCE.openWindow(template, {editor_id : editor_id, plain_text: plain_text, resizable : "yes", scrollbars : "no", inline : "yes", mceDo : 'insert'});
+ }
+ } else
+ TinyMCE_PastePlugin._insertWordContent(value);
+
+ return true;
+
+ case "mceSelectAll":
+ tinyMCE.execInstanceCommand(editor_id, 'selectall');
+ return true;
- return true;
-}
+ }
-function TinyMCE_paste_getControlHTML(control_name) {
- switch (control_name) {
- case "pastetext":
- var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcePasteText\', true);return false;';
- return ' ';
-
- case "pasteword":
- var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcePasteWord\', true);return false;';
- return ' ';
-
- case "selectall":
- var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSelectAll\');return false;';
- return ' ';
- }
-
- return '';
-}
-
-function TinyMCE_paste_execCommand(editor_id, element, command, user_interface, value) {
- switch (command) {
- case "mcePasteText":
- if (user_interface) {
- if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && !tinyMCE.getParam('paste_use_dialog', false))
- TinyMCE_paste__insertText(clipboardData.getData("Text"), true);
- else {
- var template = new Array();
- template['file'] = '../../plugins/paste/pastetext.htm'; // Relative to theme
- template['width'] = 450;
- template['height'] = 400;
- var plain_text = "";
- tinyMCE.openWindow(template, {editor_id : editor_id, plain_text: plain_text, resizable : "yes", scrollbars : "no", inline : "yes", mceDo : 'insert'});
- }
- } else
- TinyMCE_paste__insertText(value['html'], value['linebreaks']);
+ // Pass to next handler in chain
+ return false;
+ },
+
+ // Private plugin internal methods
+
+ _handlePasteEvent : function(e) {
+ switch (e.type) {
+ case "paste":
+ var html = TinyMCE_PastePlugin._clipboardHTML();
+ var r, inst = tinyMCE.selectedInstance;
+
+ // Removes italic, strong etc, the if was needed due to bug #1437114
+ if (inst && (r = inst.getRng()) && r.text.length > 0)
+ tinyMCE.execCommand('delete');
- return true;
+ if (html && html.length > 0)
+ tinyMCE.execCommand('mcePasteWord', false, html);
- case "mcePasteWord":
- if (user_interface) {
- if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && !tinyMCE.getParam('paste_use_dialog', false)) {
- var html = TinyMCE_paste__clipboardHTML();
-
- if (html && html.length > 0)
- TinyMCE_paste__insertWordContent(html);
- } else {
- var template = new Array();
- template['file'] = '../../plugins/paste/pasteword.htm'; // Relative to theme
- template['width'] = 450;
- template['height'] = 400;
- var plain_text = "";
- tinyMCE.openWindow(template, {editor_id : editor_id, plain_text: plain_text, resizable : "yes", scrollbars : "no", inline : "yes", mceDo : 'insert'});
- }
- } else
- TinyMCE_paste__insertWordContent(value);
+ tinyMCE.cancelEvent(e);
+ return false;
+ }
- return true;
+ return true;
+ },
- case "mceSelectAll":
- tinyMCE.execInstanceCommand(editor_id, 'selectall');
- return true;
-
- }
-
- // Pass to next handler in chain
- return false;
-}
-
-function TinyMCE_paste__insertText(content, bLinebreaks) {
- if (content && content.length > 0) {
- if (bLinebreaks) {
- // Special paragraph treatment
- if (tinyMCE.getParam("paste_create_paragraphs", true)) {
- var rl = tinyMCE.getParam("paste_replace_list", '\u2122,TM ,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');
- for (var i=0; i", "gi");
- content = tinyMCE.regexpReplace(content, "\r\r", "
", "gi");
- content = tinyMCE.regexpReplace(content, "\n\n", "
", "gi");
-
- // Has paragraphs
- if ((pos = content.indexOf('
')) != -1) {
- tinyMCE.execCommand("Delete");
-
- var node = tinyMCE.selectedInstance.getFocusElement();
-
- // Get list of elements to break
- var breakElms = new Array();
-
- do {
- if (node.nodeType == 1) {
- // Don't break tables and break at body
- if (node.nodeName == "TD" || node.nodeName == "BODY")
- break;
-
- breakElms[breakElms.length] = node;
+ _insertText : function(content, bLinebreaks) {
+ if (content && content.length > 0) {
+ if (bLinebreaks) {
+ // Special paragraph treatment
+ if (tinyMCE.getParam("paste_create_paragraphs", true)) {
+ var rl = tinyMCE.getParam("paste_replace_list", '\u2122,TM ,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');
+ for (var i=0; i", "gi");
+ content = tinyMCE.regexpReplace(content, "\r\r", "
", "gi");
+ content = tinyMCE.regexpReplace(content, "\n\n", "
", "gi");
+
+ // Has paragraphs
+ if ((pos = content.indexOf('
')) != -1) {
+ tinyMCE.execCommand("Delete");
+
+ var node = tinyMCE.selectedInstance.getFocusElement();
+
+ // Get list of elements to break
+ var breakElms = new Array();
+
+ do {
+ if (node.nodeType == 1) {
+ // Don't break tables and break at body
+ if (node.nodeName == "TD" || node.nodeName == "BODY")
+ break;
+
+ breakElms[breakElms.length] = node;
+ }
+ } while(node = node.parentNode);
+
+ var before = "", after = "
";
+ before += content.substring(0, pos);
+
+ for (var i=0; i";
+ after += "<" + breakElms[(breakElms.length-1)-i].nodeName + ">";
}
- } while(node = node.parentNode);
-
- var before = "", after = "
";
- before += content.substring(0, pos);
- for (var i=0; i";
- after += "<" + breakElms[(breakElms.length-1)-i].nodeName + ">";
+ before += "";
+ content = before + content.substring(pos+7) + after;
}
-
- before += "
";
- content = before + content.substring(pos+7) + after;
}
+
+ if (tinyMCE.getParam("paste_create_linebreaks", true)) {
+ content = tinyMCE.regexpReplace(content, "\r\n", " ", "gi");
+ content = tinyMCE.regexpReplace(content, "\r", " ", "gi");
+ content = tinyMCE.regexpReplace(content, "\n", " ", "gi");
+ }
}
+
+ tinyMCE.execCommand("mceInsertRawHTML", false, content);
+ }
+ },
+
+ _insertWordContent : function(content) {
+ if (content && content.length > 0) {
+ // Cleanup Word content
+ var bull = String.fromCharCode(8226);
+ var middot = String.fromCharCode(183);
+ var cb;
+
+ if ((cb = tinyMCE.getParam("paste_insert_word_content_callback", "")) != "")
+ content = eval(cb + "('before', content)");
+
+ var rl = tinyMCE.getParam("paste_replace_list", '\u2122,TM ,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');
+ for (var i=0; i ", "gi");
- content = tinyMCE.regexpReplace(content, "\r", " ", "gi");
- content = tinyMCE.regexpReplace(content, "\n", " ", "gi");
+ if (tinyMCE.getParam("paste_convert_headers_to_strong", false)) {
+ content = content.replace(new RegExp('
(.*?)<\/p>', 'gi'), '
$1
');
}
- }
-
- tinyMCE.execCommand("mceInsertRawHTML", false, content);
- }
-}
-function TinyMCE_paste__insertWordContent(content) {
- if (content && content.length > 0) {
- // Cleanup Word content
- var bull = String.fromCharCode(8226);
- var middot = String.fromCharCode(183);
+ content = content.replace(new RegExp('tab-stops: list [0-9]+.0pt">', 'gi'), '">' + "--list--");
+ content = content.replace(new RegExp(bull + "(.*?) ", "gi"), "" + middot + "$1
");
+ content = content.replace(new RegExp('', 'gi'), "" + bull); // Covert to bull list
+ content = content.replace(/<\/o:p>/gi, "");
+ content = content.replace(new RegExp(' ]*>/gi, "");
+
+ if (tinyMCE.getParam("paste_remove_styles", true))
+ content = content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)', 'gi'), "<$1$3");
+
+ content = content.replace(/<\/?font[^>]*>/gi, "");
+
+ // Strips class attributes.
+ switch (tinyMCE.getParam("paste_strip_class_attributes", "all")) {
+ case "all":
+ content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3");
+ break;
- var rl = tinyMCE.getParam("paste_replace_list", '\u2122,TM ,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');
- for (var i=0; i]*) class="?mso([^ |>]*)([^>]*)', 'gi'), "<$1$3");
+ break;
+ }
- if (tinyMCE.getParam("paste_convert_headers_to_strong", false)) {
- content = content.replace(new RegExp('(.*?)<\/p>', 'gi'), '
$1
');
- }
+ content = content.replace(new RegExp('href="?' + TinyMCE_PastePlugin._reEscape("" + document.location) + '', 'gi'), 'href="' + tinyMCE.settings['document_base_url']);
+ content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3");
+ content = content.replace(/<\\?\?xml[^>]*>/gi, "");
+ content = content.replace(/<\/?\w+:[^>]*>/gi, "");
+ content = content.replace(/-- page break --\s* <\/p>/gi, ""); // Remove pagebreaks
+ content = content.replace(/-- page break --/gi, ""); // Remove pagebreaks
+
+ // content = content.replace(/\/? */gi, "");
+ // content = content.replace(/
<\/p>/gi, '');
+
+ if (!tinyMCE.settings['force_p_newlines']) {
+ content = content.replace('', '' ,'gi');
+ content = content.replace('
', ' ' ,'gi');
+ }
- content = content.replace(new RegExp('tab-stops: list [0-9]+.0pt">', 'gi'), '">' + "--list--");
- content = content.replace(new RegExp(bull + "(.*?) ", "gi"), "" + middot + "$1
");
- content = content.replace(new RegExp('', 'gi'), "" + bull); // Covert to bull list
- content = content.replace(/<\/o:p>/gi, "");
- content = content.replace(new RegExp(' ]*>/gi, "");
- content = content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)', 'gi'), "<$1$3");
- content = content.replace(/<\/?font[^>]*>/gi, "");
-
- // Strips class attributes.
- switch (tinyMCE.getParam("paste_strip_class_attributes", "all")) {
- case "all":
- content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3");
- break;
-
- case "mso":
- content = content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)', 'gi'), "<$1$3");
- break;
- }
+ if (!tinyMCE.isMSIE && !tinyMCE.settings['force_p_newlines']) {
+ content = content.replace(/<\/?p[^>]*>/gi, "");
+ }
- content = content.replace(new RegExp('href="?' + TinyMCE_paste__reEscape("" + document.location) + '', 'gi'), 'href="' + tinyMCE.settings['document_base_url']);
- content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3");
- content = content.replace(/<\\?\?xml[^>]*>/gi, "");
- content = content.replace(/<\/?\w+:[^>]*>/gi, "");
- content = content.replace(/-- page break --\s* <\/p>/gi, ""); // Remove pagebreaks
- content = content.replace(/-- page break --/gi, ""); // Remove pagebreaks
-
-// content = content.replace(/\/? */gi, "");
-// content = content.replace(/
<\/p>/gi, '');
-
- if (!tinyMCE.settings['force_p_newlines']) {
- content = content.replace('', '' ,'gi');
- content = content.replace('
', ' ' ,'gi');
- }
+ content = content.replace(/<\/?div[^>]*>/gi, "");
- if (!tinyMCE.isMSIE && !tinyMCE.settings['force_p_newlines']) {
- content = content.replace(/<\/?p[^>]*>/gi, "");
- }
+ // Convert all middlot lists to UL lists
+ if (tinyMCE.getParam("paste_convert_middot_lists", true)) {
+ var div = document.createElement("div");
+ div.innerHTML = content;
- content = content.replace(/<\/?div[^>]*>/gi, "");
+ // Convert all middot paragraphs to li elements
+ var className = tinyMCE.getParam("paste_unindented_list_class", "unIndentedList");
- // Convert all middlot lists to UL lists
- if (tinyMCE.getParam("paste_convert_middot_lists", true)) {
- var div = document.createElement("div");
- div.innerHTML = content;
+ while (TinyMCE_PastePlugin._convertMiddots(div, "--list--")) ; // bull
+ while (TinyMCE_PastePlugin._convertMiddots(div, middot, className)) ; // Middot
+ while (TinyMCE_PastePlugin._convertMiddots(div, bull)) ; // bull
- // Convert all middot paragraphs to li elements
- var className = tinyMCE.getParam("paste_unindented_list_class", "unIndentedList");
+ content = div.innerHTML;
+ }
- while (TinyMCE_paste_convertMiddots(div, "--list--")) ; // bull
- while (TinyMCE_paste_convertMiddots(div, middot, className)) ; // Middot
- while (TinyMCE_paste_convertMiddots(div, bull)) ; // bull
+ // Replace all headers with strong and fix some other issues
+ if (tinyMCE.getParam("paste_convert_headers_to_strong", false)) {
+ content = content.replace(/ <\/h[1-6]>/gi, '
');
+ content = content.replace(//gi, '');
+ content = content.replace(/<\/h[1-6]>/gi, '
');
+ content = content.replace(/ <\/b>/gi, ' ');
+ content = content.replace(/^( )*/gi, '');
+ }
- content = div.innerHTML;
+ content = content.replace(/--list--/gi, ""); // Remove --list--
+
+ if ((cb = tinyMCE.getParam("paste_insert_word_content_callback", "")) != "")
+ content = eval(cb + "('after', content)");
+
+ // Insert cleaned content
+ tinyMCE.execCommand("mceInsertContent", false, content);
+ window.setTimeout('tinyMCE.execCommand("mceCleanup");', 1); // Do normal cleanup detached from this thread
}
+ },
- // Replace all headers with strong and fix some other issues
- if (tinyMCE.getParam("paste_convert_headers_to_strong", false)) {
- content = content.replace(/ <\/h[1-6]>/gi, '
');
- content = content.replace(//gi, '');
- content = content.replace(/<\/h[1-6]>/gi, '
');
- content = content.replace(/ <\/b>/gi, ' ');
- content = content.replace(/^( )*/gi, '');
+ _reEscape : function(s) {
+ var l = "?.\\*[](){}+^$:";
+ var o = "";
+
+ for (var i=0; i ';}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",inline:"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+=tinyMCE.getParam('doctype');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
+tinyMCE.importPluginLanguagePack('preview','en,tr,cs,de,el,fr_ca,it,ko,pt,sv,zh_cn,fa,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_PreviewPlugin={getInfo:function(){return{longname:'Preview',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_preview.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"preview":return tinyMCE.getButtonHTML(cn,'lang_preview_desc','{$pluginurl}/images/preview.gif','mcePreview');}return"";},execCommand:function(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",inline:"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="";var c=tinyMCE.getContent();var pos=c.indexOf('',pos);pos2=c.lastIndexOf('');c=c.substring(pos+1,pos2);}html+=tinyMCE.getParam('doctype');html+='';html+='';html+=''+tinyMCE.getLang('lang_preview_desc')+' ';html+=' ';html+=' ';html+=' ';html+='';html+='';html+=c;html+='';html+='';win.document.write(html);win.document.close();}return true;}return false;}};tinyMCE.addPlugin("preview",TinyMCE_PreviewPlugin);
\ No newline at end of file
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js 2006-06-25 16:54:19.000000000 -0400
@@ -1,72 +1,92 @@
-/* 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,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk');
-
-function TinyMCE_preview_getInfo() {
- return {
- longname : 'Preview',
- author : 'Moxiecode Systems',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_preview.html',
- version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
- };
-};
-
/**
- * Returns the HTML contents of the preview control.
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.23 $
+ * $Date: 2006/03/20 12:03:44 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
-function TinyMCE_preview_getControlHTML(control_name) {
- switch (control_name) {
- case "preview":
- var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcePreview\');return false;';
- return ' ';
- }
- return "";
-}
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('preview', 'en,tr,cs,de,el,fr_ca,it,ko,pt,sv,zh_cn,fa,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk');
-/**
- * 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", inline : "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 += tinyMCE.getParam('doctype');
- 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();
- }
+var TinyMCE_PreviewPlugin = {
+ getInfo : function() {
+ return {
+ longname : 'Preview',
+ author : 'Moxiecode Systems',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_preview.html',
+ version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+ };
+ },
+
+ /**
+ * Returns the HTML contents of the preview control.
+ */
+ getControlHTML : function(cn) {
+ switch (cn) {
+ case "preview":
+ return tinyMCE.getButtonHTML(cn, 'lang_preview_desc', '{$pluginurl}/images/preview.gif', 'mcePreview');
+ }
+
+ return "";
+ },
+
+ /**
+ * Executes the mcePreview command.
+ */
+ execCommand : function(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", inline : "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 = "";
+ var c = tinyMCE.getContent();
+ var pos = c.indexOf('', pos);
+ pos2 = c.lastIndexOf('');
+ c = c.substring(pos + 1, pos2);
+ }
+
+ html += tinyMCE.getParam('doctype');
+ html += '';
+ html += '';
+ html += '' + tinyMCE.getLang('lang_preview_desc') + ' ';
+ html += ' ';
+ html += ' ';
+ html += ' ';
+ html += '';
+ html += '';
+ html += c;
+ html += '';
+ html += '';
+
+ win.document.write(html);
+ win.document.close();
+ }
- return true;
+ return true;
+ }
+
+ return false;
}
+};
- return false;
-}
+tinyMCE.addPlugin("preview", TinyMCE_PreviewPlugin);
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js 2006-06-25 16:54:23.000000000 -0400
@@ -1 +1 @@
-tinyMCE.importPluginLanguagePack('print','en,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,es,cy,is,zh_tw,zh_tw_utf8,sk');function TinyMCE_print_getInfo(){return{longname:'Print',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_print.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_print_getControlHTML(control_name){switch(control_name){case "print":var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcePrint\',true);return false;';return ' ';}return "";}function TinyMCE_print_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mcePrint":tinyMCE.getInstanceById(editor_id).contentWindow.print();return true;}return false;}
\ No newline at end of file
+tinyMCE.importPluginLanguagePack('print','en,tr,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,es,cy,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_PrintPlugin={getInfo:function(){return{longname:'Print',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_print.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"print":return tinyMCE.getButtonHTML(cn,'lang_print_desc','{$pluginurl}/images/print.gif','mcePrint');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mcePrint":tinyMCE.getInstanceById(editor_id).contentWindow.print();return true;}return false;}};tinyMCE.addPlugin("print",TinyMCE_PrintPlugin);
\ No newline at end of file
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js 2006-06-25 16:54:23.000000000 -0400
@@ -1,37 +1,49 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.19 $
+ * $Date: 2006/02/10 16:29:40 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
/* Import theme specific language pack */
-tinyMCE.importPluginLanguagePack('print', 'en,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,es,cy,is,zh_tw,zh_tw_utf8,sk');
+tinyMCE.importPluginLanguagePack('print', 'en,tr,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,es,cy,is,zh_tw,zh_tw_utf8,sk');
-function TinyMCE_print_getInfo() {
- return {
- longname : 'Print',
- author : 'Moxiecode Systems',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_print.html',
- version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
- };
-};
+var TinyMCE_PrintPlugin = {
+ getInfo : function() {
+ return {
+ longname : 'Print',
+ author : 'Moxiecode Systems',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_print.html',
+ version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+ };
+ },
-function TinyMCE_print_getControlHTML(control_name) {
- switch (control_name) {
- case "print":
- var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcePrint\',true);return false;';
- return ' ';
- }
+ getControlHTML : function(cn) {
+ switch (cn) {
+ case "print":
+ return tinyMCE.getButtonHTML(cn, 'lang_print_desc', '{$pluginurl}/images/print.gif', 'mcePrint');
+ }
- return "";
-}
+ return "";
+ },
-/**
- * Executes the search/replace commands.
- */
-function TinyMCE_print_execCommand(editor_id, element, command, user_interface, value) {
- // Handle commands
- switch (command) {
- case "mcePrint":
- tinyMCE.getInstanceById(editor_id).contentWindow.print();
- return true;
+ /**
+ * Executes the search/replace commands.
+ */
+ execCommand : function(editor_id, element, command, user_interface, value) {
+ // Handle commands
+ switch (command) {
+ case "mcePrint":
+ tinyMCE.getInstanceById(editor_id).contentWindow.print();
+ return true;
+ }
+
+ // Pass to next handler in chain
+ return false;
}
+};
- // Pass to next handler in chain
- return false;
-}
+tinyMCE.addPlugin("print", TinyMCE_PrintPlugin);
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js 2006-06-25 16:54:23.000000000 -0400
@@ -1 +1 @@
-tinyMCE.importPluginLanguagePack('save','en,sv,zh_cn,cs,fa,fr_ca,fr,de,pl,pt_br,nl,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,da,es,cy,is,zh_tw,zh_tw_utf8,sk');function TinyMCE_save_getInfo(){return{longname:'Save',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_save.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_save_getControlHTML(control_name){switch(control_name){case "save":var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSave\');return false;';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 ';
- }
+ if (tinyMCE.getParam("save_enablewhendirty")) {
+ var inst = tinyMCE.getInstanceById(editor_id);
- return "";
-}
+ if (inst.isDirty()) {
+ tinyMCE.switchClass(editor_id + '_save', 'mceButtonNormal');
+ return true;
+ }
-/**
- * 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 ';case "replace":var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSearchReplace\',true);return false;';return ' ';}return "";}function TinyMCE_searchreplace_execCommand(editor_id,element,command,user_interface,value){function defValue(key,default_value){value[key]=typeof(value[key])=="undefined"?default_value:value[key];}function replaceSel(search_str,str){if(!tinyMCE.isMSIE){var sel=instance.contentWindow.getSelection();var rng=sel.getRangeAt(0);}else{var rng=instance.contentWindow.document.selection.createRange();}if(!tinyMCE.isMSIE){var doc=instance.contentWindow.document;if(str.indexOf(search_str)==-1){rng.deleteContents();rng.insertNode(rng.createContextualFragment(str));rng.collapse(false);}else{doc.execCommand("insertimage",false,"#mce_temp_url#");var elm=tinyMCE.getElementByAttributeValue(doc.body,"img","src","#mce_temp_url#");elm.parentNode.replaceChild(doc.createTextNode(str),elm);}}else{if(rng.item)rng.item(0).outerHTML=str;else rng.pasteHTML(str);}}var instance=tinyMCE.getInstanceById(editor_id);if(!value)value=new Array();defValue("editor_id",editor_id);defValue("searchstring","");defValue("replacestring",null);defValue("replacemode","none");defValue("casesensitive",false);defValue("backwards",false);defValue("wrap",false);defValue("wholeword",false);defValue("inline","yes");switch(command){case "mceResetSearch":tinyMCE.lastSearchRng=null;return true;case "mceSearch":if(user_interface){var template=new Array();if(value['replacestring']!=null){template['file']='../../plugins/searchreplace/replace.htm';template['width']=320;template['height']=120+(tinyMCE.isNS7?20:0);template['width']+=tinyMCE.getLang('lang_searchreplace_replace_delta_width',0);template['height']+=tinyMCE.getLang('lang_searchreplace_replace_delta_height',0);}else{template['file']='../../plugins/searchreplace/search.htm';template['width']=310;template['height']=105+(tinyMCE.isNS7?25:0);template['width']+=tinyMCE.getLang('lang_searchreplace_search_delta_width',0);template['height']+=tinyMCE.getLang('lang_searchreplace_replace_delta_height',0);}tinyMCE.openWindow(template,value);}else{var win=tinyMCE.getInstanceById(editor_id).contentWindow;var doc=tinyMCE.getInstanceById(editor_id).contentWindow.document;var body=tinyMCE.getInstanceById(editor_id).contentWindow.document.body;if(body.innerHTML==""){alert(tinyMCE.getLang('lang_searchreplace_notfound'));return true;}if(value['replacemode']=="current"){replaceSel(value['string'],value['replacestring']);value['replacemode']="none";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true;}if(tinyMCE.isMSIE){var rng=tinyMCE.lastSearchRng?tinyMCE.lastSearchRng:doc.selection.createRange();var flags=0;if(value['wholeword'])flags=flags|2;if(value['casesensitive'])flags=flags|4;if(!rng.findText){alert('This operation is currently not supported by this browser.');return true;}if(value['replacemode']=="all"){while(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select();rng.collapse(false);replaceSel(value['string'],value['replacestring']);}alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));return true;}if(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select();rng.collapse(value['backwards']);tinyMCE.lastSearchRng=rng;}else alert(tinyMCE.getLang('lang_searchreplace_notfound'));}else{if(value['replacemode']=="all"){while(win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))replaceSel(value['string'],value['replacestring']);alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));return true;}if(!win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))alert(tinyMCE.getLang('lang_searchreplace_notfound'));}}return true;case "mceSearchReplace":value['replacestring']="";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true;}return false;}function TinyMCE_searchreplace_handleNodeChange(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){return true;}
\ No newline at end of file
+tinyMCE.importPluginLanguagePack('searchreplace','en,tr,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_SearchReplacePlugin={getInfo:function(){return{longname:'Search/Replace',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_searchreplace.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){inst.addShortcut('ctrl','f','lang_searchreplace_search_desc','mceSearch',true);},getControlHTML:function(cn){switch(cn){case"search":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_search_desc','{$pluginurl}/images/search.gif','mceSearch',true);case"replace":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_replace_desc','{$pluginurl}/images/replace.gif','mceSearchReplace',true);}return"";},execCommand:function(editor_id,element,command,user_interface,value){var instance=tinyMCE.getInstanceById(editor_id);function defValue(key,default_value){value[key]=typeof(value[key])=="undefined"?default_value:value[key];}function replaceSel(search_str,str,back){instance.execCommand('mceInsertContent',false,str);}if(!value)value=new Array();defValue("editor_id",editor_id);defValue("searchstring","");defValue("replacestring",null);defValue("replacemode","none");defValue("casesensitive",false);defValue("backwards",false);defValue("wrap",false);defValue("wholeword",false);defValue("inline","yes");switch(command){case"mceResetSearch":tinyMCE.lastSearchRng=null;return true;case"mceSearch":if(user_interface){var template=new Array();if(value['replacestring']!=null){template['file']='../../plugins/searchreplace/replace.htm';template['width']=320;template['height']=100+(tinyMCE.isNS7?20:0);template['width']+=tinyMCE.getLang('lang_searchreplace_replace_delta_width',0);template['height']+=tinyMCE.getLang('lang_searchreplace_replace_delta_height',0);}else{template['file']='../../plugins/searchreplace/search.htm';template['width']=310;template['height']=105+(tinyMCE.isNS7?25:0);template['width']+=tinyMCE.getLang('lang_searchreplace_search_delta_width',0);template['height']+=tinyMCE.getLang('lang_searchreplace_replace_delta_height',0);}instance.execCommand('SelectAll');if(tinyMCE.isMSIE){var r=instance.selection.getRng();r.collapse(true);r.select();}else instance.selection.getSel().collapseToStart();tinyMCE.openWindow(template,value);}else{var win=tinyMCE.getInstanceById(editor_id).contentWindow;var doc=tinyMCE.getInstanceById(editor_id).contentWindow.document;var body=tinyMCE.getInstanceById(editor_id).contentWindow.document.body;if(body.innerHTML==""){alert(tinyMCE.getLang('lang_searchreplace_notfound'));return true;}if(value['replacemode']=="current"){replaceSel(value['string'],value['replacestring'],value['backwards']);value['replacemode']="none";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true;}if(tinyMCE.isMSIE){var rng=tinyMCE.lastSearchRng?tinyMCE.lastSearchRng:doc.selection.createRange();var flags=0;if(value['wholeword'])flags=flags|2;if(value['casesensitive'])flags=flags|4;if(!rng.findText){alert('This operation is currently not supported by this browser.');return true;}if(value['replacemode']=="all"){while(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select();rng.collapse(false);replaceSel(value['string'],value['replacestring'],value['backwards']);}alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));return true;}if(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select();rng.collapse(value['backwards']);tinyMCE.lastSearchRng=rng;}else alert(tinyMCE.getLang('lang_searchreplace_notfound'));}else{if(value['replacemode']=="all"){while(win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))replaceSel(value['string'],value['replacestring'],value['backwards']);alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));return true;}if(!win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))alert(tinyMCE.getLang('lang_searchreplace_notfound'));}}return true;case"mceSearchReplace":value['replacestring']="";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true;}return false;}};tinyMCE.addPlugin("searchreplace",TinyMCE_SearchReplacePlugin);
\ No newline at end of file
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js 2006-06-25 16:54:23.000000000 -0400
@@ -1,195 +1,185 @@
-/* Import theme specific language pack */
-tinyMCE.importPluginLanguagePack('searchreplace', 'en,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,zh_tw,zh_tw_utf8,sk');
-
-function TinyMCE_searchreplace_getInfo() {
- return {
- longname : 'Search/Replace',
- author : 'Moxiecode Systems',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_searchreplace.html',
- version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
- };
-};
-
-function TinyMCE_searchreplace_getControlHTML(control_name) {
- switch (control_name) {
- case "search":
- var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSearch\',true);return false;';
- return ' ';
-
- case "replace":
- var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSearchReplace\',true);return false;';
- return ' ';
- }
-
- return "";
-}
-
/**
- * Executes the search/replace commands.
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.27 $
+ * $Date: 2006/02/13 15:09:28 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
-function TinyMCE_searchreplace_execCommand(editor_id, element, command, user_interface, value) {
- function defValue(key, default_value) {
- value[key] = typeof(value[key]) == "undefined" ? default_value : value[key];
- }
- function replaceSel(search_str, str) {
- // Get current selection
- if (!tinyMCE.isMSIE) {
- var sel = instance.contentWindow.getSelection();
- var rng = sel.getRangeAt(0);
- } else {
- var rng = instance.contentWindow.document.selection.createRange();
- }
+/* Import theme specific language pack */
+tinyMCE.importPluginLanguagePack('searchreplace', 'en,tr,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,zh_tw,zh_tw_utf8,sk');
- // Replace current one
- if (!tinyMCE.isMSIE) {
- var doc = instance.contentWindow.document;
-
- // This way works when the replace doesn't contain the search string
- if (str.indexOf(search_str) == -1) {
- rng.deleteContents();
- rng.insertNode(rng.createContextualFragment(str));
- rng.collapse(false);
- } else {
- // Insert content ugly way! Needed to move selection to after replace item
- doc.execCommand("insertimage", false, "#mce_temp_url#");
- var elm = tinyMCE.getElementByAttributeValue(doc.body, "img", "src", "#mce_temp_url#");
- elm.parentNode.replaceChild(doc.createTextNode(str), elm);
- }
- } else {
- if (rng.item)
- rng.item(0).outerHTML = str;
- else
- rng.pasteHTML(str);
+var TinyMCE_SearchReplacePlugin = {
+ getInfo : function() {
+ return {
+ longname : 'Search/Replace',
+ author : 'Moxiecode Systems',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_searchreplace.html',
+ version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+ };
+ },
+
+ initInstance : function(inst) {
+ inst.addShortcut('ctrl', 'f', 'lang_searchreplace_search_desc', 'mceSearch', true);
+ },
+
+ getControlHTML : function(cn) {
+ switch (cn) {
+ case "search":
+ return tinyMCE.getButtonHTML(cn, 'lang_searchreplace_search_desc', '{$pluginurl}/images/search.gif', 'mceSearch', true);
+ case "replace":
+ return tinyMCE.getButtonHTML(cn, 'lang_searchreplace_replace_desc', '{$pluginurl}/images/replace.gif', 'mceSearchReplace', true);
}
- }
+ return "";
+ },
- var instance = tinyMCE.getInstanceById(editor_id);
+ /**
+ * Executes the search/replace commands.
+ */
+ execCommand : function(editor_id, element, command, user_interface, value) {
+ var instance = tinyMCE.getInstanceById(editor_id);
- if (!value)
- value = new Array();
-
- // Setup defualt values
- defValue("editor_id", editor_id);
- defValue("searchstring", "");
- defValue("replacestring", null);
- defValue("replacemode", "none");
- defValue("casesensitive", false);
- defValue("backwards", false);
- defValue("wrap", false);
- defValue("wholeword", false);
- defValue("inline", "yes");
-
- // Handle commands
- switch (command) {
- case "mceResetSearch":
- tinyMCE.lastSearchRng = null;
- return true;
-
- case "mceSearch":
- if (user_interface) {
- // Open search dialog
- var template = new Array();
-
- if (value['replacestring'] != null) {
- template['file'] = '../../plugins/searchreplace/replace.htm'; // Relative to theme
- template['width'] = 320;
- template['height'] = 120 + (tinyMCE.isNS7 ? 20 : 0);
- template['width'] += tinyMCE.getLang('lang_searchreplace_replace_delta_width', 0);
- template['height'] += tinyMCE.getLang('lang_searchreplace_replace_delta_height', 0);
- } else {
- template['file'] = '../../plugins/searchreplace/search.htm'; // Relative to theme
- template['width'] = 310;
- template['height'] = 105 + (tinyMCE.isNS7 ? 25 : 0);
- template['width'] += tinyMCE.getLang('lang_searchreplace_search_delta_width', 0);
- template['height'] += tinyMCE.getLang('lang_searchreplace_replace_delta_height', 0);
- }
+ function defValue(key, default_value) {
+ value[key] = typeof(value[key]) == "undefined" ? default_value : value[key];
+ }
- tinyMCE.openWindow(template, value);
- } else {
- var win = tinyMCE.getInstanceById(editor_id).contentWindow;
- var doc = tinyMCE.getInstanceById(editor_id).contentWindow.document;
- var body = tinyMCE.getInstanceById(editor_id).contentWindow.document.body;
-
- // Whats the point
- if (body.innerHTML == "") {
- alert(tinyMCE.getLang('lang_searchreplace_notfound'));
- return true;
- }
+ function replaceSel(search_str, str, back) {
+ instance.execCommand('mceInsertContent', false, str);
+ }
- // Handle replace current
- if (value['replacemode'] == "current") {
- replaceSel(value['string'], value['replacestring']);
-
- // Search next one
- value['replacemode'] = "none";
- tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value, false);
+ if (!value)
+ value = new Array();
- return true;
- }
+ // Setup defualt values
+ defValue("editor_id", editor_id);
+ defValue("searchstring", "");
+ defValue("replacestring", null);
+ defValue("replacemode", "none");
+ defValue("casesensitive", false);
+ defValue("backwards", false);
+ defValue("wrap", false);
+ defValue("wholeword", false);
+ defValue("inline", "yes");
+
+ // Handle commands
+ switch (command) {
+ case "mceResetSearch":
+ tinyMCE.lastSearchRng = null;
+ return true;
+
+ case "mceSearch":
+ if (user_interface) {
+ // Open search dialog
+ var template = new Array();
+
+ if (value['replacestring'] != null) {
+ template['file'] = '../../plugins/searchreplace/replace.htm'; // Relative to theme
+ template['width'] = 320;
+ template['height'] = 100 + (tinyMCE.isNS7 ? 20 : 0);
+ template['width'] += tinyMCE.getLang('lang_searchreplace_replace_delta_width', 0);
+ template['height'] += tinyMCE.getLang('lang_searchreplace_replace_delta_height', 0);
+ } else {
+ template['file'] = '../../plugins/searchreplace/search.htm'; // Relative to theme
+ template['width'] = 310;
+ template['height'] = 105 + (tinyMCE.isNS7 ? 25 : 0);
+ template['width'] += tinyMCE.getLang('lang_searchreplace_search_delta_width', 0);
+ template['height'] += tinyMCE.getLang('lang_searchreplace_replace_delta_height', 0);
+ }
- if (tinyMCE.isMSIE) {
- var rng = tinyMCE.lastSearchRng ? tinyMCE.lastSearchRng : doc.selection.createRange();
- var flags = 0;
+ instance.execCommand('SelectAll');
- if (value['wholeword'])
- flags = flags | 2;
+ if (tinyMCE.isMSIE) {
+ var r = instance.selection.getRng();
+ r.collapse(true);
+ r.select();
+ } else
+ instance.selection.getSel().collapseToStart();
- if (value['casesensitive'])
- flags = flags | 4;
+ tinyMCE.openWindow(template, value);
+ } else {
+ var win = tinyMCE.getInstanceById(editor_id).contentWindow;
+ var doc = tinyMCE.getInstanceById(editor_id).contentWindow.document;
+ var body = tinyMCE.getInstanceById(editor_id).contentWindow.document.body;
- if (!rng.findText) {
- alert('This operation is currently not supported by this browser.');
+ // Whats the point
+ if (body.innerHTML == "") {
+ alert(tinyMCE.getLang('lang_searchreplace_notfound'));
return true;
}
- // Handle replace all mode
- if (value['replacemode'] == "all") {
- while (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) {
- rng.scrollIntoView();
- rng.select();
- rng.collapse(false);
- replaceSel(value['string'], value['replacestring']);
- }
+ // Handle replace current
+ if (value['replacemode'] == "current") {
+ replaceSel(value['string'], value['replacestring'], value['backwards']);
+
+ // Search next one
+ value['replacemode'] = "none";
+ tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value, false);
- alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));
return true;
}
- if (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) {
- rng.scrollIntoView();
- rng.select();
- rng.collapse(value['backwards']);
- tinyMCE.lastSearchRng = rng;
- } else
- alert(tinyMCE.getLang('lang_searchreplace_notfound'));
- } else {
- if (value['replacemode'] == "all") {
- while (win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false))
- replaceSel(value['string'], value['replacestring']);
+ if (tinyMCE.isMSIE) {
+ var rng = tinyMCE.lastSearchRng ? tinyMCE.lastSearchRng : doc.selection.createRange();
+ var flags = 0;
+
+ if (value['wholeword'])
+ flags = flags | 2;
+
+ if (value['casesensitive'])
+ flags = flags | 4;
+
+ if (!rng.findText) {
+ alert('This operation is currently not supported by this browser.');
+ return true;
+ }
- alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));
- return true;
- }
+ // Handle replace all mode
+ if (value['replacemode'] == "all") {
+ while (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) {
+ rng.scrollIntoView();
+ rng.select();
+ rng.collapse(false);
+ replaceSel(value['string'], value['replacestring'], value['backwards']);
+ }
- if (!win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false))
- alert(tinyMCE.getLang('lang_searchreplace_notfound'));
+ alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));
+ return true;
+ }
+
+ if (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) {
+ rng.scrollIntoView();
+ rng.select();
+ rng.collapse(value['backwards']);
+ tinyMCE.lastSearchRng = rng;
+ } else
+ alert(tinyMCE.getLang('lang_searchreplace_notfound'));
+ } else {
+ if (value['replacemode'] == "all") {
+ while (win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false))
+ replaceSel(value['string'], value['replacestring'], value['backwards']);
+
+ alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));
+ return true;
+ }
+
+ if (!win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false))
+ alert(tinyMCE.getLang('lang_searchreplace_notfound'));
+ }
}
- }
- return true;
+ return true;
- case "mceSearchReplace":
- value['replacestring'] = "";
+ case "mceSearchReplace":
+ value['replacestring'] = "";
- tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value, false);
- return true;
+ tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value, false);
+ return true;
+ }
+
+ // Pass to next handler in chain
+ return false;
}
+};
- // Pass to next handler in chain
- return false;
-}
-
-function TinyMCE_searchreplace_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
- return true;
-}
+tinyMCE.addPlugin("searchreplace", TinyMCE_SearchReplacePlugin);
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/jscripts/replace.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/jscripts/replace.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/jscripts/replace.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/jscripts/replace.js 2006-06-25 16:54:23.000000000 -0400
@@ -6,8 +6,8 @@
formObj.searchstring.value = tinyMCE.getWindowArg("searchstring");
formObj.replacestring.value = tinyMCE.getWindowArg("replacestring");
formObj.casesensitivebox.checked = tinyMCE.getWindowArg("casesensitive");
- formObj.backwards[0].checked = tinyMCE.getWindowArg("backwards");
- formObj.backwards[1].checked = !tinyMCE.getWindowArg("backwards");
+// formObj.backwards[0].checked = tinyMCE.getWindowArg("backwards");
+// formObj.backwards[1].checked = !tinyMCE.getWindowArg("backwards");
// formObj.wrapatend.checked = tinyMCE.getWindowArg("wrap");
// formObj.wholeword.checked = tinyMCE.getWindowArg("wholeword");
@@ -27,7 +27,7 @@
replacestring : formObj.replacestring.value,
replacemode : replacemode,
casesensitive : formObj.casesensitivebox.checked,
- backwards : formObj.backwards[0].checked
+ backwards : false
// wrap : formObj.wrapatend.checked,
// wholeword : formObj.wholeword.checked
}, false);
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en.js 2006-06-25 16:54:23.000000000 -0400
@@ -4,10 +4,10 @@
searchreplace_search_desc : 'Find',
searchreplace_searchnext_desc : 'Find again',
searchreplace_replace_desc : 'Find/Replace',
-searchreplace_notfound : 'The search has been compleated. The search string could not be found.',
+searchreplace_notfound : 'The search has been completed. The search string could not be found.',
searchreplace_search_title : 'Find',
searchreplace_replace_title : 'Find/Replace',
-searchreplace_allreplaced : 'All occurrences of the search string was replaced.',
+searchreplace_allreplaced : 'All occurrences of the search string were replaced.',
searchreplace_findwhat : 'Find what',
searchreplace_replacewith : 'Replace with',
searchreplace_direction : 'Direction',
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/replace.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/replace.htm
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/replace.htm 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/replace.htm 2006-06-25 16:54:23.000000000 -0400
@@ -17,7 +17,7 @@
-
+
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/css/props.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/css/props.css
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/css/props.css 1969-12-31 19:00:00.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/css/props.css 2006-06-25 16:54:23.000000000 -0400
@@ -0,0 +1,63 @@
+#text_font {
+ width: 250px;
+}
+
+#text_size {
+ width: 70px;
+}
+
+.mceAddSelectValue {
+ background-color: #DDDDDD;
+}
+
+select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {
+ width: 70px;
+}
+
+#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {
+ width: 70px;
+}
+
+#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {
+ width: 70px;
+}
+
+#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {
+ width: 70px;
+}
+
+.panel_wrapper div.current {
+ padding-top: 10px;
+ height: 230px;
+}
+
+.delim {
+ b2ackground-color: #DDDDDD;
+ border-left: 1px solid gray;
+}
+
+.tdelim {
+ border-bottom: 1px solid gray;
+}
+
+#block_display {
+ width: 145px;
+}
+
+#list_type {
+ width: 115px;
+}
+
+.disabled {
+ background-color: #EEEEEE;
+}
+
+#apply {
+ font-weight: bold;
+ width: 78px;
+ height: 21px;
+ border: 0;
+ background-image: url('../images/apply_button_bg.gif');
+ cursor: pointer;
+}
+
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js 1969-12-31 19:00:00.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js 2006-06-25 16:54:23.000000000 -0400
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('style','en');var TinyMCE_StylePlugin={getInfo:function(){return{longname:'Style',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_style.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"styleprops":return tinyMCE.getButtonHTML(cn,'lang_style_styleinfo_desc','{$pluginurl}/images/style_info.gif','mceStyleProps',true);}return"";},execCommand:function(editor_id,element,command,user_interface,value){var e,inst;switch(command){case"mceStyleProps":TinyMCE_StylePlugin._styleProps();return true;case"mceSetElementStyle":inst=tinyMCE.getInstanceById(editor_id);e=inst.selection.getFocusElement();if(e){e.style.cssText=value;inst.repaint();}return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){},_styleProps:function(){var e=tinyMCE.selectedInstance.selection.getFocusElement();if(!e)return;tinyMCE.openWindow({file:'../../plugins/style/props.htm',width:480+tinyMCE.getLang('lang_style_props_delta_width',0),height:320+tinyMCE.getLang('lang_style_props_delta_height',0)},{editor_id:tinyMCE.selectedInstance.editorId,inline:"yes",style_text:e.style.cssText});}};tinyMCE.addPlugin("style",TinyMCE_StylePlugin);
\ No newline at end of file
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js 1969-12-31 19:00:00.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js 2006-06-25 16:54:23.000000000 -0400
@@ -0,0 +1,81 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.1 $
+ * $Date: 2006/05/03 10:46:42 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('style', 'en');
+
+var TinyMCE_StylePlugin = {
+ getInfo : function() {
+ return {
+ longname : 'Style',
+ author : 'Moxiecode Systems',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_style.html',
+ version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+ };
+ },
+
+ getControlHTML : function(cn) {
+ switch (cn) {
+ case "styleprops":
+ return tinyMCE.getButtonHTML(cn, 'lang_style_styleinfo_desc', '{$pluginurl}/images/style_info.gif', 'mceStyleProps', true);
+ }
+
+ return "";
+ },
+
+ execCommand : function(editor_id, element, command, user_interface, value) {
+ var e, inst;
+
+ // Handle commands
+ switch (command) {
+ case "mceStyleProps":
+ TinyMCE_StylePlugin._styleProps();
+ return true;
+
+ case "mceSetElementStyle":
+ inst = tinyMCE.getInstanceById(editor_id);
+ e = inst.selection.getFocusElement();
+
+ if (e) {
+ e.style.cssText = value;
+ inst.repaint();
+ }
+
+ return true;
+ }
+
+ // Pass to next handler in chain
+ return false;
+ },
+
+ handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+ },
+
+ // Private plugin specific methods
+
+ _styleProps : function() {
+ var e = tinyMCE.selectedInstance.selection.getFocusElement();
+
+ if (!e)
+ return;
+
+ tinyMCE.openWindow({
+ file : '../../plugins/style/props.htm',
+ width : 480 + tinyMCE.getLang('lang_style_props_delta_width', 0),
+ height : 320 + tinyMCE.getLang('lang_style_props_delta_height', 0)
+ }, {
+ editor_id : tinyMCE.selectedInstance.editorId,
+ inline : "yes",
+ style_text : e.style.cssText
+ });
+ }
+};
+
+tinyMCE.addPlugin("style", TinyMCE_StylePlugin);
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/images/apply_button_bg.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/images/apply_button_bg.gif differ
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/images/style_info.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/images/style_info.gif differ
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/jscripts/props.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/jscripts/props.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/jscripts/props.js 1969-12-31 19:00:00.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/jscripts/props.js 2006-06-25 16:54:23.000000000 -0400
@@ -0,0 +1,630 @@
+var defaultFonts = "" +
+ "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" +
+ "Times New Roman, Times, serif=Times New Roman, Times, serif;" +
+ "Courier New, Courier, mono=Courier New, Courier, mono;" +
+ "Times New Roman, Times, serif=Times New Roman, Times, serif;" +
+ "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" +
+ "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" +
+ "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif";
+
+var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger";
+var defaultMeasurement = "+pixels=px;points=pt;in;cm;mm;picas;ems;exs;%";
+var defaultSpacingMeasurement = "pixels=px;points=pt;in;cm;mm;picas;+ems;exs;%";
+var defaultIndentMeasurement = "pixels=px;+points=pt;in;cm;mm;picas;ems;exs;%";
+var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900";
+var defaultTextStyle = "normal;italic;oblique";
+var defaultVariant = "normal;small-caps";
+var defaultLineHeight = "normal";
+var defaultAttachment = "fixed;scroll";
+var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y";
+var defaultPosH = "left;center;right";
+var defaultPosV = "top;center;bottom";
+var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom";
+var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none";
+var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset";
+var defaultBorderWidth = "thin;medium;thick";
+var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none";
+
+function init() {
+ var ce = document.getElementById('container');
+
+ ce.style.cssText = tinyMCEPopup.getWindowArg('style_text');
+
+ tinyMCEPopup.resizeToInnerSize();
+
+ document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color');
+ document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color');
+ document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top');
+ document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right');
+ document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom');
+ document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left');
+
+ fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true);
+ fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true);
+ fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true);
+ fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true);
+ fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true);
+ fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true);
+ fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true);
+ fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true);
+
+ fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true);
+ fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true);
+
+ fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true);
+
+ fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true);
+ fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true);
+
+ fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true);
+ fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true);
+ fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true);
+ fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true);
+ fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true);
+ fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true);
+ fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true);
+ fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true);
+ fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true);
+
+ fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true);
+ fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true);
+ fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true);
+
+ fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true);
+ fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true);
+ fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true);
+ fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true);
+
+ fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true);
+ fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true);
+ fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true);
+ fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true);
+
+ fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true);
+
+ fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true);
+ fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true);
+
+ fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true);
+ fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true);
+
+ fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true);
+
+ fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true);
+
+ fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true);
+ fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true);
+
+ TinyMCE_EditableSelects.init();
+ setupFormData();
+ showDisabledControls();
+}
+
+function setupFormData() {
+ var ce = document.getElementById('container'), f = document.forms[0], s, b, i;
+
+ // Setup text fields
+
+ selectByValue(f, 'text_font', ce.style.fontFamily, true, true);
+ selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true);
+ selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize));
+ selectByValue(f, 'text_weight', ce.style.fontWeight, true, true);
+ selectByValue(f, 'text_style', ce.style.fontStyle, true, true);
+ selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true);
+ selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight));
+ selectByValue(f, 'text_case', ce.style.textTransform, true, true);
+ selectByValue(f, 'text_variant', ce.style.fontVariant, true, true);
+ f.text_color.value = ce.style.color;
+ updateColor('text_color_pick', 'text_color');
+ f.text_underline.checked = inStr(ce.style.textDecoration, 'underline');
+ f.text_overline.checked = inStr(ce.style.textDecoration, 'overline');
+ f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through');
+ f.text_blink.checked = inStr(ce.style.textDecoration, 'blink');
+
+ // Setup background fields
+
+ f.background_color.value = ce.style.backgroundColor;
+ updateColor('background_color_pick', 'background_color');
+ f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+ selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true);
+ selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true);
+ selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true);
+ selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0)));
+ selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true);
+ selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1)));
+
+ // Setup block fields
+
+ selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true);
+ selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing));
+ selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true);
+ selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing));
+ selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true);
+ selectByValue(f, 'block_text_align', ce.style.textAlign, true, true);
+ f.block_text_indent.value = getNum(ce.style.textIndent);
+ selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent));
+ selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true);
+ selectByValue(f, 'block_display', ce.style.display, true, true);
+
+ // Setup box fields
+
+ f.box_width.value = getNum(ce.style.width);
+ selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width));
+
+ f.box_height.value = getNum(ce.style.height);
+ selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height));
+
+ if (tinyMCE.isGecko)
+ selectByValue(f, 'box_float', ce.style.cssFloat, true, true);
+ else
+ selectByValue(f, 'box_float', ce.style.styleFloat, true, true);
+
+ selectByValue(f, 'box_clear', ce.style.clear, true, true);
+
+ setupBox(f, ce, 'box_padding', 'padding', '');
+ setupBox(f, ce, 'box_margin', 'margin', '');
+
+ // Setup border fields
+
+ setupBox(f, ce, 'border_style', 'border', 'Style');
+ setupBox(f, ce, 'border_width', 'border', 'Width');
+ setupBox(f, ce, 'border_color', 'border', 'Color');
+
+ updateColor('border_color_top_pick', 'border_color_top');
+ updateColor('border_color_right_pick', 'border_color_right');
+ updateColor('border_color_bottom_pick', 'border_color_bottom');
+ updateColor('border_color_left_pick', 'border_color_left');
+
+ // Setup list fields
+
+ selectByValue(f, 'list_type', ce.style.listStyleType, true, true);
+ selectByValue(f, 'list_position', ce.style.listStylePosition, true, true);
+ f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+
+ // Setup box fields
+
+ selectByValue(f, 'positioning_type', ce.style.position, true, true);
+ selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true);
+ selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true);
+ f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : "";
+
+ f.positioning_width.value = getNum(ce.style.width);
+ selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width));
+
+ f.positioning_height.value = getNum(ce.style.height);
+ selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height));
+
+ setupBox(f, ce, 'positioning_placement', '', '', new Array('top', 'right', 'bottom', 'left'));
+
+ s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1");
+ s = s.replace(/,/g, ' ');
+
+ if (!hasEqualValues(new Array(getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)))) {
+ f.positioning_clip_top.value = getNum(getVal(s, 0));
+ selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
+ f.positioning_clip_right.value = getNum(getVal(s, 1));
+ selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1)));
+ f.positioning_clip_bottom.value = getNum(getVal(s, 2));
+ selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2)));
+ f.positioning_clip_left.value = getNum(getVal(s, 3));
+ selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3)));
+ } else {
+ f.positioning_clip_top.value = getNum(getVal(s, 0));
+ selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
+ f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value;
+ }
+
+// setupBox(f, ce, '', 'border', 'Color');
+}
+
+function getMeasurement(s) {
+ return s.replace(/^([0-9]+)(.*)$/, "$2");
+}
+
+function getNum(s) {
+ if (new RegExp('^[0-9]+[a-z%]+$', 'gi').test(s))
+ return s.replace(/[^0-9]/g, '');
+
+ return s;
+}
+
+function inStr(s, n) {
+ return new RegExp(n, 'gi').test(s);
+}
+
+function getVal(s, i) {
+ var a = tinyMCE.explode(' ', s);
+
+ if (a.length > 1)
+ return a[i];
+
+ return "";
+}
+
+function setValue(f, n, v) {
+ if (f.elements[n].type == "text")
+ f.elements[n].value = v;
+ else
+ selectByValue(f, n, v, true, true);
+}
+
+function setupBox(f, ce, fp, pr, sf, b) {
+ if (typeof(b) == "undefined")
+ b = new Array('Top', 'Right', 'Bottom', 'Left');
+
+ if (isSame(ce, pr, sf, b)) {
+ f.elements[fp + "_same"].checked = true;
+
+ setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));
+ f.elements[fp + "_top"].disabled = false;
+
+ f.elements[fp + "_right"].value = "";
+ f.elements[fp + "_right"].disabled = true;
+ f.elements[fp + "_bottom"].value = "";
+ f.elements[fp + "_bottom"].disabled = true;
+ f.elements[fp + "_left"].value = "";
+ f.elements[fp + "_left"].disabled = true;
+
+ if (f.elements[fp + "_top_measurement"]) {
+ selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));
+ f.elements[fp + "_left_measurement"].disabled = true;
+ f.elements[fp + "_bottom_measurement"].disabled = true;
+ f.elements[fp + "_right_measurement"].disabled = true;
+ }
+ } else {
+ f.elements[fp + "_same"].checked = false;
+
+ setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));
+ f.elements[fp + "_top"].disabled = false;
+
+ setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf]));
+ f.elements[fp + "_right"].disabled = false;
+
+ setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf]));
+ f.elements[fp + "_bottom"].disabled = false;
+
+ setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf]));
+ f.elements[fp + "_left"].disabled = false;
+
+ if (f.elements[fp + "_top_measurement"]) {
+ selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));
+ selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf]));
+ selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf]));
+ selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf]));
+ f.elements[fp + "_left_measurement"].disabled = false;
+ f.elements[fp + "_bottom_measurement"].disabled = false;
+ f.elements[fp + "_right_measurement"].disabled = false;
+ }
+ }
+}
+
+function isSame(e, pr, sf, b) {
+ var a = new Array(), i, x;
+
+ if (typeof(b) == "undefined")
+ b = new Array('Top', 'Right', 'Bottom', 'Left');
+
+ if (typeof(sf) == "undefined" || sf == null)
+ sf = "";
+
+ a[0] = e.style[pr + b[0] + sf];
+ a[1] = e.style[pr + b[1] + sf];
+ a[2] = e.style[pr + b[2] + sf];
+ a[3] = e.style[pr + b[3] + sf];
+
+ for (i=0; i 0 ? s.substring(1) : s;
+
+ if (f.text_none.checked)
+ s = "none";
+
+ ce.style.textDecoration = s;
+
+ // Build background styles
+
+ ce.style.backgroundColor = f.background_color.value;
+ ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : "";
+ ce.style.backgroundRepeat = f.background_repeat.value;
+ ce.style.backgroundAttachment = f.background_attachment.value;
+
+ if (f.background_hpos.value != "") {
+ s = "";
+ s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " ";
+ s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : "");
+ ce.style.backgroundPosition = s;
+ }
+
+ // Build block styles
+
+ ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : "");
+ ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : "");
+ ce.style.verticalAlign = f.block_vertical_alignment.value;
+ ce.style.textAlign = f.block_text_align.value;
+ ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : "");
+ ce.style.whiteSpace = f.block_whitespace.value;
+ ce.style.display = f.block_display.value;
+
+ // Build box styles
+
+ ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : "");
+ ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : "");
+ ce.style.styleFloat = f.box_float.value;
+
+ if (tinyMCE.isGecko)
+ ce.style.cssFloat = f.box_float.value;
+
+ ce.style.clear = f.box_clear.value;
+
+ if (!f.box_padding_same.checked) {
+ ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");
+ ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : "");
+ ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : "");
+ ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : "");
+ } else
+ ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");
+
+ if (!f.box_margin_same.checked) {
+ ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");
+ ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : "");
+ ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : "");
+ ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : "");
+ } else
+ ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");
+
+ // Build border styles
+
+ if (!f.border_style_same.checked) {
+ ce.style.borderTopStyle = f.border_style_top.value;
+ ce.style.borderRightStyle = f.border_style_right.value;
+ ce.style.borderBottomStyle = f.border_style_bottom.value;
+ ce.style.borderLeftStyle = f.border_style_left.value;
+ } else
+ ce.style.borderStyle = f.border_style_top.value;
+
+ if (!f.border_width_same.checked) {
+ ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : "");
+ ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : "");
+ ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : "");
+ ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : "");
+ } else
+ ce.style.borderWidth = f.border_width_top.value;
+
+ if (!f.border_color_same.checked) {
+ ce.style.borderTopColor = f.border_color_top.value;
+ ce.style.borderRightColor = f.border_color_right.value;
+ ce.style.borderBottomColor = f.border_color_bottom.value;
+ ce.style.borderLeftColor = f.border_color_left.value;
+ } else
+ ce.style.borderColor = f.border_color_top.value;
+
+ // Build list styles
+
+ ce.style.listStyleType = f.list_type.value;
+ ce.style.listStylePosition = f.list_position.value;
+ ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : "";
+
+ // Build positioning styles
+
+ ce.style.position = f.positioning_type.value;
+ ce.style.visibility = f.positioning_visibility.value;
+
+ if (ce.style.width == "")
+ ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : "");
+
+ if (ce.style.height == "")
+ ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : "");
+
+ ce.style.zIndex = f.positioning_zindex.value;
+ ce.style.overflow = f.positioning_overflow.value;
+
+ if (!f.positioning_placement_same.checked) {
+ ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");
+ ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : "");
+ ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : "");
+ ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : "");
+ } else {
+ s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");
+ ce.style.top = s;
+ ce.style.right = s;
+ ce.style.bottom = s;
+ ce.style.left = s;
+ }
+
+ if (!f.positioning_clip_same.checked) {
+ s = "rect(";
+ s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " ";
+ s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " ";
+ s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " ";
+ s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto");
+ s += ")";
+
+ if (s != "rect(auto auto auto auto)")
+ ce.style.clip = s;
+ } else {
+ s = "rect(";
+ t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto";
+ s += t + " ";
+ s += t + " ";
+ s += t + " ";
+ s += t + ")";
+
+ if (s != "rect(auto auto auto auto)")
+ ce.style.clip = s;
+ }
+
+ ce.style.cssText = tinyMCE.serializeStyle(tinyMCE.parseStyle(ce.style.cssText));
+}
+
+function isNum(s) {
+ return new RegExp('[0-9]+', 'g').test(s);
+}
+
+function showDisabledControls() {
+ var f = document.forms, i, a;
+
+ for (i=0; i 1) {
+ addSelectValue(f, s, p[0], p[1]);
+
+ if (se)
+ selectByValue(f, s, p[1]);
+ } else {
+ addSelectValue(f, s, p[0], p[0]);
+
+ if (se)
+ selectByValue(f, s, p[0]);
+ }
+ }
+}
+
+function toggleSame(ce, pre) {
+ var el = document.forms[0].elements, i;
+
+ if (ce.checked) {
+ el[pre + "_top"].disabled = false;
+ el[pre + "_right"].disabled = true;
+ el[pre + "_bottom"].disabled = true;
+ el[pre + "_left"].disabled = true;
+
+ if (el[pre + "_top_measurement"]) {
+ el[pre + "_top_measurement"].disabled = false;
+ el[pre + "_right_measurement"].disabled = true;
+ el[pre + "_bottom_measurement"].disabled = true;
+ el[pre + "_left_measurement"].disabled = true;
+ }
+ } else {
+ el[pre + "_top"].disabled = false;
+ el[pre + "_right"].disabled = false;
+ el[pre + "_bottom"].disabled = false;
+ el[pre + "_left"].disabled = false;
+
+ if (el[pre + "_top_measurement"]) {
+ el[pre + "_top_measurement"].disabled = false;
+ el[pre + "_right_measurement"].disabled = false;
+ el[pre + "_bottom_measurement"].disabled = false;
+ el[pre + "_left_measurement"].disabled = false;
+ }
+ }
+
+ showDisabledControls();
+}
+
+function synch(fr, to) {
+ var f = document.forms[0];
+
+ f.elements[to].value = f.elements[fr].value;
+
+ if (f.elements[fr + "_measurement"])
+ selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value);
+}
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/langs/en.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/langs/en.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/langs/en.js 1969-12-31 19:00:00.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/langs/en.js 2006-06-25 16:54:23.000000000 -0400
@@ -0,0 +1,60 @@
+// UK lang variables
+
+tinyMCE.addToLang('style',{
+title : 'Edit CSS Style',
+styleinfo_desc : 'Edit CSS Style',
+text_tab : 'Text',
+background_tab : 'Background',
+block_tab : 'Block',
+box_tab : 'Box',
+border_tab : 'Border',
+list_tab : 'List',
+positioning_tab : 'Positioning',
+text_props : 'Text',
+text_font : 'Font',
+text_size : 'Size',
+text_weight : 'Weight',
+text_style : 'Style',
+text_variant : 'Variant',
+text_lineheight : 'Line height',
+text_case : 'Case',
+text_color : 'Color',
+text_decoration : 'Decoration',
+background_color : 'Background color',
+background_image : 'Background image',
+background_repeat : 'Repeat',
+background_attachment : 'Attachment',
+background_hpos : 'Horizontal position',
+background_vpos : 'Vertical position',
+block_wordspacing : 'Word spacing',
+block_letterspacing : 'Letter spacing',
+block_vertical_alignment : 'Vertical alignment',
+block_text_align : 'Text align',
+block_text_indent : 'Text indent',
+block_whitespace : 'Whitespace',
+block_display : 'Display',
+box_width : 'Width',
+box_height : 'Height',
+box_float : 'Float',
+box_clear : 'Clear',
+padding : 'Padding',
+same : 'Same for all',
+top : 'Top',
+right : 'Right',
+bottom : 'Bottom',
+left : 'Left',
+margin : 'Margin',
+style : 'Style',
+width : 'Width',
+height : 'Height',
+color : 'Color',
+list_type : 'Type',
+bullet_image : 'Bullet image',
+position : 'Position',
+positioning_type : 'Type',
+visibility : 'Visibility',
+zindex : 'Z-index',
+overflow : 'Overflow',
+placement : 'Placement',
+clip : 'Clip'
+});
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/props.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/props.htm
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/props.htm 1969-12-31 19:00:00.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/props.htm 2006-06-25 16:54:23.000000000 -0400
@@ -0,0 +1,580 @@
+
+
+ {$lang_style_title}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/cell.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/cell.htm
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/cell.htm 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/cell.htm 2006-06-25 16:54:22.000000000 -0400
@@ -75,7 +75,7 @@
-
+
{$lang_class_name}
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js 2006-06-25 16:54:22.000000000 -0400
@@ -1 +1 @@
-tinyMCE.importPluginLanguagePack('table','en,ar,cs,da,de,el,es,fi,fr_ca,hu,it,ja,ko,nl,nb,pl,pt,pt_br,sv,tw,zh_cn,fr,de,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,is,zh_tw,zh_tw_utf8,sk');function TinyMCE_table_getInfo(){return{longname:'Tables',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_table.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_table_initInstance(inst){if(tinyMCE.isGecko){var doc=inst.getDoc();tinyMCE.addEvent(doc,"mouseup",TinyMCE_table_mouseDownHandler);}inst.tableRowClipboard=null;}function TinyMCE_table_mouseDownHandler(e){var elm=tinyMCE.isMSIE?event.srcElement:e.target;var focusElm=tinyMCE.selectedInstance.getFocusElement();if(elm.nodeName=="BODY"&&(focusElm.nodeName=="TD"||focusElm.nodeName=="TH"||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TD")||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TH"))){window.setTimeout(function(){var tableElm=tinyMCE.getParentElement(focusElm,"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);},10);}}function TinyMCE_table_getControlHTML(control_name){var controls=new Array(['table','table.gif','{$lang_table_desc}','mceInsertTable',true],['delete_col','table_delete_col.gif','{$lang_table_delete_col_desc}','mceTableDeleteCol'],['delete_row','table_delete_row.gif','{$lang_table_delete_row_desc}','mceTableDeleteRow'],['col_after','table_insert_col_after.gif','{$lang_table_col_after_desc}','mceTableInsertColAfter'],['col_before','table_insert_col_before.gif','{$lang_table_col_before_desc}','mceTableInsertColBefore'],['row_after','table_insert_row_after.gif','{$lang_table_row_after_desc}','mceTableInsertRowAfter'],['row_before','table_insert_row_before.gif','{$lang_table_row_before_desc}','mceTableInsertRowBefore'],['row_props','table_row_props.gif','{$lang_table_row_desc}','mceTableRowProps',true],['cell_props','table_cell_props.gif','{$lang_table_cell_desc}','mceTableCellProps',true],['split_cells','table_split_cells.gif','{$lang_table_split_cells_desc}','mceTableSplitCells',true],['merge_cells','table_merge_cells.gif','{$lang_table_merge_cells_desc}','mceTableMergeCells',true]);for(var i=0;i4?but[4]:false)+(but.length>5?', \''+but[5]+'\'':'')+');return false;';if(but[0]==control_name&&(tinyMCE.isMSIE||!tinyMCE.settings['button_tile_map']))return ' ';else if(but[0]==control_name)return ' ';}if(control_name=="tablecontrols"){var html="";html+=tinyMCE.getControlHTML("table");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_props");html+=tinyMCE.getControlHTML("cell_props");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_before");html+=tinyMCE.getControlHTML("row_after");html+=tinyMCE.getControlHTML("delete_row");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("col_before");html+=tinyMCE.getControlHTML("col_after");html+=tinyMCE.getControlHTML("delete_col");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("split_cells");html+=tinyMCE.getControlHTML("merge_cells");return html;}return "";}function TinyMCE_table_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceInsertTable":case "mceTableRowProps":case "mceTableCellProps":case "mceTableSplitCells":case "mceTableMergeCells":case "mceTableInsertRowBefore":case "mceTableInsertRowAfter":case "mceTableDeleteRow":case "mceTableInsertColBefore":case "mceTableInsertColAfter":case "mceTableDeleteCol":case "mceTableCutRow":case "mceTableCopyRow":case "mceTablePasteRowBefore":case "mceTablePasteRowAfter":case "mceTableDelete":var inst=tinyMCE.getInstanceById(editor_id);inst.execCommand('mceBeginUndoLevel');TinyMCE_table_doExecCommand(editor_id,element,command,user_interface,value);inst.execCommand('mceEndUndoLevel');return true;}return false;}function TinyMCE_table_doExecCommand(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();var trElm=tinyMCE.getParentElement(focusElm,"tr");var tdElm=tinyMCE.getParentElement(focusElm,"td,th");var tableElm=tinyMCE.getParentElement(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i0&&inArray(ar[i],v))return true;if(ar[i]==v)return true;}return false;}function makeTD(){var newTD=doc.createElement("td");newTD.innerHTML=" ";}function getColRowSpan(td){var colspan=tinyMCE.getAttrib(td,"colspan");var rowspan=tinyMCE.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan};}function getCellPos(grid,td){for(var y=0;y1){for(var i=x;i1)td.rowSpan=sd.rowspan+1;lastElm=td;}deleteMarked(tableElm);}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node;}return null;}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td);}while((td=nexttd)!=null);}}while((tr=next)!=null);}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD);}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1;}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true;}lastTDElm=tdElm;}}deleteMarked(tableElm);cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;inst.selectNode(getCell(grid,cpos.rowindex,0),true,true);break;case "mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML=" ";newTD.rowSpan=tdElm.rowSpan;tdElm.parentNode.insertBefore(newTD,tdElm);}else tdElm.colSpan++;lastTDElm=tdElm;}}break;case "mceTableInsertColAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML=" ";newTD.rowSpan=tdElm.rowSpan;var nextTD=nextElm(tdElm,"TD,TH");if(nextTD==null)tdElm.parentNode.appendChild(newTD);else nextTD.parentNode.insertBefore(newTD,nextTD);}else tdElm.colSpan++;lastTDElm=tdElm;}}break;case "mceTableDeleteCol":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;if(grid.length>1&&grid[0].length<=1){tableElm.parentNode.removeChild(tableElm);return true;}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm);}lastTDElm=tdElm;}}cpos.cellindex--;if(cpos.cellindex<0)cpos.cellindex=0;inst.selectNode(getCell(grid,0,cpos.cellindex),true,true);break;case "mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i1)addRows(newTD,trElm,rowspan);}addRows(tdElm,trElm,rowspan);}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");break;case "mceTableMergeCells":var rows=new Array();var sel=inst.getSel();var grid=getTableGrid(tableElm);if(tinyMCE.isMSIE||sel.rangeCount==1){if(user_interface){var template=new Array();var sp=getColRowSpan(tdElm);template['file']='../../plugins/table/merge_cells.htm';template['width']=250;template['height']=105+(tinyMCE.isNS7?25:0);template['width']+=tinyMCE.getLang('lang_table_merge_cells_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_merge_cells_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes",action:"update",numcols:sp.colspan,numrows:sp.rowspan});return true;}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y0)rows[rows.length]=rowCells;}}}else{var cells=new Array();var sel=inst.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i0)rows[rows.length]=rowCells;}var curRow=new Array();var lastTR=null;for(var y=0;ycolSpan)colSpan=rowColSpan;lastRowSpan=-1;}var lastColSpan=-1;for(var x=0;xrowSpan)rowSpan=colRowSpan;lastColSpan=-1;}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y "&&chk!=" "&&chk!=" "&&(x+y>0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm;}if(tdElm.rowSpan>1)tdElm.rowSpan--;}}}}break;}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);tinyMCE.triggerNodeChange();inst.repaint();}return true;}return false;}function TinyMCE_table_handleNodeChange(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){var colspan="1",rowspan="1";var inst=tinyMCE.getInstanceById(editor_id);tinyMCE.switchClassSticky(editor_id+'_table','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_row_props','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_cell_props','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_row_before','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_row_after','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_delete_row','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_col_before','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_col_after','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_delete_col','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_split_cells','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_merge_cells','mceButtonDisabled',true);if(tinyMCE.getParentElement(node,"tr"))tinyMCE.switchClassSticky(editor_id+'_row_props','mceButtonSelected',false);if(tdElm=tinyMCE.getParentElement(node,"td,th")){tinyMCE.switchClassSticky(editor_id+'_cell_props','mceButtonSelected',false);tinyMCE.switchClassSticky(editor_id+'_row_before','mceButtonNormal',false);tinyMCE.switchClassSticky(editor_id+'_row_after','mceButtonNormal',false);tinyMCE.switchClassSticky(editor_id+'_delete_row','mceButtonNormal',false);tinyMCE.switchClassSticky(editor_id+'_col_before','mceButtonNormal',false);tinyMCE.switchClassSticky(editor_id+'_col_after','mceButtonNormal',false);tinyMCE.switchClassSticky(editor_id+'_delete_col','mceButtonNormal',false);colspan=tinyMCE.getAttrib(tdElm,"colspan");rowspan=tinyMCE.getAttrib(tdElm,"rowspan");colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;if(colspan!="1"||rowspan!="1")tinyMCE.switchClassSticky(editor_id+'_split_cells','mceButtonNormal',false);}if(tinyMCE.getParentElement(node,"table")){tinyMCE.switchClassSticky(editor_id+'_table','mceButtonSelected');tinyMCE.switchClassSticky(editor_id+'_merge_cells','mceButtonNormal',false);}}
\ No newline at end of file
+tinyMCE.importPluginLanguagePack('table','en,tr,ar,cs,da,de,el,es,fi,fr_ca,hu,it,ja,ko,nl,nb,pl,pt,pt_br,sv,tw,zh_cn,fr,de,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_TablePlugin={getInfo:function(){return{longname:'Tables',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_table.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){if(tinyMCE.isGecko){var doc=inst.getDoc();tinyMCE.addEvent(doc,"mouseup",TinyMCE_TablePlugin._mouseDownHandler);}inst.tableRowClipboard=null;},getControlHTML:function(control_name){var controls=new Array(['table','table.gif','lang_table_desc','mceInsertTable',true],['delete_col','table_delete_col.gif','lang_table_delete_col_desc','mceTableDeleteCol'],['delete_row','table_delete_row.gif','lang_table_delete_row_desc','mceTableDeleteRow'],['col_after','table_insert_col_after.gif','lang_table_col_after_desc','mceTableInsertColAfter'],['col_before','table_insert_col_before.gif','lang_table_col_before_desc','mceTableInsertColBefore'],['row_after','table_insert_row_after.gif','lang_table_row_after_desc','mceTableInsertRowAfter'],['row_before','table_insert_row_before.gif','lang_table_row_before_desc','mceTableInsertRowBefore'],['row_props','table_row_props.gif','lang_table_row_desc','mceTableRowProps',true],['cell_props','table_cell_props.gif','lang_table_cell_desc','mceTableCellProps',true],['split_cells','table_split_cells.gif','lang_table_split_cells_desc','mceTableSplitCells',true],['merge_cells','table_merge_cells.gif','lang_table_merge_cells_desc','mceTableMergeCells',true]);for(var i=0;i4?but[4]:false)+(but.length>5?', \''+but[5]+'\'':'')+');return false;';if(but[0]==control_name)return tinyMCE.getButtonHTML(control_name,but[2],'{$pluginurl}/images/'+but[1],but[3],(but.length>4?but[4]:false));}if(control_name=="tablecontrols"){var html="";html+=tinyMCE.getControlHTML("table");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_props");html+=tinyMCE.getControlHTML("cell_props");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_before");html+=tinyMCE.getControlHTML("row_after");html+=tinyMCE.getControlHTML("delete_row");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("col_before");html+=tinyMCE.getControlHTML("col_after");html+=tinyMCE.getControlHTML("delete_col");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("split_cells");html+=tinyMCE.getControlHTML("merge_cells");return html;}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":var inst=tinyMCE.getInstanceById(editor_id);inst.execCommand('mceBeginUndoLevel');TinyMCE_TablePlugin._doExecCommand(editor_id,element,command,user_interface,value);inst.execCommand('mceEndUndoLevel');return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){var colspan="1",rowspan="1";var inst=tinyMCE.getInstanceById(editor_id);tinyMCE.switchClass(editor_id+'_table','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_cell_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_row','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_split_cells','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonDisabled');if(tdElm=tinyMCE.getParentElement(node,"td,th")){tinyMCE.switchClass(editor_id+'_cell_props','mceButtonSelected');tinyMCE.switchClass(editor_id+'_row_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_row','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonNormal');colspan=tinyMCE.getAttrib(tdElm,"colspan");rowspan=tinyMCE.getAttrib(tdElm,"rowspan");colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;if(colspan!="1"||rowspan!="1")tinyMCE.switchClass(editor_id+'_split_cells','mceButtonNormal');}if(tinyMCE.getParentElement(node,"tr"))tinyMCE.switchClass(editor_id+'_row_props','mceButtonSelected');if(tinyMCE.getParentElement(node,"table")){tinyMCE.switchClass(editor_id+'_table','mceButtonSelected');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonNormal');}},_mouseDownHandler:function(e){var elm=tinyMCE.isMSIE?event.srcElement:e.target;var focusElm=tinyMCE.selectedInstance.getFocusElement();if(elm.nodeName=="BODY"&&(focusElm.nodeName=="TD"||focusElm.nodeName=="TH"||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TD")||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TH"))){window.setTimeout(function(){var tableElm=tinyMCE.getParentElement(focusElm,"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);},10);}},_doExecCommand:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();var trElm=tinyMCE.getParentElement(focusElm,"tr");var tdElm=tinyMCE.getParentElement(focusElm,"td,th");var tableElm=tinyMCE.getParentElement(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i0&&inArray(ar[i],v))return true;if(ar[i]==v)return true;}return false;}function makeTD(){var newTD=doc.createElement("td");newTD.innerHTML=" ";}function getColRowSpan(td){var colspan=tinyMCE.getAttrib(td,"colspan");var rowspan=tinyMCE.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan};}function getCellPos(grid,td){for(var y=0;y1){for(var i=x;i1)td.rowSpan=sd.rowspan+1;lastElm=td;}deleteMarked(tableElm);}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node;}return null;}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td);}while((td=nexttd)!=null);}}while((tr=next)!=null);}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD);}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1;}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true;}lastTDElm=tdElm;}}deleteMarked(tableElm);cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;inst.selection.selectNode(getCell(grid,cpos.rowindex,0),true,true);break;case"mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML=" ";newTD.rowSpan=tdElm.rowSpan;tdElm.parentNode.insertBefore(newTD,tdElm);}else tdElm.colSpan++;lastTDElm=tdElm;}}break;case"mceTableInsertColAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML=" ";newTD.rowSpan=tdElm.rowSpan;var nextTD=nextElm(tdElm,"TD,TH");if(nextTD==null)tdElm.parentNode.appendChild(newTD);else nextTD.parentNode.insertBefore(newTD,nextTD);}else tdElm.colSpan++;lastTDElm=tdElm;}}break;case"mceTableDeleteCol":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;if(grid.length>1&&grid[0].length<=1){tableElm.parentNode.removeChild(tableElm);return true;}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm);}lastTDElm=tdElm;}}cpos.cellindex--;if(cpos.cellindex<0)cpos.cellindex=0;inst.selection.selectNode(getCell(grid,0,cpos.cellindex),true,true);break;case"mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i1)addRows(newTD,trElm,rowspan);}addRows(tdElm,trElm,rowspan);}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");break;case"mceTableMergeCells":var rows=new Array();var sel=inst.getSel();var grid=getTableGrid(tableElm);if(tinyMCE.isMSIE||sel.rangeCount==1){if(user_interface){var template=new Array();var sp=getColRowSpan(tdElm);template['file']='../../plugins/table/merge_cells.htm';template['width']=250;template['height']=105+(tinyMCE.isNS7?25:0);template['width']+=tinyMCE.getLang('lang_table_merge_cells_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_merge_cells_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes",action:"update",numcols:sp.colspan,numrows:sp.rowspan});return true;}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y0)rows[rows.length]=rowCells;}}}else{var cells=new Array();var sel=inst.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i0)rows[rows.length]=rowCells;}var curRow=new Array();var lastTR=null;for(var y=0;ycolSpan)colSpan=rowColSpan;lastRowSpan=-1;}var lastColSpan=-1;for(var x=0;xrowSpan)rowSpan=colRowSpan;lastColSpan=-1;}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y "&&chk!=" "&&chk!=" "&&(x+y>0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm;}if(tdElm.rowSpan>1)tdElm.rowSpan--;}}}}break;}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);tinyMCE.triggerNodeChange();inst.repaint();}return true;}return false;}};tinyMCE.addPlugin("table",TinyMCE_TablePlugin);
\ No newline at end of file
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js 2006-06-25 16:54:22.000000000 -0400
@@ -1,1041 +1,1054 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.38 $
+ * $Date: 2006/02/11 18:53:51 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
/* Import plugin specific language pack */
-tinyMCE.importPluginLanguagePack('table', 'en,ar,cs,da,de,el,es,fi,fr_ca,hu,it,ja,ko,nl,nb,pl,pt,pt_br,sv,tw,zh_cn,fr,de,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,is,zh_tw,zh_tw_utf8,sk');
+tinyMCE.importPluginLanguagePack('table', 'en,tr,ar,cs,da,de,el,es,fi,fr_ca,hu,it,ja,ko,nl,nb,pl,pt,pt_br,sv,tw,zh_cn,fr,de,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,is,zh_tw,zh_tw_utf8,sk');
-function TinyMCE_table_getInfo() {
- return {
- longname : 'Tables',
- author : 'Moxiecode Systems',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_table.html',
- version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
- };
-};
+var TinyMCE_TablePlugin = {
+ getInfo : function() {
+ return {
+ longname : 'Tables',
+ author : 'Moxiecode Systems',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_table.html',
+ version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+ };
+ },
+
+ initInstance : function(inst) {
+ if (tinyMCE.isGecko) {
+ var doc = inst.getDoc();
+ tinyMCE.addEvent(doc, "mouseup", TinyMCE_TablePlugin._mouseDownHandler);
+ }
-function TinyMCE_table_initInstance(inst) {
- if (tinyMCE.isGecko) {
- var doc = inst.getDoc();
- tinyMCE.addEvent(doc, "mouseup", TinyMCE_table_mouseDownHandler);
- }
+ inst.tableRowClipboard = null;
+ },
- inst.tableRowClipboard = null;
-}
+ /**
+ * Returns the HTML contents of the table control.
+ */
+ getControlHTML : function(control_name) {
+ var controls = new Array(
+ ['table', 'table.gif', 'lang_table_desc', 'mceInsertTable', true],
+ ['delete_col', 'table_delete_col.gif', 'lang_table_delete_col_desc', 'mceTableDeleteCol'],
+ ['delete_row', 'table_delete_row.gif', 'lang_table_delete_row_desc', 'mceTableDeleteRow'],
+ ['col_after', 'table_insert_col_after.gif', 'lang_table_col_after_desc', 'mceTableInsertColAfter'],
+ ['col_before', 'table_insert_col_before.gif', 'lang_table_col_before_desc', 'mceTableInsertColBefore'],
+ ['row_after', 'table_insert_row_after.gif', 'lang_table_row_after_desc', 'mceTableInsertRowAfter'],
+ ['row_before', 'table_insert_row_before.gif', 'lang_table_row_before_desc', 'mceTableInsertRowBefore'],
+ ['row_props', 'table_row_props.gif', 'lang_table_row_desc', 'mceTableRowProps', true],
+ ['cell_props', 'table_cell_props.gif', 'lang_table_cell_desc', 'mceTableCellProps', true],
+ ['split_cells', 'table_split_cells.gif', 'lang_table_split_cells_desc', 'mceTableSplitCells', true],
+ ['merge_cells', 'table_merge_cells.gif', 'lang_table_merge_cells_desc', 'mceTableMergeCells', true]);
+
+ // Render table control
+ for (var i=0; i 4 ? but[4] : false) + (but.length > 5 ? ', \'' + but[5] + '\'' : '') + ');return false;';
-function TinyMCE_table_mouseDownHandler(e) {
- var elm = tinyMCE.isMSIE ? event.srcElement : e.target;
- var focusElm = tinyMCE.selectedInstance.getFocusElement();
-
- // If press on special Mozilla create TD/TR thingie
- if (elm.nodeName == "BODY" && (focusElm.nodeName == "TD" || focusElm.nodeName == "TH" || (focusElm.parentNode && focusElm.parentNode.nodeName == "TD") ||(focusElm.parentNode && focusElm.parentNode.nodeName == "TH") )) {
- window.setTimeout(function() {
- var tableElm = tinyMCE.getParentElement(focusElm, "table");
- tinyMCE.handleVisualAid(tableElm, true, tinyMCE.settings['visual'], tinyMCE.selectedInstance);
- }, 10);
- }
-}
+ if (but[0] == control_name)
+ return tinyMCE.getButtonHTML(control_name, but[2], '{$pluginurl}/images/'+ but[1], but[3], (but.length > 4 ? but[4] : false));
+ }
-/**
- * Returns the HTML contents of the table control.
- */
-function TinyMCE_table_getControlHTML(control_name) {
- var controls = new Array(
- ['table', 'table.gif', '{$lang_table_desc}', 'mceInsertTable', true],
- ['delete_col', 'table_delete_col.gif', '{$lang_table_delete_col_desc}', 'mceTableDeleteCol'],
- ['delete_row', 'table_delete_row.gif', '{$lang_table_delete_row_desc}', 'mceTableDeleteRow'],
- ['col_after', 'table_insert_col_after.gif', '{$lang_table_col_after_desc}', 'mceTableInsertColAfter'],
- ['col_before', 'table_insert_col_before.gif', '{$lang_table_col_before_desc}', 'mceTableInsertColBefore'],
- ['row_after', 'table_insert_row_after.gif', '{$lang_table_row_after_desc}', 'mceTableInsertRowAfter'],
- ['row_before', 'table_insert_row_before.gif', '{$lang_table_row_before_desc}', 'mceTableInsertRowBefore'],
- ['row_props', 'table_row_props.gif', '{$lang_table_row_desc}', 'mceTableRowProps', true],
- ['cell_props', 'table_cell_props.gif', '{$lang_table_cell_desc}', 'mceTableCellProps', true],
- ['split_cells', 'table_split_cells.gif', '{$lang_table_split_cells_desc}', 'mceTableSplitCells', true],
- ['merge_cells', 'table_merge_cells.gif', '{$lang_table_merge_cells_desc}', 'mceTableMergeCells', true]);
-
- // Render table control
- for (var i=0; i 4 ? but[4] : false) + (but.length > 5 ? ', \'' + but[5] + '\'' : '') + ');return false;';
-
- if (but[0] == control_name && (tinyMCE.isMSIE || !tinyMCE.settings['button_tile_map']))
- return ' ';
- else if (but[0] == control_name)
- return ' ';
- }
+ // Special tablecontrols
+ if (control_name == "tablecontrols") {
+ var html = "";
+
+ html += tinyMCE.getControlHTML("table");
+ html += tinyMCE.getControlHTML("separator");
+ html += tinyMCE.getControlHTML("row_props");
+ html += tinyMCE.getControlHTML("cell_props");
+ html += tinyMCE.getControlHTML("separator");
+ html += tinyMCE.getControlHTML("row_before");
+ html += tinyMCE.getControlHTML("row_after");
+ html += tinyMCE.getControlHTML("delete_row");
+ html += tinyMCE.getControlHTML("separator");
+ html += tinyMCE.getControlHTML("col_before");
+ html += tinyMCE.getControlHTML("col_after");
+ html += tinyMCE.getControlHTML("delete_col");
+ html += tinyMCE.getControlHTML("separator");
+ html += tinyMCE.getControlHTML("split_cells");
+ html += tinyMCE.getControlHTML("merge_cells");
- // Special tablecontrols
- if (control_name == "tablecontrols") {
- var html = "";
-
- html += tinyMCE.getControlHTML("table");
- html += tinyMCE.getControlHTML("separator");
- html += tinyMCE.getControlHTML("row_props");
- html += tinyMCE.getControlHTML("cell_props");
- html += tinyMCE.getControlHTML("separator");
- html += tinyMCE.getControlHTML("row_before");
- html += tinyMCE.getControlHTML("row_after");
- html += tinyMCE.getControlHTML("delete_row");
- html += tinyMCE.getControlHTML("separator");
- html += tinyMCE.getControlHTML("col_before");
- html += tinyMCE.getControlHTML("col_after");
- html += tinyMCE.getControlHTML("delete_col");
- html += tinyMCE.getControlHTML("separator");
- html += tinyMCE.getControlHTML("split_cells");
- html += tinyMCE.getControlHTML("merge_cells");
+ return html;
+ }
- return html;
- }
+ return "";
+ },
- return "";
-}
+ /**
+ * Executes the table commands.
+ */
+ execCommand : function(editor_id, element, command, user_interface, value) {
+ // Is table command
+ switch (command) {
+ case "mceInsertTable":
+ case "mceTableRowProps":
+ case "mceTableCellProps":
+ case "mceTableSplitCells":
+ case "mceTableMergeCells":
+ case "mceTableInsertRowBefore":
+ case "mceTableInsertRowAfter":
+ case "mceTableDeleteRow":
+ case "mceTableInsertColBefore":
+ case "mceTableInsertColAfter":
+ case "mceTableDeleteCol":
+ case "mceTableCutRow":
+ case "mceTableCopyRow":
+ case "mceTablePasteRowBefore":
+ case "mceTablePasteRowAfter":
+ case "mceTableDelete":
+ var inst = tinyMCE.getInstanceById(editor_id);
+
+ inst.execCommand('mceBeginUndoLevel');
+ TinyMCE_TablePlugin._doExecCommand(editor_id, element, command, user_interface, value);
+ inst.execCommand('mceEndUndoLevel');
-/**
- * Executes the table commands.
- */
-function TinyMCE_table_execCommand(editor_id, element, command, user_interface, value) {
- // Is table command
- switch (command) {
- case "mceInsertTable":
- case "mceTableRowProps":
- case "mceTableCellProps":
- case "mceTableSplitCells":
- case "mceTableMergeCells":
- case "mceTableInsertRowBefore":
- case "mceTableInsertRowAfter":
- case "mceTableDeleteRow":
- case "mceTableInsertColBefore":
- case "mceTableInsertColAfter":
- case "mceTableDeleteCol":
- case "mceTableCutRow":
- case "mceTableCopyRow":
- case "mceTablePasteRowBefore":
- case "mceTablePasteRowAfter":
- case "mceTableDelete":
- var inst = tinyMCE.getInstanceById(editor_id);
-
- inst.execCommand('mceBeginUndoLevel');
- TinyMCE_table_doExecCommand(editor_id, element, command, user_interface, value);
- inst.execCommand('mceEndUndoLevel');
+ return true;
+ }
- return true;
- }
+ // Pass to next handler in chain
+ return false;
+ },
- // Pass to next handler in chain
- return false;
-}
+ handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+ var colspan = "1", rowspan = "1";
-/**
- * Executes the table commands.
- */
-function TinyMCE_table_doExecCommand(editor_id, element, command, user_interface, value) {
- var inst = tinyMCE.getInstanceById(editor_id);
- var focusElm = inst.getFocusElement();
- var trElm = tinyMCE.getParentElement(focusElm, "tr");
- var tdElm = tinyMCE.getParentElement(focusElm, "td,th");
- var tableElm = tinyMCE.getParentElement(focusElm, "table");
- var doc = inst.contentWindow.document;
- var tableBorder = tableElm ? tableElm.getAttribute("border") : "";
-
- // Get first TD if no TD found
- if (trElm && tdElm == null)
- tdElm = trElm.cells[0];
-
- // ------- Inner functions ---------
- function inArray(ar, v) {
- for (var i=0; i 0 && inArray(ar[i], v))
- return true;
+ var inst = tinyMCE.getInstanceById(editor_id);
- // Found value
- if (ar[i] == v)
- return true;
- }
+ // Reset table controls
+ tinyMCE.switchClass(editor_id + '_table', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonDisabled');
+ tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonDisabled');
+ tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonDisabled');
+ tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonDisabled');
+ tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonDisabled');
+ tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonDisabled');
+ tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonDisabled');
+ tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonDisabled');
+ tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonDisabled');
+ tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonDisabled');
+
+ // Within a td element
+ if (tdElm = tinyMCE.getParentElement(node, "td,th")) {
+ tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonSelected');
+ tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonNormal');
- return false;
- }
+ colspan = tinyMCE.getAttrib(tdElm, "colspan");
+ rowspan = tinyMCE.getAttrib(tdElm, "rowspan");
- function makeTD() {
- var newTD = doc.createElement("td");
- newTD.innerHTML = " ";
- }
+ colspan = colspan == "" ? "1" : colspan;
+ rowspan = rowspan == "" ? "1" : rowspan;
- function getColRowSpan(td) {
- var colspan = tinyMCE.getAttrib(td, "colspan");
- var rowspan = tinyMCE.getAttrib(td, "rowspan");
+ if (colspan != "1" || rowspan != "1")
+ tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonNormal');
+ }
- colspan = colspan == "" ? 1 : parseInt(colspan);
- rowspan = rowspan == "" ? 1 : parseInt(rowspan);
+ // Within a tr element
+ if (tinyMCE.getParentElement(node, "tr"))
+ tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonSelected');
+
+ // Within table
+ if (tinyMCE.getParentElement(node, "table")) {
+ tinyMCE.switchClass(editor_id + '_table', 'mceButtonSelected');
+ tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonNormal');
+ }
+ },
- return {colspan : colspan, rowspan : rowspan};
- }
+ // Private plugin internal methods
- function getCellPos(grid, td) {
- for (var y=0; y 0 && inArray(ar[i], v))
+ return true;
+
+ // Found value
+ if (ar[i] == v)
+ return true;
}
+
+ return false;
}
- return null;
- }
+ function makeTD() {
+ var newTD = doc.createElement("td");
+ newTD.innerHTML = " ";
+ }
- function getCell(grid, row, col) {
- if (grid[row] && grid[row][col])
- return grid[row][col];
+ function getColRowSpan(td) {
+ var colspan = tinyMCE.getAttrib(td, "colspan");
+ var rowspan = tinyMCE.getAttrib(td, "rowspan");
- return null;
- }
+ colspan = colspan == "" ? 1 : parseInt(colspan);
+ rowspan = rowspan == "" ? 1 : parseInt(rowspan);
- function getTableGrid(table) {
- var grid = new Array();
- var rows = table.rows;
-
- for (var y=0; y 1) { // Remove due to colspan
- for (var i=x; i 1)
- td.rowSpan = sd.rowspan + 1;
+ function getTableGrid(table) {
+ var grid = new Array();
+ var rows = table.rows;
+
+ for (var y=0; y 1) { // Remove due to colspan
+ for (var i=x; i 1)
+ td.rowSpan = sd.rowspan + 1;
- function nextElm(node, names) {
- var namesAr = names.split(',');
+ lastElm = td;
+ }
- while ((node = node.nextSibling) != null) {
- for (var i=0; i 1) {
- do {
- var nexttd = nextElm(td, "TD,TH");
-
- if (td._delete)
- td.parentNode.removeChild(td);
- } while ((td = nexttd) != null);
- }
- } while ((tr = next) != null);
- }
+ return null;
+ }
- function addRows(td_elm, tr_elm, rowspan) {
- // Add rows
- td_elm.rowSpan = 1;
- var trNext = nextElm(tr_elm, "TR");
- for (var i=1; i 1) {
+ do {
+ var nexttd = nextElm(td, "TD,TH");
+
+ if (td._delete)
+ td.parentNode.removeChild(td);
+ } while ((td = nexttd) != null);
+ }
+ } while ((tr = next) != null);
+ }
- // Reset col/row span
- newTD.colSpan = 1;
- newTD.rowSpan = 1;
+ function addRows(td_elm, tr_elm, rowspan) {
+ // Add rows
+ td_elm.rowSpan = 1;
+ var trNext = nextElm(tr_elm, "TR");
+ for (var i=1; i 1) {
- var newTD = cells[x].cloneNode(true);
- var sd = getColRowSpan(cells[x]);
+ var grid = getTableGrid(tableElm);
+ var cpos = getCellPos(grid, tdElm);
+ var newTR = doc.createElement("tr");
+ var lastTDElm = null;
- newTD.rowSpan = sd.rowspan - 1;
+ // Create cells
+ for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+ if (tdElm != lastTDElm) {
+ var sd = getColRowSpan(tdElm);
- var nextTD = nextTR.cells[x];
+ if (sd['rowspan'] == 1) {
+ var newTD = doc.createElement("td");
- if (nextTD == null)
- nextTR.appendChild(newTD);
- else
- nextTR.insertBefore(newTD, nextTD);
- }
- }
+ newTD.innerHTML = " ";
+ newTD.colSpan = tdElm.colSpan;
- // Delete cells
- var lastTDElm = null;
- for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
- if (tdElm != lastTDElm) {
- var sd = getColRowSpan(tdElm);
-
- if (sd.rowspan > 1) {
- tdElm.rowSpan = sd.rowspan - 1;
- } else {
- trElm = tdElm.parentNode;
+ newTR.appendChild(newTD);
+ } else
+ tdElm.rowSpan = sd['rowspan'] + 1;
- if (trElm.parentNode)
- trElm._delete = true;
+ lastTDElm = tdElm;
}
+ }
- lastTDElm = tdElm;
+ if (newTR.hasChildNodes()) {
+ var nextTR = nextElm(trElm, "TR");
+ if (nextTR)
+ nextTR.parentNode.insertBefore(newTR, nextTR);
+ else
+ tableElm.appendChild(newTR);
}
- }
+ break;
- deleteMarked(tableElm);
+ case "mceTableDeleteRow":
+ if (!trElm || !tdElm)
+ return true;
+
+ var grid = getTableGrid(tableElm);
+ var cpos = getCellPos(grid, tdElm);
- cpos.rowindex--;
- if (cpos.rowindex < 0)
- cpos.rowindex = 0;
+ // Only one row, remove whole table
+ if (grid.length == 1) {
+ tableElm.parentNode.removeChild(tableElm);
+ return true;
+ }
- inst.selectNode(getCell(grid, cpos.rowindex, 0), true, true);
- break;
+ // Move down row spanned cells
+ var cells = trElm.cells;
+ var nextTR = nextElm(trElm, "TR");
+ for (var x=0; x 1) {
+ var newTD = cells[x].cloneNode(true);
+ var sd = getColRowSpan(cells[x]);
- case "mceTableInsertColBefore":
- if (!trElm || !tdElm)
- return true;
+ newTD.rowSpan = sd.rowspan - 1;
- var grid = getTableGrid(tableElm);
- var cpos = getCellPos(grid, tdElm);
- var lastTDElm = null;
+ var nextTD = nextTR.cells[x];
- for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
- if (tdElm != lastTDElm) {
- var sd = getColRowSpan(tdElm);
-
- if (sd['colspan'] == 1) {
- var newTD = doc.createElement(tdElm.nodeName);
+ if (nextTD == null)
+ nextTR.appendChild(newTD);
+ else
+ nextTR.insertBefore(newTD, nextTD);
+ }
+ }
- newTD.innerHTML = " ";
- newTD.rowSpan = tdElm.rowSpan;
+ // Delete cells
+ var lastTDElm = null;
+ for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+ if (tdElm != lastTDElm) {
+ var sd = getColRowSpan(tdElm);
+
+ if (sd.rowspan > 1) {
+ tdElm.rowSpan = sd.rowspan - 1;
+ } else {
+ trElm = tdElm.parentNode;
- tdElm.parentNode.insertBefore(newTD, tdElm);
- } else
- tdElm.colSpan++;
+ if (trElm.parentNode)
+ trElm._delete = true;
+ }
- lastTDElm = tdElm;
+ lastTDElm = tdElm;
+ }
}
- }
- break;
- case "mceTableInsertColAfter":
- if (!trElm || !tdElm)
- return true;
+ deleteMarked(tableElm);
- var grid = getTableGrid(tableElm);
- var cpos = getCellPos(grid, tdElm);
- var lastTDElm = null;
+ cpos.rowindex--;
+ if (cpos.rowindex < 0)
+ cpos.rowindex = 0;
+
+ inst.selection.selectNode(getCell(grid, cpos.rowindex, 0), true, true);
+ break;
- for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
- if (tdElm != lastTDElm) {
- var sd = getColRowSpan(tdElm);
+ case "mceTableInsertColBefore":
+ if (!trElm || !tdElm)
+ return true;
- if (sd['colspan'] == 1) {
- var newTD = doc.createElement(tdElm.nodeName);
+ var grid = getTableGrid(tableElm);
+ var cpos = getCellPos(grid, tdElm);
+ var lastTDElm = null;
- newTD.innerHTML = " ";
- newTD.rowSpan = tdElm.rowSpan;
+ for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
+ if (tdElm != lastTDElm) {
+ var sd = getColRowSpan(tdElm);
- var nextTD = nextElm(tdElm, "TD,TH");
- if (nextTD == null)
- tdElm.parentNode.appendChild(newTD);
- else
- nextTD.parentNode.insertBefore(newTD, nextTD);
- } else
- tdElm.colSpan++;
+ if (sd['colspan'] == 1) {
+ var newTD = doc.createElement(tdElm.nodeName);
- lastTDElm = tdElm;
+ newTD.innerHTML = " ";
+ newTD.rowSpan = tdElm.rowSpan;
+
+ tdElm.parentNode.insertBefore(newTD, tdElm);
+ } else
+ tdElm.colSpan++;
+
+ lastTDElm = tdElm;
+ }
}
- }
- break;
+ break;
- case "mceTableDeleteCol":
- if (!trElm || !tdElm)
- return true;
+ case "mceTableInsertColAfter":
+ if (!trElm || !tdElm)
+ return true;
- var grid = getTableGrid(tableElm);
- var cpos = getCellPos(grid, tdElm);
- var lastTDElm = null;
+ var grid = getTableGrid(tableElm);
+ var cpos = getCellPos(grid, tdElm);
+ var lastTDElm = null;
- // Only one col, remove whole table
- if (grid.length > 1 && grid[0].length <= 1) {
- tableElm.parentNode.removeChild(tableElm);
- return true;
- }
+ for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
+ if (tdElm != lastTDElm) {
+ var sd = getColRowSpan(tdElm);
+
+ if (sd['colspan'] == 1) {
+ var newTD = doc.createElement(tdElm.nodeName);
+
+ newTD.innerHTML = " ";
+ newTD.rowSpan = tdElm.rowSpan;
+
+ var nextTD = nextElm(tdElm, "TD,TH");
+ if (nextTD == null)
+ tdElm.parentNode.appendChild(newTD);
+ else
+ nextTD.parentNode.insertBefore(newTD, nextTD);
+ } else
+ tdElm.colSpan++;
- // Delete cells
- for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
- if (tdElm != lastTDElm) {
- var sd = getColRowSpan(tdElm);
-
- if (sd['colspan'] > 1)
- tdElm.colSpan = sd['colspan'] - 1;
- else {
- if (tdElm.parentNode)
- tdElm.parentNode.removeChild(tdElm);
+ lastTDElm = tdElm;
}
-
- lastTDElm = tdElm;
}
- }
+ break;
- cpos.cellindex--;
- if (cpos.cellindex < 0)
- cpos.cellindex = 0;
+ case "mceTableDeleteCol":
+ if (!trElm || !tdElm)
+ return true;
- inst.selectNode(getCell(grid, 0, cpos.cellindex), true, true);
- break;
+ var grid = getTableGrid(tableElm);
+ var cpos = getCellPos(grid, tdElm);
+ var lastTDElm = null;
- case "mceTableSplitCells":
- if (!trElm || !tdElm)
- return true;
+ // Only one col, remove whole table
+ if (grid.length > 1 && grid[0].length <= 1) {
+ tableElm.parentNode.removeChild(tableElm);
+ return true;
+ }
- var spandata = getColRowSpan(tdElm);
+ // Delete cells
+ for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
+ if (tdElm != lastTDElm) {
+ var sd = getColRowSpan(tdElm);
+
+ if (sd['colspan'] > 1)
+ tdElm.colSpan = sd['colspan'] - 1;
+ else {
+ if (tdElm.parentNode)
+ tdElm.parentNode.removeChild(tdElm);
+ }
- var colspan = spandata["colspan"];
- var rowspan = spandata["rowspan"];
+ lastTDElm = tdElm;
+ }
+ }
- // Needs splitting
- if (colspan > 1 || rowspan > 1) {
- // Generate cols
- tdElm.colSpan = 1;
- for (var i=1; i 1)
- addRows(newTD, trElm, rowspan);
- }
+ var spandata = getColRowSpan(tdElm);
- addRows(tdElm, trElm, rowspan);
- }
+ var colspan = spandata["colspan"];
+ var rowspan = spandata["rowspan"];
- // Apply visual aids
- tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
- break;
+ // Needs splitting
+ if (colspan > 1 || rowspan > 1) {
+ // Generate cols
+ tdElm.colSpan = 1;
+ for (var i=1; i 1)
+ addRows(newTD, trElm, rowspan);
+ }
- if (("" + numRows) == "NaN")
- numRows = 1;
+ addRows(tdElm, trElm, rowspan);
+ }
- if (("" + numCols) == "NaN")
- numCols = 1;
+ // Apply visual aids
+ tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+ break;
- // Get rows and cells
- var tRows = tableElm.rows;
- for (var y=cpos.rowindex; y 0)
+ rows[rows.length] = rowCells;
}
- if (rowCells.length > 0)
- rows[rows.length] = rowCells;
+ //return true;
}
+ } else {
+ var cells = new Array();
+ var sel = inst.getSel();
+ var lastTR = null;
+ var curRow = null;
+ var x1 = -1, y1 = -1, x2, y2;
- //return true;
- }
- } else {
- var cells = new Array();
- var sel = inst.getSel();
- var lastTR = null;
- var curRow = null;
- var x1 = -1, y1 = -1, x2, y2;
+ // Only one cell selected, whats the point?
+ if (sel.rangeCount < 2)
+ return true;
- // Only one cell selected, whats the point?
- if (sel.rangeCount < 2)
- return true;
+ // Get all selected cells
+ for (var i=0; i 0)
+ rows[rows.length] = rowCells;
}
- if (rowCells.length > 0)
- rows[rows.length] = rowCells;
- }
+ // Find selected cells in grid and box
+ var curRow = new Array();
+ var lastTR = null;
+ for (var y=0; y colSpan)
+ colSpan = rowColSpan;
+
+ lastRowSpan = -1;
}
- if (rowColSpan > colSpan)
- colSpan = rowColSpan;
+ // Validate vertical and get total rowspan
+ var lastColSpan = -1;
+ for (var x=0; x rowSpan)
+ rowSpan = colRowSpan;
+
+ lastColSpan = -1;
}
- if (colRowSpan > rowSpan)
- rowSpan = colRowSpan;
+ // Setup td
+ tdElm = rows[0][0];
+ tdElm.rowSpan = rowSpan;
+ tdElm.colSpan = colSpan;
- lastColSpan = -1;
- }
+ // Merge cells
+ for (var y=0; y " && chk != " " && chk != " " && (x+y > 0))
+ tdElm.innerHTML += html;
+
+ // Not current cell
+ if (rows[y][x] != tdElm && !rows[y][x]._deleted) {
+ var cpos = getCellPos(grid, rows[y][x]);
+ var tr = rows[y][x].parentNode;
+
+ tr.removeChild(rows[y][x]);
+ rows[y][x]._deleted = true;
+
+ // Empty TR, remove it
+ if (!tr.hasChildNodes()) {
+ tr.parentNode.removeChild(tr);
+
+ var lastCell = null;
+ for (var x=0; cellElm = getCell(grid, cpos.rowindex, x); x++) {
+ if (cellElm != lastCell && cellElm.rowSpan > 1)
+ cellElm.rowSpan--;
- // Setup td
- tdElm = rows[0][0];
- tdElm.rowSpan = rowSpan;
- tdElm.colSpan = colSpan;
-
- // Merge cells
- for (var y=0; y " && chk != " " && chk != " " && (x+y > 0))
- tdElm.innerHTML += html;
-
- // Not current cell
- if (rows[y][x] != tdElm && !rows[y][x]._deleted) {
- var cpos = getCellPos(grid, rows[y][x]);
- var tr = rows[y][x].parentNode;
-
- tr.removeChild(rows[y][x]);
- rows[y][x]._deleted = true;
-
- // Empty TR, remove it
- if (!tr.hasChildNodes()) {
- tr.parentNode.removeChild(tr);
-
- var lastCell = null;
- for (var x=0; cellElm = getCell(grid, cpos.rowindex, x); x++) {
- if (cellElm != lastCell && cellElm.rowSpan > 1)
- cellElm.rowSpan--;
+ lastCell = cellElm;
+ }
- lastCell = cellElm;
+ if (tdElm.rowSpan > 1)
+ tdElm.rowSpan--;
}
-
- if (tdElm.rowSpan > 1)
- tdElm.rowSpan--;
}
}
}
+
+ break;
}
- break;
+ tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+ tinyMCE.handleVisualAid(tableElm, true, tinyMCE.settings['visual'], tinyMCE.selectedInstance);
+ tinyMCE.triggerNodeChange();
+ inst.repaint();
}
- tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
- tinyMCE.handleVisualAid(tableElm, true, tinyMCE.settings['visual'], tinyMCE.selectedInstance);
- tinyMCE.triggerNodeChange();
- inst.repaint();
- }
-
- return true;
- }
-
- // Pass to next handler in chain
- return false;
-}
-
-function TinyMCE_table_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
- var colspan = "1", rowspan = "1";
-
- var inst = tinyMCE.getInstanceById(editor_id);
-
- // Reset table controls
- tinyMCE.switchClassSticky(editor_id + '_table', 'mceButtonNormal');
- tinyMCE.switchClassSticky(editor_id + '_row_props', 'mceButtonDisabled', true);
- tinyMCE.switchClassSticky(editor_id + '_cell_props', 'mceButtonDisabled', true);
- tinyMCE.switchClassSticky(editor_id + '_row_before', 'mceButtonDisabled', true);
- tinyMCE.switchClassSticky(editor_id + '_row_after', 'mceButtonDisabled', true);
- tinyMCE.switchClassSticky(editor_id + '_delete_row', 'mceButtonDisabled', true);
- tinyMCE.switchClassSticky(editor_id + '_col_before', 'mceButtonDisabled', true);
- tinyMCE.switchClassSticky(editor_id + '_col_after', 'mceButtonDisabled', true);
- tinyMCE.switchClassSticky(editor_id + '_delete_col', 'mceButtonDisabled', true);
- tinyMCE.switchClassSticky(editor_id + '_split_cells', 'mceButtonDisabled', true);
- tinyMCE.switchClassSticky(editor_id + '_merge_cells', 'mceButtonDisabled', true);
-
- // Within a tr element
- if (tinyMCE.getParentElement(node, "tr"))
- tinyMCE.switchClassSticky(editor_id + '_row_props', 'mceButtonSelected', false);
-
- // Within a td element
- if (tdElm = tinyMCE.getParentElement(node, "td,th")) {
- tinyMCE.switchClassSticky(editor_id + '_cell_props', 'mceButtonSelected', false);
- tinyMCE.switchClassSticky(editor_id + '_row_before', 'mceButtonNormal', false);
- tinyMCE.switchClassSticky(editor_id + '_row_after', 'mceButtonNormal', false);
- tinyMCE.switchClassSticky(editor_id + '_delete_row', 'mceButtonNormal', false);
- tinyMCE.switchClassSticky(editor_id + '_col_before', 'mceButtonNormal', false);
- tinyMCE.switchClassSticky(editor_id + '_col_after', 'mceButtonNormal', false);
- tinyMCE.switchClassSticky(editor_id + '_delete_col', 'mceButtonNormal', false);
-
- colspan = tinyMCE.getAttrib(tdElm, "colspan");
- rowspan = tinyMCE.getAttrib(tdElm, "rowspan");
-
- colspan = colspan == "" ? "1" : colspan;
- rowspan = rowspan == "" ? "1" : rowspan;
+ return true;
+ }
- if (colspan != "1" || rowspan != "1")
- tinyMCE.switchClassSticky(editor_id + '_split_cells', 'mceButtonNormal', false);
+ // Pass to next handler in chain
+ return false;
}
+};
- // Within table
- if (tinyMCE.getParentElement(node, "table")) {
- tinyMCE.switchClassSticky(editor_id + '_table', 'mceButtonSelected');
- tinyMCE.switchClassSticky(editor_id + '_merge_cells', 'mceButtonNormal', false);
- }
-}
+tinyMCE.addPlugin("table", TinyMCE_TablePlugin);
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/jscripts/table.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/jscripts/table.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/jscripts/table.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/jscripts/table.js 2006-06-25 16:54:22.000000000 -0400
@@ -1,13 +1,14 @@
var action, orgTableWidth, orgTableHeight;
function insertTable() {
- tinyMCEPopup.restoreSelection();
-
var formObj = document.forms[0];
var inst = tinyMCE.selectedInstance;
var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className;
var html = '';
var elm = tinyMCE.tableElm;
+ var cellLimit, rowLimit, colLimit;
+
+ tinyMCEPopup.restoreSelection();
// Get form data
cols = formObj.elements['cols'].value;
@@ -28,6 +29,22 @@
lang = formObj.elements['lang'].value;
background = formObj.elements['backgroundimage'].value;
+ cellLimit = tinyMCE.getParam('table_cell_limit', false);
+ rowLimit = tinyMCE.getParam('table_row_limit', false);
+ colLimit = tinyMCE.getParam('table_col_limit', false);
+
+ // Validate table size
+ if (colLimit && cols > colLimit) {
+ alert(tinyMCE.getLang('lang_table_col_limit', '', true, {cols : colLimit}));
+ return false;
+ } else if (rowLimit && rows > rowLimit) {
+ alert(tinyMCE.getLang('lang_table_row_limit', '', true, {rows : rowLimit}));
+ return false;
+ } else if (cellLimit && cols * rows > cellLimit) {
+ alert(tinyMCE.getLang('lang_table_cell_limit', '', true, {cells : cellLimit}));
+ return false;
+ }
+
// Update table
if (action == "update") {
inst.execCommand('mceBeginUndoLevel');
@@ -150,7 +167,7 @@
value = value.replace(/&/g, '&');
value = value.replace(/\"/g, '"');
value = value.replace(//g, '&gr;');
+ value = value.replace(/>/g, '>');
return ' ' + attrib + '="' + value + '"';
}
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/langs/en.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/langs/en.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/langs/en.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/langs/en.js 2006-06-25 16:54:22.000000000 -0400
@@ -71,5 +71,8 @@
col : 'Col',
rowgroup : 'Row Group',
colgroup : 'Col Group',
+col_limit : 'You\'ve exceeded the maximum number of columns of {$cols}.',
+row_limit : 'You\'ve exceeded the maximum number of rows of {$rows}.',
+cell_limit : 'You\'ve exceeded the maximum number of cells of {$cells}.',
missing_scope: 'Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.'
});
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/row.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/row.htm
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/row.htm 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/row.htm 2006-06-25 16:54:22.000000000 -0400
@@ -58,7 +58,7 @@
-
+
{$lang_class_name}
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/table.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/table.htm
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/table.htm 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/table.htm 2006-06-25 16:54:22.000000000 -0400
@@ -52,7 +52,7 @@
{$lang_table_height}
-
+
{$lang_class_name}
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/editor_plugin.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/editor_plugin.js 2006-06-25 16:54:20.000000000 -0400
@@ -1,6 +1 @@
-function TinyMCE_zoom_getInfo(){return{longname:'Zoom',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_zoom.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_zoom_getControlHTML(control_name){if(!tinyMCE.isMSIE||tinyMCE.isMSIE5_0||tinyMCE.isOpera)return "";switch(control_name){case "zoom":return '\
- + 100% \
- + 150% \
- + 200% \
- + 250% \
- ';}return "";}function TinyMCE_zoom_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceZoom":tinyMCE.getInstanceById(editor_id).contentDocument.body.style.zoom=value;tinyMCE.getInstanceById(editor_id).contentDocument.body.style.mozZoom=value;return true;}return false;}
\ No newline at end of file
+var TinyMCE_ZoomPlugin={getInfo:function(){return{longname:'Zoom',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_zoom.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(control_name){if(!tinyMCE.isMSIE||tinyMCE.isMSIE5_0||tinyMCE.isOpera)return"";switch(control_name){case"zoom":return''+'+ 100% '+'+ 150% '+'+ 200% '+'+ 250% '+' ';}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceZoom":tinyMCE.getInstanceById(editor_id).contentDocument.body.style.zoom=value;tinyMCE.getInstanceById(editor_id).contentDocument.body.style.mozZoom=value;return true;}return false;}};tinyMCE.addPlugin("zoom",TinyMCE_ZoomPlugin);
\ No newline at end of file
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/editor_plugin_src.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/editor_plugin_src.js 2006-06-25 16:54:20.000000000 -0400
@@ -1,47 +1,58 @@
-/* Import plugin specific language pack */
-
-function TinyMCE_zoom_getInfo() {
- return {
- longname : 'Zoom',
- author : 'Moxiecode Systems',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_zoom.html',
- version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
- };
-};
-
/**
- * Returns the HTML contents of the zoom control.
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.10 $
+ * $Date: 2006/04/07 15:52:50 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
-function TinyMCE_zoom_getControlHTML(control_name) {
- if (!tinyMCE.isMSIE || tinyMCE.isMSIE5_0 || tinyMCE.isOpera)
- return "";
- switch (control_name) {
- case "zoom":
- return '\
- + 100% \
- + 150% \
- + 200% \
- + 250% \
- ';
- }
+var TinyMCE_ZoomPlugin = {
+ getInfo : function() {
+ return {
+ longname : 'Zoom',
+ author : 'Moxiecode Systems',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_zoom.html',
+ version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+ };
+ },
+
+ /**
+ * Returns the HTML contents of the zoom control.
+ */
+ getControlHTML : function(control_name) {
+ if (!tinyMCE.isMSIE || tinyMCE.isMSIE5_0 || tinyMCE.isOpera)
+ return "";
+
+ switch (control_name) {
+ case "zoom":
+ return '' +
+ '+ 100% ' +
+ '+ 150% ' +
+ '+ 200% ' +
+ '+ 250% ' +
+ ' ';
+ }
- return "";
-}
+ return "";
+ },
-/**
- * Executes the mceZoom command.
- */
-function TinyMCE_zoom_execCommand(editor_id, element, command, user_interface, value) {
- // Handle commands
- switch (command) {
- case "mceZoom":
- tinyMCE.getInstanceById(editor_id).contentDocument.body.style.zoom = value;
- tinyMCE.getInstanceById(editor_id).contentDocument.body.style.mozZoom = value;
- return true;
+ /**
+ * Executes the mceZoom command.
+ */
+ execCommand : function(editor_id, element, command, user_interface, value) {
+ // Handle commands
+ switch (command) {
+ case "mceZoom":
+ tinyMCE.getInstanceById(editor_id).contentDocument.body.style.zoom = value;
+ tinyMCE.getInstanceById(editor_id).contentDocument.body.style.mozZoom = value;
+ return true;
+ }
+
+ // Pass to next handler in chain
+ return false;
}
+};
- // Pass to next handler in chain
- return false;
-}
+tinyMCE.addPlugin("zoom", TinyMCE_ZoomPlugin);
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/es.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/es.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/es.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/es.js 1969-12-31 19:00:00.000000000 -0500
@@ -1,3 +0,0 @@
-// Español por matiasl-AR
-
-tinyMCELang['lang_zoom_prefix'] = 'Aumento de Tamaño';
\ No newline at end of file
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/he.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/he.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/he.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/he.js 1969-12-31 19:00:00.000000000 -0500
@@ -1,5 +0,0 @@
-// HE lang variables by Liron Newman, http://eesh.net
-
-tinyMCE.addToLang('',{
-zoom_prefix : 'æåí'
-});
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/index.html joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/index.html
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/index.html 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/index.html 1969-12-31 19:00:00.000000000 -0500
@@ -1 +0,0 @@
-
\ No newline at end of file
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru.js 1969-12-31 19:00:00.000000000 -0500
@@ -1,5 +0,0 @@
-// RU cp1251 lang variables
-
-tinyMCE.addToLang('',{
-zoom_prefix : 'ìàñøòàá'
-});
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru_KOI8-R.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru_KOI8-R.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru_KOI8-R.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru_KOI8-R.js 1969-12-31 19:00:00.000000000 -0500
@@ -1,5 +0,0 @@
-// RU KOI8-R lang variables
-
-tinyMCE.addToLang('',{
-zoom_prefix : 'ÍÁÓÛÔÁÂ'
-});
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru_UTF-8.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru_UTF-8.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru_UTF-8.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru_UTF-8.js 1969-12-31 19:00:00.000000000 -0500
@@ -1,5 +0,0 @@
-// RU UTF-8 lang variables
-
-tinyMCE.addToLang('',{
-zoom_prefix : 'маÑштаб'
-});
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/readme.txt joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/readme.txt
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/readme.txt 1969-12-31 19:00:00.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/readme.txt 2006-06-25 16:54:20.000000000 -0400
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/about.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/about.htm
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/about.htm 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/about.htm 2006-06-25 16:54:35.000000000 -0400
@@ -4,14 +4,15 @@
-
@@ -22,7 +23,7 @@
Version: {$tinymce_version} ({$tinymce_releasedate})
TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL
by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.
- Copyright © 2005, Moxiecode Systems AB , All rights reserved.
+ Copyright © 2003-2006, Moxiecode Systems AB , All rights reserved.
For more information about this software visit the TinyMCE website .
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm 2006-06-25 16:54:35.000000000 -0400
@@ -5,7 +5,7 @@
-
+
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_content.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_content.css
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_content.css 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_content.css 2006-06-25 16:54:35.000000000 -0400
@@ -1,34 +1,24 @@
/* This file contains the CSS data for the editable area(iframe) of TinyMCE */
/* You can extend this CSS by adding your own CSS file with the the content_css option */
-body {
- background-color: #FFFFFF;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 10px;
- scrollbar-3dlight-color: #F0F0EE;
- scrollbar-arrow-color: #676662;
- scrollbar-base-color: #F0F0EE;
- scrollbar-darkshadow-color: #DDDDDD;
- scrollbar-face-color: #E0E0DD;
- scrollbar-highlight-color: #F0F0EE;
- scrollbar-shadow-color: #F0F0EE;
- scrollbar-track-color: #F5F5F5;
-}
-
-td {
+body, td, pre {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
-pre {
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 10px;
+body {
+ background-color: #FFFFFF;
}
.mceVisualAid {
border: 1px dashed #BBBBBB !important;
}
+div.mceVisualAid {
+ background-image:url('../images/spacer.gif');
+ visibility: visible !important;
+}
+
.mceItemAnchor {
width: 12px;
line-height: 6px;
@@ -53,3 +43,16 @@
color: green;
}
*/
+
+/* MSIE specific */
+
+* html body {
+ 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;
+}
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_popup.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_popup.css
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_popup.css 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_popup.css 2006-06-25 16:54:35.000000000 -0400
@@ -35,14 +35,14 @@
}
.input_noborder {
- border: 0px solid #808080;
+ border: 0;
}
-#insert {
+#insert, .updateButton {
font-weight: bold;
width: 90px;
height: 21px;
- border: 0px;
+ border: 0;
background-image: url('../images/insert_button_bg.gif');
cursor: pointer;
}
@@ -51,7 +51,7 @@
font-weight: bold;
width: 90px;
height: 21px;
- border: 0px;
+ border: 0;
background-image: url('../images/cancel_button_bg.gif');
cursor: pointer;
}
@@ -84,7 +84,7 @@
td.charmapOver {
background-color: #CCCCCC;
- cursor: arrow;
+ cursor: default;
}
a.charmap {
@@ -120,17 +120,17 @@
border-bottom: 1px solid;
border-right: 1px solid;
border-color: #F0F0EE;
- cursor: arrow;
+ cursor: default;
}
.mceButtonOver {
border: 1px solid #0A246A;
- cursor: arrow;
+ cursor: default;
background-color: #B6BDD2;
}
.mceButtonDown {
- cursor: arrow;
+ cursor: default;
border: 1px solid #0A246A;
background-color: #8592B5;
}
@@ -144,7 +144,7 @@
border-bottom: 1px solid;
border-right: 1px solid;
border-color: #F0F0EE;
- cursor: arrow;
+ cursor: default;
}
.mceActionPanel {
@@ -162,7 +162,7 @@
.tabs ul {
margin: 0;
- padding: 0px 0px 0;
+ padding: 0 0 0;
list-style: none;
}
@@ -170,7 +170,7 @@
float: left;
background: url("../images/xp/tab_bg.gif") no-repeat left top;
margin: 0;
- margin-left: 0px;
+ margin-left: 0;
margin-right: 2px;
padding: 0 0 0 10px;
line-height: 18px;
@@ -185,7 +185,7 @@
float: left;
display: block;
background: url("../images/xp/tab_end.gif") no-repeat right top;
- padding: 0px 10px 0px 0px;
+ padding: 0px 10px 0 0;
}
.tabs .current span {
@@ -235,8 +235,8 @@
border: 1px solid #919B9C;
font-family: Verdana, Arial;
font-size: 10px;
- padding: 0px;
- margin: 0px;
+ padding: 0;
+ margin: 0;
padding: 4px;
}
@@ -295,8 +295,8 @@
h1, h2, h3, h4 {
color: #2B6FB6;
- margin: 0px;
- padding: 0px;
+ margin: 0;
+ padding: 0;
padding-top: 5px;
}
@@ -304,6 +304,14 @@
font-size: 14px;
}
+#link .panel_wrapper, #link div.current {
+ height: 125px;
+}
+
+#image .panel_wrapper, #image div.current {
+ height: 190px;
+}
+
/* Disables the advanced tab in the table plugin. */
/*
#table #advanced_tab {
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_ui.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_ui.css
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_ui.css 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_ui.css 2006-06-25 16:54:35.000000000 -0400
@@ -1,65 +1,14 @@
/* This file contains the CSS data for the editor UI of TinyMCE instances */
.mceToolbarTop a, .mceToolbarTop a:visited, .mceToolbarTop a:hover, .mceToolbarBottom a, .mceToolbarBottom a:visited, .mceToolbarBottom a:hover {
- border: 0px; margin: 0px; padding: 0px; background: transparent;
-}
-
-.mceButtonNormal, .mceButtonOver, .mceButtonDown, .mceSeparator, .mceSeparatorLine, .mceButtonDisabled, .mceButtonSelected {
- border: 0px; margin: 0px; padding: 0px; background: transparent;
- margin-top: 1px;
- margin-left: 1px;
- padding: 0px;
-}
-
-.mceButtonNormal {
- border: 1px solid #F0F0EE !important;
- cursor: arrow;
-}
-
-.mceButtonOver {
- border: 1px solid #0A246A !important;
- cursor: arrow;
- background-color: #B6BDD2;
-}
-
-.mceButtonDown {
- cursor: arrow;
- border: 1px solid #0A246A !important;
- background-color: #8592B5;
-}
-
-.mceButtonSelected {
- border: 1px solid #C0C0BB !important;
- cursor: arrow;
-}
-
-.mceButtonDisabled {
- filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
- -moz-opacity:0.3;
- opacity: 0.3;
- border: 1px solid #F0F0EE !important;
- 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;
+ border: 0; margin: 0; padding: 0; background: transparent;
}
.mceSeparatorLine {
- margin:2px;
+ border: 0;
+ padding: 0;
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;
+ margin-right: 2px;
}
.mceSelectList {
@@ -67,10 +16,10 @@
font-size: 7pt !important;
font-weight: normal;
margin-top: 3px;
- padding: 0px;
+ padding: 0;
display: inline;
vertical-align: top;
- background-color: #F0F0EE
+ background-color: #F0F0EE;
}
.mceLabel, .mceLabelDisabled {
@@ -90,15 +39,15 @@
.mceEditor {
background: #F0F0EE;
border: 1px solid #cccccc;
- padding: 0px;
- margin: 0px;
+ padding: 0;
+ margin: 0;
}
.mceEditorArea {
font-family: 'MS Sans Serif', sans-serif, Verdana, Arial;
background: #FFFFFF;
- padding: 0px;
- margin: 0px;
+ padding: 0;
+ margin: 0;
}
.mceToolbarTop, .mceToolbarBottom {
@@ -109,6 +58,7 @@
.mceToolbarTop {
border-bottom: 1px solid #cccccc;
+ padding-bottom: 1px;
}
.mceToolbarBottom {
@@ -168,6 +118,236 @@
height: 10px;
display: none;
border: 1px dotted gray;
- margin: 0px;
- padding: 0px;
+ margin: 0;
+ padding: 0;
+}
+
+.mceEditorIframe {
+ border: 0;
+}
+
+/* Button CSS rules */
+
+a.mceButtonDisabled img, a.mceButtonNormal img, a.mceButtonSelected img {
+ width: 20px;
+ height: 20px;
+ cursor: default;
+ margin-top: 1px;
+ margin-left: 1px;
+}
+
+a.mceButtonDisabled img {
+ border: 0 !important;
+}
+
+a.mceButtonNormal img, a.mceButtonSelected img {
+ border: 1px solid #F0F0EE !important;
+}
+
+a.mceButtonSelected img {
+ border: 1px solid #6779AA !important;
+ background-color: #D4D5D8;
+}
+
+a.mceButtonNormal img:hover, a.mceButtonSelected img:hover {
+ border: 1px solid #0A246A !important;
+ cursor: default;
+ background-color: #B6BDD2;
+}
+
+a.mceButtonDisabled img {
+ -moz-opacity:0.3;
+ opacity: 0.3;
+ border: 1px solid #F0F0EE !important;
+ cursor: default;
+}
+
+a.mceTiledButton img {
+ background-image: url('../images/buttons.gif');
+ background-repeat: no-repeat;
+}
+
+/* MSIE specific rules */
+
+* html a.mceButtonNormal img, * html a.mceButtonSelected img, * html a.mceButtonDisabled img {
+ border: 0 !important;
+ margin-top: 2px;
+ margin-bottom: 1px;
+}
+
+* html a.mceButtonDisabled img {
+ filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
+ border: 0 !important;
+}
+
+* html a.mceButtonDisabled {
+ border: 1px solid #F0F0EE !important;
+}
+
+* html a.mceButtonNormal, * html a.mceButtonSelected {
+ border: 1px solid #F0F0EE !important;
+ cursor: default;
+}
+
+* html a.mceButtonSelected {
+ border: 1px solid #6779AA !important;
+ background-color: #D4D5D8;
+}
+
+* html a.mceButtonNormal:hover, * html a.mceButtonSelected:hover {
+ border: 1px solid #0A246A !important;
+ cursor: default;
+ background-color: #B6BDD2;
+}
+
+* html .mceSelectList {
+ margin-top: 2px;
+}
+
+/* Menu button CSS rules */
+
+span.mceMenuButton img, span.mceMenuButtonSelected img {
+ border: 1px solid #F0F0EE;
+ margin-left: 1px;
+}
+
+span.mceMenuButtonSelected img {
+ border: 1px solid #6779AA;
+ background-color: #B6BDD2;
+}
+
+span.mceMenuButtonSelected img.mceMenuButton {
+ border: 1px solid #F0F0EE;
+ background-color: transparent;
+}
+
+span.mceMenuButton img.mceMenuButton, span.mceMenuButtonSelected img.mceMenuButton {
+ border-left: 0;
+ margin-left: 0;
+}
+
+span.mceMenuButton:hover img, span.mceMenuButtonSelected:hover img {
+ border: 1px solid #0A246A;
+ background-color: #B6BDD2;
+}
+
+span.mceMenuButton:hover img.mceMenuButton, span.mceMenuButtonSelected:hover img.mceMenuButton {
+ border-left: 0;
+}
+
+span.mceMenuButtonFocus img {
+ border: 1px solid gray;
+ border-right: 0;
+ margin-left: 1px;
+ background-color: #F5F4F2;
+}
+
+span.mceMenuButtonFocus img.mceMenuButton {
+ border: 1px solid gray;
+ border-left: 1px solid #F5F4F2;
+ margin-left: 0;
+}
+
+/* Menu button MSIE specific rules */
+
+* html span.mceMenuButton, * html span.mceMenuButtonFocus {
+ position: relative;
+ left: 0;
+ top: 0;
+}
+
+* html span.mceMenuButton img, * html span.mceMenuButtonSelected img, * html span.mceMenuButtonFocus img {
+ position: relative;
+ top: 1px;
+}
+
+* html span.mceMenuHover img {
+ border: 1px solid #0A246A;
+ background-color: #B6BDD2;
+}
+
+* html span.mceMenuButtonSelected.mceMenuHover img.mceMenuButton {
+ border: 1px solid #0A246A;
+ background-color: #B6BDD2;
+ border-left: 0;
+}
+
+/* Menu */
+
+.mceMenu {
+ position: absolute;
+ left: 0;
+ top: 0;
+ display: none;
+ z-index: 100;
+ background-color: white;
+ border: 1px solid gray;
+ font-weight: normal;
+}
+
+.mceMenu a, .mceMenuTitle, .mceMenuDisabled {
+ display: block;
+ width: 100%;
+ text-decoration: none;
+ background-color: white;
+ font-family: Tahoma, Verdana, Arial, Helvetica;
+ font-size: 11px;
+ line-height: 20px;
+ color: black;
+}
+
+.mceMenu a:hover {
+ background-color: #B6BDD2;
+ color: black;
+ text-decoration: none !important;
+}
+
+.mceMenu span {
+ padding-left: 10px;
+ padding-right: 10px;
+ display: block;
+ line-height: 20px;
+}
+
+.mceMenuSeparator {
+ border-bottom: 1px solid gray;
+ background-color: gray;
+ height: 1px;
+}
+
+.mceMenuTitle span {
+ padding-left: 5px;
+}
+
+.mceMenuTitle {
+ background-color: #DDDDDD;
+ font-weight: bold;
+}
+
+.mceMenuDisabled {
+ color: gray;
+}
+
+span.mceMenuSelectedItem {
+ background-image: url('../images/menu_check.gif');
+ background-repeat: no-repeat;
+ background-position: 5px 8px;
+ padding-left: 20px;
+}
+
+span.mceMenuCheckItem {
+ padding-left: 20px;
+}
+
+span.mceMenuLine {
+ display: block;
+ position: absolute;
+ left: 0;
+ top: -1px;
+ background-color: #F5F4F2;
+ width: 30px;
+ height: 1px;
+ overflow: hidden;
+ padding-left: 0;
+ padding-right: 0;
}
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js 2006-06-25 16:54:35.000000000 -0400
@@ -1,12 +1 @@
-tinyMCE.importThemeLanguagePack('advanced');var TinyMCE_advanced_autoImportCSSClasses=true;var TinyMCE_advanced_resizer=new Object();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','justifyleft.gif','{$lang_justifyleft_desc}','JustifyLeft'],['justifycenter','justifycenter.gif','{$lang_justifycenter_desc}','JustifyCenter'],['justifyright','justifyright.gif','{$lang_justifyright_desc}','JustifyRight'],['justifyfull','justifyfull.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','justifycenter.gif','charmap.gif','cleanup.gif','code.gif','copy.gif','custom_1.gif','cut.gif','forecolor.gif','justifyfull.gif','help.gif','hr.gif','image.gif','indent.gif','justifyleft.gif','link.gif','numlist.gif','outdent.gif','paste.gif','redo.gif','removeformat.gif','justifyright.gif','strikethrough.gif','sub.gif','sup.gif','undo.gif','unlink.gif','visualaid.gif');for(var i=0;i4?but[4]:false)+(but.length>5?',\''+but[5]+'\'':'')+')';return ' ';}}}var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+but[3]+'\','+(but.length>4?but[4]:false)+(but.length>5?',\''+but[5]+'\'':'')+')';return ' ';}}switch(button_name){case "formatselect":var html='';var formats=tinyMCE.getParam("theme_advanced_blockformats","p,address,pre,h1,h2,h3,h4,h5,h6",true).split(',');var lookup=[['p','{$lang_theme_paragraph}'],['address','{$lang_theme_address}'],['pre','{$lang_theme_pre}'],['h1','{$lang_theme_h1}'],['h2','{$lang_theme_h2}'],['h3','{$lang_theme_h3}'],['h4','{$lang_theme_h4}'],['h5','{$lang_theme_h5}'],['h6','{$lang_theme_h6}']];html+='{$lang_theme_block} ';for(var i=0;i'+lookup[x][1]+'';}}}html+=' ';return html;case "styleselect":return '{$style_select_options} ';case "fontselect":var fontHTML='{$lang_theme_fontdefault} ';var iFonts='Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';var nFonts='Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sand;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';var fonts=tinyMCE.getParam("theme_advanced_fonts",nFonts).split(';');for(var i=0;i'+parts[0]+'';}}fontHTML+=' ';return fontHTML;case "fontsizeselect":return '\
- {$lang_theme_font_size} \
- 1 (8 pt) \
- 2 (10 pt) \
- 3 (12 pt) \
- 4 (14 pt) \
- 5 (18 pt) \
- 6 (24 pt) \
- 7 (36 pt) \
- ';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 elm=tinyMCE.selectedInstance.getFocusElement();var inputColor=tinyMCE.getAttrib(elm,"color");if(inputColor=='')inputColor=elm.style.color;if(!inputColor)inputColor="#000000";template['file']='color_picker.htm';template['width']=220;template['height']=190;tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",command:"forecolor",input_color:inputColor});return true;case "mceBackColor":var template=new Array();var elm=tinyMCE.selectedInstance.getFocusElement();var inputColor=elm.style.backgroundColor;if(!inputColor)inputColor="#000000";template['file']='color_picker.htm';template['width']=220;template['height']=190;template['width']+=tinyMCE.getLang('lang_theme_advanced_backcolor_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_backcolor_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",command:"HiliteColor",input_color:inputColor});return true;case "mceColorPicker":if(user_interface){var template=new Array();var inputColor=value['document'].getElementById(value['element_id']).value;template['file']='color_picker.htm';template['width']=220;template['height']=190;template['close_previous']="no";template['width']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height',0);if(typeof(value['store_selection'])=="undefined")value['store_selection']=true;tinyMCE.lastColorPickerValue=value;tinyMCE.openWindow(template,{editor_id:editor_id,mce_store_selection:value['store_selection'],inline:"yes",command:"mceColorPicker",input_color:inputColor});}else{var savedVal=tinyMCE.lastColorPickerValue;var elm=savedVal['document'].getElementById(savedVal['element_id']);elm.value=value;eval('elm.onchange();');}return true;case "mceCodeEditor":var template=new Array();template['file']='source_editor.htm';template['width']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_width",500));template['height']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_height",400));tinyMCE.openWindow(template,{editor_id:editor_id,resizable:"yes",scrollbars:"no",inline:"yes"});return true;case "mceCharMap":var template=new Array();template['file']='charmap.htm';template['width']=550+(tinyMCE.isOpera?40:0);template['height']=250;template['width']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case "mceInsertAnchor":var template=new Array();template['file']='anchor.htm';template['width']=320;template['height']=90+(tinyMCE.isNS7?30:0);template['width']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});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
';var layoutManager=tinyMCE.getParam("theme_advanced_layout_manager","SimpleLayout");var styleSelectHTML='{$lang_theme_style_select} ';if(settings['theme_advanced_styles']){var stylesAr=settings['theme_advanced_styles'].split(';');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 statusbarLocation=tinyMCE.getParam("theme_advanced_statusbar_location",pathLocation);var defVals={theme_advanced_buttons1:"bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,separator,sub,sup,separator,charmap"};toolbarHTML+=' ';for(var i=1;i<100;i++){var def=defVals["theme_advanced_buttons"+i];var buttons=tinyMCE.getParam("theme_advanced_buttons"+i,def==null?'':def,true,',');if(buttons.length==0)break;buttons=removeFromArray(buttons,tinyMCE.getParam("theme_advanced_disable","",true,','));buttons=addToArray(buttons,tinyMCE.getParam("theme_advanced_buttons"+i+"_add","",true,','));buttons=addToArray(tinyMCE.getParam("theme_advanced_buttons"+i+"_add_before","",true,','),buttons);for(var b=0;b0){toolbarHTML+=" ";deltaHeight-=23;}}toolbarHTML+=' ';template['html']='';if(toolbarLocation=="top"){template['html']+=''+toolbarHTML+' ';}if(statusbarLocation=="top"){template['html']+=''+statusbarHTML+' ';deltaHeight-=23;}template['html']+=' ';if(toolbarLocation=="bottom"){template['html']+=''+toolbarHTML+' ';}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.applyTemplate(toolbarHTML);elm.className="mceToolbarExternal";elm.id=editorId+"_toolbar";elm.innerHTML='';bod.appendChild(elm);deltaHeight=0;tinyMCE.getInstanceById(editorId).toolbarElement=elm;}else{tinyMCE.getInstanceById(editorId).toolbarElement=null;}if(statusbarLocation=="bottom"){template['html']+=''+statusbarHTML+' ';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"||containers[i]=="mceStatusbar"){var pathClass="mceStatusbar";if(i==containers.length-1){pathClass="mceStatusbarBottom";}else if(i==0){pathClass="mceStatusbar";}else{deltaHeight-=2;}template['html']+=''+statusbarHTML+' ';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']+=''+curContainerHTML+' ';}}template['html']+='
';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;}if(resizing)template['html']+=' ';template['html']=tinyMCE.replaceVar(template['html'],'style_select_options',styleSelectHTML);template['delta_width']=0;template['delta_height']=deltaHeight;return template;}function TinyMCE_advanced_setResizing(e,editor_id,state){e=typeof(e)=="undefined"?window.event:e;var resizer=TinyMCE_advanced_resizer;var editorContainer=document.getElementById(editor_id+'_parent');var editorArea=document.getElementById(editor_id+'_parent').firstChild;var resizeBox=document.getElementById(editor_id+'_resize_box');var inst=tinyMCE.getInstanceById(editor_id);if(state){var width=editorArea.clientWidth;var height=editorArea.clientHeight;resizeBox.style.width=width+"px";resizeBox.style.height=height+"px";resizer.iframeWidth=inst.iframeElement.clientWidth;resizer.iframeHeight=inst.iframeElement.clientHeight;editorArea.style.display="none";resizeBox.style.display="block";if(!resizer.eventHandlers){if(tinyMCE.isMSIE)tinyMCE.addEvent(document,"mousemove",TinyMCE_advanced_resizeEventHandler);else tinyMCE.addEvent(window,"mousemove",TinyMCE_advanced_resizeEventHandler);tinyMCE.addEvent(document,"mouseup",TinyMCE_advanced_resizeEventHandler);resizer.eventHandlers=true;}resizer.resizing=true;resizer.downX=e.screenX;resizer.downY=e.screenY;resizer.width=parseInt(resizeBox.style.width);resizer.height=parseInt(resizeBox.style.height);resizer.editorId=editor_id;resizer.resizeBox=resizeBox;resizer.horizontal=tinyMCE.getParam("theme_advanced_resize_horizontal",true);}else{resizer.resizing=false;resizeBox.style.display="none";editorArea.style.display=tinyMCE.isMSIE?"block":"table";tinyMCE.execCommand('mceResetDesignMode');}}function TinyMCE_advanced_initInstance(inst){if(tinyMCE.getParam("theme_advanced_resizing",false)){if(tinyMCE.getParam("theme_advanced_resizing_use_cookie",true)){var w=TinyMCE_advanced_getCookie("TinyMCE_"+inst.editorId+"_width");var h=TinyMCE_advanced_getCookie("TinyMCE_"+inst.editorId+"_height");TinyMCE_advanced_resizeTo(inst,w,h,tinyMCE.getParam("theme_advanced_resize_horizontal",true));}}}function TinyMCE_advanced_setCookie(name,value,expires,path,domain,secure){var curCookie=name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+escape(path):"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");document.cookie=curCookie;}function TinyMCE_advanced_getCookie(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}else begin+=2;var end=document.cookie.indexOf(";",begin);if(end==-1)end=dc.length;return unescape(dc.substring(begin+prefix.length,end));}function TinyMCE_advanced_resizeTo(inst,w,h,set_w){var editorContainer=document.getElementById(inst.editorId+'_parent');var tableElm=editorContainer.firstChild;var iframe=inst.iframeElement;if(w==null||w=="null"){set_w=false;w=0;}if(h==null||h=="null")return;w=parseInt(w);h=parseInt(h);if(tinyMCE.isGecko){w+=2;h+=2;}var dx=w-tableElm.clientWidth;var dy=h-tableElm.clientHeight;w=w<1?30:w;h=h<1?30:h;if(set_w)tableElm.style.width=w+"px";tableElm.style.height=h+"px";iw=iframe.clientWidth+dx;ih=iframe.clientHeight+dy;iw=iw<1?30:iw;ih=ih<1?30:ih;if(tinyMCE.isGecko){iw-=2;ih-=2;}if(set_w)iframe.style.width=iw+"px";iframe.style.height=ih+"px";if(set_w){var tableBodyElm=tableElm.firstChild;var minIframeWidth=tableBodyElm.scrollWidth;if(inst.iframeElement.clientWidth=0;i--){var nodeName=path[i].nodeName.toLowerCase();var nodeData="";if(nodeName=="b"){nodeName="strong";}if(nodeName=="i"){nodeName="em";}if(nodeName=="span"){var cn=tinyMCE.getAttrib(path[i],"class");if(cn!=""&&cn.indexOf('mceItem')==-1)nodeData+="class: "+cn+" ";var st=tinyMCE.getAttrib(path[i],"style");if(st!=""){st=tinyMCE.serializeStyle(tinyMCE.parseStyle(st));nodeData+="style: "+st+" ";}}if(nodeName=="font"){if(tinyMCE.getParam("convert_fonts_to_spans"))nodeName="span";var face=tinyMCE.getAttrib(path[i],"face");if(face!="")nodeData+="font: "+face+" ";var size=tinyMCE.getAttrib(path[i],"size");if(size!="")nodeData+="size: "+size+" ";var color=tinyMCE.getAttrib(path[i],"color");if(color!="")nodeData+="color: "+color+" ";}if(getAttrib(path[i],'id')!=""){nodeData+="id: "+path[i].getAttribute('id')+" ";}var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1)nodeData+="class: "+className+" ";if(getAttrib(path[i],'src')!=""){var src=tinyMCE.getAttrib(path[i],"mce_src");if(src=="")src=tinyMCE.getAttrib(path[i],"src");nodeData+="src: "+src+" ";}if(getAttrib(path[i],'href')!=""){var href=tinyMCE.getAttrib(path[i],"mce_href");if(href=="")href=tinyMCE.getAttrib(path[i],"href");nodeData+="href: "+href+" ";}if(nodeName=="img"&&tinyMCE.getAttrib(path[i],"class").indexOf('mceItemFlash')!=-1){nodeName="flash";nodeData="src: "+path[i].getAttribute('title');}if(nodeName=="a"&&(anchor=tinyMCE.getAttrib(path[i],"name"))!=""){nodeName="a";nodeName+="#"+anchor;nodeData="";}if(getAttrib(path[i],'name').indexOf("mce_")!=0){var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1){nodeName+="."+className;}}var cmd='tinyMCE.execInstanceCommand(\''+editor_id+'\',\'mceSelectNodeDepth\',false,\''+i+'\');';html+=''+nodeName+' ';if(i>0){html+=" » ";}}pathElm.innerHTML=' '+tinyMCE.getLang('lang_theme_path')+": "+html+' ';}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');if(node.nodeName=="A"&&tinyMCE.getAttrib(node,"class").indexOf('mceItemAnchor')!=-1)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){if(!tinyMCE.isSafari&&!(tinyMCE.isMSIE&&!tinyMCE.isOpera)){var face=inst.queryCommandValue('FontName');face=face==null||face==""?"":face;selectByValue(selectElm,face,face!="");}else{var elm=tinyMCE.getParentElement(node,"font","face");if(elm){var family=tinyMCE.getAttrib(elm,"face");if(family=='')family=''+elm.style.fontFamily;if(!selectByValue(selectElm,family,family!=""))selectByValue(selectElm,"");}else selectByValue(selectElm,"");}}var selectElm=document.getElementById(editor_id+"_fontSizeSelect");if(selectElm){if(!tinyMCE.isSafari&&!tinyMCE.isOpera){var size=inst.queryCommandValue('FontSize');selectByValue(selectElm,size==null||size==""?"0":size);}else{var elm=tinyMCE.getParentElement(node,"font","size");if(elm){var size=tinyMCE.getAttrib(elm,"size");if(size==''){var sizes=new Array('','8px','10px','12px','14px','18px','24px','36px');size=''+elm.style.fontSize;for(var i=0;i0){selectElm.setAttribute('cssImported','true');}}};
\ No newline at end of file
+tinyMCE.importThemeLanguagePack('advanced');var TinyMCE_AdvancedTheme={_autoImportCSSClasses:true,_resizer:{},_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','justifyleft.gif','lang_justifyleft_desc','JustifyLeft'],['justifycenter','justifycenter.gif','lang_justifycenter_desc','JustifyCenter'],['justifyright','justifyright.gif','lang_justifyright_desc','JustifyRight'],['justifyfull','justifyfull.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']],_buttonMap:'anchor,backcolor,bold,bullist,charmap,cleanup,code,copy,cut,forecolor,help,hr,image,indent,italic,justifycenter,justifyfull,justifyleft,justifyright,link,newdocument,numlist,outdent,paste,redo,removeformat,strikethrough,sub,sup,underline,undo,unlink,visualaid,advhr,ltr,rtl,emotions,flash,fullpage,fullscreen,iespell,insertdate,inserttime,pastetext,pasteword,selectall,preview,print,save,replace,search,table,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,merge_cells,row_props,split_cells',getControlHTML:function(button_name){var i,x;for(i=0;i4?but[4]:false),(but.length>5?but[5]:null));}switch(button_name){case"formatselect":var html='';var formats=tinyMCE.getParam("theme_advanced_blockformats","p,address,pre,h1,h2,h3,h4,h5,h6",true).split(',');var lookup=[['p','{$lang_theme_paragraph}'],['address','{$lang_theme_address}'],['pre','{$lang_theme_pre}'],['h1','{$lang_theme_h1}'],['h2','{$lang_theme_h2}'],['h3','{$lang_theme_h3}'],['h4','{$lang_theme_h4}'],['h5','{$lang_theme_h5}'],['h6','{$lang_theme_h6}'],['div','{$lang_theme_div}'],['blockquote','{$lang_theme_blockquote}'],['code','{$lang_theme_code}'],['dt','{$lang_theme_dt}'],['dd','{$lang_theme_dd}'],['samp','{$lang_theme_samp}']];html+='{$lang_theme_block} ';for(var i=0;i'+lookup[x][1]+'';}}html+=' ';return html;case"styleselect":return'{$style_select_options} ';case"fontselect":var fontHTML='{$lang_theme_fontdefault} ';var iFonts='Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';var nFonts='Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sand;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';var fonts=tinyMCE.getParam("theme_advanced_fonts",nFonts).split(';');for(i=0;i'+parts[0]+'';}}fontHTML+=' ';return fontHTML;case"fontsizeselect":return''+'{$lang_theme_font_size} '+'1 (8 pt) '+'2 (10 pt) '+'3 (12 pt) '+'4 (14 pt) '+'5 (18 pt) '+'6 (24 pt) '+'7 (36 pt) '+' ';case"|":case"separator":return' ';case"spacer":return' ';case"rowseparator":return' ';}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceLink":var inst=tinyMCE.getInstanceById(editor_id);var doc=inst.getDoc();var selectedText="";if(tinyMCE.isMSIE){var rng=doc.selection.createRange();selectedText=rng.text;}else selectedText=inst.getSel().toString();if(!tinyMCE.linkElement){if((tinyMCE.selectedElement.nodeName.toLowerCase()!="img")&&(selectedText.length<=0))return true;}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,'onclick');style_class=tinyMCE.getAttrib(tinyMCE.linkElement,'class');if(onclick=="")onclick=tinyMCE.getAttrib(tinyMCE.linkElement,'onclick');onclick=tinyMCE.cleanupEventStr(onclick);href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement, true);");mceRealHref=tinyMCE.getAttrib(tinyMCE.linkElement,'mce_href');if(mceRealHref!=""){href=mceRealHref;if(tinyMCE.getParam('convert_urls'))href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement, true);");}action="update";}var template=new Array();template['file']='link.htm';template['width']=310;template['height']=200;template['width']+=tinyMCE.getLang('lang_insert_link_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_link_delta_height',0);if(inst.settings['insertlink_callback']){var returnVal=eval(inst.settings['insertlink_callback']+"(href, target, title, onclick, action, style_class);");if(returnVal&&returnVal['href'])TinyMCE_AdvancedTheme._insertLink(returnVal['href'],returnVal['target'],returnVal['title'],returnVal['onclick'],returnVal['style_class']);}else{tinyMCE.openWindow(template,{href:href,target:target,title:title,onclick:onclick,action:action,className:style_class,inline:"yes"});}return true;case"mceImage":var src="",alt="",border="",hspace="",vspace="",width="",height="",align="";var title="",onmouseover="",onmouseout="",action="insert";var img=tinyMCE.imgElement;var inst=tinyMCE.getInstanceById(editor_id);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 true;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:"";}src=eval(tinyMCE.settings['urlconverter_callback']+"(src, img, true);");mceRealSrc=tinyMCE.getAttrib(img,'mce_src');if(mceRealSrc!=""){src=mceRealSrc;if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, img, true);");}action="update";}var template=new Array();template['file']='image.htm?src={$src}';template['width']=355;template['height']=265+(tinyMCE.isMSIE?25:0);template['width']+=tinyMCE.getLang('lang_insert_image_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_image_delta_height',0);if(inst.settings['insertimage_callback']){var returnVal=eval(inst.settings['insertimage_callback']+"(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);");if(returnVal&&returnVal['src'])TinyMCE_AdvancedTheme._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(template,{src:src,alt:alt,border:border,hspace:hspace,vspace:vspace,width:width,height:height,align:align,title:title,onmouseover:onmouseover,onmouseout:onmouseout,action:action,inline:"yes"});return true;case"mceForeColor":var template=new Array();var elm=tinyMCE.selectedInstance.getFocusElement();var inputColor=tinyMCE.getAttrib(elm,"color");if(inputColor=='')inputColor=elm.style.color;if(!inputColor)inputColor="#000000";template['file']='color_picker.htm';template['width']=220;template['height']=190;tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",command:"forecolor",input_color:inputColor});return true;case"mceBackColor":var template=new Array();var elm=tinyMCE.selectedInstance.getFocusElement();var inputColor=elm.style.backgroundColor;if(!inputColor)inputColor="#000000";template['file']='color_picker.htm';template['width']=220;template['height']=190;template['width']+=tinyMCE.getLang('lang_theme_advanced_backcolor_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_backcolor_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",command:"HiliteColor",input_color:inputColor});return true;case"mceColorPicker":if(user_interface){var template=new Array();var inputColor=value['document'].getElementById(value['element_id']).value;template['file']='color_picker.htm';template['width']=220;template['height']=190;template['close_previous']="no";template['width']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height',0);if(typeof(value['store_selection'])=="undefined")value['store_selection']=true;tinyMCE.lastColorPickerValue=value;tinyMCE.openWindow(template,{editor_id:editor_id,mce_store_selection:value['store_selection'],inline:"yes",command:"mceColorPicker",input_color:inputColor});}else{var savedVal=tinyMCE.lastColorPickerValue;var elm=savedVal['document'].getElementById(savedVal['element_id']);elm.value=value;if(elm.onchange!=null&&elm.onchange!='')eval('elm.onchange();');}return true;case"mceCodeEditor":var template=new Array();template['file']='source_editor.htm';template['width']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_width",720));template['height']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_height",580));tinyMCE.openWindow(template,{editor_id:editor_id,resizable:"yes",scrollbars:"no",inline:"yes"});return true;case"mceCharMap":var template=new Array();template['file']='charmap.htm';template['width']=550+(tinyMCE.isOpera?40:0);template['height']=250;template['width']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case"mceInsertAnchor":var template=new Array();template['file']='anchor.htm';template['width']=320;template['height']=90+(tinyMCE.isNS7?30:0);template['width']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case"mceNewDocument":if(confirm(tinyMCE.getLang('lang_newdocument')))tinyMCE.execInstanceCommand(editor_id,'mceSetContent',false,' ');return true;}return false;},getEditorTemplate:function(settings,editorId){function removeFromArray(in_array,remove_array){var outArray=new Array();for(var i=0;i
';var layoutManager=tinyMCE.getParam("theme_advanced_layout_manager","SimpleLayout");var styleSelectHTML='{$lang_theme_style_select} ';if(settings['theme_advanced_styles']){var stylesAr=settings['theme_advanced_styles'].split(';');for(var i=0;i'+key+'';}TinyMCE_AdvancedTheme._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 statusbarLocation=tinyMCE.getParam("theme_advanced_statusbar_location",pathLocation);var defVals={theme_advanced_buttons1:"bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,separator,sub,sup,separator,charmap"};toolbarHTML+=' ';for(var i=1;i<100;i++){var def=defVals["theme_advanced_buttons"+i];var buttons=tinyMCE.getParam("theme_advanced_buttons"+i,def==null?'':def,true,',');if(buttons.length==0)break;buttons=removeFromArray(buttons,tinyMCE.getParam("theme_advanced_disable","",true,','));buttons=addToArray(buttons,tinyMCE.getParam("theme_advanced_buttons"+i+"_add","",true,','));buttons=addToArray(tinyMCE.getParam("theme_advanced_buttons"+i+"_add_before","",true,','),buttons);for(var b=0;b0){toolbarHTML+=" ";deltaHeight-=23;}}toolbarHTML+=' ';template['html']='';if(toolbarLocation=="top"){template['html']+=''+toolbarHTML+' ';}if(statusbarLocation=="top"){template['html']+=''+statusbarHTML+' ';deltaHeight-=23;}template['html']+=' ';if(toolbarLocation=="bottom"){template['html']+=''+toolbarHTML+' ';}if(toolbarLocation=="external"){var bod=document.body;var elm=document.createElement("div");toolbarHTML=tinyMCE.replaceVar(toolbarHTML,'style_select_options',styleSelectHTML);toolbarHTML=tinyMCE.applyTemplate(toolbarHTML,{editor_id:editorId});elm.className="mceToolbarExternal";elm.id=editorId+"_toolbar";elm.innerHTML='';bod.appendChild(elm);deltaHeight=0;tinyMCE.getInstanceById(editorId).toolbarElement=elm;}else{tinyMCE.getInstanceById(editorId).toolbarElement=null;}if(statusbarLocation=="bottom"){template['html']+=''+statusbarHTML+' ';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"||containers[i]=="mceStatusbar"){var pathClass="mceStatusbar";if(i==containers.length-1){pathClass="mceStatusbarBottom";}else if(i==0){pathClass="mceStatusbar";}else{deltaHeight-=2;}template['html']+=''+statusbarHTML+' ';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']+=''+curContainerHTML+' ';}}template['html']+='
';break;case"CustomLayout":var customLayout=tinyMCE.getParam("theme_advanced_custom_layout","");if(customLayout!=""&&eval("typeof("+customLayout+")")!="undefined"){template=eval(customLayout+"(template);");}break;}if(resizing)template['html']+=' ';template['html']=tinyMCE.replaceVar(template['html'],'style_select_options',styleSelectHTML);template['delta_width']=0;template['delta_height']=deltaHeight;return template;},initInstance:function(inst){if(tinyMCE.getParam("theme_advanced_resizing",false)){if(tinyMCE.getParam("theme_advanced_resizing_use_cookie",true)){var w=TinyMCE_AdvancedTheme._getCookie("TinyMCE_"+inst.editorId+"_width");var h=TinyMCE_AdvancedTheme._getCookie("TinyMCE_"+inst.editorId+"_height");TinyMCE_AdvancedTheme._resizeTo(inst,w,h,tinyMCE.getParam("theme_advanced_resize_horizontal",true));}}inst.addShortcut('ctrl','k','lang_link_desc','mceLink');},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection,setup_content){function selectByValue(select_elm,value,first_index){first_index=typeof(first_index)=="undefined"?false:true;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(nodeName=="span"){var cn=tinyMCE.getAttrib(path[i],"class");if(cn!=""&&cn.indexOf('mceItem')==-1)nodeData+="class: "+cn+" ";var st=tinyMCE.getAttrib(path[i],"style");if(st!=""){st=tinyMCE.serializeStyle(tinyMCE.parseStyle(st));nodeData+="style: "+st+" ";}}if(nodeName=="font"){if(tinyMCE.getParam("convert_fonts_to_spans"))nodeName="span";var face=tinyMCE.getAttrib(path[i],"face");if(face!="")nodeData+="font: "+face+" ";var size=tinyMCE.getAttrib(path[i],"size");if(size!="")nodeData+="size: "+size+" ";var color=tinyMCE.getAttrib(path[i],"color");if(color!="")nodeData+="color: "+color+" ";}if(getAttrib(path[i],'id')!=""){nodeData+="id: "+path[i].getAttribute('id')+" ";}var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1)nodeData+="class: "+className+" ";if(getAttrib(path[i],'src')!=""){var src=tinyMCE.getAttrib(path[i],"mce_src");if(src=="")src=tinyMCE.getAttrib(path[i],"src");nodeData+="src: "+src+" ";}if(getAttrib(path[i],'href')!=""){var href=tinyMCE.getAttrib(path[i],"mce_href");if(href=="")href=tinyMCE.getAttrib(path[i],"href");nodeData+="href: "+href+" ";}if(nodeName=="img"&&tinyMCE.getAttrib(path[i],"class").indexOf('mceItemFlash')!=-1){nodeName="flash";nodeData="src: "+path[i].getAttribute('title');}if(nodeName=="a"&&(anchor=tinyMCE.getAttrib(path[i],"name"))!=""){nodeName="a";nodeName+="#"+anchor;nodeData="";}if(getAttrib(path[i],'name').indexOf("mce_")!=0){var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1){nodeName+="."+className;}}var cmd='tinyMCE.execInstanceCommand(\''+editor_id+'\',\'mceSelectNodeDepth\',false,\''+i+'\');';html+=''+nodeName+' ';if(i>0){html+=" » ";}}pathElm.innerHTML=' '+tinyMCE.getLang('lang_theme_path')+": "+html+' ';}tinyMCE.switchClass(editor_id+'_justifyleft','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifyright','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifycenter','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifyfull','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClass(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClass(editor_id+'_underline','mceButtonNormal');tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_numlist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_sub','mceButtonNormal');tinyMCE.switchClass(editor_id+'_sup','mceButtonNormal');tinyMCE.switchClass(editor_id+'_anchor','mceButtonNormal');tinyMCE.switchClass(editor_id+'_link','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_unlink','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_outdent','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_image','mceButtonNormal');tinyMCE.switchClass(editor_id+'_hr','mceButtonNormal');if(node.nodeName=="A"&&tinyMCE.getAttrib(node,"class").indexOf('mceItemAnchor')!=-1)tinyMCE.switchClass(editor_id+'_anchor','mceButtonSelected');var anchorLink=tinyMCE.getParentElement(node,"a","href");if(anchorLink||any_selection){tinyMCE.switchClass(editor_id+'_link',anchorLink?'mceButtonSelected':'mceButtonNormal');tinyMCE.switchClass(editor_id+'_unlink',anchorLink?'mceButtonSelected':'mceButtonNormal');}tinyMCE.switchClass(editor_id+'_visualaid',visual_aid?'mceButtonSelected':'mceButtonNormal');if(undo_levels!=-1){tinyMCE.switchClass(editor_id+'_undo','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_redo','mceButtonDisabled');}if(tinyMCE.getParentElement(node,"li,blockquote"))tinyMCE.switchClass(editor_id+'_outdent','mceButtonNormal');if(undo_index!=-1&&(undo_index0))tinyMCE.switchClass(editor_id+'_redo','mceButtonNormal');if(undo_index!=-1&&(undo_index>0&&undo_levels>0))tinyMCE.switchClass(editor_id+'_undo','mceButtonNormal');var selectElm=document.getElementById(editor_id+"_styleSelect");if(selectElm){TinyMCE_AdvancedTheme._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){if(!tinyMCE.isSafari&&!(tinyMCE.isMSIE&&!tinyMCE.isOpera)){var face=inst.queryCommandValue('FontName');face=face==null||face==""?"":face;selectByValue(selectElm,face,face!="");}else{var elm=tinyMCE.getParentElement(node,"font","face");if(elm){var family=tinyMCE.getAttrib(elm,"face");if(family=='')family=''+elm.style.fontFamily;if(!selectByValue(selectElm,family,family!=""))selectByValue(selectElm,"");}else selectByValue(selectElm,"");}}var selectElm=document.getElementById(editor_id+"_fontSizeSelect");if(selectElm){if(!tinyMCE.isSafari&&!tinyMCE.isOpera){var size=inst.queryCommandValue('FontSize');selectByValue(selectElm,size==null||size==""?"0":size);}else{var elm=tinyMCE.getParentElement(node,"font","size");if(elm){var size=tinyMCE.getAttrib(elm,"size");if(size==''){var sizes=new Array('','8px','10px','12px','14px','18px','24px','36px');size=''+elm.style.fontSize;for(var i=0;i0)selectElm.setAttribute('cssImported','true');}},_setCookie:function(name,value,expires,path,domain,secure){var curCookie=name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+escape(path):"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");document.cookie=curCookie;},_getCookie:function(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}else begin+=2;var end=document.cookie.indexOf(";",begin);if(end==-1)end=dc.length;return unescape(dc.substring(begin+prefix.length,end));},_resizeTo:function(inst,w,h,set_w){var editorContainer=document.getElementById(inst.editorId+'_parent');var tableElm=editorContainer.firstChild;var iframe=inst.iframeElement;if(w==null||w=="null"){set_w=false;w=0;}if(h==null||h=="null")return;w=parseInt(w);h=parseInt(h);if(tinyMCE.isGecko){w+=2;h+=2;}var dx=w-tableElm.clientWidth;var dy=h-tableElm.clientHeight;w=w<1?30:w;h=h<1?30:h;if(set_w)tableElm.style.width=w+"px";tableElm.style.height=h+"px";iw=iframe.clientWidth+dx;ih=iframe.clientHeight+dy;iw=iw<1?30:iw;ih=ih<1?30:ih;if(tinyMCE.isGecko){iw-=2;ih-=2;}if(set_w)iframe.style.width=iw+"px";iframe.style.height=ih+"px";if(set_w){var tableBodyElm=tableElm.firstChild;var minIframeWidth=tableBodyElm.scrollWidth;if(inst.iframeElement.clientWidth ';tinyMCE.execCommand("mceInsertContent",false,html);}else{if(!tinyMCE.imgElement&&tinyMCE.selectedInstance){if(tinyMCE.isSafari)tinyMCE.execCommand("mceInsertContent",false,' ');else tinyMCE.selectedInstance.contentDocument.execCommand("insertimage",false,tinyMCE.uniqueURL);tinyMCE.imgElement=tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"img","src",tinyMCE.uniqueURL);}}if(tinyMCE.imgElement){var needsRepaint=false;var msrc=src;src=eval(tinyMCE.settings['urlconverter_callback']+"(src, tinyMCE.imgElement);");if(tinyMCE.getParam('convert_urls'))msrc=src;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!=tinyMCE.imgElement.getAttribute("width")||height!=tinyMCE.imgElement.getAttribute("height")||align!=tinyMCE.imgElement.getAttribute("align"))needsRepaint=true;tinyMCE.setAttrib(tinyMCE.imgElement,'src',src);tinyMCE.setAttrib(tinyMCE.imgElement,'mce_src',msrc);tinyMCE.setAttrib(tinyMCE.imgElement,'alt',alt);tinyMCE.setAttrib(tinyMCE.imgElement,'title',title);tinyMCE.setAttrib(tinyMCE.imgElement,'align',align);tinyMCE.setAttrib(tinyMCE.imgElement,'border',border,true);tinyMCE.setAttrib(tinyMCE.imgElement,'hspace',hspace,true);tinyMCE.setAttrib(tinyMCE.imgElement,'vspace',vspace,true);tinyMCE.setAttrib(tinyMCE.imgElement,'width',width,true);tinyMCE.setAttrib(tinyMCE.imgElement,'height',height,true);tinyMCE.setAttrib(tinyMCE.imgElement,'onmouseover',onmouseover);tinyMCE.setAttrib(tinyMCE.imgElement,'onmouseout',onmouseout);if(width&&width!="")tinyMCE.imgElement.style.pixelWidth=width;if(height&&height!="")tinyMCE.imgElement.style.pixelHeight=height;if(needsRepaint)tinyMCE.selectedInstance.repaint();}tinyMCE.execCommand('mceEndUndoLevel');},_insertLink:function(href,target,title,onclick,style_class){tinyMCE.execCommand('mceBeginUndoLevel');if(tinyMCE.selectedInstance&&tinyMCE.selectedElement&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img"){var doc=tinyMCE.selectedInstance.getDoc();var linkElement=tinyMCE.getParentElement(tinyMCE.selectedElement,"a");var newLink=false;if(!linkElement){linkElement=doc.createElement("a");newLink=true;}var mhref=href;var thref=eval(tinyMCE.settings['urlconverter_callback']+"(href, linkElement);");mhref=tinyMCE.getParam('convert_urls')?href:mhref;tinyMCE.setAttrib(linkElement,'href',thref);tinyMCE.setAttrib(linkElement,'mce_href',mhref);tinyMCE.setAttrib(linkElement,'target',target);tinyMCE.setAttrib(linkElement,'title',title);tinyMCE.setAttrib(linkElement,'onclick',onclick);tinyMCE.setAttrib(linkElement,'class',style_class);if(newLink){linkElement.appendChild(tinyMCE.selectedElement.cloneNode(true));tinyMCE.selectedElement.parentNode.replaceChild(linkElement,tinyMCE.selectedElement);}return;}if(!tinyMCE.linkElement&&tinyMCE.selectedInstance){if(tinyMCE.isSafari){tinyMCE.execCommand("mceInsertContent",false,''+tinyMCE.selectedInstance.selection.getSelectedHTML()+' ');}else tinyMCE.selectedInstance.contentDocument.execCommand("createlink",false,tinyMCE.uniqueURL);tinyMCE.linkElement=tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);var elementArray=tinyMCE.getElementsByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);for(var i=0;i 4 ? but[4] : false) + (but.length > 5 ? ',\'' + but[5] + '\'' : '') + ')';
- return ' ';
+ if (but[0] == button_name)
+ return tinyMCE.getButtonHTML(but[0], but[2], '{$themeurl}/images/' + but[1], but[3], (but.length > 4 ? but[4] : false), (but.length > 5 ? but[5] : null));
+ }
+
+ // Custom controlls other than buttons
+ switch (button_name) {
+ case "formatselect":
+ var html = '';
+ var formats = tinyMCE.getParam("theme_advanced_blockformats", "p,address,pre,h1,h2,h3,h4,h5,h6", true).split(',');
+ var lookup = [
+ ['p', '{$lang_theme_paragraph}'],
+ ['address', '{$lang_theme_address}'],
+ ['pre', '{$lang_theme_pre}'],
+ ['h1', '{$lang_theme_h1}'],
+ ['h2', '{$lang_theme_h2}'],
+ ['h3', '{$lang_theme_h3}'],
+ ['h4', '{$lang_theme_h4}'],
+ ['h5', '{$lang_theme_h5}'],
+ ['h6', '{$lang_theme_h6}'],
+ ['div', '{$lang_theme_div}'],
+ ['blockquote', '{$lang_theme_blockquote}'],
+ ['code', '{$lang_theme_code}'],
+ ['dt', '{$lang_theme_dt}'],
+ ['dd', '{$lang_theme_dd}'],
+ ['samp', '{$lang_theme_samp}']
+ ];
+
+ html += '{$lang_theme_block} ';
+
+ // Build format select
+ for (var i=0; i' + lookup[x][1] + '';
}
}
- }
- // Old style
- var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + but[3] + '\',' + (but.length > 4 ? but[4] : false) + (but.length > 5 ? ',\'' + but[5] + '\'' : '') + ')';
- return ' ';
+ html += ' ';
+
+ return html;
+
+ case "styleselect":
+ return '{$style_select_options} ';
+
+ case "fontselect":
+ var fontHTML = '{$lang_theme_fontdefault} ';
+ var iFonts = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';
+ var nFonts = 'Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sand;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';
+ var fonts = tinyMCE.getParam("theme_advanced_fonts", nFonts).split(';');
+ for (i=0; i' + parts[0] + '';
+ }
+ }
+
+ fontHTML += ' ';
+ return fontHTML;
+
+ case "fontsizeselect":
+ return ''+
+ '{$lang_theme_font_size} '+
+ '1 (8 pt) '+
+ '2 (10 pt) '+
+ '3 (12 pt) '+
+ '4 (14 pt) '+
+ '5 (18 pt) '+
+ '6 (24 pt) '+
+ '7 (36 pt) '+
+ ' ';
+
+ case "|":
+ case "separator":
+ return ' ';
+
+ case "spacer":
+ return ' ';
+
+ case "rowseparator":
+ return ' ';
}
- }
- // Custom controlls other than buttons
- switch (button_name)
- {
- case "formatselect":
- var html = '';
- var formats = tinyMCE.getParam("theme_advanced_blockformats", "p,address,pre,h1,h2,h3,h4,h5,h6", true).split(',');
- var lookup = [
- ['p', '{$lang_theme_paragraph}'],
- ['address', '{$lang_theme_address}'],
- ['pre', '{$lang_theme_pre}'],
- ['h1', '{$lang_theme_h1}'],
- ['h2', '{$lang_theme_h2}'],
- ['h3', '{$lang_theme_h3}'],
- ['h4', '{$lang_theme_h4}'],
- ['h5', '{$lang_theme_h5}'],
- ['h6', '{$lang_theme_h6}']
- ];
-
- html += '{$lang_theme_block} ';
-
- // Build format select
- for (var i=0; i' + lookup[x][1] + '';
+ return "";
+ },
+
+ /**
+ * Theme specific execcommand handling.
+ */
+ execCommand : function(editor_id, element, command, user_interface, value) {
+ switch (command) {
+ case "mceLink":
+ var inst = tinyMCE.getInstanceById(editor_id);
+ var doc = inst.getDoc();
+ var selectedText = "";
+
+ if (tinyMCE.isMSIE) {
+ var rng = doc.selection.createRange();
+ selectedText = rng.text;
+ } else
+ selectedText = inst.getSel().toString();
+
+ if (!tinyMCE.linkElement) {
+ if ((tinyMCE.selectedElement.nodeName.toLowerCase() != "img") && (selectedText.length <= 0))
+ return true;
+ }
+
+ 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, '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);
+
+ href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
+
+ // Use mce_href if defined
+ mceRealHref = tinyMCE.getAttrib(tinyMCE.linkElement, 'mce_href');
+ if (mceRealHref != "") {
+ href = mceRealHref;
+
+ if (tinyMCE.getParam('convert_urls'))
+ href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
}
+
+ action = "update";
}
- }
- html += ' ';
- //formatselect
- return html;
-
- case "styleselect":
- //styleselect
- return '{$style_select_options} ';
-
- case "fontselect":
- var fontHTML = '{$lang_theme_fontdefault} ';
- var iFonts = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';
- var nFonts = 'Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sand;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';
- var fonts = tinyMCE.getParam("theme_advanced_fonts", nFonts).split(';');
- for (var i=0; i' + parts[0] + '';
+ var template = new Array();
+
+ template['file'] = 'link.htm';
+ template['width'] = 310;
+ template['height'] = 200;
+
+ // 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);
+
+ if (inst.settings['insertlink_callback']) {
+ var returnVal = eval(inst.settings['insertlink_callback'] + "(href, target, title, onclick, action, style_class);");
+ if (returnVal && returnVal['href'])
+ TinyMCE_AdvancedTheme._insertLink(returnVal['href'], returnVal['target'], returnVal['title'], returnVal['onclick'], returnVal['style_class']);
+ } else {
+ tinyMCE.openWindow(template, {href : href, target : target, title : title, onclick : onclick, action : action, className : style_class, inline : "yes"});
+ }
+
+ return true;
+
+ case "mceImage":
+ var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = "";
+ var title = "", onmouseover = "", onmouseout = "", action = "insert";
+ var img = tinyMCE.imgElement;
+ var inst = tinyMCE.getInstanceById(editor_id);
+
+ if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") {
+ img = tinyMCE.selectedElement;
+ tinyMCE.imgElement = img;
}
- }
- fontHTML += ' ';
- return fontHTML;
+ if (img) {
+ // Is it a internal MCE visual aid image, then skip this one.
+ if (tinyMCE.getAttrib(img, 'name').indexOf('mce_') == 0)
+ return true;
+
+ 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);
+ }
- case "fontsizeselect":
- //fontsizeselect
- return '\
- {$lang_theme_font_size} \
- 1 (8 pt) \
- 2 (10 pt) \
- 3 (12 pt) \
- 4 (14 pt) \
- 5 (18 pt) \
- 6 (24 pt) \
- 7 (36 pt) \
- ';
-
- case "|":
- case "separator":
- return ' ';
+ 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 : "";
+ }
- case "spacer":
- return ' ';
+ //onmouseover = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseover));
+ //onmouseout = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseout));
- case "rowseparator":
- return ' ';
- }
+ src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
- return "";
-}
+ // Use mce_src if defined
+ mceRealSrc = tinyMCE.getAttrib(img, 'mce_src');
+ if (mceRealSrc != "") {
+ src = mceRealSrc;
-/**
- * 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 elm = tinyMCE.selectedInstance.getFocusElement();
- var inputColor = tinyMCE.getAttrib(elm, "color");
-
- if (inputColor == '')
- inputColor = elm.style.color;
-
- if (!inputColor)
- inputColor = "#000000";
-
- template['file'] = 'color_picker.htm';
- template['width'] = 220;
- template['height'] = 190;
-
- tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", command : "forecolor", input_color : inputColor});
- return true;
-
- case "mceBackColor":
- var template = new Array();
- var elm = tinyMCE.selectedInstance.getFocusElement();
- var inputColor = elm.style.backgroundColor;
-
- if (!inputColor)
- inputColor = "#000000";
-
- template['file'] = 'color_picker.htm';
- template['width'] = 220;
- template['height'] = 190;
-
- template['width'] += tinyMCE.getLang('lang_theme_advanced_backcolor_delta_width', 0);
- template['height'] += tinyMCE.getLang('lang_theme_advanced_backcolor_delta_height', 0);
-
- tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", command : "HiliteColor", input_color : inputColor});
- //mceBackColor
- return true;
+ if (tinyMCE.getParam('convert_urls'))
+ 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";
+ }
+
+ var template = new Array();
+
+ template['file'] = 'image.htm?src={$src}';
+ template['width'] = 355;
+ template['height'] = 265 + (tinyMCE.isMSIE ? 25 : 0);
+
+ // 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);
+
+ if (inst.settings['insertimage_callback']) {
+ var returnVal = eval(inst.settings['insertimage_callback'] + "(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);");
+ if (returnVal && returnVal['src'])
+ TinyMCE_AdvancedTheme._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(template, {src : src, alt : alt, border : border, hspace : hspace, vspace : vspace, width : width, height : height, align : align, title : title, onmouseover : onmouseover, onmouseout : onmouseout, action : action, inline : "yes"});
+
+ return true;
- case "mceColorPicker":
- if (user_interface) {
+ case "mceForeColor":
var template = new Array();
- var inputColor = value['document'].getElementById(value['element_id']).value;
+ var elm = tinyMCE.selectedInstance.getFocusElement();
+ var inputColor = tinyMCE.getAttrib(elm, "color");
+
+ if (inputColor == '')
+ inputColor = elm.style.color;
+
+ if (!inputColor)
+ inputColor = "#000000";
template['file'] = 'color_picker.htm';
template['width'] = 220;
template['height'] = 190;
- template['close_previous'] = "no";
- template['width'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width', 0);
- template['height'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height', 0);
+ tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", command : "forecolor", input_color : inputColor});
+ return true;
- if (typeof(value['store_selection']) == "undefined")
- value['store_selection'] = true;
+ case "mceBackColor":
+ var template = new Array();
+ var elm = tinyMCE.selectedInstance.getFocusElement();
+ var inputColor = elm.style.backgroundColor;
- tinyMCE.lastColorPickerValue = value;
- tinyMCE.openWindow(template, {editor_id : editor_id, mce_store_selection : value['store_selection'], inline : "yes", command : "mceColorPicker", input_color : inputColor});
- } else {
- var savedVal = tinyMCE.lastColorPickerValue;
- var elm = savedVal['document'].getElementById(savedVal['element_id']);
- elm.value = value;
- eval('elm.onchange();');
- }
- return true;
+ if (!inputColor)
+ inputColor = "#000000";
- case "mceCodeEditor":
- var template = new Array();
+ template['file'] = 'color_picker.htm';
+ template['width'] = 220;
+ template['height'] = 190;
- template['file'] = 'source_editor.htm';
- template['width'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_width", 500));
- template['height'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_height", 400));
+ template['width'] += tinyMCE.getLang('lang_theme_advanced_backcolor_delta_width', 0);
+ template['height'] += tinyMCE.getLang('lang_theme_advanced_backcolor_delta_height', 0);
- tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "no", inline : "yes"});
- //mceCodeEditor
- return true;
+ tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", command : "HiliteColor", input_color : inputColor});
+ //mceBackColor
+ return true;
- case "mceCharMap":
- var template = new Array();
+ case "mceColorPicker":
+ if (user_interface) {
+ var template = new Array();
+ var inputColor = value['document'].getElementById(value['element_id']).value;
+
+ template['file'] = 'color_picker.htm';
+ template['width'] = 220;
+ template['height'] = 190;
+ template['close_previous'] = "no";
+
+ template['width'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width', 0);
+ template['height'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height', 0);
+
+ if (typeof(value['store_selection']) == "undefined")
+ value['store_selection'] = true;
+
+ tinyMCE.lastColorPickerValue = value;
+ tinyMCE.openWindow(template, {editor_id : editor_id, mce_store_selection : value['store_selection'], inline : "yes", command : "mceColorPicker", input_color : inputColor});
+ } else {
+ var savedVal = tinyMCE.lastColorPickerValue;
+ var elm = savedVal['document'].getElementById(savedVal['element_id']);
+ elm.value = value;
- template['file'] = 'charmap.htm';
- template['width'] = 550 + (tinyMCE.isOpera ? 40 : 0);
- template['height'] = 250;
+ if (elm.onchange != null && elm.onchange != '')
+ eval('elm.onchange();');
+ }
+ return true;
- template['width'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_width', 0);
- template['height'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_height', 0);
+ case "mceCodeEditor":
+ var template = new Array();
- tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
- //mceCharMap
- return true;
+ template['file'] = 'source_editor.htm';
+ template['width'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_width", 720));
+ template['height'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_height", 580));
- case "mceInsertAnchor":
- var template = new Array();
+ tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "no", inline : "yes"});
+ return true;
- template['file'] = 'anchor.htm';
- template['width'] = 320;
- template['height'] = 90 + (tinyMCE.isNS7 ? 30 : 0);
+ case "mceCharMap":
+ var template = new Array();
- template['width'] += tinyMCE.getLang('lang_theme_advanced_anchor_delta_width', 0);
- template['height'] += tinyMCE.getLang('lang_theme_advanced_anchor_delta_height', 0);
+ template['file'] = 'charmap.htm';
+ template['width'] = 550 + (tinyMCE.isOpera ? 40 : 0);
+ template['height'] = 250;
- tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
- return true;
+ template['width'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_width', 0);
+ template['height'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_height', 0);
- case "mceNewDocument":
- if (confirm(tinyMCE.getLang('lang_newdocument')))
- tinyMCE.execInstanceCommand(editor_id, 'mceSetContent', false, '');
+ tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
+ return true;
- return true;
- }
+ case "mceInsertAnchor":
+ var template = new Array();
- // Default behavior
- return false;
-}
+ template['file'] = 'anchor.htm';
+ template['width'] = 320;
+ template['height'] = 90 + (tinyMCE.isNS7 ? 30 : 0);
-/**
- * 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
';
+ var layoutManager = tinyMCE.getParam("theme_advanced_layout_manager", "SimpleLayout");
+
+ // Setup style select options -- MOVED UP FOR EXTERNAL TOOLBAR COMPATABILITY!
+ var styleSelectHTML = '{$lang_theme_style_select} ';
+ if (settings['theme_advanced_styles']) {
+ var stylesAr = settings['theme_advanced_styles'].split(';');
+
+ for (var i=0; i
';
- var layoutManager = tinyMCE.getParam("theme_advanced_layout_manager", "SimpleLayout");
-
- // Setup style select options -- MOVED UP FOR EXTERNAL TOOLBAR COMPATABILITY!
- var styleSelectHTML = '{$lang_theme_style_select} ';
- if (settings['theme_advanced_styles']) {
- var stylesAr = settings['theme_advanced_styles'].split(';');
-
- for (var i=0; i' + key + '';
+ }
- styleSelectHTML += '' + key + ' ';
+ TinyMCE_AdvancedTheme._autoImportCSSClasses = false;
}
- 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"); // Compatiblity
+ var statusbarLocation = tinyMCE.getParam("theme_advanced_statusbar_location", pathLocation);
+ var defVals = {
+ theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect",
+ theme_advanced_buttons2 : "bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",
+ theme_advanced_buttons3 : "hr,removeformat,visualaid,separator,sub,sup,separator,charmap"
+ };
+
+ // Add accessibility control
+ toolbarHTML += ' ';
+
+ // Render rows
+ for (var i=1; i<100; i++) {
+ var def = defVals["theme_advanced_buttons" + i];
- 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"); // Compatiblity
- var statusbarLocation = tinyMCE.getParam("theme_advanced_statusbar_location", pathLocation);
- var defVals = {
- theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect",
- theme_advanced_buttons2 : "bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",
- theme_advanced_buttons3 : "hr,removeformat,visualaid,separator,sub,sup,separator,charmap"
- };
-
- // Add accessibility control
- toolbarHTML += ' ';
-
- // Render rows
- for (var i=1; i<100; i++) {
- var def = defVals["theme_advanced_buttons" + i];
+ var buttons = tinyMCE.getParam("theme_advanced_buttons" + i, def == null ? '' : def, true, ',');
+ if (buttons.length == 0)
+ break;
- var buttons = tinyMCE.getParam("theme_advanced_buttons" + i, def == null ? '' : def, true, ',');
- if (buttons.length == 0)
- break;
+ buttons = removeFromArray(buttons, tinyMCE.getParam("theme_advanced_disable", "", true, ','));
+ buttons = addToArray(buttons, tinyMCE.getParam("theme_advanced_buttons" + i + "_add", "", true, ','));
+ buttons = addToArray(tinyMCE.getParam("theme_advanced_buttons" + i + "_add_before", "", true, ','), buttons);
+
+ for (var b=0; b 0) {
+ toolbarHTML += " ";
+ deltaHeight -= 23;
+ }
+ }
+
+ // Add accessibility control
+ toolbarHTML += ' ';
+
+ // Setup template html
+ template['html'] = '';
- for (var b=0; b' + toolbarHTML + ' ';
+ }
- if (buttons.length > 0) {
- toolbarHTML += " ";
+ if (statusbarLocation == "top") {
+ template['html'] += '' + statusbarHTML + ' ';
deltaHeight -= 23;
}
- }
- // Add accessibility control
- toolbarHTML += ' ';
+ template['html'] += ' ';
- // Setup template html
- template['html'] = '';
+ if (toolbarLocation == "bottom") {
+ template['html'] += '' + toolbarHTML + ' ';
+ }
- if (toolbarLocation == "top")
- {
- template['html'] += '' + toolbarHTML + ' ';
- }
+ // External toolbar changes
+ if (toolbarLocation == "external") {
+ var bod = document.body;
+ var elm = document.createElement ("div");
+
+ toolbarHTML = tinyMCE.replaceVar(toolbarHTML, 'style_select_options', styleSelectHTML);
+ toolbarHTML = tinyMCE.applyTemplate(toolbarHTML, {editor_id : editorId});
+
+ elm.className = "mceToolbarExternal";
+ elm.id = editorId+"_toolbar";
+ elm.innerHTML = '';
+ bod.appendChild (elm);
+ // bod.style.marginTop = elm.offsetHeight + "px";
+
+ deltaHeight = 0;
+ tinyMCE.getInstanceById(editorId).toolbarElement = elm;
+
+ //template['html'] = '' + template["html"];
+ } else {
+ tinyMCE.getInstanceById(editorId).toolbarElement = null;
+ }
- if (statusbarLocation == "top")
- {
- template['html'] += '' + statusbarHTML + ' ';
- deltaHeight -= 23;
- }
+ if (statusbarLocation == "bottom") {
+ template['html'] += '' + statusbarHTML + ' ';
+ deltaHeight -= 23;
+ }
- template['html'] += ' ';
+ template['html'] += '
';
+ //"SimpleLayout"
+ break;
- if (toolbarLocation == "bottom")
- {
- template['html'] += '' + toolbarHTML + ' ';
- }
+ case "RowLayout" : //Container Layout - containers defined in "theme_advanced_containers" are rendered from top to 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.applyTemplate(toolbarHTML);
-
- elm.className = "mceToolbarExternal";
- elm.id = editorId+"_toolbar";
- elm.innerHTML = '';
- bod.appendChild (elm);
- // bod.style.marginTop = elm.offsetHeight + "px";
+ 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");
- deltaHeight = 0;
- tinyMCE.getInstanceById(editorId).toolbarElement = elm;
+ //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" || containers[i] == "mceStatusbar") // ... mceElementpath:
+ {
+ var pathClass = "mceStatusbar";
- //template['html'] = '' + template["html"];
- }
- else
- {
- tinyMCE.getInstanceById(editorId).toolbarElement = null;
- }
+ if (i == containers.length-1)
+ {
+ pathClass = "mceStatusbarBottom";
+ }
+ else if (i == 0)
+ {
+ pathClass = "mceStatusbar";
+ }
+ else
+ {
+ deltaHeight-=2;
+ }
- if (statusbarLocation == "bottom")
- {
- template['html'] += '' + statusbarHTML + ' ';
- deltaHeight -= 23;
- }
+ template['html'] += '' + statusbarHTML + ' ';
+ 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);
- 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" || containers[i] == "mceStatusbar") // ... mceElementpath:
- {
- var pathClass = "mceStatusbar";
+ for (var j=0; j 0) {
+ curContainerHTML += " ";
+ deltaHeight -= 23;
+ }
- template['html'] += '' + statusbarHTML + ' ';
- deltaHeight -= 22;
+ template['html'] += '' + curContainerHTML + ' ';
+ }
}
- 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
';
+ //RowLayout
+ break;
- if (curContainer.length > 0)
- {
- curContainerHTML += " ";
- deltaHeight -= 23;
- }
+ case "CustomLayout" : //User defined layout callback...
+ var customLayout = tinyMCE.getParam("theme_advanced_custom_layout","");
- template['html'] += '' + curContainerHTML + ' ';
+ if (customLayout != "" && eval("typeof(" + customLayout + ")") != "undefined") {
+ template = eval(customLayout + "(template);");
}
- }
+ break;
+ }
- template['html'] += '
';
- //RowLayout
- break;
-
- case "BorderLayout" : //will be like java.awt.BorderLayout of SUN Java...
- // Not implemented yet...
- break;
+ if (resizing)
+ template['html'] += ' ';
- case "CustomLayout" : //User defined layout callback...
- var customLayout = tinyMCE.getParam("theme_advanced_custom_layout","");
-
- if (customLayout != "" && eval("typeof(" + customLayout + ")") != "undefined")
- {
- template = eval(customLayout + "(template);");
+ template['html'] = tinyMCE.replaceVar(template['html'], 'style_select_options', styleSelectHTML);
+ template['delta_width'] = 0;
+ template['delta_height'] = deltaHeight;
+
+ return template;
+ },
+
+ initInstance : function(inst) {
+ if (tinyMCE.getParam("theme_advanced_resizing", false)) {
+ if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) {
+ var w = TinyMCE_AdvancedTheme._getCookie("TinyMCE_" + inst.editorId + "_width");
+ var h = TinyMCE_AdvancedTheme._getCookie("TinyMCE_" + inst.editorId + "_height");
+
+ TinyMCE_AdvancedTheme._resizeTo(inst, w, h, tinyMCE.getParam("theme_advanced_resize_horizontal", true));
}
- break;
-
- default:
- alert('UNDEFINED LAYOUT MANAGER! PLEASE CHECK YOUR TINYMCE CONFIG!');
- //CustomLayout
- break;
- }
+ }
- if (resizing)
- template['html'] += ' ';
+ inst.addShortcut('ctrl', 'k', 'lang_link_desc', 'mceLink');
+ },
- template['html'] = tinyMCE.replaceVar(template['html'], 'style_select_options', styleSelectHTML);
- template['delta_width'] = 0;
- template['delta_height'] = deltaHeight;
+ /**
+ * Node change handler.
+ */
+ handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection, setup_content) {
+ function selectByValue(select_elm, value, first_index) {
+ first_index = typeof(first_index) == "undefined" ? false : true;
+
+ if (select_elm) {
+ for (var i=0; i=0; i--) {
+ var nodeName = path[i].nodeName.toLowerCase();
+ var nodeData = "";
-function TinyMCE_advanced_initInstance(inst) {
- if (tinyMCE.getParam("theme_advanced_resizing", false)) {
- if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) {
- var w = TinyMCE_advanced_getCookie("TinyMCE_" + inst.editorId + "_width");
- var h = TinyMCE_advanced_getCookie("TinyMCE_" + inst.editorId + "_height");
+ if (nodeName == "b") {
+ nodeName = "strong";
+ }
- TinyMCE_advanced_resizeTo(inst, w, h, tinyMCE.getParam("theme_advanced_resize_horizontal", true));
- }
- }
-}
+ if (nodeName == "i") {
+ nodeName = "em";
+ }
-function TinyMCE_advanced_setCookie(name, value, expires, path, domain, secure) {
- var curCookie = name + "=" + escape(value) +
- ((expires) ? "; expires=" + expires.toGMTString() : "") +
- ((path) ? "; path=" + escape(path) : "") +
- ((domain) ? "; domain=" + domain : "") +
- ((secure) ? "; secure" : "");
-
- document.cookie = curCookie;
-}
-
-function TinyMCE_advanced_getCookie(name) {
- var dc = document.cookie;
- var prefix = name + "=";
- var begin = dc.indexOf("; " + prefix);
-
- if (begin == -1) {
- begin = dc.indexOf(prefix);
-
- if (begin != 0)
- return null;
- } else
- begin += 2;
-
- var end = document.cookie.indexOf(";", begin);
-
- if (end == -1)
- end = dc.length;
-
- return unescape(dc.substring(begin + prefix.length, end));
-}
-
-function TinyMCE_advanced_resizeTo(inst, w, h, set_w) {
- var editorContainer = document.getElementById(inst.editorId + '_parent');
- var tableElm = editorContainer.firstChild;
- var iframe = inst.iframeElement;
-
- if (w == null || w == "null") {
- set_w = false;
- w = 0;
- }
+ if (nodeName == "span") {
+ var cn = tinyMCE.getAttrib(path[i], "class");
+ if (cn != "" && cn.indexOf('mceItem') == -1)
+ nodeData += "class: " + cn + " ";
+
+ var st = tinyMCE.getAttrib(path[i], "style");
+ if (st != "") {
+ st = tinyMCE.serializeStyle(tinyMCE.parseStyle(st));
+ nodeData += "style: " + st + " ";
+ }
+ }
- if (h == null || h == "null")
- return;
+ if (nodeName == "font") {
+ if (tinyMCE.getParam("convert_fonts_to_spans"))
+ nodeName = "span";
+
+ var face = tinyMCE.getAttrib(path[i], "face");
+ if (face != "")
+ nodeData += "font: " + face + " ";
+
+ var size = tinyMCE.getAttrib(path[i], "size");
+ if (size != "")
+ nodeData += "size: " + size + " ";
+
+ var color = tinyMCE.getAttrib(path[i], "color");
+ if (color != "")
+ nodeData += "color: " + color + " ";
+ }
- w = parseInt(w);
- h = parseInt(h);
+ if (getAttrib(path[i], 'id') != "") {
+ nodeData += "id: " + path[i].getAttribute('id') + " ";
+ }
- if (tinyMCE.isGecko) {
- w += 2;
- h += 2;
- }
+ var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false);
+ if (className != "" && className.indexOf('mceItem') == -1)
+ nodeData += "class: " + className + " ";
- var dx = w - tableElm.clientWidth;
- var dy = h - tableElm.clientHeight;
+ if (getAttrib(path[i], 'src') != "") {
+ var src = tinyMCE.getAttrib(path[i], "mce_src");
- w = w < 1 ? 30 : w;
- h = h < 1 ? 30 : h;
+ if (src == "")
+ src = tinyMCE.getAttrib(path[i], "src");
- if (set_w)
- tableElm.style.width = w + "px";
+ nodeData += "src: " + src + " ";
+ }
- tableElm.style.height = h + "px";
+ if (getAttrib(path[i], 'href') != "") {
+ var href = tinyMCE.getAttrib(path[i], "mce_href");
- iw = iframe.clientWidth + dx;
- ih = iframe.clientHeight + dy;
+ if (href == "")
+ href = tinyMCE.getAttrib(path[i], "href");
- iw = iw < 1 ? 30 : iw;
- ih = ih < 1 ? 30 : ih;
+ nodeData += "href: " + href + " ";
+ }
- if (tinyMCE.isGecko) {
- iw -= 2;
- ih -= 2;
- }
+ if (nodeName == "img" && tinyMCE.getAttrib(path[i], "class").indexOf('mceItemFlash') != -1) {
+ nodeName = "flash";
+ nodeData = "src: " + path[i].getAttribute('title');
+ }
- if (set_w)
- iframe.style.width = iw + "px";
+ if (nodeName == "a" && (anchor = tinyMCE.getAttrib(path[i], "name")) != "") {
+ nodeName = "a";
+ nodeName += "#" + anchor;
+ nodeData = "";
+ }
- iframe.style.height = ih + "px";
+ if (getAttrib(path[i], 'name').indexOf("mce_") != 0) {
+ var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false);
+ if (className != "" && className.indexOf('mceItem') == -1) {
+ nodeName += "." + className;
+ }
+ }
- // Is it to small, make it bigger again
- if (set_w) {
- var tableBodyElm = tableElm.firstChild;
- var minIframeWidth = tableBodyElm.scrollWidth;
- if (inst.iframeElement.clientWidth < minIframeWidth) {
- dx = minIframeWidth - inst.iframeElement.clientWidth;
+ var cmd = 'tinyMCE.execInstanceCommand(\'' + editor_id + '\',\'mceSelectNodeDepth\',false,\'' + i + '\');';
+ html += '' + nodeName + ' ';
- inst.iframeElement.style.width = (iw + dx) + "px";
- }
- }
-}
+ if (i > 0) {
+ html += " » ";
+ }
+ }
-/**
- * Handles resizing events.
- */
-function TinyMCE_advanced_resizeEventHandler(e) {
- var resizer = TinyMCE_advanced_resizer;
+ pathElm.innerHTML = ' ' + tinyMCE.getLang('lang_theme_path') + ": " + html + ' ';
+ }
- // Do nothing
- if (!resizer.resizing)
- return;
+ // Reset old states
+ tinyMCE.switchClass(editor_id + '_justifyleft', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_justifyright', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_justifyfull', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_bold', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_italic', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_underline', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_sub', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_sup', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_link', 'mceButtonDisabled');
+ tinyMCE.switchClass(editor_id + '_unlink', 'mceButtonDisabled');
+ tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonDisabled');
+ tinyMCE.switchClass(editor_id + '_image', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_hr', 'mceButtonNormal');
+
+ if (node.nodeName == "A" && tinyMCE.getAttrib(node, "class").indexOf('mceItemAnchor') != -1)
+ tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonSelected');
+
+ // Get link
+ var anchorLink = tinyMCE.getParentElement(node, "a", "href");
+
+ if (anchorLink || any_selection) {
+ tinyMCE.switchClass(editor_id + '_link', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_unlink', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal');
+ }
- e = typeof(e) == "undefined" ? window.event : e;
+ // Handle visual aid
+ tinyMCE.switchClass(editor_id + '_visualaid', visual_aid ? 'mceButtonSelected' : 'mceButtonNormal');
- var dx = e.screenX - resizer.downX;
- var dy = e.screenY - resizer.downY;
- var resizeBox = resizer.resizeBox;
- var editorId = resizer.editorId;
+ if (undo_levels != -1) {
+ tinyMCE.switchClass(editor_id + '_undo', 'mceButtonDisabled');
+ tinyMCE.switchClass(editor_id + '_redo', 'mceButtonDisabled');
+ }
- switch (e.type) {
- case "mousemove":
- var w, h;
+ // Within li, blockquote
+ if (tinyMCE.getParentElement(node, "li,blockquote"))
+ tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonNormal');
+
+ // Has redo levels
+ if (undo_index != -1 && (undo_index < undo_levels-1 && undo_levels > 0))
+ tinyMCE.switchClass(editor_id + '_redo', 'mceButtonNormal');
+
+ // Has undo levels
+ if (undo_index != -1 && (undo_index > 0 && undo_levels > 0))
+ tinyMCE.switchClass(editor_id + '_undo', 'mceButtonNormal');
- w = resizer.width + dx;
- h = resizer.height + dy;
+ // Select class in select box
+ var selectElm = document.getElementById(editor_id + "_styleSelect");
+
+ if (selectElm) {
+ TinyMCE_AdvancedTheme._setupCSSClasses(editor_id);
- w = w < 1 ? 1 : w;
- h = h < 1 ? 1 : h;
+ classNode = node;
+ breakOut = false;
+ var index = 0;
+
+ do {
+ if (classNode && classNode.className) {
+ for (var i=0; i");
+ else
+ selectByValue(selectElm, "");
+ }
- // Expire in a month
- if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) {
- var expires = new Date();
- expires.setTime(expires.getTime() + 3600000 * 24 * 30);
+ // Select fontselect
+ var selectElm = document.getElementById(editor_id + "_fontNameSelect");
+ if (selectElm) {
+ if (!tinyMCE.isSafari && !(tinyMCE.isMSIE && !tinyMCE.isOpera)) {
+ var face = inst.queryCommandValue('FontName');
- // Set the cookies
- TinyMCE_advanced_setCookie("TinyMCE_" + editorId + "_width", "" + (resizer.horizontal ? resizer.width + dx : ""), expires);
- TinyMCE_advanced_setCookie("TinyMCE_" + editorId + "_height", "" + (resizer.height + dy), expires);
- }
- break;
- }
-}
+ face = face == null || face == "" ? "" : face;
-/**
- * Insert link template function.
- */
-function TinyMCE_advanced_getInsertLinkTemplate()
-{
- var template = new Array();
-
- template['file'] = 'link.htm';
- template['width'] = 330;
- template['height'] = 170 + (tinyMCE.isMSIE ? 25 : 0);
-
- // 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);
+ selectByValue(selectElm, face, face != "");
+ } else {
+ var elm = tinyMCE.getParentElement(node, "font", "face");
- return template;
-};
+ if (elm) {
+ var family = tinyMCE.getAttrib(elm, "face");
-/**
- * Insert image template function.
- */
-function TinyMCE_advanced_getInsertImageTemplate() {
- var template = new Array();
+ if (family == '')
+ family = '' + elm.style.fontFamily;
- template['file'] = 'image.htm?src={$src}';
- template['width'] = 340;
- template['height'] = 250 + (tinyMCE.isMSIE ? 25 : 0);
-
- // 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);
+ if (!selectByValue(selectElm, family, family != ""))
+ selectByValue(selectElm, "");
+ } else
+ selectByValue(selectElm, "");
+ }
+ }
- return template;
-};
+ // Select fontsize
+ var selectElm = document.getElementById(editor_id + "_fontSizeSelect");
+ if (selectElm) {
+ if (!tinyMCE.isSafari && !tinyMCE.isOpera) {
+ var size = inst.queryCommandValue('FontSize');
+ selectByValue(selectElm, size == null || size == "" ? "0" : size);
+ } else {
+ var elm = tinyMCE.getParentElement(node, "font", "size");
+ if (elm) {
+ var size = tinyMCE.getAttrib(elm, "size");
+
+ if (size == '') {
+ var sizes = new Array('', '8px', '10px', '12px', '14px', '18px', '24px', '36px');
+
+ size = '' + elm.style.fontSize;
+
+ for (var i=0; i=0; i--) {
- var nodeName = path[i].nodeName.toLowerCase();
- var nodeData = "";
+ // Handle elements
+ do {
+ switch (node.nodeName) {
+ case "UL":
+ tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonSelected');
+ break;
- if (nodeName == "b") {
- nodeName = "strong";
- }
+ case "OL":
+ tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonSelected');
+ break;
- if (nodeName == "i") {
- nodeName = "em";
- }
+ case "HR":
+ tinyMCE.switchClass(editor_id + '_hr', 'mceButtonSelected');
+ break;
- if (nodeName == "span") {
- var cn = tinyMCE.getAttrib(path[i], "class");
- if (cn != "" && cn.indexOf('mceItem') == -1)
- nodeData += "class: " + cn + " ";
-
- var st = tinyMCE.getAttrib(path[i], "style");
- if (st != "") {
- st = tinyMCE.serializeStyle(tinyMCE.parseStyle(st));
- nodeData += "style: " + st + " ";
+ case "IMG":
+ if (getAttrib(node, 'name').indexOf('mce_') != 0) {
+ tinyMCE.switchClass(editor_id + '_image', 'mceButtonSelected');
}
+ break;
}
+ } while ((node = node.parentNode) != null);
+ },
- if (nodeName == "font") {
- if (tinyMCE.getParam("convert_fonts_to_spans"))
- nodeName = "span";
-
- var face = tinyMCE.getAttrib(path[i], "face");
- if (face != "")
- nodeData += "font: " + face + " ";
-
- var size = tinyMCE.getAttrib(path[i], "size");
- if (size != "")
- nodeData += "size: " + size + " ";
-
- var color = tinyMCE.getAttrib(path[i], "color");
- if (color != "")
- nodeData += "color: " + color + " ";
- }
+ // Private theme internal functions
- if (getAttrib(path[i], 'id') != "") {
- nodeData += "id: " + path[i].getAttribute('id') + " ";
- }
+ // This function auto imports CSS classes into the class selection droplist
+ _setupCSSClasses : function(editor_id) {
+ var i, selectElm;
- var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false);
- if (className != "" && className.indexOf('mceItem') == -1)
- nodeData += "class: " + className + " ";
+ if (!TinyMCE_AdvancedTheme._autoImportCSSClasses)
+ return;
- if (getAttrib(path[i], 'src') != "") {
- var src = tinyMCE.getAttrib(path[i], "mce_src");
+ selectElm = document.getElementById(editor_id + '_styleSelect');
- if (src == "")
- src = tinyMCE.getAttrib(path[i], "src");
-
- nodeData += "src: " + src + " ";
+ if (selectElm && selectElm.getAttribute('cssImported') != 'true') {
+ var csses = tinyMCE.getCSSClasses(editor_id);
+ if (csses && selectElm) {
+ for (i=0; i 0)
+ selectElm.setAttribute('cssImported', 'true');
+ }
+ },
- if (href == "")
- href = tinyMCE.getAttrib(path[i], "href");
+ _setCookie : function(name, value, expires, path, domain, secure) {
+ var curCookie = name + "=" + escape(value) +
+ ((expires) ? "; expires=" + expires.toGMTString() : "") +
+ ((path) ? "; path=" + escape(path) : "") +
+ ((domain) ? "; domain=" + domain : "") +
+ ((secure) ? "; secure" : "");
+
+ document.cookie = curCookie;
+ },
+
+ _getCookie : function(name) {
+ var dc = document.cookie;
+ var prefix = name + "=";
+ var begin = dc.indexOf("; " + prefix);
+
+ if (begin == -1) {
+ begin = dc.indexOf(prefix);
+
+ if (begin != 0)
+ return null;
+ } else
+ begin += 2;
+
+ var end = document.cookie.indexOf(";", begin);
+
+ if (end == -1)
+ end = dc.length;
+
+ return unescape(dc.substring(begin + prefix.length, end));
+ },
+
+ _resizeTo : function(inst, w, h, set_w) {
+ var editorContainer = document.getElementById(inst.editorId + '_parent');
+ var tableElm = editorContainer.firstChild;
+ var iframe = inst.iframeElement;
+
+ if (w == null || w == "null") {
+ set_w = false;
+ w = 0;
+ }
- nodeData += "href: " + href + " ";
- }
+ if (h == null || h == "null")
+ return;
- if (nodeName == "img" && tinyMCE.getAttrib(path[i], "class").indexOf('mceItemFlash') != -1) {
- nodeName = "flash";
- nodeData = "src: " + path[i].getAttribute('title');
- }
+ w = parseInt(w);
+ h = parseInt(h);
- if (nodeName == "a" && (anchor = tinyMCE.getAttrib(path[i], "name")) != "") {
- nodeName = "a";
- nodeName += "#" + anchor;
- nodeData = "";
- }
+ if (tinyMCE.isGecko) {
+ w += 2;
+ h += 2;
+ }
- if (getAttrib(path[i], 'name').indexOf("mce_") != 0) {
- var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false);
- if (className != "" && className.indexOf('mceItem') == -1) {
- nodeName += "." + className;
- }
- }
+ var dx = w - tableElm.clientWidth;
+ var dy = h - tableElm.clientHeight;
- var cmd = 'tinyMCE.execInstanceCommand(\'' + editor_id + '\',\'mceSelectNodeDepth\',false,\'' + i + '\');';
- html += '' + nodeName + ' ';
+ w = w < 1 ? 30 : w;
+ h = h < 1 ? 30 : h;
- if (i > 0) {
- html += " » ";
- }
- }
+ if (set_w)
+ tableElm.style.width = w + "px";
- pathElm.innerHTML = ' ' + tinyMCE.getLang('lang_theme_path') + ": " + html + ' ';
- }
+ tableElm.style.height = h + "px";
- // 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');
-
- if (node.nodeName == "A" && tinyMCE.getAttrib(node, "class").indexOf('mceItemAnchor') != -1)
- 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);
- }
+ iw = iframe.clientWidth + dx;
+ ih = iframe.clientHeight + dy;
- // Handle visual aid
- tinyMCE.switchClassSticky(editor_id + '_visualaid', visual_aid ? 'mceButtonSelected' : 'mceButtonNormal', false);
+ iw = iw < 1 ? 30 : iw;
+ ih = ih < 1 ? 30 : ih;
- if (undo_levels != -1)
- {
- tinyMCE.switchClassSticky(editor_id + '_undo', 'mceButtonDisabled', true);
- tinyMCE.switchClassSticky(editor_id + '_redo', 'mceButtonDisabled', true);
- }
+ if (tinyMCE.isGecko) {
+ iw -= 2;
+ ih -= 2;
+ }
- // Within li, blockquote
- if (tinyMCE.getParentElement(node, "li,blockquote"))
- {
- tinyMCE.switchClassSticky(editor_id + '_outdent', 'mceButtonNormal', false);
- }
+ if (set_w)
+ iframe.style.width = iw + "px";
- // Has redo levels
- if (undo_index != -1 && (undo_index < undo_levels-1 && undo_levels > 0))
- {
- tinyMCE.switchClassSticky(editor_id + '_redo', 'mceButtonNormal', false);
- }
+ iframe.style.height = ih + "px";
- // Has undo levels
- if (undo_index != -1 && (undo_index > 0 && undo_levels > 0))
- {
- tinyMCE.switchClassSticky(editor_id + '_undo', 'mceButtonNormal', false);
- }
+ // Is it to small, make it bigger again
+ if (set_w) {
+ var tableBodyElm = tableElm.firstChild;
+ var minIframeWidth = tableBodyElm.scrollWidth;
+ if (inst.iframeElement.clientWidth < minIframeWidth) {
+ dx = minIframeWidth - inst.iframeElement.clientWidth;
- // Select class in select box
- var selectElm = document.getElementById(editor_id + "_styleSelect");
-
- if (selectElm)
- {
- TinyMCE_advanced_setupCSSClasses(editor_id);
+ inst.iframeElement.style.width = (iw + dx) + "px";
+ }
+ }
+ },
- classNode = node;
- breakOut = false;
- var index = 0;
+ /**
+ * Handles resizing events.
+ */
+ _resizeEventHandler : function(e) {
+ var resizer = TinyMCE_AdvancedTheme._resizer;
- do
- {
- if (classNode && classNode.className)
- {
- for (var i=0; i");
- else
- selectByValue(selectElm, "");
- }
+ var dx = e.screenX - resizer.downX;
+ var dy = e.screenY - resizer.downY;
+ var resizeBox = resizer.resizeBox;
+ var editorId = resizer.editorId;
- // Select fontselect
- var selectElm = document.getElementById(editor_id + "_fontNameSelect");
- if (selectElm) {
- if (!tinyMCE.isSafari && !(tinyMCE.isMSIE && !tinyMCE.isOpera)) {
- var face = inst.queryCommandValue('FontName');
+ switch (e.type) {
+ case "mousemove":
+ var w, h;
- face = face == null || face == "" ? "" : face;
+ w = resizer.width + dx;
+ h = resizer.height + dy;
- selectByValue(selectElm, face, face != "");
- } else {
- var elm = tinyMCE.getParentElement(node, "font", "face");
+ w = w < 1 ? 1 : w;
+ h = h < 1 ? 1 : h;
- if (elm) {
- var family = tinyMCE.getAttrib(elm, "face");
+ if (resizer.horizontal)
+ resizeBox.style.width = w + "px";
- if (family == '')
- family = '' + elm.style.fontFamily;
+ resizeBox.style.height = h + "px";
+ break;
- if (!selectByValue(selectElm, family, family != ""))
- selectByValue(selectElm, "");
- } else
- selectByValue(selectElm, "");
+ case "mouseup":
+ TinyMCE_AdvancedTheme._setResizing(e, editorId, false);
+ TinyMCE_AdvancedTheme._resizeTo(tinyMCE.getInstanceById(editorId), resizer.width + dx, resizer.height + dy, resizer.horizontal);
+
+ // Expire in a month
+ if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) {
+ var expires = new Date();
+ expires.setTime(expires.getTime() + 3600000 * 24 * 30);
+
+ // Set the cookies
+ TinyMCE_AdvancedTheme._setCookie("TinyMCE_" + editorId + "_width", "" + (resizer.horizontal ? resizer.width + dx : ""), expires);
+ TinyMCE_AdvancedTheme._setCookie("TinyMCE_" + editorId + "_height", "" + (resizer.height + dy), expires);
+ }
+ break;
}
- }
+ },
- // Select fontsize
- var selectElm = document.getElementById(editor_id + "_fontSizeSelect");
- if (selectElm) {
- if (!tinyMCE.isSafari && !tinyMCE.isOpera) {
- var size = inst.queryCommandValue('FontSize');
- selectByValue(selectElm, size == null || size == "" ? "0" : size);
+ /**
+ * Starts/stops the editor resizing.
+ */
+ _setResizing : function(e, editor_id, state) {
+ e = typeof(e) == "undefined" ? window.event : e;
+
+ var resizer = TinyMCE_AdvancedTheme._resizer;
+ var editorContainer = document.getElementById(editor_id + '_parent');
+ var editorArea = document.getElementById(editor_id + '_parent').firstChild;
+ var resizeBox = document.getElementById(editor_id + '_resize_box');
+ var inst = tinyMCE.getInstanceById(editor_id);
+
+ if (state) {
+ // Place box over editor area
+ var width = editorArea.clientWidth;
+ var height = editorArea.clientHeight;
+
+ resizeBox.style.width = width + "px";
+ resizeBox.style.height = height + "px";
+
+ resizer.iframeWidth = inst.iframeElement.clientWidth;
+ resizer.iframeHeight = inst.iframeElement.clientHeight;
+
+ // Hide editor and show resize box
+ editorArea.style.display = "none";
+ resizeBox.style.display = "block";
+
+ // Add event handlers, only once
+ if (!resizer.eventHandlers) {
+ if (tinyMCE.isMSIE)
+ tinyMCE.addEvent(document, "mousemove", TinyMCE_AdvancedTheme._resizeEventHandler);
+ else
+ tinyMCE.addEvent(window, "mousemove", TinyMCE_AdvancedTheme._resizeEventHandler);
+
+ tinyMCE.addEvent(document, "mouseup", TinyMCE_AdvancedTheme._resizeEventHandler);
+
+ resizer.eventHandlers = true;
+ }
+
+ resizer.resizing = true;
+ resizer.downX = e.screenX;
+ resizer.downY = e.screenY;
+ resizer.width = parseInt(resizeBox.style.width);
+ resizer.height = parseInt(resizeBox.style.height);
+ resizer.editorId = editor_id;
+ resizer.resizeBox = resizeBox;
+ resizer.horizontal = tinyMCE.getParam("theme_advanced_resize_horizontal", true);
} else {
- var elm = tinyMCE.getParentElement(node, "font", "size");
- if (elm) {
- var size = tinyMCE.getAttrib(elm, "size");
-
- if (size == '') {
- var sizes = new Array('', '8px', '10px', '12px', '14px', '18px', '24px', '36px');
-
- size = '' + elm.style.fontSize;
-
- for (var i=0; i ';
- case "justify":
- tinyMCE.switchClassSticky(editor_id + '_justifyfull', 'mceButtonSelected');
- breakOut = true;
- break;
- }
- } while (!breakOut && (alignNode = alignNode.parentNode) != null);
+ tinyMCE.execCommand("mceInsertContent", false, html);
+ } else {
+ if (!tinyMCE.imgElement && tinyMCE.selectedInstance) {
+ if (tinyMCE.isSafari)
+ tinyMCE.execCommand("mceInsertContent", false, ' ');
+ else
+ tinyMCE.selectedInstance.contentDocument.execCommand("insertimage", false, tinyMCE.uniqueURL);
- // Div justification
- var div = tinyMCE.getParentElement(node, "div");
- if (div && div.style.textAlign == "center")
- tinyMCE.switchClassSticky(editor_id + '_justifycenter', 'mceButtonSelected');
-
- // Do special text
- if (!setup_content) {
- // , "JustifyLeft", "_justifyleft", "JustifyCenter", "justifycenter", "JustifyRight", "justifyright", "JustifyFull", "justifyfull", "InsertUnorderedList", "bullist", "InsertOrderedList", "numlist", "InsertUnorderedList", "bullist", "Outdent", "outdent", "Indent", "indent", "subscript", "sub"
- var ar = new Array("Bold", "_bold", "Italic", "_italic", "Strikethrough", "_strikethrough", "superscript", "_sup", "subscript", "_sub");
- for (var i=0; i' + tinyMCE.selectedInstance.selection.getSelectedHTML() + '');
+ } else
+ tinyMCE.selectedInstance.contentDocument.execCommand("createlink", false, tinyMCE.uniqueURL);
+
+ tinyMCE.linkElement = tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL);
+
+ var elementArray = tinyMCE.getElementsByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL);
- var selectElm = document.getElementById(editor_id + '_styleSelect');
+ for (var i=0; i 0) {
- selectElm.setAttribute('cssImported', 'true');
+ if (tinyMCE.linkElement) {
+ var mhref = href;
+ href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement);");
+ mhref = tinyMCE.getParam('convert_urls') ? href : mhref;
+
+ tinyMCE.setAttrib(tinyMCE.linkElement, 'href', href);
+ tinyMCE.setAttrib(tinyMCE.linkElement, 'mce_href', mhref);
+ tinyMCE.setAttrib(tinyMCE.linkElement, 'target', target);
+ tinyMCE.setAttrib(tinyMCE.linkElement, 'title', title);
+ tinyMCE.setAttrib(tinyMCE.linkElement, 'onclick', onclick);
+ tinyMCE.setAttrib(tinyMCE.linkElement, 'class', style_class);
}
+
+ tinyMCE.execCommand('mceEndUndoLevel');
}
};
+
+tinyMCE.addTheme("advanced", TinyMCE_AdvancedTheme);
+
+// Add default buttons maps for advanced theme and all internal plugins
+tinyMCE.addButtonMap(TinyMCE_AdvancedTheme._buttonMap);
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/image.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/image.htm
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/image.htm 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/image.htm 2006-06-25 16:54:35.000000000 -0400
@@ -2,23 +2,27 @@
{$lang_insert_image_title}
+
-
-
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/button_menu.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/button_menu.gif differ
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/buttons.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/buttons.gif differ
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/center.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/center.gif differ
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/full.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/full.gif differ
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/left.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/left.gif differ
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/menu_check.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/menu_check.gif differ
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/right.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/right.gif differ
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/separator.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/separator.gif differ
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table.gif differ
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_delete_col.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_delete_col.gif differ
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_delete_row.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_delete_row.gif differ
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_insert_col_after.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_insert_col_after.gif differ
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_insert_col_before.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_insert_col_before.gif differ
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_insert_row_after.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_insert_row_after.gif differ
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_insert_row_before.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_insert_row_before.gif differ
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/about.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/about.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/about.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/about.js 2006-06-25 16:54:25.000000000 -0400
@@ -1,5 +1,8 @@
function init() {
+ var inst;
+
tinyMCEPopup.resizeToInnerSize();
+ inst = tinyMCE.selectedInstance;
// Give FF some time
window.setTimeout('insertHelpIFrame();', 10);
@@ -20,8 +23,8 @@
html += '';
html += '';
- for (var i=0; i';
@@ -46,10 +49,8 @@
}
function getPluginInfo(name) {
- var fn = eval('tinyMCEPopup.windowOpener.TinyMCE_' + name + '_getInfo');
-
- if (typeof(fn) != 'undefined')
- return fn();
+ if (tinyMCE.plugins[name].getInfo)
+ return tinyMCE.plugins[name].getInfo();
return {
longname : name,
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/anchor.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/anchor.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/anchor.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/anchor.js 2006-06-25 16:54:25.000000000 -0400
@@ -26,7 +26,7 @@
function insertAnchor() {
var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
- var name = document.forms[0].anchorName.value;
+ var name = document.forms[0].anchorName.value, e;
tinyMCEPopup.execCommand("mceBeginUndoLevel");
@@ -44,11 +44,26 @@
name = name.replace(/&/g, '&');
name = name.replace(/\"/g, '"');
name = name.replace(//g, '&gr;');
+ name = name.replace(/>/g, '>');
- html = ' ';
+ // Fix for bug #1447335
+ if (tinyMCE.isGecko)
+ html = ' ';
+ else
+ html = ' ';
tinyMCEPopup.execCommand("mceInsertContent", false, html);
+
+ // Fix for bug #1447335 force cursor after the anchor element
+ if (tinyMCE.isGecko) {
+ e = inst.getDoc().getElementById('mceNewAnchor');
+
+ if (e) {
+ inst.selection.selectNode(e, true, false, false);
+ e.removeAttribute('id');
+ }
+ }
+
tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
}
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/charmap.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/charmap.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/charmap.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/charmap.js 2006-06-25 16:54:25.000000000 -0400
@@ -170,7 +170,7 @@
['ý', 'ý', true, 'y - acute'],
['þ', 'þ', true, 'thorn'],
['ÿ', 'ÿ', true, 'y - diaeresis'],
-// ['Α', 'Α', true, 'Alpha'],
+ ['Α', 'Α', true, 'Alpha'],
['Β', 'Β', true, 'Beta'],
['Γ', 'Γ', true, 'Gamma'],
['Δ', 'Δ', true, 'Delta'],
@@ -279,9 +279,9 @@
cols++;
html += ''
+ ''
+ charmap[i][1]
+ ' ';
@@ -299,11 +299,13 @@
}
function insertChar(chr) {
- tinyMCEPopup.execCommand('mceInsertContent', false, '\' + chr + ';');
+ tinyMCEPopup.execCommand('mceInsertContent', false, '' + chr + ';');
// Refocus in window
if (tinyMCEPopup.isWindow)
window.focus();
+
+ tinyMCEPopup.close();
}
function previewChar(codeA, codeB, codeN) {
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/color_picker.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/color_picker.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/color_picker.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/color_picker.js 2006-06-25 16:54:25.000000000 -0400
@@ -99,7 +99,8 @@
+ ' '
+ ''
+ '
'
- + ' '
+ + '
'
+ + '
'
+ ' '
+ '
';
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/image.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/image.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/image.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/image.js 2006-06-25 16:54:25.000000000 -0400
@@ -18,7 +18,7 @@
var align = document.forms[0].align.options[document.forms[0].align.selectedIndex].value;
tinyMCEPopup.restoreSelection();
- tinyMCE.insertImage(src, alt, border, hspace, vspace, width, height, align);
+ tinyMCE.themes['advanced']._insertImage(src, alt, border, hspace, vspace, width, height, align);
tinyMCEPopup.close();
}
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/link.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/link.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/link.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/link.js 2006-06-25 16:54:25.000000000 -0400
@@ -12,6 +12,10 @@
document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','theme_advanced_link');
+ // Handle file browser
+ if (isVisible('hrefbrowser'))
+ document.getElementById('href').style.width = '180px';
+
var formObj = document.forms[0];
for (var i=0; i 0) {
var formObj = document.forms[0];
@@ -53,7 +54,7 @@
var href = document.forms[0].href.value;
var target = document.forms[0].target.options[document.forms[0].target.selectedIndex].value;
var title = document.forms[0].linktitle.value;
- var style_class = document.forms[0].styleSelect.value;
+ var style_class = document.forms[0].styleSelect ? document.forms[0].styleSelect.value : "";
var dummy;
// Make anchors absolute
@@ -64,6 +65,6 @@
target = '';
tinyMCEPopup.restoreSelection();
- tinyMCE.insertLink(href, target, title, dummy, style_class);
+ tinyMCE.themes['advanced']._insertLink(href, target, title, dummy, style_class);
tinyMCEPopup.close();
}
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/source_editor.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/source_editor.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/source_editor.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/source_editor.js 2006-06-25 16:54:25.000000000 -0400
@@ -5,10 +5,10 @@
// Fixes some charcode issues
function fixContent(html) {
- html = html.replace(new RegExp('<(p|hr|table|tr|td|ol|ul|object|embed|li|blockquote)', 'gi'),'\n<$1');
+/* html = html.replace(new RegExp('<(p|hr|table|tr|td|ol|ul|object|embed|li|blockquote)', 'gi'),'\n<$1');
html = html.replace(new RegExp('<\/(p|ol|ul|li|table|tr|td|blockquote|object)>', 'gi'),'$1>\n');
html = tinyMCE.regexpReplace(html, ' ',' \n','gi');
- html = tinyMCE.regexpReplace(html, '\n\n','\n','gi');
+ html = tinyMCE.regexpReplace(html, '\n\n','\n','gi');*/
return html;
}
@@ -17,12 +17,25 @@
document.forms[0].htmlSource.value = fixContent(tinyMCE.getContent(tinyMCE.getWindowArg('editor_id')));
resizeInputs();
- setWrap('off');
+
+ if (tinyMCE.getParam("theme_advanced_source_editor_wrap", true)) {
+ setWrap('soft');
+ document.forms[0].wraped.checked = true;
+ }
}
function setWrap(val) {
- // hard soft off
- document.forms[0].htmlSource.wrap = val;
+ var s = document.forms[0].htmlSource;
+
+ s.wrap = val;
+
+ if (tinyMCE.isGecko) {
+ var v = s.value;
+ var n = s.cloneNode(false);
+ n.setAttribute("wrap", val);
+ s.parentNode.replaceChild(n, s);
+ n.value = v;
+ }
}
function toggleWordWrap(elm) {
@@ -48,6 +61,6 @@
}
function renderWordWrap() {
- if (tinyMCE.isMSIE)
+ if (tinyMCE.isMSIE || tinyMCE.isGecko)
document.write('{$lang_theme_code_wordwrap} ');
}
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js 2006-06-25 16:54:25.000000000 -0400
@@ -38,6 +38,11 @@
theme_h4 : 'Heading 4',
theme_h5 : 'Heading 5',
theme_h6 : 'Heading 6',
+theme_blockquote : 'Blockquote',
+theme_code : 'Code',
+theme_samp : 'Code sample',
+theme_dt : 'Definition term ',
+theme_dd : 'Definition description',
theme_colorpicker_title : 'Select a color',
theme_colorpicker_apply : 'Apply',
theme_forecolor_desc : 'Select text color',
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/link.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/link.htm
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/link.htm 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/link.htm 2006-06-25 16:54:35.000000000 -0400
@@ -2,34 +2,39 @@
{$lang_insert_link_title}
+
-
-
-
-
-
-
- {$lang_insert_link_title}
-
+
+
+
+
+
+
+
+
- {$lang_insert_link_url}:
-
+ {$lang_insert_link_url}
+
- {$lang_insert_link_target}:
-
+ {$lang_insert_link_target}
+
{$lang_insert_link_target_same}
{$lang_insert_link_target_blank}
-
+
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_content.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_content.css
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_content.css 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_content.css 2006-06-25 16:54:36.000000000 -0400
@@ -1,7 +1,19 @@
-body {
- background-color: #FFFFFF;
+body, td, pre {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
+}
+
+body {
+ background-color: #FFFFFF;
+}
+
+.mceVisualAid {
+ border: 1px dashed #BBBBBB;
+}
+
+/* MSIE specific */
+
+* html body {
scrollbar-3dlight-color: #F0F0EE;
scrollbar-arrow-color: #676662;
scrollbar-base-color: #F0F0EE;
@@ -9,19 +21,5 @@
scrollbar-face-color: #E0E0DD;
scrollbar-highlight-color: #F0F0EE;
scrollbar-shadow-color: #F0F0EE;
- scrollbar-track-color: #F5F5F5;
-}
-
-td {
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 10px;
-}
-
-pre {
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 10px;
-}
-
-.mceVisualAid {
- border: 1px dashed #BBBBBB;
+ scrollbar-track-color: #F5F5F5;
}
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_popup.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_popup.css
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_popup.css 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_popup.css 2006-06-25 16:54:36.000000000 -0400
@@ -32,7 +32,7 @@
}
.input_noborder {
- border: 0px solid #808080;
+ border: 0;
}
.title {
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_ui.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_ui.css
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_ui.css 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_ui.css 2006-06-25 16:54:36.000000000 -0400
@@ -1,58 +1,8 @@
-.mceButtonNormal, .mceButtonOver, .mceButtonDown, .mceSeparator, .mceButtonDisabled, .mceButtonSelected {
- margin-top: 1px;
- margin-left: 1px;
-}
-
-.mceButtonNormal {
- border: 1px solid #F0F0EE !important;
- cursor: arrow;
-}
-
-.mceButtonOver {
- border: 1px solid #0A246A;
- cursor: arrow;
- background-color: #B6BDD2;
-}
-
-.mceButtonDown {
- 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: 1px solid #F0F0EE !important;
- 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;
+ border: 0;
+ padding: 0;
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;
+ margin-right: 2px;
}
.mceSelectList {
@@ -89,4 +39,87 @@
.mceToolbar {
background: #F0F0EE;
border-top: 1px solid #cccccc;
-}
\ No newline at end of file
+ line-height: 1px;
+ font-size: 1px;
+ padding-bottom: 1px;
+}
+
+.mceEditorIframe {
+ border: 0;
+}
+
+/* Button CSS rules */
+
+a.mceButtonDisabled img, a.mceButtonNormal img, a.mceButtonSelected img {
+ width: 20px;
+ height: 20px;
+ cursor: default;
+ margin-top: 1px;
+ margin-left: 1px;
+}
+
+a.mceButtonDisabled img {
+ border: 0 !important;
+}
+
+a.mceButtonNormal img, a.mceButtonSelected img {
+ border: 1px solid #F0F0EE !important;
+}
+
+a.mceButtonSelected img {
+ border: 1px solid #C0C0BB !important;
+}
+
+a.mceButtonNormal img:hover, a.mceButtonSelected img:hover {
+ border: 1px solid #0A246A !important;
+ cursor: default;
+ background-color: #B6BDD2;
+}
+
+a.mceButtonDisabled img {
+ -moz-opacity:0.3;
+ opacity: 0.3;
+ border: 1px solid #F0F0EE !important;
+ cursor: default;
+}
+
+a.mceTiledButton img {
+ background-image: url('../images/buttons.gif');
+ background-repeat: no-repeat;
+}
+
+/* MSIE specific rules */
+
+* html a.mceButtonNormal img, * html a.mceButtonSelected img, * html a.mceButtonDisabled img {
+ border: 0px !important;
+ margin-top: 2px;
+ margin-bottom: 1px;
+}
+
+* html a.mceButtonDisabled img {
+ filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
+ border: 0px !important;
+}
+
+* html a.mceButtonDisabled {
+ border: 1px solid #F0F0EE !important;
+}
+
+* html a.mceButtonNormal, * html a.mceButtonSelected {
+ border: 1px solid #F0F0EE;
+ cursor: default;
+}
+
+* html a.mceButtonSelected {
+ border: 1px solid #C0C0BB;
+}
+
+* html a.mceButtonNormal:hover, * html a.mceButtonSelected:hover {
+ border: 1px solid #0A246A;
+ cursor: default;
+ background-color: #B6BDD2;
+}
+
+* html .mceSelectList {
+ margin-top: 2px;
+}
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js 2006-06-25 16:54:36.000000000 -0400
@@ -1,20 +1,4 @@
-function TinyMCE_simple_getEditorTemplate(){var template=new Array();template['html']='\
-
';template['delta_width']=0;template['delta_height']=-20;return template;}function TinyMCE_simple_handleNodeChange(editor_id,node){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');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;}}while((node=node.parentNode)!=null);}
\ No newline at end of file
+var TinyMCE_SimpleTheme={_buttonMap:'bold,bullist,cleanup,italic,numlist,redo,strikethrough,underline,undo',getEditorTemplate:function(){var html='';html+='
';html+='';html+='IFRAME ';html+=' ';html+='';html+=tinyMCE.getButtonHTML('bold','lang_bold_desc','{$themeurl}/images/{$lang_bold_img}','Bold');html+=tinyMCE.getButtonHTML('italic','lang_italic_desc','{$themeurl}/images/{$lang_italic_img}','Italic');html+=tinyMCE.getButtonHTML('underline','lang_underline_desc','{$themeurl}/images/{$lang_underline_img}','Underline');html+=tinyMCE.getButtonHTML('strikethrough','lang_striketrough_desc','{$themeurl}/images/strikethrough.gif','Strikethrough');html+=' ';html+=tinyMCE.getButtonHTML('undo','lang_undo_desc','{$themeurl}/images/undo.gif','Undo');html+=tinyMCE.getButtonHTML('redo','lang_redo_desc','{$themeurl}/images/redo.gif','Redo');html+=' ';html+=tinyMCE.getButtonHTML('cleanup','lang_cleanup_desc','{$themeurl}/images/cleanup.gif','mceCleanup')
+html+=' ';html+=tinyMCE.getButtonHTML('bullist','lang_bullist_desc','{$themeurl}/images/bullist.gif','InsertUnorderedList')
+html+=tinyMCE.getButtonHTML('numlist','lang_numlist_desc','{$themeurl}/images/numlist.gif','InsertOrderedList')
+html+='
';return{delta_width:0,delta_height:20,html:html};},handleNodeChange:function(editor_id,node){tinyMCE.switchClass(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClass(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClass(editor_id+'_underline','mceButtonNormal');tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_numlist','mceButtonNormal');do{switch(node.nodeName.toLowerCase()){case"b":case"strong":tinyMCE.switchClass(editor_id+'_bold','mceButtonSelected');break;case"i":case"em":tinyMCE.switchClass(editor_id+'_italic','mceButtonSelected');break;case"u":tinyMCE.switchClass(editor_id+'_underline','mceButtonSelected');break;case"strike":tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonSelected');break;case"ul":tinyMCE.switchClass(editor_id+'_bullist','mceButtonSelected');break;case"ol":tinyMCE.switchClass(editor_id+'_numlist','mceButtonSelected');break;}}while((node=node.parentNode)!=null);}};tinyMCE.addTheme("simple",TinyMCE_SimpleTheme);tinyMCE.addButtonMap(TinyMCE_SimpleTheme._buttonMap);
\ No newline at end of file
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js 2006-06-25 16:54:36.000000000 -0400
@@ -1,70 +1,86 @@
-function TinyMCE_simple_getEditorTemplate() {
- var template = new Array();
+/**
+ * $RCSfile: editor_template_src.js,v $
+ * $Revision: 1.9 $
+ * $Date: 2006/04/18 13:32:53 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+var TinyMCE_SimpleTheme = {
+ // List of button ids in tile map
+ _buttonMap : 'bold,bullist,cleanup,italic,numlist,redo,strikethrough,underline,undo',
+
+ getEditorTemplate : function() {
+ var html = '';
+
+ html += '
';
+ html += '';
+ html += 'IFRAME ';
+ html += ' ';
+ html += '';
+ html += tinyMCE.getButtonHTML('bold', 'lang_bold_desc', '{$themeurl}/images/{$lang_bold_img}', 'Bold');
+ html += tinyMCE.getButtonHTML('italic', 'lang_italic_desc', '{$themeurl}/images/{$lang_italic_img}', 'Italic');
+ html += tinyMCE.getButtonHTML('underline', 'lang_underline_desc', '{$themeurl}/images/{$lang_underline_img}', 'Underline');
+ html += tinyMCE.getButtonHTML('strikethrough', 'lang_striketrough_desc', '{$themeurl}/images/strikethrough.gif', 'Strikethrough');
+ html += ' ';
+ html += tinyMCE.getButtonHTML('undo', 'lang_undo_desc', '{$themeurl}/images/undo.gif', 'Undo');
+ html += tinyMCE.getButtonHTML('redo', 'lang_redo_desc', '{$themeurl}/images/redo.gif', 'Redo');
+ html += ' ';
+ html += tinyMCE.getButtonHTML('cleanup', 'lang_cleanup_desc', '{$themeurl}/images/cleanup.gif', 'mceCleanup')
+ html += ' ';
+ html += tinyMCE.getButtonHTML('bullist', 'lang_bullist_desc', '{$themeurl}/images/bullist.gif', 'InsertUnorderedList')
+ html += tinyMCE.getButtonHTML('numlist', 'lang_numlist_desc', '{$themeurl}/images/numlist.gif', 'InsertOrderedList')
+ html += '
';
+
+ return {
+ delta_width : 0,
+ delta_height : 20,
+ html : html
+ };
+ },
+
+ handleNodeChange : function(editor_id, node) {
+ // Reset old states
+ tinyMCE.switchClass(editor_id + '_bold', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_italic', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_underline', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonNormal');
+ tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonNormal');
+
+ // Handle elements
+ do {
+ switch (node.nodeName.toLowerCase()) {
+ case "b":
+ case "strong":
+ tinyMCE.switchClass(editor_id + '_bold', 'mceButtonSelected');
+ break;
+
+ case "i":
+ case "em":
+ tinyMCE.switchClass(editor_id + '_italic', 'mceButtonSelected');
+ break;
+
+ case "u":
+ tinyMCE.switchClass(editor_id + '_underline', 'mceButtonSelected');
+ break;
+
+ case "strike":
+ tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonSelected');
+ break;
+
+ case "ul":
+ tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonSelected');
+ break;
+
+ case "ol":
+ tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonSelected');
+ break;
+ }
+ } while ((node = node.parentNode) != null);
+ }
+};
- template['html'] = '\
-
';
-
- template['delta_width'] = 0;
- template['delta_height'] = -20;
-
- return template;
-}
-
-function TinyMCE_simple_handleNodeChange(editor_id, node) {
- // Reset old states
- 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');
-
- // 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;
- }
- } while ((node = node.parentNode) != null);
-}
+tinyMCE.addTheme("simple", TinyMCE_SimpleTheme);
+tinyMCE.addButtonMap(TinyMCE_SimpleTheme._buttonMap);
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/images/buttons.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/images/buttons.gif differ
Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/images/separator.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/images/separator.gif differ
diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/tiny_mce.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/tiny_mce.js
--- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/tiny_mce.js 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/tiny_mce.js 2006-06-25 16:54:36.000000000 -0400
@@ -1,3 +1 @@
-function TinyMCE(){this.majorVersion="2";this.minorVersion="0";this.releaseDate="2005-12-01";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();var ua=navigator.userAgent;this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.isMSIE5=this.isMSIE&&(ua.indexOf('MSIE 5')!=-1);this.isMSIE5_0=this.isMSIE&&(ua.indexOf('MSIE 5.0')!=-1);this.isGecko=ua.indexOf('Gecko')!=-1;this.isSafari=ua.indexOf('Safari')!=-1;this.isOpera=ua.indexOf('Opera')!=-1;this.isMac=ua.indexOf('Mac')!=-1;this.isNS7=ua.indexOf('Netscape/7')!=-1;this.isNS71=ua.indexOf('Netscape/7.1')!=-1;this.dialogCounter=0;if(this.isOpera){this.isMSIE=true;this.isGecko=false;this.isSafari=false;}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.defParam("font_size_classes",'');this.defParam("font_size_style_values",'xx-small,x-small,small,medium,large,x-large,xx-large');this.defParam("event_elements",'a,img');this.defParam("convert_urls",true);this.defParam("table_inline_editing",false);this.defParam("object_resizing",true);if(this.isMSIE&&this.settings['browsers'].indexOf('msie')==-1)return;if(this.isGecko&&this.settings['browsers'].indexOf('gecko')==-1)return;if(this.isSafari&&this.settings['browsers'].indexOf('safari')==-1)return;if(this.isOpera&&this.settings['browsers'].indexOf('opera')==-1)return;var baseHREF=tinyMCE.settings['document_base_url'];var h=document.location.href;var p=h.indexOf('://');if(p>0&&document.location.protocol!="file:"){p=h.indexOf('/',p+3);h=h.substring(0,p);if(baseHREF.indexOf('://')==-1)baseHREF=h+baseHREF;tinyMCE.settings['document_base_url']=baseHREF;tinyMCE.settings['document_base_prefix']=h;}if(baseHREF.indexOf('?')!=-1)baseHREF=baseHREF.substring(0,baseHREF.indexOf('?'));this.settings['base_href']=baseHREF.substring(0,baseHREF.lastIndexOf('/'))+"/";theme=this.settings['theme'];this.blockRegExp=new RegExp("^(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|blockquote|center|dl|dir|fieldset|form|noscript|noframes|menu|isindex)$","i");this.posKeyCodes=new Array(13,45,36,35,33,34,37,38,39,40);this.uniqueURL='http://tinymce.moxiecode.cp/mce_temp_url';this.uniqueTag='TMP
';this.settings['theme_href']=tinyMCE.baseURL+"/themes/"+theme;if(!tinyMCE.isMSIE)this.settings['force_br_newlines']=false;if(tinyMCE.getParam("content_css",false)){var cssPath=tinyMCE.getParam("content_css","");if(cssPath.indexOf('://')==-1&&cssPath.charAt(0)!='/')this.settings['content_css']=this.documentBasePath+"/"+cssPath;else this.settings['content_css']=cssPath;}else this.settings['content_css']='';if(tinyMCE.getParam("popups_css",false)){var cssPath=tinyMCE.getParam("popups_css","");if(cssPath.indexOf('://')==-1&&cssPath.charAt(0)!='/')this.settings['popups_css']=this.documentBasePath+"/"+cssPath;else this.settings['popups_css']=cssPath;}else this.settings['popups_css']=tinyMCE.baseURL+"/themes/"+theme+"/css/editor_popup.css";if(tinyMCE.getParam("editor_css",false)){var cssPath=tinyMCE.getParam("editor_css","");if(cssPath.indexOf('://')==-1&&cssPath.charAt(0)!='/')this.settings['editor_css']=this.documentBasePath+"/"+cssPath;else this.settings['editor_css']=cssPath;}else this.settings['editor_css']=tinyMCE.baseURL+"/themes/"+theme+"/css/editor_ui.css";if(tinyMCE.settings['debug']){var msg="Debug: \n";msg+="baseURL: "+this.baseURL+"\n";msg+="documentBasePath: "+this.documentBasePath+"\n";msg+="content_css: "+this.settings['content_css']+"\n";msg+="popups_css: "+this.settings['popups_css']+"\n";msg+="editor_css: "+this.settings['editor_css']+"\n";alert(msg);}this._initCleanup();if(this.configs.length==0){if(this.isSafari&&this.getParam('safari_warning',true))alert("Safari support is very limited and should be considered experimental.\nSo there is no need to even submit bugreports on this early version.\nYou can disable this message by setting: safari_warning option to false");tinyMCE.addEvent(window,"load",TinyMCE.prototype.onLoad);if(tinyMCE.isMSIE){if(tinyMCE.settings['add_unload_trigger']){tinyMCE.addEvent(window,"unload",TinyMCE.prototype.unloadHandler);tinyMCE.addEvent(window.document,"beforeunload",TinyMCE.prototype.unloadHandler);}}else{if(tinyMCE.settings['add_unload_trigger'])tinyMCE.addEvent(window,"unload",function(){tinyMCE.triggerSave(true,true);});}}this.loadScript(tinyMCE.baseURL+'/themes/'+this.settings['theme']+'/editor_template'+tinyMCE.srcMode+'.js');this.loadScript(tinyMCE.baseURL+'/langs/'+this.settings['language']+'.js');this.loadCSS(this.settings['editor_css']);var themePlugins=tinyMCE.getParam('plugins','',true,',');if(this.settings['plugins']!=''){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(css_file=='')return;if(typeof(doc.createStyleSheet)=="undefined"){var elm=doc.createElement("link");elm.rel="stylesheet";elm.href=css_file;if((headArr=doc.getElementsByTagName("head"))!=null&&headArr.length>0)headArr[0].appendChild(elm);}else var styleSheet=doc.createStyleSheet(css_file);};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];if(!tinyMCE.isInstance(inst))continue;inst.switchSettings();if(inst.formElement==formElement){var doc=inst.getDoc();tinyMCE._setHTML(doc,inst.formElement.value);if(!tinyMCE.isMSIE)doc.body.innerHTML=tinyMCE._cleanupHTML(inst,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];if(!tinyMCE.isInstance(inst))continue;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);if(inst.settings['cleanup']==false){tinyMCE.handleVisualAid(inst.getBody(),true,false,inst);tinyMCE._setEventsEnabled(inst.getBody(),true);}tinyMCE._customCleanup(inst,"submit_content_dom",inst.contentWindow.document.body);var htm=skip_cleanup?inst.getBody().innerHTML:tinyMCE._cleanupHTML(inst,inst.getDoc(),this.settings,inst.getBody(),this.visualAid,true);htm=tinyMCE._customCleanup(inst,"submit_content",htm);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._setEventsEnabled=function(node,state){var events=new Array('onfocus','onblur','onclick','ondblclick','onmousedown','onmouseup','onmouseover','onmousemove','onmouseout','onkeypress','onkeydown','onkeydown','onkeyup');var evs=tinyMCE.settings['event_elements'].split(',');for(var y=0;y ","gi");content=tinyMCE.regexpReplace(content,"\r"," ","gi");content=tinyMCE.regexpReplace(content,"\n"," ","gi");}content=tinyMCE.storeAwayURLs(content);content=tinyMCE._customCleanup(inst,"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);body.editorId=editor_id;}content=tinyMCE.cleanupHTMLCode(content);if(!tinyMCE.isMSIE){var contentElement=inst.getDoc().createElement("body");var doc=inst.getDoc();contentElement.innerHTML=content;if(tinyMCE.isGecko&&tinyMCE.settings['remove_lt_gt'])content=content.replace(new RegExp('<>','g'),"");if(tinyMCE.settings['cleanup_on_startup'])tinyMCE.setInnerHTML(inst.getBody(),tinyMCE._cleanupHTML(inst,doc,this.settings,contentElement));else{content=tinyMCE.regexpReplace(content,"","","gi");content=tinyMCE.regexpReplace(content,"","","gi");content=tinyMCE.regexpReplace(content," "," ","gi");tinyMCE.setInnerHTML(inst.getBody(),content);}inst.convertAllRelativeURLs();}else{if(tinyMCE.settings['cleanup_on_startup']){tinyMCE._setHTML(inst.getDoc(),content);eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}');}else tinyMCE._setHTML(inst.getDoc(),content);}var parentElm=document.getElementById(inst.editorId+'_parent');if(parentElm.lastChild.nodeName=="INPUT")inst.formElement=tinyMCE.isGecko?parentElm.firstChild:parentElm.lastChild;else inst.formElement=tinyMCE.isGecko?parentElm.previousSibling:parentElm.nextSibling;tinyMCE.handleVisualAid(inst.getBody(),true,tinyMCE.settings['visual'],inst);tinyMCE.executeCallback('setupcontent_callback','_setupContent',0,editor_id,inst.getBody(),inst.getDoc());if(!tinyMCE.isMSIE)TinyMCE.prototype.addEventHandlers(editor_id);if(tinyMCE.isMSIE)tinyMCE.addEvent(inst.getBody(),"blur",TinyMCE.prototype.eventPatch);tinyMCE.selectedInstance=inst;tinyMCE.selectedElement=inst.contentWindow.document.body;if(!inst.isHidden())tinyMCE.triggerNodeChange(false,true);tinyMCE._customCleanup(inst,"insert_to_editor_dom",inst.getBody());tinyMCE._customCleanup(inst,"setup_content_dom",inst.getBody());tinyMCE._setEventsEnabled(inst.getBody(),false);tinyMCE.cleanupAnchors(inst.getDoc());if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(inst.getDoc());inst.startContent=tinyMCE.trim(inst.getBody().innerHTML);inst.undoLevels[inst.undoLevels.length]=inst.startContent;tinyMCE.operaOpacityCounter=-1;};TinyMCE.prototype.cleanupHTMLCode=function(s){s=s.replace(/
/gi,'
');s=s.replace(/\s*<\/p>/gi,'
');s=s.replace(/<(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|b|em|strong|i|strike|u|span|a|ul|ol|li|blockquote)([a-z]*)([^\\|>]*?)\/>/gi,'<$1$2$3>$1$2>');s=s.replace(new RegExp('\\s+>','gi'),'>');s=s.replace(/<(img|br|hr)(.*?)><\/(img|br|hr)>/gi,'<$1$2 />');if(tinyMCE.isMSIE)s=s.replace(/
<\/p>/gi," ");s=s.replace(new RegExp('(href=\"?)(\\s*?#)','gi'),'$1'+tinyMCE.settings['document_base_url']+"#");return s;};TinyMCE.prototype.storeAwayURLs=function(s){s=s.replace(new RegExp('mce_src\\s*=\\s*\"[^ >\"]*\"','gi'),'');s=s.replace(new RegExp('mce_href\\s*=\\s*\"[^ >\"]*\"','gi'),'');s=s.replace(new RegExp('src\\s*=\\s*\"([^ >\"]*)\"','gi'),'src="$1" mce_src="$1"');s=s.replace(new RegExp('href\\s*=\\s*\"([^ >\"]*)\"','gi'),'href="$1" mce_href="$1"');return s;};TinyMCE.prototype.cancelEvent=function(e){if(tinyMCE.isMSIE){e.returnValue=false;e.cancelBubble=true;}else e.preventDefault();};TinyMCE.prototype.removeTinyMCEFormElements=function(form_obj){if(typeof(form_obj)=="undefined"||form_obj==null)return;if(form_obj.nodeName!="FORM"){if(form_obj.form)form_obj=form_obj.form;else form_obj=tinyMCE.getParentElement(form_obj,"form");}if(form_obj==null)return;for(var i=0;i ");rng.collapse(false);rng.select();tinyMCE.execCommand("mceAddUndoLevel");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();var inst=tinyMCE.selectedInstance;if(tinyMCE.isGecko&&tinyMCE.settings['force_p_newlines']&&(e.keyCode==8||e.keyCode==46)&&!e.shiftKey){if(tinyMCE.selectedInstance._handleBackSpace(e.type)){tinyMCE.execCommand("mceAddUndoLevel");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'],tinyMCE.selectedInstance);if(tinyMCE.isMSIE&&e.type=="keydown"&&e.keyCode==13)tinyMCE.enterKeyElement=tinyMCE.selectedInstance.getFocusElement();if(tinyMCE.isMSIE&&e.type=="keyup"&&e.keyCode==13){var elm=tinyMCE.enterKeyElement;if(elm){var re=new RegExp('^HR|IMG|BR$','g');var dre=new RegExp('^H[1-6]$','g');if(!elm.hasChildNodes()&&!re.test(elm.nodeName)){if(dre.test(elm.nodeName))elm.innerHTML=" ";else elm.innerHTML=" ";}}}var keys=tinyMCE.posKeyCodes;var posKey=false;for(var i=0;i-1)suffix='?rnd='+this.operaOpacityCounter++;element.src=tinyMCE.baseURL+"/themes/"+tinyMCE.getParam("theme")+"/images/opacity.png"+suffix;element.style.backgroundImage="url('"+element.mceOldSrc+"')";}else{if(element.mceOldSrc){element.src=element.mceOldSrc;element.parentNode.style.backgroundImage="";element.mceOldSrc=null;}}}}};TinyMCE.prototype.restoreClass=function(element){if(element!=null&&element.oldClassName&&!element.classLock){element.className=element.oldClassName;element.oldClassName=null;}};TinyMCE.prototype.setClassLock=function(element,lock_state){if(element!=null)element.classLock=lock_state;};TinyMCE.prototype.addEvent=function(obj,name,handler){if(tinyMCE.isMSIE){obj.attachEvent("on"+name,handler);}else obj.addEventListener(name,handler,false);};TinyMCE.prototype.submitPatch=function(){tinyMCE.removeTinyMCEFormElements(this);tinyMCE.triggerSave();this.mceOldSubmit();tinyMCE.isNotDirty=true;};TinyMCE.prototype.onLoad=function(){for(var c=0;c0)return;if(val.indexOf('%')==-1)val+='px';break;case "vspace":case "hspace":elm.style.marginTop=val+"px";elm.style.marginBottom=val+"px";elm.removeAttribute(attrib);return;case "align":if(elm.nodeName=="IMG"){if(tinyMCE.isMSIE)elm.style.styleFloat=val;else elm.style.cssFloat=val;}else elm.style.textAlign=val;elm.removeAttribute(attrib);return;}if(val!=''){eval('elm.style.'+style+' = val;');elm.removeAttribute(attrib);}}}else{if(style=='')return;var val=eval('elm.style.'+style)==''?tinyMCE.getAttrib(elm,attrib):eval('elm.style.'+style);val=val==null?'':''+val;switch(attrib){case "background":if(val.indexOf('url')==-1&&val!='')val="url('"+val+"');";if(val!=''){elm.style.backgroundImage=val;elm.removeAttribute(attrib);}return;case "border":case "width":case "height":val=val.replace('px','');break;case "align":if(tinyMCE.getAttrib(elm,'align')==''){if(elm.nodeName=="IMG"){if(tinyMCE.isMSIE&&elm.style.styleFloat!=''){val=elm.style.styleFloat;style='styleFloat';}else if(tinyMCE.isGecko&&elm.style.cssFloat!=''){val=elm.style.cssFloat;style='cssFloat';}}}break;}if(val!=''){elm.removeAttribute(attrib);elm.setAttribute(attrib,val);eval('elm.style.'+style+' = "";');}}};TinyMCE.prototype._cleanupAttribute=function(valid_attributes,element_name,attribute_node,element_node){var attribName=attribute_node.nodeName.toLowerCase();var attribValue=attribute_node.nodeValue;var attribMustBeValue=null;var verified=false;if(attribName.indexOf('moz_')!=-1)return null;if(!tinyMCE.cleanup_on_save&&(attribName=="mce_href"||attribName=="mce_src"))return{name:attribName,value:attribValue};if(tinyMCE.cleanup_verify_html&&!verified){for(var i=1;i1)val="url('"+eval(tinyMCE.getParam('urlconverter_callback')+"(m[1], null, true);")+"')";}if(tinyMCE.getParam("force_hex_style_colors"))val=tinyMCE.convertRGBToHex(val,true);if(val!="url('')")str+=key.toLowerCase()+": "+val+"; ";}}if(new RegExp('; $').test(str))str=str.substring(0,str.length-2);return str;};TinyMCE.prototype.convertRGBToHex=function(s,k){if(s.toLowerCase().indexOf('rgb')!=-1){var re=new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)","gi");var rgb=s.replace(re,"$1,$2,$3,$4,$5").split(',');if(rgb.length==5){r=parseInt(rgb[1]).toString(16);g=parseInt(rgb[2]).toString(16);b=parseInt(rgb[3]).toString(16);r=r.length==1?'0'+r:r;g=g.length==1?'0'+g:g;b=b.length==1?'0'+b:b;s="#"+r+g+b;if(k)s=rgb[0]+s+rgb[4];}}return s;};TinyMCE.prototype.convertHexToRGB=function(s){if(s.indexOf('#')!=-1){s=s.replace(new RegExp('[^0-9A-F]','gi'),'');return "rgb("+parseInt(s.substring(0,2),16)+","+parseInt(s.substring(2,4),16)+","+parseInt(s.substring(4,6),16)+")";}return s;};TinyMCE.prototype._verifyClass=function(node){if(tinyMCE.isGecko){var className=node.getAttribute('class');if(!className)return false;}if(tinyMCE.isMSIE)var className=node.getAttribute('className');if(tinyMCE.cleanup_verify_css_classes&&tinyMCE.cleanup_on_save){var csses=tinyMCE.getCSSClasses();nonDefinedCSS=true;for(var c=0;c'+output;}}var re=new RegExp("^(TABLE|TD|TR)$");if(re.test(node.nodeName)){if((node.nodeName!="TABLE"||tinyMCE.cleanup_inline_styles)&&(width=tinyMCE.getAttrib(node,"width"))!=''){node.style.width=width.indexOf('%')!=-1?width:width.replace(/[^0-9]/gi,'')+"px";node.removeAttribute("width");}if((node.nodeName=="TABLE"&&!tinyMCE.cleanup_inline_styles)&&node.style.width!=''){tinyMCE.setAttrib(node,"width",node.style.width.replace('px',''));node.style.width='';}if((height=tinyMCE.getAttrib(node,"height"))!=''){height=""+height;node.style.height=height.indexOf('%')!=-1?height:height.replace(/[^0-9]/gi,'')+"px";node.removeAttribute("height");}}if(tinyMCE.cleanup_inline_styles){var re=new RegExp("^(TABLE|TD|TR|IMG|HR)$");if(re.test(node.nodeName)&&tinyMCE.getAttrib(node,"class").indexOf('mceItem')==-1){tinyMCE._moveStyle(node,'width','width');tinyMCE._moveStyle(node,'height','height');tinyMCE._moveStyle(node,'borderWidth','border');tinyMCE._moveStyle(node,'','vspace');tinyMCE._moveStyle(node,'','hspace');tinyMCE._moveStyle(node,'textAlign','align');tinyMCE._moveStyle(node,'backgroundColor','bgColor');tinyMCE._moveStyle(node,'borderColor','borderColor');tinyMCE._moveStyle(node,'backgroundImage','background');if(tinyMCE.isMSIE5)node.outerHTML=node.outerHTML;}else if(tinyMCE.isBlockElement(node))tinyMCE._moveStyle(node,'textAlign','align');if(node.nodeName=="FONT")tinyMCE._moveStyle(node,'color','color');}if(elementValidAttribs){for(var a=1;a"+node.innerHTML+"";if(elementName=="table"&&!node.hasChildNodes())return "";if(node.attributes.length>0){var lastAttrib="";for(var i=0;i"+this.convertStringToXML(String.fromCharCode(160))+""+elementName+">";if(tinyMCE.isMSIE&&elementName=="script")return "<"+elementName+elementAttribs+">"+node.text+""+elementName+">";if(node.hasChildNodes()){if(!(elementName=="span"&&elementAttribs==""&&tinyMCE.getParam("trim_span_elements"))){if(elementName=="p"&&tinyMCE.cleanup_force_br_newlines)output+="";else output+="<"+elementName+elementAttribs+">";}for(var i=0;i
";else output+=""+elementName+">";}}else{if(!nonEmptyTag){if(openTag)output+="<"+elementName+elementAttribs+">"+elementName+">";else output+="<"+elementName+elementAttribs+" />";}}return output;case 3:if(node.parentNode.nodeName=="SCRIPT"||node.parentNode.nodeName=="NOSCRIPT"||node.parentNode.nodeName=="STYLE")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.settings['cleanup_entities']["c"+chr])!='undefined'&&tinyMCE.settings['cleanup_entities']["c"+chr]!='')output+='&'+tinyMCE.settings['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(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/gi,'>');return html;}if(on_save&&tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertFontsToSpans(doc);tinyMCE._customCleanup(inst,on_save?"get_from_editor_dom":"insert_to_editor_dom",doc.body);var n=doc.getElementsByTagName("font");for(var i=0;i[ \n\r]*[ \n\r]*',' ','gi'));tinyMCE.setInnerHTML(element,tinyMCE.regexpReplace(element.innerHTML,'','','gi'));}var html=this.cleanupNode(element);if(tinyMCE.settings['debug'])tinyMCE.debug("Cleanup process executed in: "+(new Date().getTime()-startTime)+" ms.");html=tinyMCE.regexpReplace(html,'
',' ');html=tinyMCE.regexpReplace(html,'
',' ');html=tinyMCE.regexpReplace(html,'\\s* \\s* ',' ');html=tinyMCE.regexpReplace(html,'\\s* \\s*
','
');html=tinyMCE.regexpReplace(html,'\\s* \\s* \\s* \\s*
','
');html=tinyMCE.regexpReplace(html,'\\s* \\s* \\s*
','
');html=tinyMCE.regexpReplace(html,'\\s* \\s* \\s*
','
');html=html.replace(new RegExp('(.*?) ','gi'),'$1');if(!tinyMCE.isMSIE)html=html.replace(new RegExp(' ','g'),"");if(tinyMCE.settings['remove_linebreaks'])html=html.replace(new RegExp('\r|\n','g'),' ');if(tinyMCE.getParam('apply_source_formatting')){html=html.replace(new RegExp('<(p|div)([^>]*)>','g'),"\n<$1$2>\n");html=html.replace(new RegExp('<\/(p|div)([^>]*)>','g'),"\n$1$2>\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.isGecko&&tinyMCE.settings['remove_lt_gt']){var re=new RegExp('<>','g');html=html.replace(re,"");}html=tinyMCE._customCleanup(inst,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.insertLink=function(href,target,title,onclick,style_class){tinyMCE.execCommand('mceBeginUndoLevel');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;}var mhref=href;var thref=eval(tinyMCE.settings['urlconverter_callback']+"(href, linkElement);");mhref=tinyMCE.getParam('convert_urls')?href:mhref;tinyMCE.setAttrib(linkElement,'href',thref);tinyMCE.setAttrib(linkElement,'mce_href',mhref);tinyMCE.setAttrib(linkElement,'target',target);tinyMCE.setAttrib(linkElement,'title',title);tinyMCE.setAttrib(linkElement,'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,tinyMCE.uniqueURL);tinyMCE.linkElement=this.getElementByAttributeValue(this.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);var elementArray=this.getElementsByAttributeValue(this.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);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,tinyMCE.uniqueURL);tinyMCE.imgElement=this.getElementByAttributeValue(this.selectedInstance.contentDocument.body,"img","src",tinyMCE.uniqueURL);}}if(this.imgElement){var needsRepaint=false;var msrc=src;src=eval(tinyMCE.settings['urlconverter_callback']+"(src, tinyMCE.imgElement);");if(tinyMCE.getParam('convert_urls'))msrc=src;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_src',msrc);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.execCommand('mceEndUndoLevel');};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&&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 targetURL.path;for(var i=0;i<(strTok1.length-(breakPoint-1));i++)outPath+="../";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="";relURL.protocol=baseURL.protocol;relURL.host=baseURL.host;relURL.port=baseURL.port;if(relURL.path.charAt(relURL.path.length-1)=="/")absPath+="/";relURL.path=absPath;return TinyMCE.prototype.serializeURL(relURL);};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,setup_content);}}if(this.selectedInstance&&(typeof(focus)=="undefined"||focus))this.selectedInstance.contentWindow.focus();};TinyMCE.prototype._customCleanup=function(inst,type,content){var customCleanup=tinyMCE.settings['cleanup_callback'];if(customCleanup!=""&&eval("typeof("+customCleanup+")")!="undefined")content=eval(customCleanup+"(type, content, inst);");var plugins=tinyMCE.getParam('plugins','',true,',');for(var i=0;i0)className+=" ";className+=classNames[i];}return className;};TinyMCE.prototype.handleVisualAid=function(el,deep,state,inst){if(!el)return;var tableElement=null;switch(el.nodeName){case "TABLE":var oldW=el.style.width;var oldH=el.style.height;var bo=tinyMCE.getAttrib(el,"border");bo=bo==""||bo=="0"?true:false;tinyMCE.setAttrib(el,"class",tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el,"class"),state&&bo));el.style.width=oldW;el.style.height=oldH;for(var y=0;y0){tinyMCE.setAttrib(s[i],'size',fSize);s[i].style.fontSize='';}var fFace=s[i].style.fontFamily;if(fFace!=null&&fFace!=""){tinyMCE.setAttrib(s[i],'face',fFace);s[i].style.fontFamily='';}var fColor=s[i].style.color;if(fColor!=null&&fColor!=""){tinyMCE.setAttrib(s[i],'color',tinyMCE.convertRGBToHex(fColor));s[i].style.color='';}}};TinyMCE.prototype.convertFontsToSpans=function(doc){var sizes=tinyMCE.getParam('font_size_style_values').replace(/\s+/,'').split(',');var h=doc.body.innerHTML;h=h.replace(/0&&fSize<8){if(fsClasses!=null)tinyMCE.setAttrib(s[i],'class',fsClasses[fSize-1]);else s[i].style.fontSize=sizes[fSize-1];}s[i].removeAttribute('size');}if(fFace!=""){s[i].style.fontFamily=fFace;s[i].removeAttribute('face');}if(fColor!=""){s[i].style.color=fColor;s[i].removeAttribute('color');}}};TinyMCE.prototype.setInnerHTML=function(e,h){if(tinyMCE.isMSIE&&!tinyMCE.isOpera){e.innerHTML=tinyMCE.uniqueTag+h;e.firstChild.removeNode(true);}else{h=this.fixGeckoBaseHREFBug(1,e,h);e.innerHTML=h;this.fixGeckoBaseHREFBug(2,e,h);}};TinyMCE.prototype.fixGeckoBaseHREFBug=function(m,e,h){if(tinyMCE.isGecko){if(m==1){h=h.replace(/\ssrc=/gi," xsrc=");h=h.replace(/\shref=/gi," xhref=");return h;}else{if(h.indexOf(' xsrc')!=-1){var n=e.getElementsByTagName("img");for(var i=0;i=0;x--)tinyMCE.insertAfter(cn[x],an[i]);}}};TinyMCE.prototype._setHTML=function(doc,html_content){html_content=tinyMCE.cleanupHTMLCode(html_content);try{tinyMCE.setInnerHTML(doc.body,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*)?","
");}tinyMCE.setInnerHTML(doc.body,html);}tinyMCE.cleanupAnchors(doc);if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(doc);};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){for(var x=0;x0)tinyMCE.cssClasses=output;return output;};TinyMCE.prototype.regexpReplace=function(in_str,reg_exp,replace_str,opts){if(in_str==null)return in_str;if(typeof(opts)=="undefined")opts='g';var re=new RegExp(reg_exp,opts);return in_str.replace(re,replace_str);};TinyMCE.prototype.trim=function(str){return str.replace(/^\s*|\s*$/g,"");};TinyMCE.prototype.cleanupEventStr=function(str){str=""+str;str=str.replace('function anonymous()\n{\n','');str=str.replace('\n}','');str=str.replace(/^return true;/gi,'');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.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;i';document.body.appendChild(debugDiv);elm=document.getElementById("tinymce_debug");}var args=this.debug.arguments;for(var i=0;i1&&tinyMCE.currentConfig!=this.settings['index']){tinyMCE.settings=this.settings;tinyMCE.currentConfig=this.settings['index'];}};TinyMCEControl.prototype.convertAllRelativeURLs=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']&&!(pos.absTop>scrollY&&pos.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&&!tinyMCE.isOpera)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&&!tinyMCE.isOpera)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+"><"+blockName+"> "+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){paraAfter.innerHTML=contents.firstChild.innerHTML;}else paraAfter.appendChild(contents);if(isEmpty(paraBefore))paraBefore.innerHTML=" ";if(isEmpty(paraAfter))paraAfter.innerHTML=" ";var rng=doc.createRange();if(!startChop.previousSibling&&startChop.parentNode.nodeName.toUpperCase()==blockName){rng.setStartBefore(startChop.parentNode);}else{if(rngBefore.startContainer.nodeName.toUpperCase()==blockName&&rngBefore.startOffset==0)rng.setStartBefore(rngBefore.startContainer);else rng.setStart(rngBefore.startContainer,rngBefore.startOffset);}if(!endChop.nextSibling&&endChop.parentNode.nodeName.toUpperCase()==blockName)rng.setEndAfter(endChop.parentNode);else rng.setEnd(rngAfter.endContainer,rngAfter.endOffset);rng.deleteContents();rng.insertNode(paraAfter);rng.insertNode(paraBefore);paraAfter.normalize();paraBefore.normalize();this.selectNode(paraAfter,true,true);return true;};TinyMCEControl.prototype._handleBackSpace=function(evt_type){var doc=this.getDoc();var sel=this.getSel();if(sel==null)return false;var rng=sel.getRangeAt(0);var node=rng.startContainer;var elm=node.nodeType==3?node.parentNode:node;if(node==null)return;if(elm&&elm.nodeName==""){var para=doc.createElement("p");while(elm.firstChild)para.appendChild(elm.firstChild);elm.parentNode.insertBefore(para,elm);elm.parentNode.removeChild(elm);var rng=rng.cloneRange();rng.setStartBefore(node.nextSibling);rng.setEndAfter(node.nextSibling);rng.extractContents();this.selectNode(node.nextSibling,true,true);}var para=tinyMCE.getParentBlockElement(node);if(para!=null&¶.nodeName.toLowerCase()=='p'&&evt_type=="keypress"){var htm=para.innerHTML;var block=tinyMCE.getParentBlockElement(node);if(htm==""||htm==" "||block.nodeName.toLowerCase()=="li"){var prevElm=para.previousSibling;while(prevElm!=null&&prevElm.nodeType!=1)prevElm=prevElm.previousSibling;if(prevElm==null)return false;var nodes=tinyMCE.getNodeTree(prevElm,new Array(),3);var lastTextNode=nodes.length==0?null:nodes[nodes.length-1];if(lastTextNode!=null)this.selectNode(lastTextNode,true,false,false);para.parentNode.removeChild(para);return true;}}return false;};TinyMCEControl.prototype._insertSpace=function(){return true;};TinyMCEControl.prototype.autoResetDesignMode=function(){if(!tinyMCE.isMSIE&&tinyMCE.settings['auto_reset_designmode']&&this.isHidden())eval('try { this.getDoc().designMode = "On"; } catch(e) {}');};TinyMCEControl.prototype.isHidden=function(){if(tinyMCE.isMSIE)return false;var sel=this.getSel();return(!sel||!sel.rangeCount||sel.rangeCount==0);};TinyMCEControl.prototype.isDirty=function(){return this.startContent!=tinyMCE.trim(this.getBody().innerHTML)&&!tinyMCE.isNotDirty;};TinyMCEControl.prototype._mergeElements=function(scmd,pa,ch,override){if(scmd=="removeformat"){pa.className="";pa.style.cssText="";ch.className="";ch.style.cssText="";return;}var st=tinyMCE.parseStyle(tinyMCE.getAttrib(pa,"style"));var stc=tinyMCE.parseStyle(tinyMCE.getAttrib(ch,"style"));var className=tinyMCE.getAttrib(pa,"class");className+=" "+tinyMCE.getAttrib(ch,"class");if(override){for(var n in st){if(typeof(st[n])=='function')continue;stc[n]=st[n];}}else{for(var n in stc){if(typeof(stc[n])=='function')continue;st[n]=stc[n];}}tinyMCE.setAttrib(pa,"style",tinyMCE.serializeStyle(st));tinyMCE.setAttrib(pa,"class",tinyMCE.trim(className));ch.className="";ch.style.cssText="";ch.removeAttribute("class");ch.removeAttribute("style");};TinyMCEControl.prototype.setUseCSS=function(b){var doc=this.getDoc();try{doc.execCommand("useCSS",false,!b);}catch(ex){}try{doc.execCommand("styleWithCSS",false,b);}catch(ex){}if(!tinyMCE.getParam("table_inline_editing"))try{doc.execCommand('enableInlineTableEditing',false,"false");}catch(ex){}if(!tinyMCE.getParam("object_resizing"))try{doc.execCommand('enableObjectResizing',false,"false");}catch(ex){}};TinyMCEControl.prototype.execCommand=function(command,user_interface,value){var doc=this.getDoc();var win=this.getWin();var focusElm=this.getFocusElement();if(this.lastSafariSelection&&!new RegExp('mceStartTyping|mceEndTyping|mceBeginUndoLevel|mceEndUndoLevel|mceAddUndoLevel','gi').test(command)){this.moveToBookmark(this.lastSafariSelection);tinyMCE.selectedElement=this.lastSafariSelectedElement;}if(!tinyMCE.isMSIE&&!this.useCSS){this.setUseCSS(false);this.useCSS=true;}this.contentDocument=doc;if(tinyMCE._themeExecCommand(this.editorId,this.getBody(),command,user_interface,value))return;if(focusElm&&focusElm.nodeName=="IMG"){var align=focusElm.getAttribute('align');var img=command=="JustifyCenter"?focusElm.cloneNode(false):focusElm;switch(command){case "JustifyLeft":if(align=='left')img.removeAttribute('align');else img.setAttribute('align','left');var div=focusElm.parentNode;if(div&&div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode)div.parentNode.replaceChild(img,div);this.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return;case "JustifyCenter":img.removeAttribute('align');var div=tinyMCE.getParentElement(focusElm,"div");if(div&&div.style.textAlign=="center"){if(div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode)div.parentNode.replaceChild(img,div);}else{var div=this.getDoc().createElement("div");div.style.textAlign='center';div.appendChild(img);focusElm.parentNode.replaceChild(div,focusElm);}this.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return;case "JustifyRight":if(align=='right')img.removeAttribute('align');else img.setAttribute('align','right');var div=focusElm.parentNode;if(div&&div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode)div.parentNode.replaceChild(img,div);this.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return;}}if(tinyMCE.settings['force_br_newlines']){var alignValue="";if(doc.selection.type!="Control"){switch(command){case "JustifyLeft":alignValue="left";break;case "JustifyCenter":alignValue="center";break;case "JustifyFull":alignValue="justify";break;case "JustifyRight":alignValue="right";break;}if(alignValue!=""){var rng=doc.selection.createRange();if((divElm=tinyMCE.getParentElement(rng.parentElement(),"div"))!=null)divElm.setAttribute("align",alignValue);else if(rng.pasteHTML&&rng.htmlText.length>0)rng.pasteHTML(''+rng.htmlText+"
");tinyMCE.triggerNodeChange();return;}}}switch(command){case "mceRepaint":this.repaint();return true;case "mceStoreSelection":this.selectionBookmark=this.getBookmark();return true;case "mceRestoreSelection":this.moveToBookmark(this.selectionBookmark);return true;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 "SetStyleInfo":var rng=this.getRng();var sel=this.getSel();var scmd=value['command'];var sname=value['name'];var svalue=value['value']==null?'':value['value'];var wrapper=value['wrapper']?value['wrapper']:"span";var parentElm=null;var invalidRe=new RegExp("^BODY|HTML$","g");var invalidParentsRe=tinyMCE.settings['merge_styles_invalid_parents']!=''?new RegExp(tinyMCE.settings['merge_styles_invalid_parents'],"gi"):null;if(tinyMCE.isMSIE){if(rng.item)parentElm=rng.item(0);else{var pelm=rng.parentElement();var prng=doc.selection.createRange();prng.moveToElementText(pelm);if(rng.htmlText==prng.htmlText||rng.boundingWidth==0){if(invalidParentsRe==null||!invalidParentsRe.test(pelm.nodeName))parentElm=pelm;}}}else{var felm=this.getFocusElement();if(sel.isCollapsed||(/td|tr|tbody|table/ig.test(felm.nodeName)&&sel.anchorNode==felm.parentNode))parentElm=felm;}if(parentElm&&!invalidRe.test(parentElm.nodeName)){if(scmd=="setstyle")tinyMCE.setStyleAttrib(parentElm,sname,svalue);if(scmd=="setattrib")tinyMCE.setAttrib(parentElm,sname,svalue);if(scmd=="removeformat"){parentElm.style.cssText='';tinyMCE.setAttrib(parentElm,'class','');}var ch=tinyMCE.getNodeTree(parentElm,new Array(),1);for(var z=0;z=0;i--){var elm=nodes[i];var isNew=tinyMCE.getAttrib(elm,"mce_new")=="true";elm.removeAttribute("mce_new");if(elm.childNodes&&elm.childNodes.length==1&&elm.childNodes[0].nodeType==1){this._mergeElements(scmd,elm,elm.childNodes[0],isNew);continue;}if(elm.parentNode.childNodes.length==1&&!invalidRe.test(elm.nodeName)&&!invalidRe.test(elm.parentNode.nodeName)){if(invalidParentsRe==null||!invalidParentsRe.test(elm.parentNode.nodeName))this._mergeElements(scmd,elm.parentNode,elm,false);}}var nodes=doc.getElementsByTagName(wrapper);for(var i=nodes.length-1;i>=0;i--){var elm=nodes[i];var isEmpty=true;var tmp=doc.createElement("body");tmp.appendChild(elm.cloneNode(false));tmp.innerHTML=tmp.innerHTML.replace(new RegExp('style=""|class=""','gi'),'');if(new RegExp('','gi').test(tmp.innerHTML)){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":this.execCommand("SetStyleInfo",false,{command:"setattrib",name:"class",value:value});break;case "mceInsertRawHTML":var key='tiny_mce_marker';this.execCommand('mceBeginUndoLevel');this.execCommand('mceInsertContent',false,key);var scrollX=this.getDoc().body.scrollLeft+this.getDoc().documentElement.scrollLeft;var scrollY=this.getDoc().body.scrollTop+this.getDoc().documentElement.scrollTop;var html=this.getBody().innerHTML;if((pos=html.indexOf(key))!=-1)tinyMCE.setInnerHTML(this.getBody(),html.substring(0,pos)+value+html.substring(pos+key.length));this.contentWindow.scrollTo(scrollX,scrollY);this.execCommand('mceEndUndoLevel');break;case "mceInsertContent":var insertHTMLFailed=false;this.getWin().focus();if(tinyMCE.isGecko||tinyMCE.isOpera){try{if(value.indexOf('<')==-1){var r=this.getRng();var n=this.getDoc().createTextNode(tinyMCE.entityDecode(value));var s=this.getSel();var r2=r.cloneRange();s.removeAllRanges();r.deleteContents();r.insertNode(n);r2.selectNode(n);r2.collapse(false);s.removeAllRanges();s.addRange(r2);}else{value=tinyMCE.fixGeckoBaseHREFBug(1,this.getDoc(),value);this.getDoc().execCommand('inserthtml',false,value);tinyMCE.fixGeckoBaseHREFBug(2,this.getDoc(),value);}}catch(ex){insertHTMLFailed=true;}if(!insertHTMLFailed){tinyMCE.triggerNodeChange();return;}}if(tinyMCE.isOpera&&insertHTMLFailed){this.getDoc().execCommand("insertimage",false,tinyMCE.uniqueURL);var ar=tinyMCE.getElementsByAttributeValue(this.getBody(),"img","src",tinyMCE.uniqueURL);ar[0].outerHTML=value;return;}if(!tinyMCE.isMSIE){var isHTML=value.indexOf('<')!=-1;var sel=this.getSel();var rng=this.getRng();if(isHTML){if(tinyMCE.isSafari){var tmpRng=this.getDoc().createRange();tmpRng.setStart(this.getBody(),0);tmpRng.setEnd(this.getBody(),0);value=tmpRng.createContextualFragment(value);}else value=rng.createContextualFragment(value);}else{var el=document.createElement("div");el.innerHTML=value;value=el.firstChild.nodeValue;value=doc.createTextNode(value);}if(tinyMCE.isSafari&&!isHTML){this.execCommand('InsertText',false,value.nodeValue);tinyMCE.triggerNodeChange();return true;}else if(tinyMCE.isSafari&&isHTML){rng.deleteContents();rng.insertNode(value);tinyMCE.triggerNodeChange();return true;}rng.deleteContents();if(rng.startContainer.nodeType==3){var node=rng.startContainer.splitText(rng.startOffset);node.parentNode.insertBefore(value,node);}else rng.insertNode(value);if(!isHTML){sel.selectAllChildren(doc.body);sel.removeAllRanges();var rng=doc.createRange();rng.selectNode(value);rng.collapse(false);sel.addRange(rng);}else rng.collapse(false);}else{var rng=doc.selection.createRange();var c=value.indexOf('";}if(hc){cn=n.childNodes;for(i=0,l=cn.length;i';return h;},_serializeAttribute:function(n,r,an){var av='',t,os=this.settings.on_save;if(os&&(an.indexOf('mce_')==0||an.indexOf('_moz')==0))return'';if(os&&this.mceAttribs[an])av=this._getAttrib(n,this.mceAttribs[an]);if(av.length==0)av=this._getAttrib(n,an);if(av.length==0&&r.defaultAttribs&&(t=r.defaultAttribs[an])){av=t;if(av=="mce_empty")return" "+an+'=""';}if(r.forceAttribs&&(t=r.forceAttribs[an]))av=t;if(os&&av.length!=0&&this.settings.url_converter.length!=0&&/^(src|href|longdesc)$/.test(an))av=eval(this.settings.url_converter+'(this, n, av)');if(av.length!=0&&r.validAttribValues&&r.validAttribValues[an]&&!r.validAttribValues[an].test(av))return"";if(av.length!=0&&av=="{$uid}")av="uid_"+(this.idCount++);if(av.length!=0)return" "+an+"="+'"'+this.xmlEncode(av)+'"';return"";},formatHTML:function(h){var s=this.settings,p='',i=0,li=0,o='',l;h=h.replace(/\r/g,'');h='\n'+h;h=h.replace(new RegExp('\\n\\s+','gi'),'\n');h=h.replace(this.nlBeforeRe,'\n<$1$2>');h=h.replace(this.nlAfterRe,'<$1$2>\n');h=h.replace(this.nlBeforeAfterRe,'\n<$1$2$3>\n');h+='\n';while((i=h.indexOf('\n',i+1))!=-1){if((l=h.substring(li+1,i)).length!=0){if(this.ouRe.test(l)&&p.length>=s.indent_levels)p=p.substring(s.indent_levels);o+=p+l+'\n';if(this.inRe.test(l))p+=this.inStr;}li=i;}return o;},xmlEncode:function(s){var i,l,e,o='',c;this._setupEntities();switch(this.settings.entity_encoding){case"raw":return tinyMCE.xmlEncode(s);case"named":for(i=0,l=s.length;i127||c==60||c==62||c==38||c==39||c==34)o+=''+c+";";else o+=String.fromCharCode(c);}return o;}return s;},split:function(re,s){var c=s.split(re);var i,l,o=new Array();for(i=0,l=c.length;i /g,'>');h=h.replace(/]*)>\u00A0?<\/p>/gi,'
');h=h.replace(/]*)>\s* \s*<\/p>/gi,'
');h=h.replace(/]*)>\s+<\/p>/gi,'
');e.innerHTML=tinyMCE.uniqueTag+h;e.firstChild.removeNode(true);nl=e.getElementsByTagName("p");for(i=nl.length-1;i>=0;i--){n=nl[i];if(n.nodeName=='P'&&!n.hasChildNodes()&&!n.mce_keep)n.parentNode.removeChild(n);}}else{h=this.fixGeckoBaseHREFBug(1,e,h);e.innerHTML=h;this.fixGeckoBaseHREFBug(2,e,h);}};TinyMCE_Engine.prototype.getOuterHTML=function(e){if(tinyMCE.isMSIE)return e.outerHTML;var d=e.ownerDocument.createElement("body");d.appendChild(e);return d.innerHTML;};TinyMCE_Engine.prototype.setOuterHTML=function(e,h){if(tinyMCE.isMSIE){e.outerHTML=h;return;}var d=e.ownerDocument.createElement("body");d.innerHTML=h;e.parentNode.replaceChild(d.firstChild,e);};TinyMCE_Engine.prototype._getElementById=function(id,d){var e,i,j,f;if(typeof(d)=="undefined")d=document;e=d.getElementById(id);if(!e){f=d.forms;for(i=0;i-1;i--){if(ar[i].specified&&ar[i].nodeValue)ne.setAttribute(ar[i].nodeName.toLowerCase(),ar[i].nodeValue);}ar=e.childNodes;for(i=0;i=strTok2.length){for(var i=0;i=strTok2.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break;}}}if(strTok1.length=strTok1.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break;}}}if(breakPoint==1)return targetURL.path;for(var i=0;i<(strTok1.length-(breakPoint-1));i++)outPath+="../";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="";relURL.protocol=baseURL.protocol;relURL.host=baseURL.host;relURL.port=baseURL.port;if(relURL.path.charAt(relURL.path.length-1)=="/")absPath+="/";relURL.path=absPath;return this.serializeURL(relURL);};TinyMCE_Engine.prototype.convertURL=function(url,node,on_save){var prot=document.location.protocol;var host=document.location.hostname;var port=document.location.port;if(prot=="file:")return url;url=tinyMCE.regexpReplace(url,'(http|https):///','/');if(url.indexOf('mailto:')!=-1||url.indexOf('javascript:')!=-1||tinyMCE.regexpReplace(url,'[ \t\r\n\+]|%20','').charAt(0)=="#")return url;if(!tinyMCE.isMSIE&&!on_save&&url.indexOf("://")==-1&&url.charAt(0)!='/')return tinyMCE.settings['base_href']+url;if(on_save&&tinyMCE.getParam('relative_urls')){var curl=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],url);if(curl.charAt(0)=='/')curl=tinyMCE.settings['document_base_prefix']+curl;var urlParts=tinyMCE.parseURL(curl);var tmpUrlParts=tinyMCE.parseURL(tinyMCE.settings['document_base_url']);if(urlParts['host']==tmpUrlParts['host']&&(urlParts['port']==tmpUrlParts['port']))return tinyMCE.convertAbsoluteURLToRelativeURL(tinyMCE.settings['document_base_url'],curl);}if(!tinyMCE.getParam('relative_urls')){var urlParts=tinyMCE.parseURL(url);var baseUrlParts=tinyMCE.parseURL(tinyMCE.settings['base_href']);url=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],url);if(urlParts['anchor']&&urlParts['path']==baseUrlParts['path'])return"#"+urlParts['anchor'];}if(tinyMCE.getParam('remove_script_host')){var start="",portPart="";if(port!="")portPart=":"+port;start=prot+"//"+host+portPart+"/";if(url.indexOf(start)==0)url=url.substring(start.length-1);}return url;};TinyMCE_Engine.prototype.convertAllRelativeURLs=function(body){var elms=body.getElementsByTagName("img");for(var i=0;ibookmark.index){try{rng.addElement(nl[bookmark.index]);}catch(ex){}}}else{rng=inst.getSel().createRange();rng.moveToElementText(inst.getBody());rng.collapse(true);rng.moveStart('character',bookmark.start);rng.moveEnd('character',bookmark.length);}rng.select();win.scrollTo(bookmark.scrollX,bookmark.scrollY);return true;}if(tinyMCE.isGecko&&bookmark.rng){sel.removeAllRanges();sel.addRange(bookmark.rng);win.scrollTo(bookmark.scrollX,bookmark.scrollY);return true;}if(tinyMCE.isGecko){rng=doc.createRange();nl=doc.getElementsByTagName(bookmark.startTag);if(nl.length>bookmark.start)rng.setStart(nl[bookmark.start].childNodes[bookmark.startIndex],bookmark.startOffset);nl=doc.getElementsByTagName(bookmark.endTag);if(nl.length>bookmark.end)rng.setEnd(nl[bookmark.end].childNodes[bookmark.endIndex],bookmark.endOffset);sel.removeAllRanges();sel.addRange(rng);win.scrollTo(bookmark.scrollX,bookmark.scrollY);return true;}return false;},selectNode:function(node,collapse,select_text_node,to_start){var inst=this.instance,sel,rng,nodes;if(!node)return;if(typeof(collapse)=="undefined")collapse=true;if(typeof(select_text_node)=="undefined")select_text_node=false;if(typeof(to_start)=="undefined")to_start=true;if(tinyMCE.isMSIE){rng=inst.getBody().createTextRange();try{rng.moveToElementText(node);if(collapse)rng.collapse(to_start);rng.select();}catch(e){}}else{sel=this.getSel();if(!sel)return;if(tinyMCE.isSafari){sel.setBaseAndExtent(node,0,node,node.innerText.length);if(collapse){if(to_start)sel.collapseToStart();else sel.collapseToEnd();}this.scrollToNode(node);return;}rng=inst.getDoc().createRange();if(select_text_node){nodes=tinyMCE.getNodeTree(node,new Array(),3);if(nodes.length>0)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;},scrollToNode:function(node){var inst=this.instance;var pos,doc,scrollX,scrollY,height;pos=tinyMCE.getAbsPosition(node);doc=inst.getDoc();scrollX=doc.body.scrollLeft+doc.documentElement.scrollLeft;scrollY=doc.body.scrollTop+doc.documentElement.scrollTop;height=tinyMCE.isMSIE?document.getElementById(inst.editorId).style.pixelHeight:inst.targetElement.clientHeight;if(!tinyMCE.settings['auto_resize']&&!(pos.absTop>scrollY&&pos.absTop<(scrollY-25+height)))inst.contentWindow.scrollTo(pos.absLeft,pos.absTop-height+25);},getSel:function(){var inst=this.instance;if(tinyMCE.isMSIE&&!tinyMCE.isOpera)return inst.getDoc().selection;return inst.contentWindow.getSelection();},getRng:function(){var inst=this.instance;var sel=this.getSel();if(sel==null)return null;if(tinyMCE.isMSIE&&!tinyMCE.isOpera)return sel.createRange();if(tinyMCE.isSafari&&!sel.getRangeAt)return''+window.getSelection();return sel.getRangeAt(0);},getFocusElement:function(){var inst=this.instance;if(tinyMCE.isMSIE&&!tinyMCE.isOpera){var doc=inst.getDoc();var rng=doc.selection.createRange();var elm=rng.item?rng.item(0):rng.parentElement();}else{if(inst.isHidden())return inst.getBody();var sel=this.getSel();var rng=this.getRng();if(!sel||!rng)return null;var elm=rng.commonAncestorContainer;if(!rng.collapsed){if(rng.startContainer==rng.endContainer){if(rng.startOffset-rng.endOffset<2){if(rng.startContainer.hasChildNodes())elm=rng.startContainer.childNodes[rng.startOffset];}}}elm=tinyMCE.getParentElement(elm);}return elm;}};function TinyMCE_UndoRedo(inst){this.instance=inst;this.undoLevels=new Array();this.undoIndex=0;this.typingUndoIndex=-1;this.undoRedo=true;};TinyMCE_UndoRedo.prototype={add:function(l){var b;if(l){this.undoLevels[this.undoLevels.length]=l;return true;}var inst=this.instance;if(this.typingUndoIndex!=-1){this.undoIndex=this.typingUndoIndex;}var newHTML=tinyMCE.trim(inst.getBody().innerHTML);if(this.undoLevels[this.undoIndex]&&newHTML!=this.undoLevels[this.undoIndex].content){tinyMCE.dispatchCallback(inst,'onchange_callback','onChange',inst);var customUndoLevels=tinyMCE.settings['custom_undo_redo_levels'];if(customUndoLevels!=-1&&this.undoLevels.length>customUndoLevels){for(var i=0;i0){this.undoIndex--;tinyMCE.setInnerHTML(inst.getBody(),this.undoLevels[this.undoIndex].content);inst.repaint();if(inst.settings.custom_undo_redo_restore_selection)inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark);}},redo:function(){var inst=this.instance;tinyMCE.execCommand("mceEndTyping");if(this.undoIndex<(this.undoLevels.length-1)){this.undoIndex++;tinyMCE.setInnerHTML(inst.getBody(),this.undoLevels[this.undoIndex].content);inst.repaint();if(inst.settings.custom_undo_redo_restore_selection)inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark);}tinyMCE.triggerNodeChange();}};var TinyMCE_ForceParagraphs={_insertPara:function(inst,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+"><"+blockName+"> "+blockName+">";paraAfter=body.childNodes[1];}inst.selection.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){paraAfter.innerHTML=contents.firstChild.innerHTML;}else paraAfter.appendChild(contents);if(isEmpty(paraBefore))paraBefore.innerHTML=" ";if(isEmpty(paraAfter))paraAfter.innerHTML=" ";var rng=doc.createRange();if(!startChop.previousSibling&&startChop.parentNode.nodeName.toUpperCase()==blockName){rng.setStartBefore(startChop.parentNode);}else{if(rngBefore.startContainer.nodeName.toUpperCase()==blockName&&rngBefore.startOffset==0)rng.setStartBefore(rngBefore.startContainer);else rng.setStart(rngBefore.startContainer,rngBefore.startOffset);}if(!endChop.nextSibling&&endChop.parentNode.nodeName.toUpperCase()==blockName)rng.setEndAfter(endChop.parentNode);else rng.setEnd(rngAfter.endContainer,rngAfter.endOffset);rng.deleteContents();rng.insertNode(paraAfter);rng.insertNode(paraBefore);paraAfter.normalize();paraBefore.normalize();inst.selection.selectNode(paraAfter,true,true);return true;},_handleBackSpace:function(inst){var r=inst.getRng(),sn=r.startContainer,nv,s=false;if(sn&&sn.nextSibling&&sn.nextSibling.nodeName=="BR"){nv=sn.nodeValue;if(nv!=null&&nv.length>=r.startOffset&&nv.charAt(r.startOffset-1)==' ')s=true;if(nv!=null&&r.startOffset==nv.length)sn.nextSibling.parentNode.removeChild(sn.nextSibling);}return s;}};function TinyMCE_Layer(id,bm){this.id=id;this.blockerElement=null;this.events=false;this.element=null;this.blockMode=typeof(bm)!='undefined'?bm:true;this.doc=document;};TinyMCE_Layer.prototype={moveRelativeTo:function(re,p){var rep=this.getAbsPosition(re);var w=parseInt(re.offsetWidth);var h=parseInt(re.offsetHeight);var e=this.getElement();var ew=parseInt(e.offsetWidth);var eh=parseInt(e.offsetHeight);var x,y;switch(p){case"tl":x=rep.absLeft;y=rep.absTop;break;case"tr":x=rep.absLeft+w;y=rep.absTop;break;case"bl":x=rep.absLeft;y=rep.absTop+h;break;case"br":x=rep.absLeft+w;y=rep.absTop+h;break;case"cc":x=rep.absLeft+(w/2)-(ew/2);y=rep.absTop+(h/2)-(eh/2);break;}this.moveTo(x,y);},moveBy:function(x,y){var e=this.getElement();this.moveTo(parseInt(e.style.left)+x,parseInt(e.style.top)+y);},moveTo:function(x,y){var e=this.getElement();e.style.left=x+"px";e.style.top=y+"px";this.updateBlocker();},resizeBy:function(w,h){var e=this.getElement();this.resizeTo(parseInt(e.style.width)+w,parseInt(e.style.height)+h);},resizeTo:function(w,h){var e=this.getElement();if(w!=null)e.style.width=w+"px";if(h!=null)e.style.height=h+"px";this.updateBlocker();},show:function(){this.getElement().style.display='block';this.updateBlocker();},hide:function(){this.getElement().style.display='none';this.updateBlocker();},isVisible:function(){return this.getElement().style.display=='block';},getElement:function(){if(!this.element)this.element=this.doc.getElementById(this.id);return this.element;},setBlockMode:function(s){this.blockMode=s;},updateBlocker:function(){var e,b,x,y,w,h;b=this.getBlocker();if(b){if(this.blockMode){e=this.getElement();x=this.parseInt(e.style.left);y=this.parseInt(e.style.top);w=this.parseInt(e.offsetWidth);h=this.parseInt(e.offsetHeight);b.style.left=x+'px';b.style.top=y+'px';b.style.width=w+'px';b.style.height=h+'px';b.style.display=e.style.display;}else b.style.display='none';}},getBlocker:function(){var d,b;if(!this.blockerElement&&this.blockMode){d=this.doc;b=d.createElement("iframe");b.style.cssText='display: none; position: absolute; left: 0; top: 0';b.src='javascript:false;';b.frameBorder='0';b.scrolling='no';d.body.appendChild(b);this.blockerElement=b;}return this.blockerElement;},getAbsPosition:function(n){var p={absLeft:0,absTop:0};while(n){p.absLeft+=n.offsetLeft;p.absTop+=n.offsetTop;n=n.offsetParent;}return p;},create:function(n,c,p){var d=this.doc,e=d.createElement(n);e.setAttribute('id',this.id);if(c)e.className=c;if(!p)p=d.body;p.appendChild(e);return this.element=e;},parseInt:function(s){if(s==null||s=='')return 0;return parseInt(s);}};function TinyMCE_Menu(){var id;if(typeof(tinyMCE.menuCounter)=="undefined")tinyMCE.menuCounter=0;id="mc_menu_"+tinyMCE.menuCounter++;TinyMCE_Layer.call(this,id,true);this.id=id;this.items=new Array();this.needsUpdate=true;};TinyMCE_Menu.prototype=tinyMCE.extend(TinyMCE_Layer.prototype,{init:function(s){var n;this.settings={separator_class:'mceMenuSeparator',title_class:'mceMenuTitle',disabled_class:'mceMenuDisabled',menu_class:'mceMenu',drop_menu:true};for(n in s)this.settings[n]=s[n];this.create('div',this.settings.menu_class);},clear:function(){this.items=new Array();},addTitle:function(t){this.add({type:'title',text:t});},addDisabled:function(t){this.add({type:'disabled',text:t});},addSeparator:function(){this.add({type:'separator'});},addItem:function(t,js){this.add({text:t,js:js});},add:function(mi){this.items[this.items.length]=mi;this.needsUpdate=true;},update:function(){var e=this.getElement(),h='',i,t,m=this.items,s=this.settings;if(this.settings.drop_menu)h+='';h+='';for(i=0;i';break;case'title':h+=' '+t+' ';break;case'disabled':h+=''+t+' ';break;default:h+=''+t+' ';}h+=' ';}h+='
';e.innerHTML=h;this.needsUpdate=false;this.updateBlocker();},show:function(){var nl,i;if(tinyMCE.lastMenu==this)return;if(this.needsUpdate)this.update();if(tinyMCE.lastMenu&&tinyMCE.lastMenu!=this)tinyMCE.lastMenu.hide();TinyMCE_Layer.prototype.show.call(this);if(!tinyMCE.isOpera){}tinyMCE.lastMenu=this;}});TinyMCE_Engine.prototype.debug=function(){var m="",e,a,i;e=document.getElementById("tinymce_debug");if(!e){var d=document.createElement("div");d.setAttribute("className","debugger");d.className="debugger";d.innerHTML='Debug output: ';document.body.appendChild(d);e=document.getElementById("tinymce_debug");}a=this.debug.arguments;for(i=0;i -1) {
- // Write main script and patch some things
- if ($index == 0) {
- TinyMCE_echo(file_get_contents(realpath("tiny_mce" . $suffix . ".js")));
- TinyMCE_echo('TinyMCE.prototype.loadScript = function() {};');
- }
-
- // Do init based on index
- TinyMCE_echo("tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);");
-
- // Load theme, language pack and theme language packs
- if ($theme) {
- TinyMCE_echo(file_get_contents(realpath("themes/" . $theme . "/editor_template" . $suffix . ".js")));
- TinyMCE_echo(file_get_contents(realpath("themes/" . $theme . "/langs/" . $lang . ".js")));
- }
-
- if ($language)
- TinyMCE_echo(file_get_contents(realpath("langs/" . $language . ".js")));
-
- // Load all plugins and their language packs
- $plugins = explode(",", $plugins);
- foreach ($plugins as $plugin) {
- $pluginFile = realpath("plugins/" . $plugin . "/editor_plugin" . $suffix . ".js");
- $languageFile = realpath("plugins/" . $plugin . "/langs/" . $lang . ".js");
-
- if ($pluginFile)
- TinyMCE_echo(file_get_contents($pluginFile));
-
- if ($languageFile)
- TinyMCE_echo(file_get_contents($languageFile));
- }
-
- // Write to cache
- if ($diskCache) {
- // Calculate compression ratio and debug target output path
- if ($debug) {
- $ratio = round(100 - strlen(gzencode($cacheData, 9, FORCE_GZIP)) / strlen($cacheData) * 100.0);
- TinyMCE_echo("alert('TinyMCE was compressed by " . $ratio . "%.\\nOutput cache file: " . $cacheFile . "');");
- }
-
- $cacheData = gzencode($cacheData, 9, FORCE_GZIP);
-
- // Write to file if possible
- $fp = @fopen($cacheFile, "wb");
- if ($fp) {
- fwrite($fp, $cacheData);
- fclose($fp);
- }
-
- // Output
- header("Content-Encoding: gzip");
- echo $cacheData;
- }
-
- die;
-}
-?>
-
-function TinyMCECompressed() {
- this.configs = new Array();
- this.loadedFiles = new Array();
-}
-
-TinyMCECompressed.prototype.init = function(settings) {
- var elements = document.getElementsByTagName('script');
- var scriptURL = "";
-
- for (var i=0; i');
-}
-
-TinyMCECompressed.prototype.getOnce = function(str) {
- var ar = str.split(',');
-
- for (var i=0; i -1) {
+ // Write main script and patch some things
+ if ($index == 0) {
+ TinyMCE_echo(file_get_contents(realpath("tiny_mce" . $suffix . ".js")));
+ TinyMCE_echo('TinyMCE.prototype.orgLoadScript = TinyMCE.prototype.loadScript;');
+ TinyMCE_echo('TinyMCE.prototype.loadScript = function() {};var realTinyMCE = tinyMCE;');
+ } else
+ TinyMCE_echo('tinyMCE = realTinyMCE;');
+
+ // Do init based on index
+ TinyMCE_echo("tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);");
+
+ // Load external plugins
+ if ($index == 0)
+ TinyMCE_echo("tinyMCECompressed.loadPlugins();");
+
+ // Load theme, language pack and theme language packs
+ if ($theme) {
+ TinyMCE_echo(file_get_contents(realpath("themes/" . $theme . "/editor_template" . $suffix . ".js")));
+ TinyMCE_echo(file_get_contents(realpath("themes/" . $theme . "/langs/" . $lang . ".js")));
+ }
+
+ if ($language)
+ TinyMCE_echo(file_get_contents(realpath("langs/" . $language . ".js")));
+
+ // Load all plugins and their language packs
+ $plugins = explode(",", $plugins);
+ foreach ($plugins as $plugin) {
+ $pluginFile = realpath("plugins/" . $plugin . "/editor_plugin" . $suffix . ".js");
+ $languageFile = realpath("plugins/" . $plugin . "/langs/" . $lang . ".js");
+
+ if ($pluginFile)
+ TinyMCE_echo(file_get_contents($pluginFile));
+
+ if ($languageFile)
+ TinyMCE_echo(file_get_contents($languageFile));
+ }
+
+ // Reset tinyMCE compressor engine
+ TinyMCE_echo("tinyMCE = tinyMCECompressed;");
+
+ // Write to cache
+ if ($diskCache) {
+ // Calculate compression ratio and debug target output path
+ if ($debug) {
+ $ratio = round(100 - strlen(gzencode($cacheData, 9, FORCE_GZIP)) / strlen($cacheData) * 100.0);
+ TinyMCE_echo("alert('TinyMCE was compressed by " . $ratio . "%.\\nOutput cache file: " . $cacheFile . "');");
+ }
+
+ $cacheData = gzencode($cacheData, 9, FORCE_GZIP);
+
+ // Write to file if possible
+ $fp = @fopen($cacheFile, "wb");
+ if ($fp) {
+ fwrite($fp, $cacheData);
+ fclose($fp);
+ }
+
+ // Output
+ header("Content-Encoding: " . $enc);
+ echo $cacheData;
+ }
+
+ die;
+}
+?>
+
+function TinyMCECompressed() {
+ this.configs = new Array();
+ this.loadedFiles = new Array();
+ this.externalPlugins = new Array();
+ this.loadAdded = false;
+ this.isLoaded = false;
+}
+
+TinyMCECompressed.prototype.init = function(settings) {
+ var elements = document.getElementsByTagName('script');
+ var scriptURL = "";
+
+ for (var i=0; i');
+
+ if (!this.loadAdded) {
+ tinyMCE.addEvent(window, "DOMContentLoaded", TinyMCECompressed.prototype.onLoad);
+ tinyMCE.addEvent(window, "load", TinyMCECompressed.prototype.onLoad);
+ this.loadAdded = true;
+ }
+}
+
+TinyMCECompressed.prototype.onLoad = function() {
+ if (tinyMCE.isLoaded)
+ return true;
+
+ tinyMCE = realTinyMCE;
+ TinyMCE_Engine.prototype.onLoad();
+ tinyMCE._addUnloadEvents();
+
+ tinyMCE.isLoaded = true;
+}
+
+TinyMCECompressed.prototype.addEvent = function(o, n, h) {
+ if (o.attachEvent)
+ o.attachEvent("on" + n, h);
+ else
+ o.addEventListener(n, h, false);
+}
+
+TinyMCECompressed.prototype.getOnce = function(str) {
+ var ar = str.replace(/\s+/g, '').split(',');
+
+ for (var i=0; i 0) {
+ elms = document.forms[0].elements;
+ for (i=0; i');
- this.defParam("font_size_classes", '');
- this.defParam("font_size_style_values", 'xx-small,x-small,small,medium,large,x-large,xx-large');
- this.defParam("event_elements", 'a,img');
- this.defParam("convert_urls", true);
- this.defParam("table_inline_editing", false);
- this.defParam("object_resizing", true);
-
- // Browser check IE
- if (this.isMSIE && this.settings['browsers'].indexOf('msie') == -1)
- return;
-
- // Browser check Gecko
- if (this.isGecko && this.settings['browsers'].indexOf('gecko') == -1)
- return;
-
- // Browser check Safari
- if (this.isSafari && this.settings['browsers'].indexOf('safari') == -1)
- return;
- // Browser check Opera
- if (this.isOpera && this.settings['browsers'].indexOf('opera') == -1)
- return;
-
- // If not super absolute make it so
- var baseHREF = tinyMCE.settings['document_base_url'];
- var h = document.location.href;
- var p = h.indexOf('://');
- if (p > 0 && document.location.protocol != "file:") {
- p = h.indexOf('/', p + 3);
- h = h.substring(0, p);
+ // Get document base path
+ this.documentBasePath = document.location.href;
+ if (this.documentBasePath.indexOf('?') != -1)
+ this.documentBasePath = this.documentBasePath.substring(0, this.documentBasePath.indexOf('?'));
+ this.documentURL = this.documentBasePath;
+ this.documentBasePath = this.documentBasePath.substring(0, this.documentBasePath.lastIndexOf('/'));
+
+ // If not HTTP absolute
+ if (tinyMCE.baseURL.indexOf('://') == -1 && tinyMCE.baseURL.charAt(0) != '/') {
+ // If site absolute
+ tinyMCE.baseURL = this.documentBasePath + "/" + tinyMCE.baseURL;
+ }
+
+ // Set default values on settings
+ this._def("mode", "none");
+ this._def("theme", "advanced");
+ this._def("plugins", "", true);
+ this._def("language", "en");
+ this._def("docs_language", this.settings['language']);
+ this._def("elements", "");
+ this._def("textarea_trigger", "mce_editable");
+ this._def("editor_selector", "");
+ this._def("editor_deselector", "mceNoEditor");
+ this._def("valid_elements", "+a[id|style|rel|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|style],-ul[class|style],-li[class|style],br,img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align],-sub[style|class],-sup[style|class],-blockquote[dir|style],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],-td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[style|class|align],-pre[class|align|style],address[class|align|style],-h1[id|style|dir|class|align],-h2[id|style|dir|class|align],-h3[id|style|dir|class|align],-h4[id|style|dir|class|align],-h5[id|style|dir|class|align],-h6[id|style|dir|class|align],hr[class|style],-font[face|size|style|id|class|dir|color],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang]");
+ this._def("extended_valid_elements", "");
+ this._def("invalid_elements", "");
+ this._def("encoding", "");
+ this._def("urlconverter_callback", tinyMCE.getParam("urlconvertor_callback", "TinyMCE_Engine.prototype.convertURL"));
+ this._def("save_callback", "");
+ this._def("debug", false);
+ this._def("force_br_newlines", false);
+ this._def("force_p_newlines", true);
+ this._def("add_form_submit_trigger", true);
+ this._def("relative_urls", true);
+ this._def("remove_script_host", true);
+ this._def("focus_alert", true);
+ this._def("document_base_url", this.documentURL);
+ this._def("visual", true);
+ this._def("visual_table_class", "mceVisualAid");
+ this._def("setupcontent_callback", "");
+ this._def("fix_content_duplication", true);
+ this._def("custom_undo_redo", true);
+ this._def("custom_undo_redo_levels", -1);
+ this._def("custom_undo_redo_keyboard_shortcuts", true);
+ this._def("custom_undo_redo_restore_selection", true);
+ this._def("verify_html", true);
+ this._def("apply_source_formatting", false);
+ this._def("directionality", "ltr");
+ this._def("cleanup_on_startup", false);
+ this._def("inline_styles", false);
+ this._def("convert_newlines_to_brs", false);
+ this._def("auto_reset_designmode", true);
+ this._def("entities", "39,#39,160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,34,quot,38,amp,60,lt,62,gt,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro", true);
+ this._def("entity_encoding", "named");
+ this._def("cleanup_callback", "");
+ this._def("add_unload_trigger", true);
+ this._def("ask", false);
+ this._def("nowrap", false);
+ this._def("auto_resize", false);
+ this._def("auto_focus", false);
+ this._def("cleanup", true);
+ this._def("remove_linebreaks", true);
+ this._def("button_tile_map", false);
+ this._def("submit_patch", true);
+ this._def("browsers", "msie,safari,gecko,opera", true);
+ this._def("dialog_type", "window");
+ this._def("accessibility_warnings", true);
+ this._def("accessibility_focus", true);
+ this._def("merge_styles_invalid_parents", "");
+ this._def("force_hex_style_colors", true);
+ this._def("trim_span_elements", true);
+ this._def("convert_fonts_to_spans", false);
+ this._def("doctype", '');
+ this._def("font_size_classes", '');
+ this._def("font_size_style_values", 'xx-small,x-small,small,medium,large,x-large,xx-large', true);
+ this._def("event_elements", 'a,img', true);
+ this._def("convert_urls", true);
+ this._def("table_inline_editing", false);
+ this._def("object_resizing", true);
+ this._def("custom_shortcuts", true);
+ this._def("convert_on_click", false);
+ this._def("content_css", '');
+ this._def("fix_list_elements", false);
+ this._def("fix_table_elements", false);
+ this._def("strict_loading_mode", document.contentType == 'application/xhtml+xml');
+ this._def("hidden_tab_class", '');
+ this._def("display_tab_class", '');
+
+ // Force strict loading mode to false on non Gecko browsers
+ if (this.isMSIE && !this.isOpera)
+ this.settings.strict_loading_mode = false;
- if (baseHREF.indexOf('://') == -1)
- baseHREF = h + baseHREF;
+ // Browser check IE
+ if (this.isMSIE && this.settings['browsers'].indexOf('msie') == -1)
+ return;
- tinyMCE.settings['document_base_url'] = baseHREF;
- tinyMCE.settings['document_base_prefix'] = h;
- }
+ // Browser check Gecko
+ if (this.isGecko && this.settings['browsers'].indexOf('gecko') == -1)
+ return;
- // Trim away query part
- if (baseHREF.indexOf('?') != -1)
- baseHREF = baseHREF.substring(0, baseHREF.indexOf('?'));
+ // Browser check Safari
+ if (this.isSafari && this.settings['browsers'].indexOf('safari') == -1)
+ return;
- this.settings['base_href'] = baseHREF.substring(0, baseHREF.lastIndexOf('/')) + "/";
+ // Browser check Opera
+ if (this.isOpera && this.settings['browsers'].indexOf('opera') == -1)
+ return;
- theme = this.settings['theme'];
- this.blockRegExp = new RegExp("^(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|blockquote|center|dl|dir|fieldset|form|noscript|noframes|menu|isindex)$", "i");
- this.posKeyCodes = new Array(13,45,36,35,33,34,37,38,39,40);
- this.uniqueURL = 'http://tinymce.moxiecode.cp/mce_temp_url'; // Make unique URL non real URL
- this.uniqueTag = 'TMP
';
+ // If not super absolute make it so
+ var baseHREF = tinyMCE.settings['document_base_url'];
+ var h = document.location.href;
+ var p = h.indexOf('://');
+ if (p > 0 && document.location.protocol != "file:") {
+ p = h.indexOf('/', p + 3);
+ h = h.substring(0, p);
+
+ if (baseHREF.indexOf('://') == -1)
+ baseHREF = h + baseHREF;
+
+ tinyMCE.settings['document_base_url'] = baseHREF;
+ tinyMCE.settings['document_base_prefix'] = h;
+ }
+
+ // Trim away query part
+ if (baseHREF.indexOf('?') != -1)
+ baseHREF = baseHREF.substring(0, baseHREF.indexOf('?'));
+
+ this.settings['base_href'] = baseHREF.substring(0, baseHREF.lastIndexOf('/')) + "/";
+
+ theme = this.settings['theme'];
+ this.blockRegExp = new RegExp("^(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|blockquote|center|dl|dt|dd|dir|fieldset|form|noscript|noframes|menu|isindex|samp)$", "i");
+ this.posKeyCodes = new Array(13,45,36,35,33,34,37,38,39,40);
+ this.uniqueURL = 'javascript:TINYMCE_UNIQUEURL();'; // Make unique URL non real URL
+ this.uniqueTag = 'TMP
';
+ this.callbacks = new Array('onInit', 'getInfo', 'getEditorTemplate', 'setupContent', 'onChange', 'onPageLoad', 'handleNodeChange', 'initInstance', 'execCommand', 'getControlHTML', 'handleEvent', 'cleanup');
+
+ // Theme url
+ this.settings['theme_href'] = tinyMCE.baseURL + "/themes/" + theme;
+
+ if (!tinyMCE.isMSIE)
+ this.settings['force_br_newlines'] = false;
+
+ if (tinyMCE.getParam("popups_css", false)) {
+ var cssPath = tinyMCE.getParam("popups_css", "");
+
+ // Is relative
+ if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/')
+ this.settings['popups_css'] = this.documentBasePath + "/" + cssPath;
+ else
+ this.settings['popups_css'] = cssPath;
+ } else
+ this.settings['popups_css'] = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_popup.css";
- // Theme url
- this.settings['theme_href'] = tinyMCE.baseURL + "/themes/" + theme;
+ if (tinyMCE.getParam("editor_css", false)) {
+ var cssPath = tinyMCE.getParam("editor_css", "");
- if (!tinyMCE.isMSIE)
- this.settings['force_br_newlines'] = false;
+ // Is relative
+ if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/')
+ this.settings['editor_css'] = this.documentBasePath + "/" + cssPath;
+ else
+ this.settings['editor_css'] = cssPath;
+ } else
+ this.settings['editor_css'] = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_ui.css";
- if (tinyMCE.getParam("content_css", false)) {
- var cssPath = tinyMCE.getParam("content_css", "");
+ if (tinyMCE.settings['debug']) {
+ var msg = "Debug: \n";
- // Is relative
- if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/')
- this.settings['content_css'] = this.documentBasePath + "/" + cssPath;
- else
- this.settings['content_css'] = cssPath;
- } else
- this.settings['content_css'] = '';
+ msg += "baseURL: " + this.baseURL + "\n";
+ msg += "documentBasePath: " + this.documentBasePath + "\n";
+ msg += "content_css: " + this.settings['content_css'] + "\n";
+ msg += "popups_css: " + this.settings['popups_css'] + "\n";
+ msg += "editor_css: " + this.settings['editor_css'] + "\n";
- if (tinyMCE.getParam("popups_css", false)) {
- var cssPath = tinyMCE.getParam("popups_css", "");
+ alert(msg);
+ }
- // Is relative
- if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/')
- this.settings['popups_css'] = this.documentBasePath + "/" + cssPath;
- else
- this.settings['popups_css'] = cssPath;
- } else
- this.settings['popups_css'] = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_popup.css";
+ // Only do this once
+ if (this.configs.length == 0) {
+ // Is Safari enabled
+ if (this.isSafari && this.getParam('safari_warning', false))
+ alert("Safari support is very limited and should be considered experimental.\nSo there is no need to even submit bugreports on this early version.\nYou can disable this message by setting: safari_warning option to false");
- if (tinyMCE.getParam("editor_css", false)) {
- var cssPath = tinyMCE.getParam("editor_css", "");
+ if (typeof(TinyMCECompressed) == "undefined") {
+ tinyMCE.addEvent(window, "DOMContentLoaded", TinyMCE_Engine.prototype.onLoad);
- // Is relative
- if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/')
- this.settings['editor_css'] = this.documentBasePath + "/" + cssPath;
- else
- this.settings['editor_css'] = cssPath;
- } else
- this.settings['editor_css'] = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_ui.css";
+ if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
+ if (document.body)
+ tinyMCE.addEvent(document.body, "readystatechange", TinyMCE_Engine.prototype.onLoad);
+ else
+ tinyMCE.addEvent(document, "readystatechange", TinyMCE_Engine.prototype.onLoad);
+ }
- if (tinyMCE.settings['debug']) {
- var msg = "Debug: \n";
+ tinyMCE.addEvent(window, "load", TinyMCE_Engine.prototype.onLoad);
+ tinyMCE._addUnloadEvents();
+ }
+ }
- msg += "baseURL: " + this.baseURL + "\n";
- msg += "documentBasePath: " + this.documentBasePath + "\n";
- msg += "content_css: " + this.settings['content_css'] + "\n";
- msg += "popups_css: " + this.settings['popups_css'] + "\n";
- msg += "editor_css: " + this.settings['editor_css'] + "\n";
+ this.loadScript(tinyMCE.baseURL + '/themes/' + this.settings['theme'] + '/editor_template' + tinyMCE.srcMode + '.js');
+ this.loadScript(tinyMCE.baseURL + '/langs/' + this.settings['language'] + '.js');
+ this.loadCSS(this.settings['editor_css']);
- alert(msg);
- }
+ // Add plugins
+ var p = tinyMCE.getParam('plugins', '', true, ',');
+ if (p.length > 0) {
+ for (var i=0; i');
+ v = t ? v.replace(/\s+/g,"") : v;
- this.loadedFiles[this.loadedFiles.length] = url;
-};
+ this.settings[key] = v;
+ },
-TinyMCE.prototype.loadCSS = function(url) {
- for (var i=0; i ');
+ addPlugin : function(n, p) {
+ var op = this.plugins[n];
- this.loadedFiles[this.loadedFiles.length] = url;
-};
+ // Use the previous plugin object base URL used when loading external plugins
+ p.baseURL = op ? op.baseURL : tinyMCE.baseURL + "/plugins/" + n;
+ this.plugins[n] = p;
-TinyMCE.prototype.importCSS = function(doc, css_file) {
- if (css_file == '')
- return;
+ this.loadNextScript();
+ },
- if (typeof(doc.createStyleSheet) == "undefined") {
- var elm = doc.createElement("link");
+ setPluginBaseURL : function(n, u) {
+ var op = this.plugins[n];
- elm.rel = "stylesheet";
- elm.href = css_file;
+ if (op)
+ op.baseURL = u;
+ else
+ this.plugins[n] = {baseURL : u};
+ },
- if ((headArr = doc.getElementsByTagName("head")) != null && headArr.length > 0)
- headArr[0].appendChild(elm);
- } else
- var styleSheet = doc.createStyleSheet(css_file);
-};
+ loadPlugin : function(n, u) {
+ u = u.indexOf('.js') != -1 ? u.substring(0, u.lastIndexOf('/')) : u;
+ u = u.charAt(u.length-1) == '/' ? u.substring(0, u.length-1) : u;
+ this.plugins[n] = {baseURL : u};
+ this.loadScript(u + "/editor_plugin" + (tinyMCE.srcMode ? '_src' : '') + ".js");
+ },
+
+ hasTheme : function(n) {
+ return typeof(this.themes[n]) != "undefined" && this.themes[n] != null;
+ },
+
+ addTheme : function(n, t) {
+ this.themes[n] = t;
+
+ this.loadNextScript();
+ },
+
+ addMenu : function(n, m) {
+ this.menus[n] = m;
+ },
+
+ hasMenu : function(n) {
+ return typeof(this.plugins[n]) != "undefined" && this.plugins[n] != null;
+ },
-TinyMCE.prototype.confirmAdd = function(e, settings) {
- var elm = tinyMCE.isMSIE ? event.srcElement : e.target;
- var elementId = elm.name ? elm.name : elm.id;
+ loadScript : function(url) {
+ var i;
- tinyMCE.settings = settings;
+ for (i=0; i');
- elm.setAttribute('mce_noask', 'true');
-};
+ this.loadedFiles[this.loadedFiles.length] = url;
+ },
-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];
- if (!tinyMCE.isInstance(inst))
- continue;
+ loadNextScript : function() {
+ var d = document, se;
- inst.switchSettings();
+ if (!tinyMCE.settings.strict_loading_mode)
+ return;
- if (inst.formElement == formElement) {
- var doc = inst.getDoc();
-
- tinyMCE._setHTML(doc, inst.formElement.value);
+ if (this.loadingIndex < this.pendingFiles.length) {
+ se = d.createElementNS('http://www.w3.org/1999/xhtml', 'script');
+ se.setAttribute('language', 'javascript');
+ se.setAttribute('type', 'text/javascript');
+ se.setAttribute('src', this.pendingFiles[this.loadingIndex++]);
- if (!tinyMCE.isMSIE)
- doc.body.innerHTML = tinyMCE._cleanupHTML(inst, doc, this.settings, doc.body, inst.visualAid);
- }
- }
-};
+ d.getElementsByTagName("head")[0].appendChild(se);
+ } else
+ this.loadingIndex = -1; // Done with loading
+ },
-TinyMCE.prototype.addMCEControl = function(replace_element, form_element_name, target_document) {
- var id = "mce_editor_" + tinyMCE.idCounter++;
- var inst = new TinyMCEControl(tinyMCE.settings);
+ loadCSS : function(url) {
+ var ar = url.replace(/\s+/, '').split(',');
+ var lflen = 0, csslen = 0;
+ var skip = false;
+ var x = 0, i = 0, nl, le;
+
+ for (x = 0,csslen = ar.length; x 0) {
+ /* Make sure it doesn't exist. */
+ for (i=0, lflen=this.loadedFiles.length; i ');
-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];
- if (!tinyMCE.isInstance(inst))
- continue;
+ this.loadedFiles[this.loadedFiles.length] = ar[x];
+ }
+ }
+ }
+ },
- inst.switchSettings();
+ importCSS : function(doc, css) {
+ var css_ary = css.replace(/\s+/, '').split(',');
+ var csslen, elm, headArr, x, css_file;
- tinyMCE.settings['preformatted'] = false;
+ for (x = 0, csslen = css_ary.length; x 0) {
+ // Is relative, make absolute
+ if (css_file.indexOf('://') == -1 && css_file.charAt(0) != '/')
+ css_file = this.documentBasePath + "/" + css_file;
- // Default to false
- if (typeof(skip_callback) == "undefined")
- skip_callback = false;
+ if (typeof(doc.createStyleSheet) == "undefined") {
+ elm = doc.createElement("link");
- tinyMCE._setHTML(inst.getDoc(), inst.getBody().innerHTML);
+ elm.rel = "stylesheet";
+ elm.href = css_file;
- // Remove visual aids when cleanup is disabled
- if (inst.settings['cleanup'] == false) {
- tinyMCE.handleVisualAid(inst.getBody(), true, false, inst);
- tinyMCE._setEventsEnabled(inst.getBody(), true);
+ if ((headArr = doc.getElementsByTagName("head")) != null && headArr.length > 0)
+ headArr[0].appendChild(elm);
+ } else
+ doc.createStyleSheet(css_file);
+ }
}
+ },
- tinyMCE._customCleanup(inst, "submit_content_dom", inst.contentWindow.document.body);
- var htm = skip_cleanup ? inst.getBody().innerHTML : tinyMCE._cleanupHTML(inst, inst.getDoc(), this.settings, inst.getBody(), this.visualAid, true);
- htm = tinyMCE._customCleanup(inst, "submit_content", htm);
+ confirmAdd : function(e, settings) {
+ var elm = tinyMCE.isMSIE ? event.srcElement : e.target;
+ var elementId = elm.name ? elm.name : elm.id;
- if (tinyMCE.settings["encoding"] == "xml" || tinyMCE.settings["encoding"] == "html")
- htm = tinyMCE.convertStringToXML(htm);
+ tinyMCE.settings = settings;
- if (!skip_callback && tinyMCE.settings['save_callback'] != "")
- var content = eval(tinyMCE.settings['save_callback'] + "(inst.formTargetElementId,htm,inst.getBody());");
+ if (tinyMCE.settings['convert_on_click'] || (!elm.getAttribute('mce_noask') && confirm(tinyMCELang['lang_edit_confirm'])))
+ tinyMCE.addMCEControl(elm, elementId);
- // Use callback content if available
- if ((typeof(content) != "undefined") && content != null)
- htm = content;
+ elm.setAttribute('mce_noask', 'true');
+ },
- // 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");
+ 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];
+ if (!tinyMCE.isInstance(inst))
+ continue;
- if (inst.formElement)
- inst.formElement.value = htm;
- }
-};
+ inst.switchSettings();
-TinyMCE.prototype._setEventsEnabled = function(node, state) {
- var events = new Array('onfocus','onblur','onclick','ondblclick',
- 'onmousedown','onmouseup','onmouseover','onmousemove',
- 'onmouseout','onkeypress','onkeydown','onkeydown','onkeyup');
+ if (inst.formElement == formElement) {
+ var doc = inst.getDoc();
+
+ tinyMCE._setHTML(doc, inst.formElement.value);
- var evs = tinyMCE.settings['event_elements'].split(',');
- for (var y=0; y');
+ content = content.replace(/"/g, '"');
+ content = content.replace(/&/g, '&');
+ }
- tinyMCE.addEvent(doc, "keypress", tinyMCE.handleEvent);
- tinyMCE.addEvent(doc, "keydown", tinyMCE.handleEvent);
- tinyMCE.addEvent(doc, "keyup", tinyMCE.handleEvent);
- tinyMCE.addEvent(doc, "click", tinyMCE.handleEvent);
- tinyMCE.addEvent(doc, "mouseup", tinyMCE.handleEvent);
- tinyMCE.addEvent(doc, "mousedown", tinyMCE.handleEvent);
- tinyMCE.addEvent(doc, "focus", tinyMCE.handleEvent);
- tinyMCE.addEvent(doc, "blur", tinyMCE.handleEvent);
+ inst.switchSettings();
- eval('try { doc.designMode = "On"; } catch(e) {}');
- }
-};
+ // Not loaded correctly hit it again, Mozilla bug #997860
+ if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") {
+ // This part will remove the designMode status
+ // Failes first time in Firefox 1.5b2 on Mac
+ try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {}
+ window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000);
+ return;
+ }
-TinyMCE.prototype._createIFrame = function(replace_element) {
- var iframe = document.createElement("iframe");
- var id = replace_element.getAttribute("id");
- var aw, ah;
+ if (!head) {
+ window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10);
+ return;
+ }
- aw = "" + tinyMCE.settings['area_width'];
- ah = "" + tinyMCE.settings['area_height'];
+ // Import theme specific content CSS the user specific
+ tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings['theme'] + "/css/editor_content.css");
+ tinyMCE.importCSS(inst.getDoc(), inst.settings['content_css']);
+ tinyMCE.dispatchCallback(inst, 'init_instance_callback', 'initInstance', inst);
- if (aw.indexOf('%') == -1) {
- aw = parseInt(aw);
- aw = aw < 0 ? 300 : aw;
- aw = aw + "px";
- }
+ // Setup keyboard shortcuts
+ if (tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')) {
+ inst.addShortcut('ctrl', 'z', 'lang_undo_desc', 'Undo');
+ inst.addShortcut('ctrl', 'y', 'lang_redo_desc', 'Redo');
+ }
- if (ah.indexOf('%') == -1) {
- ah = parseInt(ah);
- ah = ah < 0 ? 240 : ah;
- ah = ah + "px";
- }
+ // Add default shortcuts for gecko
+ if (tinyMCE.isGecko) {
+ inst.addShortcut('ctrl', 'b', 'lang_bold_desc', 'Bold');
+ inst.addShortcut('ctrl', 'i', 'lang_italic_desc', 'Italic');
+ inst.addShortcut('ctrl', 'u', 'lang_underline_desc', 'Underline');
+ }
- iframe.setAttribute("id", id);
- //iframe.setAttribute("className", "mceEditorArea");
- iframe.setAttribute("border", "0");
- iframe.setAttribute("frameBorder", "0");
- iframe.setAttribute("marginWidth", "0");
- iframe.setAttribute("marginHeight", "0");
- iframe.setAttribute("leftMargin", "0");
- iframe.setAttribute("topMargin", "0");
- iframe.setAttribute("width", aw);
- iframe.setAttribute("height", ah);
- iframe.setAttribute("allowtransparency", "true");
+ // Setup span styles
+ if (tinyMCE.getParam("convert_fonts_to_spans"))
+ inst.getDoc().body.setAttribute('id', 'mceSpanFonts');
- if (tinyMCE.settings["auto_resize"])
- iframe.setAttribute("scrolling", "no");
+ if (tinyMCE.settings['nowrap'])
+ doc.body.style.whiteSpace = "nowrap";
- // Must have a src element in MSIE HTTPs breaks aswell as absoute URLs
- if (tinyMCE.isMSIE && !tinyMCE.isOpera)
- iframe.setAttribute("src", this.settings['default_document']);
+ doc.body.dir = this.settings['directionality'];
+ doc.editorId = editor_id;
- iframe.style.width = aw;
- iframe.style.height = ah;
+ // Add on document element in Mozilla
+ if (!tinyMCE.isMSIE)
+ doc.documentElement.editorId = editor_id;
- // MSIE 5.0 issue
- if (tinyMCE.isMSIE && !tinyMCE.isOpera)
- replace_element.outerHTML = iframe.outerHTML;
- else
- replace_element.parentNode.replaceChild(iframe, replace_element);
+ inst.setBaseHREF(tinyMCE.settings['base_href']);
- if (tinyMCE.isMSIE)
- return window.frames[id];
- else
- return iframe;
-};
+ // Replace new line characters to BRs
+ if (tinyMCE.settings['convert_newlines_to_brs']) {
+ content = tinyMCE.regexpReplace(content, "\r\n", " ", "gi");
+ content = tinyMCE.regexpReplace(content, "\r", " ", "gi");
+ content = tinyMCE.regexpReplace(content, "\n", " ", "gi");
+ }
-TinyMCE.prototype.setupContent = function(editor_id) {
- var inst = tinyMCE.instances[editor_id];
- var doc = inst.getDoc();
- var head = doc.getElementsByTagName('head').item(0);
- var content = inst.startContent;
+ // Open closed anchors
+ // content = content.replace(new RegExp(' ', 'gi'), ' ');
- tinyMCE.operaOpacityCounter = 100 * tinyMCE.idCounter;
+ // Call custom cleanup code
+ content = tinyMCE.storeAwayURLs(content);
+ content = tinyMCE._customCleanup(inst, "insert_to_editor", content);
- inst.switchSettings();
+ if (tinyMCE.isMSIE) {
+ // Ugly!!!
+ window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["' + editor_id + '"].getDoc(), "' + editor_id + '");}catch(e){}', 500);
- // Not loaded correctly hit it again, Mozilla bug #997860
- if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") {
- // This part will remove the designMode status
- // Failes first time in Firefox 1.5b2 on Mac
- try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {}
- window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000);
- return;
- }
+ if (tinyMCE.settings["force_br_newlines"])
+ doc.styleSheets[0].addRule("p", "margin: 0;");
- if (!head) {
- window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10);
- return;
- }
+ var body = inst.getBody();
+ body.editorId = editor_id;
+ }
- // Import theme specific content CSS the user specific
- tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings['theme'] + "/css/editor_content.css");
- tinyMCE.importCSS(inst.getDoc(), inst.settings['content_css']);
- tinyMCE.executeCallback('init_instance_callback', '_initInstance', 0, inst);
+ content = tinyMCE.cleanupHTMLCode(content);
- // Setup span styles
- if (tinyMCE.getParam("convert_fonts_to_spans"))
- inst.getDoc().body.setAttribute('id', 'mceSpanFonts');
+ // Fix for bug #958637
+ if (!tinyMCE.isMSIE) {
+ var contentElement = inst.getDoc().createElement("body");
+ var doc = inst.getDoc();
- if (tinyMCE.settings['nowrap'])
- doc.body.style.whiteSpace = "nowrap";
+ contentElement.innerHTML = content;
- doc.body.dir = this.settings['directionality'];
- doc.editorId = editor_id;
+ // Remove weridness!
+ if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt'])
+ content = content.replace(new RegExp('<>', 'g'), "");
+
+ if (tinyMCE.settings['cleanup_on_startup'])
+ tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement));
+ else {
+ // Convert all strong/em to b/i
+ content = tinyMCE.regexpReplace(content, "", "", "gi");
+ content = tinyMCE.regexpReplace(content, "", "", "gi");
+ content = tinyMCE.regexpReplace(content, " ", " ", "gi");
+ tinyMCE.setInnerHTML(inst.getBody(), content);
+ }
- // Add on document element in Mozilla
- if (!tinyMCE.isMSIE)
- doc.documentElement.editorId = editor_id;
+ tinyMCE.convertAllRelativeURLs(inst.getBody());
+ } else {
+ if (tinyMCE.settings['cleanup_on_startup']) {
+ tinyMCE._setHTML(inst.getDoc(), content);
- // Setup base element
- var base = doc.createElement("base");
- base.setAttribute('href', tinyMCE.settings['base_href']);
- head.appendChild(base);
+ // Produces permission denied error in MSIE 5.5
+ eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}');
+ } else
+ tinyMCE._setHTML(inst.getDoc(), content);
+ }
- // Replace new line characters to BRs
- if (tinyMCE.settings['convert_newlines_to_brs']) {
- content = tinyMCE.regexpReplace(content, "\r\n", " ", "gi");
- content = tinyMCE.regexpReplace(content, "\r", " ", "gi");
- content = tinyMCE.regexpReplace(content, "\n", " ", "gi");
- }
+ // Fix for bug #957681
+ //inst.getDoc().designMode = inst.getDoc().designMode;
- // Open closed anchors
-// content = content.replace(new RegExp(' ', 'gi'), ' ');
+ // Setup element references
+ var parentElm = inst.targetDoc.getElementById(inst.editorId + '_parent');
+ inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling;
- // Call custom cleanup code
- content = tinyMCE.storeAwayURLs(content);
- content = tinyMCE._customCleanup(inst, "insert_to_editor", content);
+ tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst);
+ tinyMCE.dispatchCallback(inst, 'setupcontent_callback', 'setupContent', editor_id, inst.getBody(), inst.getDoc());
- if (tinyMCE.isMSIE) {
- // Ugly!!!
- window.setInterval('try{tinyMCE.getCSSClasses(document.frames["' + editor_id + '"].document, "' + editor_id + '");}catch(e){}', 500);
+ // Re-add design mode on mozilla
+ if (!tinyMCE.isMSIE)
+ tinyMCE.addEventHandlers(inst);
- if (tinyMCE.settings["force_br_newlines"])
- document.frames[editor_id].document.styleSheets[0].addRule("p", "margin: 0px;");
+ // Add blur handler
+ if (tinyMCE.isMSIE) {
+ tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE_Engine.prototype._eventPatch);
+ tinyMCE.addEvent(inst.getBody(), "beforedeactivate", TinyMCE_Engine.prototype._eventPatch); // Bug #1439953
- var body = document.frames[editor_id].document.body;
+ // Workaround for drag drop/copy paste base href bug
+ if (!tinyMCE.isOpera) {
+ tinyMCE.addEvent(doc.body, "mousemove", TinyMCE_Engine.prototype.onMouseMove);
+ tinyMCE.addEvent(doc.body, "beforepaste", TinyMCE_Engine.prototype._eventPatch);
+ tinyMCE.addEvent(doc.body, "drop", TinyMCE_Engine.prototype._eventPatch);
+ }
+ }
- tinyMCE.addEvent(body, "beforepaste", TinyMCE.prototype.eventPatch);
- tinyMCE.addEvent(body, "beforecut", TinyMCE.prototype.eventPatch);
+ // Trigger node change, this call locks buttons for tables and so forth
+ tinyMCE.selectedInstance = inst;
+ tinyMCE.selectedElement = inst.contentWindow.document.body;
+
+ // Call custom DOM cleanup
+ tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody());
+ tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody());
+ tinyMCE._setEventsEnabled(inst.getBody(), false);
+ tinyMCE.cleanupAnchors(inst.getDoc());
+
+ if (tinyMCE.getParam("convert_fonts_to_spans"))
+ tinyMCE.convertSpansToFonts(inst.getDoc());
+
+ inst.startContent = tinyMCE.trim(inst.getBody().innerHTML);
+ inst.undoRedo.add({ content : inst.startContent });
+
+ // Cleanup any mess left from storyAwayURLs
+ if (tinyMCE.isGecko) {
+ // Remove mce_src from textnodes and comments
+ tinyMCE.selectNodes(inst.getBody(), function(n) {
+ if (n.nodeType == 3 || n.nodeType == 8) {
+ n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), "");
+ n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), "");
+ }
- body.editorId = editor_id;
- }
+ return false;
+ });
+ }
- content = tinyMCE.cleanupHTMLCode(content);
+ // Cleanup any mess left from storyAwayURLs
+ tinyMCE._removeInternal(inst.getBody());
- // Fix for bug #958637
- if (!tinyMCE.isMSIE) {
- var contentElement = inst.getDoc().createElement("body");
- var doc = inst.getDoc();
+ tinyMCE.selectedInstance = inst;
+ tinyMCE.triggerNodeChange(false, true);
+ },
- contentElement.innerHTML = content;
+ storeAwayURLs : function(s) {
+ // Remove all mce_src, mce_href and replace them with new ones
+ // s = s.replace(new RegExp('mce_src\\s*=\\s*\"[^ >\"]*\"', 'gi'), '');
+ // s = s.replace(new RegExp('mce_href\\s*=\\s*\"[^ >\"]*\"', 'gi'), '');
+
+ if (!s.match(/(mce_src|mce_href)/gi, s)) {
+ s = s.replace(new RegExp('src\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'src="$1" mce_src="$1"');
+ s = s.replace(new RegExp('href\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'href="$1" mce_href="$1"');
+ }
+
+ return s;
+ },
+
+ _removeInternal : function(n) {
+ if (tinyMCE.isGecko) {
+ // Remove mce_src from textnodes and comments
+ tinyMCE.selectNodes(n, function(n) {
+ if (n.nodeType == 3 || n.nodeType == 8) {
+ n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), "");
+ n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), "");
+ }
- // Remove weridness!
- if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt'])
- content = content.replace(new RegExp('<>', 'g'), "");
-
- if (tinyMCE.settings['cleanup_on_startup'])
- tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement));
- else {
- // Convert all strong/em to b/i
- content = tinyMCE.regexpReplace(content, "", "", "gi");
- content = tinyMCE.regexpReplace(content, "", "", "gi");
- content = tinyMCE.regexpReplace(content, " ", " ", "gi");
- tinyMCE.setInnerHTML(inst.getBody(), content);
+ return false;
+ });
}
+ },
- inst.convertAllRelativeURLs();
- } else {
- if (tinyMCE.settings['cleanup_on_startup']) {
- tinyMCE._setHTML(inst.getDoc(), content);
+ removeTinyMCEFormElements : function(form_obj) {
+ // Check if form is valid
+ if (typeof(form_obj) == "undefined" || form_obj == null)
+ return;
- // Produces permission denied error in MSIE 5.5
- eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}');
- } else
- tinyMCE._setHTML(inst.getDoc(), content);
- }
+ // If not a form, find the form
+ if (form_obj.nodeName != "FORM") {
+ if (form_obj.form)
+ form_obj = form_obj.form;
+ else
+ form_obj = tinyMCE.getParentElement(form_obj, "form");
+ }
- // Fix for bug #957681
- //inst.getDoc().designMode = inst.getDoc().designMode;
-
- // Setup element references
- var parentElm = document.getElementById(inst.editorId + '_parent');
- if (parentElm.lastChild.nodeName == "INPUT")
- inst.formElement = tinyMCE.isGecko ? parentElm.firstChild : parentElm.lastChild;
- else
- inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling;
-
- tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst);
- 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);
-
- // Add blur handler
- if (tinyMCE.isMSIE)
- tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE.prototype.eventPatch);
-
- // Trigger node change, this call locks buttons for tables and so forth
- tinyMCE.selectedInstance = inst;
- tinyMCE.selectedElement = inst.contentWindow.document.body;
-
- if (!inst.isHidden())
- tinyMCE.triggerNodeChange(false, true);
-
- // Call custom DOM cleanup
- tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody());
- tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody());
- tinyMCE._setEventsEnabled(inst.getBody(), false);
- tinyMCE.cleanupAnchors(inst.getDoc());
-
- if (tinyMCE.getParam("convert_fonts_to_spans"))
- tinyMCE.convertSpansToFonts(inst.getDoc());
-
- inst.startContent = tinyMCE.trim(inst.getBody().innerHTML);
- inst.undoLevels[inst.undoLevels.length] = inst.startContent;
-
- tinyMCE.operaOpacityCounter = -1;
-};
-
-TinyMCE.prototype.cleanupHTMLCode = function(s) {
- s = s.replace(/
/gi, '
');
- s = s.replace(/\s*<\/p>/gi, '
');
-
- // Open closed tags like to
-// tinyMCE.debug("f:" + s);
- s = s.replace(/<(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|b|em|strong|i|strike|u|span|a|ul|ol|li|blockquote)([a-z]*)([^\\|>]*?)\/>/gi, '<$1$2$3>$1$2>');
-// tinyMCE.debug("e:" + s);
-
- // Remove trailing space to
- s = s.replace(new RegExp('\\s+>', 'gi'), '>');
-
- // Close tags to
- s = s.replace(/<(img|br|hr)(.*?)><\/(img|br|hr)>/gi, '<$1$2 />');
-
- // Weird MSIE bug,
breaks runtime?
- if (tinyMCE.isMSIE)
- s = s.replace(/
<\/p>/gi, " ");
-
- // Convert relative anchors to absolute URLs ex: #something to file.htm#something
- s = s.replace(new RegExp('(href=\"?)(\\s*?#)', 'gi'), '$1' + tinyMCE.settings['document_base_url'] + "#");
-
- return s;
-};
-
-TinyMCE.prototype.storeAwayURLs = function(s) {
- // Remove all mce_src, mce_href and replace them with new ones
- s = s.replace(new RegExp('mce_src\\s*=\\s*\"[^ >\"]*\"', 'gi'), '');
- s = s.replace(new RegExp('mce_href\\s*=\\s*\"[^ >\"]*\"', 'gi'), '');
- s = s.replace(new RegExp('src\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'src="$1" mce_src="$1"');
- s = s.replace(new RegExp('href\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'href="$1" mce_href="$1"');
-
- return s;
-};
-
-TinyMCE.prototype.cancelEvent = function(e) {
- if (tinyMCE.isMSIE) {
- e.returnValue = false;
- e.cancelBubble = true;
- } else
- e.preventDefault();
-};
-
-TinyMCE.prototype.removeTinyMCEFormElements = function(form_obj) {
- // Check if form is valid
- if (typeof(form_obj) == "undefined" || form_obj == null)
- return;
-
- // If not a form, find the form
- if (form_obj.nodeName != "FORM") {
- if (form_obj.form)
- form_obj = form_obj.form;
- else
- form_obj = tinyMCE.getParentElement(form_obj, "form");
- }
-
- // Still nothing
- if (form_obj == null)
- return;
-
- // Disable all UI form elements that TinyMCE created
- for (var i=0; i ");
+ rng.collapse(false);
+ rng.select();
- if (tinyMCE.getParentElement(rng.parentElement(), "li") != null)
+ tinyMCE.execCommand("mceAddUndoLevel");
+ tinyMCE.triggerNodeChange(false);
return false;
+ }
+ }
- // Cancel event
- e.returnValue = false;
- e.cancelBubble = true;
-
- // Insert BR element
- rng.pasteHTML(" ");
- rng.collapse(false);
- rng.select();
-
- tinyMCE.execCommand("mceAddUndoLevel");
+ // 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;
}
- }
- // 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;
- return false;
- break;
+ case "keyup":
+ case "keydown":
+ tinyMCE.hideMenus();
+ tinyMCE.hasMouseMoved = false;
- case "keyup":
- case "keydown":
- if (e.target.editorId)
- tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId];
- else
- return;
+ if (inst && inst.handleShortcut(e))
+ return false;
- if (tinyMCE.selectedInstance)
- tinyMCE.selectedInstance.switchSettings();
+ if (e.target.editorId)
+ tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId];
+ else
+ return;
- var inst = tinyMCE.selectedInstance;
+ 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
- tinyMCE.execCommand("mceAddUndoLevel");
- e.preventDefault();
- return false;
- }
- }
+ var inst = tinyMCE.selectedInstance;
- 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'], tinyMCE.selectedInstance);
-
- // Fix empty elements on return/enter, check where enter occured
- if (tinyMCE.isMSIE && e.type == "keydown" && e.keyCode == 13)
- tinyMCE.enterKeyElement = tinyMCE.selectedInstance.getFocusElement();
-
- // Fix empty elements on return/enter
- if (tinyMCE.isMSIE && e.type == "keyup" && e.keyCode == 13) {
- var elm = tinyMCE.enterKeyElement;
- if (elm) {
- var re = new RegExp('^HR|IMG|BR$','g'); // Skip these
- var dre = new RegExp('^H[1-6]$','g'); // Add double on these
-
- if (!elm.hasChildNodes() && !re.test(elm.nodeName)) {
- if (dre.test(elm.nodeName))
- elm.innerHTML = " ";
- else
- elm.innerHTML = " ";
+ // 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_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance, e.type)) {
+ // Cancel event
+ tinyMCE.execCommand("mceAddUndoLevel");
+ e.preventDefault();
+ return false;
}
}
- }
- // Check if it's a position key
- var keys = tinyMCE.posKeyCodes;
- var posKey = false;
- for (var i=0; i';
+ h += ' ';
+ h += '';
+ } else {
+ // Normal button
+ h += '';
+ h += ' ';
+ h += ' ';
+ }
+
+ return h;
+ },
+
+ addButtonMap : function(m) {
+ var i, a = m.replace(/\s+/, '').split(',');
+
+ for (i=0; i -1)
- suffix = '?rnd=' + this.operaOpacityCounter++;
+ for (var c=0; c 0);
- // Remove element
- var replaceElement = document.getElementById(editor_id + "_parent");
- var oldTargetElement = inst.oldTargetElement;
- var targetName = oldTargetElement.nodeName.toLowerCase();
-
- if (targetName == "textarea" || targetName == "input") {
- // Just show the old text area
- replaceElement.parentNode.removeChild(replaceElement);
- oldTargetElement.style.display = "inline";
- oldTargetElement.value = html;
- } else {
- oldTargetElement.innerHTML = html;
+ if (tinyMCE.settings['custom_undo_redo']) {
+ undoIndex = inst.undoRedo.undoIndex;
+ undoLevels = inst.undoRedo.undoLevels.length;
+ }
- replaceElement.parentNode.insertBefore(oldTargetElement, replaceElement);
- replaceElement.parentNode.removeChild(replaceElement);
+ tinyMCE.dispatchCallback(inst, 'handle_node_change_callback', 'handleNodeChange', editorId, elm, undoIndex, undoLevels, inst.visualAid, anySelection, setup_content);
}
- }
-};
-TinyMCE.prototype._cleanupElementName = function(element_name, element) {
- var name = "";
+ if (this.selectedInstance && (typeof(focus) == "undefined" || focus))
+ this.selectedInstance.contentWindow.focus();
+ },
- element_name = element_name.toLowerCase();
+ _customCleanup : function(inst, type, content) {
+ var pl, po, i;
- // Never include body
- if (element_name == "body")
- return null;
+ // Call custom cleanup
+ var customCleanup = tinyMCE.settings['cleanup_callback'];
+ if (customCleanup != "" && eval("typeof(" + customCleanup + ")") != "undefined")
+ content = eval(customCleanup + "(type, content, inst);");
- // If verification mode
- if (tinyMCE.cleanup_verify_html) {
- // Check if invalid element
- for (var i=0; i 0) {
+ for (i=ar.length-1; i>=0; i--) {
+ s = ar[i].substring(2, ar[i].length-1);
- if (val != '') {
- val = '' + val;
+ if (s.indexOf('lang_') == 0 && tinyMCELang[s])
+ h = tinyMCE.replaceVar(h, s, tinyMCELang[s]);
+ else if (as && as[s])
+ h = tinyMCE.replaceVar(h, s, as[s]);
+ else if (tinyMCE.settings[s])
+ h = tinyMCE.replaceVar(h, s, tinyMCE.settings[s]);
+ }
+ }
- switch (attrib) {
- case "background":
- val = "url('" + val + "')";
- break;
+ h = tinyMCE.replaceVar(h, "themeurl", tinyMCE.themeURL);
- case "bordercolor":
- if (elm.style.borderStyle == '' || elm.style.borderStyle == 'none')
- elm.style.borderStyle = 'solid';
- break;
+ return h;
+ },
- case "border":
- case "width":
- case "height":
- if (attrib == "border" && elm.style.borderWidth > 0)
- return;
+ replaceVar : function(h, r, v) {
+ return h.replace(new RegExp('{\\\$' + r + '}', 'g'), v);
+ },
- if (val.indexOf('%') == -1)
- val += 'px';
- break;
+ openWindow : function(template, args) {
+ var html, width, height, x, y, resizable, scrollbars, url;
- case "vspace":
- case "hspace":
- elm.style.marginTop = val + "px";
- elm.style.marginBottom = val + "px";
- elm.removeAttribute(attrib);
- return;
+ args['mce_template_file'] = template['file'];
+ args['mce_width'] = template['width'];
+ args['mce_height'] = template['height'];
+ tinyMCE.windowArgs = args;
- case "align":
- if (elm.nodeName == "IMG") {
- if (tinyMCE.isMSIE)
- elm.style.styleFloat = val;
- else
- elm.style.cssFloat = val;
- } else
- elm.style.textAlign = val;
+ html = template['html'];
+ if (!(width = parseInt(template['width'])))
+ width = 320;
- elm.removeAttribute(attrib);
- return;
- }
+ if (!(height = parseInt(template['height'])))
+ height = 200;
- if (val != '') {
- eval('elm.style.' + style + ' = val;');
- elm.removeAttribute(attrib);
- }
- }
- } else {
- if (style == '')
- return;
+ // Add to height in M$ due to SP2 WHY DON'T YOU GUYS IMPLEMENT innerWidth of windows!!
+ if (tinyMCE.isMSIE)
+ height += 40;
+ else
+ height += 20;
- var val = eval('elm.style.' + style) == '' ? tinyMCE.getAttrib(elm, attrib) : eval('elm.style.' + style);
- val = val == null ? '' : '' + val;
+ x = parseInt(screen.width / 2.0) - (width / 2.0);
+ y = parseInt(screen.height / 2.0) - (height / 2.0);
- switch (attrib) {
- // Always move background to style
- case "background":
- if (val.indexOf('url') == -1 && val != '')
- val = "url('" + val + "');";
-
- if (val != '') {
- elm.style.backgroundImage = val;
- elm.removeAttribute(attrib);
- }
- return;
+ resizable = (args && args['resizable']) ? args['resizable'] : "no";
+ scrollbars = (args && args['scrollbars']) ? args['scrollbars'] : "no";
- case "border":
- case "width":
- case "height":
- val = val.replace('px', '');
- break;
+ if (template['file'].charAt(0) != '/' && template['file'].indexOf('://') == -1)
+ url = tinyMCE.baseURL + "/themes/" + tinyMCE.getParam("theme") + "/" + template['file'];
+ else
+ url = template['file'];
- case "align":
- if (tinyMCE.getAttrib(elm, 'align') == '') {
- if (elm.nodeName == "IMG") {
- if (tinyMCE.isMSIE && elm.style.styleFloat != '') {
- val = elm.style.styleFloat;
- style = 'styleFloat';
- } else if (tinyMCE.isGecko && elm.style.cssFloat != '') {
- val = elm.style.cssFloat;
- style = 'cssFloat';
- }
- }
- }
- break;
- }
+ // Replace all args as variables in URL
+ for (var name in args) {
+ if (typeof(args[name]) == 'function')
+ continue;
- if (val != '') {
- elm.removeAttribute(attrib);
- elm.setAttribute(attrib, val);
- eval('elm.style.' + style + ' = "";');
+ url = tinyMCE.replaceVar(url, name, escape(args[name]));
}
- }
-};
-TinyMCE.prototype._cleanupAttribute = function(valid_attributes, element_name, attribute_node, element_node) {
- var attribName = attribute_node.nodeName.toLowerCase();
- var attribValue = attribute_node.nodeValue;
- var attribMustBeValue = null;
- var verified = false;
+ if (html) {
+ html = tinyMCE.replaceVar(html, "css", this.settings['popups_css']);
+ html = tinyMCE.applyTemplate(html, args);
- // Mozilla attibute, remove them
- if (attribName.indexOf('moz_') != -1)
- return null;
+ var win = window.open("", "mcePopup" + new Date().getTime(), "top=" + y + ",left=" + x + ",scrollbars=" + scrollbars + ",dialog=yes,minimizable=" + resizable + ",modal=yes,width=" + width + ",height=" + height + ",resizable=" + resizable);
+ if (win == null) {
+ alert(tinyMCELang['lang_popup_blocked']);
+ return;
+ }
- if (!tinyMCE.cleanup_on_save && (attribName == "mce_href" || attribName == "mce_src"))
- return {name : attribName, value : attribValue};
+ win.document.write(html);
+ win.document.close();
+ win.resizeTo(width, height);
+ win.focus();
+ } else {
+ if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && resizable != 'yes' && tinyMCE.settings["dialog_type"] == "modal") {
+ height += 10;
- // Verify attrib
- if (tinyMCE.cleanup_verify_html && !verified) {
- for (var i=1; i 0)
+ className += " ";
- break;
+ className += classNames[i];
+ }
- case "colspan":
- case "rowspan":
- // Not needed
- if (attribValue == "1")
- return null;
- break;
+ return className;
+ },
- // Skip these
- case "_moz-userdefined":
- case "editorid":
- case "mce_href":
- case "mce_src":
- return null;
- }
+ handleVisualAid : function(el, deep, state, inst, skip_dispatch) {
+ if (!el)
+ return;
- // Not the must be value
- if (attribMustBeValue != null) {
- var isCorrect = false;
- for (var i=0; i 1)
- val = "url('" + eval(tinyMCE.getParam('urlconverter_callback') + "(m[1], null, true);") + "')";
- }
+ n[i].removeAttribute("mce_thref");
+ }
+ }
+ }
- // Force HEX colors
- if (tinyMCE.getParam("force_hex_style_colors"))
- val = tinyMCE.convertRGBToHex(val, true);
+ el = tinyMCE.selectNodes(e, function(n) {
+ if (n.nodeType == 3 || n.nodeType == 8) {
+ n.nodeValue = n.nodeValue.replace(/\smce_tsrc=/gi, " src=");
+ n.nodeValue = n.nodeValue.replace(/\smce_thref=/gi, " href=");
+ }
- if (val != "url('')")
- str += key.toLowerCase() + ": " + val + "; ";
+ return false;
+ });
+ }
}
- }
- if (new RegExp('; $').test(str))
- str = str.substring(0, str.length - 2);
+ return h;
+ },
- return str;
-};
+ _setHTML : function(doc, html_content) {
+ // Force closed anchors open
+ //html_content = html_content.replace(new RegExp(' ', 'gi'), ' ');
-TinyMCE.prototype.convertRGBToHex = function(s, k) {
- if (s.toLowerCase().indexOf('rgb') != -1) {
- var re = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi");
- var rgb = s.replace(re, "$1,$2,$3,$4,$5").split(',');
- if (rgb.length == 5) {
- r = parseInt(rgb[1]).toString(16);
- g = parseInt(rgb[2]).toString(16);
- b = parseInt(rgb[3]).toString(16);
+ html_content = tinyMCE.cleanupHTMLCode(html_content);
- r = r.length == 1 ? '0' + r : r;
- g = g.length == 1 ? '0' + g : g;
- b = b.length == 1 ? '0' + b : b;
+ // Try innerHTML if it fails use pasteHTML in MSIE
+ try {
+ tinyMCE.setInnerHTML(doc.body, html_content);
+ } catch (e) {
+ if (this.isMSIE)
+ doc.body.createTextRange().pasteHTML(html_content);
+ }
- s = "#" + r + g + b;
+ // 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
+ tinyMCE.setInnerHTML(doc.body, html);
}
- }
- return s;
-};
+ tinyMCE.cleanupAnchors(doc);
-TinyMCE.prototype.convertHexToRGB = function(s) {
- if (s.indexOf('#') != -1) {
- s = s.replace(new RegExp('[^0-9A-F]', 'gi'), '');
- return "rgb(" + parseInt(s.substring(0, 2), 16) + "," + parseInt(s.substring(2, 4), 16) + "," + parseInt(s.substring(4, 6), 16) + ")";
- }
+ if (tinyMCE.getParam("convert_fonts_to_spans"))
+ tinyMCE.convertSpansToFonts(doc);
+ },
- return s;
-};
+ getEditorId : function(form_element) {
+ var inst = this.getInstanceById(form_element);
+ if (!inst)
+ return null;
-TinyMCE.prototype._verifyClass = function(node) {
- // Sometimes the class gets set to null, weird Gecko bug?
- if (tinyMCE.isGecko) {
- var className = node.getAttribute('class');
- if (!className)
- return false;
- }
+ return inst.editorId;
+ },
- // Trim CSS class
- if (tinyMCE.isMSIE)
- var className = node.getAttribute('className');
+ getInstanceById : function(editor_id) {
+ var inst = this.instances[editor_id];
+ if (!inst) {
+ for (var n in tinyMCE.instances) {
+ var instance = tinyMCE.instances[n];
+ if (!tinyMCE.isInstance(instance))
+ continue;
- if (tinyMCE.cleanup_verify_css_classes && tinyMCE.cleanup_on_save) {
- var csses = tinyMCE.getCSSClasses();
- nonDefinedCSS = true;
- for (var c=0; c' + output;
- }
+ break;
}
- // Remove deprecated attributes
- var re = new RegExp("^(TABLE|TD|TR)$");
- if (re.test(node.nodeName)) {
- // Move attrib to style
- if ((node.nodeName != "TABLE" || tinyMCE.cleanup_inline_styles) && (width = tinyMCE.getAttrib(node, "width")) != '') {
- node.style.width = width.indexOf('%') != -1 ? width : width.replace(/[^0-9]/gi, '') + "px";
- node.removeAttribute("width");
- }
-
- // Is table and not inline
- if ((node.nodeName == "TABLE" && !tinyMCE.cleanup_inline_styles) && node.style.width != '') {
- tinyMCE.setAttrib(node, "width", node.style.width.replace('px',''));
- node.style.width = '';
- }
+ doc = instance.getDoc();
+ }
- // Move attrib to style
- if ((height = tinyMCE.getAttrib(node, "height")) != '') {
- height = "" + height; // Force string
- node.style.height = height.indexOf('%') != -1 ? height : height.replace(/[^0-9]/gi, '') + "px";
- node.removeAttribute("height");
- }
- }
+ if (typeof(doc) == "undefined") {
+ var instance = tinyMCE.getInstanceById(editor_id);
+ doc = instance.getDoc();
+ }
- // Handle inline/outline styles
- if (tinyMCE.cleanup_inline_styles) {
- var re = new RegExp("^(TABLE|TD|TR|IMG|HR)$");
- if (re.test(node.nodeName) && tinyMCE.getAttrib(node, "class").indexOf('mceItem') == -1) {
- tinyMCE._moveStyle(node, 'width', 'width');
- tinyMCE._moveStyle(node, 'height', 'height');
- tinyMCE._moveStyle(node, 'borderWidth', 'border');
- tinyMCE._moveStyle(node, '', 'vspace');
- tinyMCE._moveStyle(node, '', 'hspace');
- tinyMCE._moveStyle(node, 'textAlign', 'align');
- tinyMCE._moveStyle(node, 'backgroundColor', 'bgColor');
- tinyMCE._moveStyle(node, 'borderColor', 'borderColor');
- tinyMCE._moveStyle(node, 'backgroundImage', 'background');
+ if (doc) {
+ var styles = doc.styleSheets;
- // Refresh element in old MSIE
- if (tinyMCE.isMSIE5)
- node.outerHTML = node.outerHTML;
- } else if (tinyMCE.isBlockElement(node))
- tinyMCE._moveStyle(node, 'textAlign', 'align');
+ if (styles && styles.length > 0) {
+ for (var x=0; x" + node.innerHTML + "";
+ // Cache em
+ if (output.length > 0)
+ tinyMCE.cssClasses = output;
- // Remove empty tables
- if (elementName == "table" && !node.hasChildNodes())
- return "";
+ return output;
+ },
- // Handle element attributes
- if (node.attributes.length > 0) {
- var lastAttrib = "";
+ regexpReplace : function(in_str, reg_exp, replace_str, opts) {
+ if (in_str == null)
+ return in_str;
- for (var i=0; i" + this.convertStringToXML(String.fromCharCode(160)) + "" + elementName + ">";
+ return '';
+ },
- // Is MSIE script element
- if (tinyMCE.isMSIE && elementName == "script")
- return "<" + elementName + elementAttribs + ">" + node.text + "" + elementName + ">";
+ evalFunc : function(f, idx, a) {
+ var s = '(', i;
- // Clean up children
- if (node.hasChildNodes()) {
- // If not empty span
- if (!(elementName == "span" && elementAttribs == "" && tinyMCE.getParam("trim_span_elements"))) {
- // Force BR
- if (elementName == "p" && tinyMCE.cleanup_force_br_newlines)
- output += "";
- else
- output += "<" + elementName + elementAttribs + ">";
- }
+ for (i=idx; i
";
- else
- output += "" + elementName + ">";
- }
- } else {
- if (!nonEmptyTag) {
- if (openTag)
- output += "<" + elementName + elementAttribs + ">" + elementName + ">";
- else
- output += "<" + elementName + elementAttribs + " />";
- }
- }
+ s += ');';
- return output;
+ return eval("f" + s);
+ },
- case 3: // Text
- // Do not convert script elements
- if (node.parentNode.nodeName == "SCRIPT" || node.parentNode.nodeName == "NOSCRIPT" || node.parentNode.nodeName == "STYLE")
- return node.nodeValue;
+ dispatchCallback : function(i, p, n) {
+ return this.callFunc(i, p, n, 0, this.dispatchCallback.arguments);
+ },
- return this.convertStringToXML(node.nodeValue);
+ executeCallback : function(i, p, n) {
+ return this.callFunc(i, p, n, 1, this.executeCallback.arguments);
+ },
- case 8: // Comment
- return "";
+ execCommandCallback : function(i, p, n) {
+ return this.callFunc(i, p, n, 2, this.execCommandCallback.arguments);
+ },
- default: // Unknown
- return "[UNKNOWN NODETYPE " + node.nodeType + "]";
- }
-};
+ callFunc : function(ins, p, n, m, a) {
+ var l, i, on, o, s, v;
-TinyMCE.prototype.convertStringToXML = function(html_data) {
- var output = "";
+ s = m == 2;
- for (var i=0; i 127)
- output += '' + chr + ";";
- else
- output += String.fromCharCode(chr);
+ if (l != '' && (v = tinyMCE.evalFunc(typeof(l) == "function" ? l : eval(l), 3, a)) == s && m > 0)
+ return true;
- continue;
+ if (ins != null) {
+ for (i=0, l = ins.plugins; i 0)
+ return true;
+ }
}
- // Raw entities
- if (tinyMCE.settings['entity_encoding'] == "raw") {
- output += String.fromCharCode(chr);
- continue;
+ l = tinyMCE.themes;
+ for (on in l) {
+ o = l[on];
+
+ if (o[n] && (v = tinyMCE.evalFunc(o[n], 3, a)) == s && m > 0)
+ return true;
}
- // Named entities
- if (typeof(tinyMCE.settings['cleanup_entities']["c" + chr]) != 'undefined' && tinyMCE.settings['cleanup_entities']["c" + chr] != '')
- output += '&' + tinyMCE.settings['cleanup_entities']["c" + chr] + ';';
- else
- output += '' + String.fromCharCode(chr);
- }
+ return false;
+ },
- return output;
-};
+ xmlEncode : function(s) {
+ s = "" + s;
+ s = s.replace(/&/g, '&');
+ s = s.replace(new RegExp('"', 'g'), '"');
+ s = s.replace(/\'/g, '''); // ' is not working in MSIE
+ s = s.replace(//g, '>');
-TinyMCE.prototype._getCleanupElementName = function(chunk) {
- var pos;
+ return s;
+ },
- if (chunk.charAt(0) == '+')
- chunk = chunk.substring(1);
+ extend : function(p, np) {
+ var o = {};
- if (chunk.charAt(0) == '-')
- chunk = chunk.substring(1);
+ o.parent = p;
- if ((pos = chunk.indexOf('/')) != -1)
- chunk = chunk.substring(0, pos);
+ for (n in p)
+ o[n] = p[n];
- 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 0) {
+ for (i=0; i/gi, '>');
+ tinyMCE.addPlugin(pn, to);
+ }
- return html;
+ this.plugins[this.plugins.length] = pn;
+ }
}
+};
- if (on_save && tinyMCE.getParam("convert_fonts_to_spans"))
- tinyMCE.convertFontsToSpans(doc);
-
- // Call custom cleanup code
- tinyMCE._customCleanup(inst, on_save ? "get_from_editor_dom" : "insert_to_editor_dom", doc.body);
+TinyMCE_Control.prototype = {
+ hasPlugin : function(n) {
+ var i;
- // Move bgcolor to style
- var n = doc.getElementsByTagName("font");
- for (var i=0; i[ \n\r]*[ \n\r]*', ' ', 'gi'));
- tinyMCE.setInnerHTML(element, tinyMCE.regexpReplace(element.innerHTML, '', '', 'gi'));
- }
+ switchSettings : function() {
+ if (tinyMCE.configs.length > 1 && tinyMCE.currentConfig != this.settings['index']) {
+ tinyMCE.settings = this.settings;
+ tinyMCE.currentConfig = this.settings['index'];
+ }
+ },
- var html = this.cleanupNode(element);
+ getBody : function() {
+ return this.getDoc().body;
+ },
- if (tinyMCE.settings['debug'])
- tinyMCE.debug("Cleanup process executed in: " + (new Date().getTime()-startTime) + " ms.");
+ getDoc : function() {
+ return this.contentWindow.document;
+ },
- // Remove pesky HR paragraphs and other crap
- html = tinyMCE.regexpReplace(html, '
', ' ');
- html = tinyMCE.regexpReplace(html, '
', ' ');
- html = tinyMCE.regexpReplace(html, '\\s* \\s* ', ' ');
- html = tinyMCE.regexpReplace(html, '\\s* \\s*
', '
');
- html = tinyMCE.regexpReplace(html, '\\s* \\s* \\s* \\s*
', '
');
- html = tinyMCE.regexpReplace(html, '\\s* \\s* \\s*
', '
');
- html = tinyMCE.regexpReplace(html, '\\s* \\s* \\s*
', '
');
+ getWin : function() {
+ return this.contentWindow;
+ },
- // Remove empty anchors
- html = html.replace(new RegExp('(.*?) ', 'gi'), '$1');
+ addShortcut : function(m, k, d, cmd, ui, va) {
+ var n = typeof(k) == "number", ie = tinyMCE.isMSIE, c, sc, i;
+ var scl = this.shortcuts;
- // Remove some mozilla crap
- if (!tinyMCE.isMSIE)
- html = html.replace(new RegExp(' ', 'g'), "");
+ if (!tinyMCE.getParam('custom_shortcuts'))
+ return false;
- if (tinyMCE.settings['remove_linebreaks'])
- html = html.replace(new RegExp('\r|\n', 'g'), ' ');
+ m = m.toLowerCase();
+ k = ie && !n ? k.toUpperCase() : k;
+ c = n ? null : k.charCodeAt(0);
+ d = d && d.indexOf('lang_') == 0 ? tinyMCE.getLang(d) : d;
+
+ sc = {
+ alt : m.indexOf('alt') != -1,
+ ctrl : m.indexOf('ctrl') != -1,
+ shift : m.indexOf('shift') != -1,
+ charCode : c,
+ keyCode : n ? k : (ie ? c : null),
+ desc : d,
+ cmd : cmd,
+ ui : ui,
+ val : va
+ };
+
+ for (i=0; i]*)>', 'g'), "\n<$1$2>\n");
- html = html.replace(new RegExp('<\/(p|div)([^>]*)>', 'g'), "\n$1$2>\n");
- html = html.replace(new RegExp(' ', 'g'), " \n");
- }
+ scl[scl.length] = sc;
- if (tinyMCE.settings['force_br_newlines']) {
- var re = new RegExp('
', 'g');
- html = html.replace(re, " ");
- }
+ return true;
+ },
- if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt']) {
- // Remove weridness!
- var re = new RegExp('<>', 'g');
- html = html.replace(re, "");
- }
+ handleShortcut : function(e) {
+ var i, s = this.shortcuts, o;
- // Call custom cleanup code
- html = tinyMCE._customCleanup(inst, on_save ? "get_from_editor" : "insert_to_editor", html);
+ for (i=0; i " || chk == " " || chk == "
" || chk == "
" || chk == "
")
- html = "";
+ tinyMCE.cancelEvent(e);
+ return true;
+ }
+ }
- if (tinyMCE.settings["preformatted"])
- return "" + html + " ";
+ return false;
+ },
- return html;
-};
+ autoResetDesignMode : function() {
+ // Add fix for tab/style.display none/block problems in Gecko
+ if (!tinyMCE.isMSIE && this.isHidden() && tinyMCE.getParam('auto_reset_designmode'))
+ eval('try { this.getDoc().designMode = "On"; } catch(e) {}');
+ },
-TinyMCE.prototype.insertLink = function(href, target, title, onclick, style_class) {
- tinyMCE.execCommand('mceBeginUndoLevel');
+ isHidden : function() {
+ if (tinyMCE.isMSIE)
+ return false;
- 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;
+ var s = this.getSel();
- if (!linkElement) {
- linkElement = doc.createElement("a");
- newLink = true;
+ // Weird, wheres that cursor selection?
+ return (!s || !s.rangeCount || s.rangeCount == 0);
+ },
+
+ isDirty : function() {
+ // Is content modified and not in a submit procedure
+ return this.startContent != tinyMCE.trim(this.getBody().innerHTML) && !tinyMCE.isNotDirty;
+ },
+
+ _mergeElements : function(scmd, pa, ch, override) {
+ if (scmd == "removeformat") {
+ pa.className = "";
+ pa.style.cssText = "";
+ ch.className = "";
+ ch.style.cssText = "";
+ return;
}
- var mhref = href;
- var thref = eval(tinyMCE.settings['urlconverter_callback'] + "(href, linkElement);");
- mhref = tinyMCE.getParam('convert_urls') ? href : mhref;
+ var st = tinyMCE.parseStyle(tinyMCE.getAttrib(pa, "style"));
+ var stc = tinyMCE.parseStyle(tinyMCE.getAttrib(ch, "style"));
+ var className = tinyMCE.getAttrib(pa, "class");
+
+ className += " " + tinyMCE.getAttrib(ch, "class");
+
+ if (override) {
+ for (var n in st) {
+ if (typeof(st[n]) == 'function')
+ continue;
- tinyMCE.setAttrib(linkElement, 'href', thref);
- tinyMCE.setAttrib(linkElement, 'mce_href', mhref);
- tinyMCE.setAttrib(linkElement, 'target', target);
- tinyMCE.setAttrib(linkElement, 'title', title);
- tinyMCE.setAttrib(linkElement, 'onclick', onclick);
- tinyMCE.setAttrib(linkElement, 'class', style_class);
+ stc[n] = st[n];
+ }
+ } else {
+ for (var n in stc) {
+ if (typeof(stc[n]) == 'function')
+ continue;
- if (newLink) {
- linkElement.appendChild(this.selectedElement.cloneNode(true));
- this.selectedElement.parentNode.replaceChild(linkElement, this.selectedElement);
+ st[n] = stc[n];
+ }
}
- return;
- }
+ tinyMCE.setAttrib(pa, "style", tinyMCE.serializeStyle(st));
+ tinyMCE.setAttrib(pa, "class", tinyMCE.trim(className));
+ ch.className = "";
+ ch.style.cssText = "";
+ ch.removeAttribute("class");
+ ch.removeAttribute("style");
+ },
- if (!this.linkElement && this.selectedInstance) {
- if (tinyMCE.isSafari) {
- tinyMCE.execCommand("mceInsertContent", false, '' + this.selectedInstance.getSelectedHTML() + ' ');
- } else
- this.selectedInstance.contentDocument.execCommand("createlink", false, tinyMCE.uniqueURL);
+ _setUseCSS : function(b) {
+ var d = this.getDoc();
- tinyMCE.linkElement = this.getElementByAttributeValue(this.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL);
+ try {d.execCommand("useCSS", false, !b);} catch (ex) {}
+ try {d.execCommand("styleWithCSS", false, b);} catch (ex) {}
- var elementArray = this.getElementsByAttributeValue(this.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL);
+ if (!tinyMCE.getParam("table_inline_editing"))
+ try {d.execCommand('enableInlineTableEditing', false, "false");} catch (ex) {}
- for (var i=0; i ';
+ case "JustifyCenter":
+ img.removeAttribute('align');
- 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, tinyMCE.uniqueURL);
+ // Is centered
+ var div = tinyMCE.getParentElement(focusElm, "div");
+ if (div && div.style.textAlign == "center") {
+ // Remove div
+ if (div.nodeName == "DIV" && div.childNodes.length == 1 && div.parentNode)
+ div.parentNode.replaceChild(img, div);
+ } else {
+ // Add div
+ var div = this.getDoc().createElement("div");
+ div.style.textAlign = 'center';
+ div.appendChild(img);
+ focusElm.parentNode.replaceChild(div, focusElm);
+ }
- tinyMCE.imgElement = this.getElementByAttributeValue(this.selectedInstance.contentDocument.body, "img", "src", tinyMCE.uniqueURL);
+ this.selection.selectNode(img);
+ this.repaint();
+ tinyMCE.triggerNodeChange();
+ return;
+
+ case "JustifyRight":
+ if (align == 'right')
+ img.removeAttribute('align');
+ else
+ img.setAttribute('align', 'right');
+
+ // Remove the div
+ var div = focusElm.parentNode;
+ if (div && div.nodeName == "DIV" && div.childNodes.length == 1 && div.parentNode)
+ div.parentNode.replaceChild(img, div);
+
+ this.selection.selectNode(img);
+ this.repaint();
+ tinyMCE.triggerNodeChange();
+ return;
+ }
}
- }
- if (this.imgElement) {
- var needsRepaint = false;
- var msrc = src;
+ if (tinyMCE.settings['force_br_newlines']) {
+ var alignValue = "";
- src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, tinyMCE.imgElement);");
+ if (doc.selection.type != "Control") {
+ switch (command) {
+ case "JustifyLeft":
+ alignValue = "left";
+ break;
- if (tinyMCE.getParam('convert_urls'))
- msrc = src;
+ case "JustifyCenter":
+ alignValue = "center";
+ break;
- if (onmouseover && onmouseover != "")
- onmouseover = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, tinyMCE.imgElement);") + "';";
+ case "JustifyFull":
+ alignValue = "justify";
+ break;
- if (onmouseout && onmouseout != "")
- onmouseout = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, tinyMCE.imgElement);") + "';";
+ case "JustifyRight":
+ alignValue = "right";
+ break;
+ }
- // Use alt as title if it's undefined
- if (typeof(title) == "undefined")
- title = alt;
+ if (alignValue != "") {
+ var rng = doc.selection.createRange();
- if (width != this.imgElement.getAttribute("width") || height != this.imgElement.getAttribute("height") || align != this.imgElement.getAttribute("align"))
- needsRepaint = true;
+ if ((divElm = tinyMCE.getParentElement(rng.parentElement(), "div")) != null)
+ divElm.setAttribute("align", alignValue);
+ else if (rng.pasteHTML && rng.htmlText.length > 0)
+ rng.pasteHTML('' + rng.htmlText + "
");
- tinyMCE.setAttrib(this.imgElement, 'src', src);
- tinyMCE.setAttrib(this.imgElement, 'mce_src', msrc);
- 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);
+ tinyMCE.triggerNodeChange();
+ return;
+ }
+ }
+ }
- // Fix for bug #989846 - Image resize bug
- if (width && width != "")
- this.imgElement.style.pixelWidth = width;
+ switch (command) {
+ case "mceRepaint":
+ this.repaint();
+ return true;
- if (height && height != "")
- this.imgElement.style.pixelHeight = height;
+ case "InsertUnorderedList":
+ case "InsertOrderedList":
+ var tag = (command == "InsertUnorderedList") ? "ul" : "ol";
- if (needsRepaint)
- tinyMCE.selectedInstance.repaint();
- }
+ if (tinyMCE.isSafari)
+ this.execCommand("mceInsertContent", false, "<" + tag + "> <" + tag + ">");
+ else
+ this.getDoc().execCommand(command, user_interface, value);
- tinyMCE.execCommand('mceEndUndoLevel');
-};
+ tinyMCE.triggerNodeChange();
+ break;
-TinyMCE.prototype.getElementByAttributeValue = function(node, element_name, attrib, value) {
- var elements = this.getElementsByAttributeValue(node, element_name, attrib, value);
- if (elements.length == 0)
- return null;
+ case "Strikethrough":
+ if (tinyMCE.isSafari)
+ this.execCommand("mceInsertContent", false, "" + this.selection.getSelectedHTML() + " ");
+ else
+ this.getDoc().execCommand(command, user_interface, value);
- return elements[0];
-};
+ tinyMCE.triggerNodeChange();
+ break;
-TinyMCE.prototype.getElementsByAttributeValue = function(node, element_name, attrib, value) {
- var elements = new Array();
+ case "mceSelectNode":
+ this.selection.selectNode(value);
+ tinyMCE.triggerNodeChange();
+ tinyMCE.selectedNode = value;
+ break;
- if (node && node.nodeName.toLowerCase() == element_name) {
- if (node.getAttribute(attrib) && node.getAttribute(attrib).indexOf(value) != -1)
- elements[elements.length] = node;
- }
+ case "FormatBlock":
+ if (value == null || value == "") {
+ var elm = tinyMCE.getParentElement(this.getFocusElement(), "p,div,h1,h2,h3,h4,h5,h6,pre,address,blockquote,dt,dl,dd,samp");
- if (node && node.hasChildNodes()) {
- for (var x=0, n=node.childNodes.length; x', 'gi').test(value))
+ value = value.replace(/[^a-z]/gi, '');
- return elements;
-};
+ if (tinyMCE.isMSIE && new RegExp('blockquote|code|samp', 'gi').test(value)) {
+ var b = this.selection.getBookmark();
+ this.getDoc().execCommand("FormatBlock", false, '');
+ tinyMCE.renameElement(tinyMCE.getParentBlockElement(this.getFocusElement()), value);
+ this.selection.moveToBookmark(b);
+ } else
+ this.getDoc().execCommand("FormatBlock", false, value);
+ }
-TinyMCE.prototype.isBlockElement = function(node) {
- return node != null && node.nodeType == 1 && this.blockRegExp.test(node.nodeName);
-};
+ tinyMCE.triggerNodeChange();
-TinyMCE.prototype.getParentBlockElement = function(node) {
- // Search up the tree for block element
- while (node) {
- if (this.blockRegExp.test(node.nodeName))
- return node;
+ break;
- node = node.parentNode;
- }
+ case "mceRemoveNode":
+ if (!value)
+ value = tinyMCE.getParentElement(this.getFocusElement());
- return null;
-};
+ 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.prototype.getNodeTree = function(node, node_array, type, node_name) {
- if (typeof(type) == "undefined" || node.nodeType == type && (typeof(node_name) == "undefined" || node.nodeName == node_name))
- node_array[node_array.length] = node;
+ tinyMCE.triggerNodeChange();
- if (node.hasChildNodes()) {
- for (var i=0; i=0; i--) {
+ var elm = nodes[i];
+ var isNew = tinyMCE.getAttrib(elm, "mce_new") == "true";
+
+ elm.removeAttribute("mce_new");
+
+ // Is only child a element
+ if (elm.childNodes && elm.childNodes.length == 1 && elm.childNodes[0].nodeType == 1) {
+ //tinyMCE.debug("merge1" + isNew);
+ this._mergeElements(scmd, elm, elm.childNodes[0], isNew);
+ continue;
+ }
- start = prot + "//" + host + portPart + "/";
+ // Is I the only child
+ if (elm.parentNode.childNodes.length == 1 && !invalidRe.test(elm.nodeName) && !invalidRe.test(elm.parentNode.nodeName)) {
+ //tinyMCE.debug("merge2" + isNew + "," + elm.nodeName + "," + elm.parentNode.nodeName);
+ if (invalidParentsRe == null || !invalidParentsRe.test(elm.parentNode.nodeName))
+ this._mergeElements(scmd, elm.parentNode, elm, false);
+ }
+ }
- if (url.indexOf(start) == 0)
- url = url.substring(start.length-1);
- }
+ // Remove empty wrappers
+ var nodes = doc.getElementsByTagName(wrapper);
+ for (var i=nodes.length-1; i>=0; i--) {
+ var elm = nodes[i];
+ var isEmpty = true;
+
+ // Check if it has any attribs
+ var tmp = doc.createElement("body");
+ tmp.appendChild(elm.cloneNode(false));
+
+ // Is empty span, remove it
+ tmp.innerHTML = tmp.innerHTML.replace(new RegExp('style=""|class=""', 'gi'), '');
+ //tinyMCE.debug(tmp.innerHTML);
+ if (new RegExp('', 'gi').test(tmp.innerHTML)) {
+ for (var x=0; x 0) {
+ value = tinyMCE.replaceVar(value, "selection", selectedText);
+ tinyMCE.execCommand('mceInsertContent', false, value);
+ }
- if (up['host'])
- url += up['host'];
+ tinyMCE.triggerNodeChange();
+ break;
- if (up['port'])
- url += ":" + up['port'];
+ 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;
- if (up['path'])
- url += up['path'];
+ case "mceSetCSSClass":
+ this.execCommand("SetStyleInfo", false, {command : "setattrib", name : "class", value : value});
+ break;
- if (up['query'])
- url += "?" + up['query'];
+ case "mceInsertRawHTML":
+ var key = 'tiny_mce_marker';
- if (up['anchor'])
- url += "#" + up['anchor'];
+ this.execCommand('mceBeginUndoLevel');
- return url;
-};
+ // Insert marker key
+ this.execCommand('mceInsertContent', false, key);
-/**
- * Converts an absolute path to relative path.
- */
-TinyMCE.prototype.convertAbsoluteURLToRelativeURL = function(base_url, url_to_relative) {
- var baseURL = this.parseURL(base_url);
- var targetURL = this.parseURL(url_to_relative);
- var strTok1;
- var strTok2;
- var breakPoint = 0;
- var outPath = "";
- var forceSlash = false;
+ // Store away scroll pos
+ var scrollX = this.getDoc().body.scrollLeft + this.getDoc().documentElement.scrollLeft;
+ var scrollY = this.getDoc().body.scrollTop + this.getDoc().documentElement.scrollTop;
- if (targetURL.path == "")
- targetURL.path = "/";
- else
- forceSlash = true;
+ // Find marker and replace with RAW HTML
+ var html = this.getBody().innerHTML;
+ if ((pos = html.indexOf(key)) != -1)
+ tinyMCE.setInnerHTML(this.getBody(), html.substring(0, pos) + value + html.substring(pos + key.length));
- // Crop away last path part
- base_url = baseURL.path.substring(0, baseURL.path.lastIndexOf('/'));
- strTok1 = base_url.split('/');
- strTok2 = targetURL.path.split('/');
+ // Restore scoll pos
+ this.contentWindow.scrollTo(scrollX, scrollY);
- if (strTok1.length >= strTok2.length) {
- for (var i=0; i= strTok2.length || strTok1[i] != strTok2[i]) {
- breakPoint = i + 1;
- break;
- }
- }
- }
+ this.execCommand('mceEndUndoLevel');
- if (strTok1.length < strTok2.length) {
- for (var i=0; i= strTok1.length || strTok1[i] != strTok2[i]) {
- breakPoint = i + 1;
break;
- }
- }
- }
- if (breakPoint == 1)
- return targetURL.path;
+ case "mceInsertContent":
+ // Force empty string
+ if (!value)
+ value = '';
- for (var i=0; i<(strTok1.length-(breakPoint-1)); i++)
- outPath += "../";
+ var insertHTMLFailed = false;
+ this.getWin().focus();
- for (var i=breakPoint-1; i=0; i--) {
- if (baseURLParts[i].length == 0)
- continue;
+ rng.selectNode(value);
+ rng.collapse(false);
- newBaseURLParts[newBaseURLParts.length] = baseURLParts[i];
- }
- baseURLParts = newBaseURLParts.reverse();
+ sel.addRange(rng);
+ } else
+ rng.collapse(false);
- // 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;
+ tinyMCE.fixGeckoBaseHREFBug(2, this.getDoc(), value);
+ } else {
+ var rng = doc.selection.createRange();
+ var c = value.indexOf('";
}
- }
- return h;
-};
+ if (hc) {
+ cn = n.childNodes;
-TinyMCE.prototype.getOuterHTML = function(e) {
- if (tinyMCE.isMSIE)
- return e.outerHTML;
+ for (i=0, l=cn.length; i';
- var d = e.ownerDocument.createElement("body");
- d.innerHTML = h;
- e.parentNode.replaceChild(d.firstChild, e);
-};
+ return h;
+ },
-TinyMCE.prototype.insertAfter = function(nc, rc){
- if (rc.nextSibling)
- rc.parentNode.insertBefore(nc, rc.nextSibling);
- else
- rc.parentNode.appendChild(nc);
-};
+ _serializeAttribute : function(n, r, an) {
+ var av = '', t, os = this.settings.on_save;
-TinyMCE.prototype.cleanupAnchors = function(doc) {
- var an = doc.getElementsByTagName("a");
+ if (os && (an.indexOf('mce_') == 0 || an.indexOf('_moz') == 0))
+ return '';
- for (var i=0; i=0; x--)
- tinyMCE.insertAfter(cn[x], an[i]);
+ if (os && this.mceAttribs[an])
+ av = this._getAttrib(n, this.mceAttribs[an]);
+
+ if (av.length == 0)
+ av = this._getAttrib(n, an);
+
+ if (av.length == 0 && r.defaultAttribs && (t = r.defaultAttribs[an])) {
+ av = t;
+
+ if (av == "mce_empty")
+ return " " + an + '=""';
}
- }
-};
-TinyMCE.prototype._setHTML = function(doc, html_content) {
- // Force closed anchors open
- //html_content = html_content.replace(new RegExp(' ', 'gi'), ' ');
+ if (r.forceAttribs && (t = r.forceAttribs[an]))
+ av = t;
- html_content = tinyMCE.cleanupHTMLCode(html_content);
+ if (os && av.length != 0 && this.settings.url_converter.length != 0 && /^(src|href|longdesc)$/.test(an))
+ av = eval(this.settings.url_converter + '(this, n, av)');
- // Try innerHTML if it fails use pasteHTML in MSIE
- try {
- tinyMCE.setInnerHTML(doc.body, html_content);
- } catch (e) {
- if (this.isMSIE)
- doc.body.createTextRange().pasteHTML(html_content);
- }
+ if (av.length != 0 && r.validAttribValues && r.validAttribValues[an] && !r.validAttribValues[an].test(av))
+ return "";
+
+ if (av.length != 0 && av == "{$uid}")
+ av = "uid_" + (this.idCount++);
+
+ if (av.length != 0)
+ return " " + an + "=" + '"' + this.xmlEncode(av) + '"';
+
+ return "";
+ },
+
+ formatHTML : function(h) {
+ var s = this.settings, p = '', i = 0, li = 0, o = '', l;
+
+ h = h.replace(/\r/g, ''); // Windows sux, isn't carriage return a thing of the past :)
+ h = '\n' + h;
+ h = h.replace(new RegExp('\\n\\s+', 'gi'), '\n'); // Remove previous formatting
+ h = h.replace(this.nlBeforeRe, '\n<$1$2>');
+ h = h.replace(this.nlAfterRe, '<$1$2>\n');
+ h = h.replace(this.nlBeforeAfterRe, '\n<$1$2$3>\n');
+ h += '\n';
+
+ //tinyMCE.debug(h);
+
+ while ((i = h.indexOf('\n', i + 1)) != -1) {
+ if ((l = h.substring(li + 1, i)).length != 0) {
+ if (this.ouRe.test(l) && p.length >= s.indent_levels)
+ p = p.substring(s.indent_levels);
- // 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 127 || c == 60 || c == 62 || c == 38 || c == 39 || c == 34)
+ o += '' + c + ";";
+ else
+ o += String.fromCharCode(c);
+ }
+
+ return o;
+ }
+
+ return s;
+ },
+
+ split : function(re, s) {
+ var c = s.split(re);
+ var i, l, o = new Array();
+
+ for (i=0, l=c.length; 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*)?", "
");
+ this.entitiesDone = true;
}
+ },
- // Always set the htmlText output
- tinyMCE.setInnerHTML(doc.body, html);
- }
-
- tinyMCE.cleanupAnchors(doc);
-
- if (tinyMCE.getParam("convert_fonts_to_spans"))
- tinyMCE.convertSpansToFonts(doc);
-};
-
-TinyMCE.prototype.getImageSrc = function(str) {
- var pos = -1;
+ _setupRules : function() {
+ var s = this.settings;
- if (!str)
- return "";
+ // Setup default rule
+ if (!this.rulesDone) {
+ this.addRuleStr(s.valid_elements);
+ this.addRuleStr(s.extended_valid_elements);
- if ((pos = str.indexOf('this.src=')) != -1) {
- var src = str.substring(pos + 10);
+ this.rulesDone = true;
+ }
+ },
- src = src.substring(0, src.indexOf('\''));
+ _isDuplicate : function(n) {
+ var i;
- return src;
- }
+ if (!this.settings.fix_content_duplication)
+ return false;
- return "";
-};
+ if (tinyMCE.isMSIE && !tinyMCE.isOpera && n.nodeType == 1) {
+ // Mark elements
+ if (n.mce_serialized == this.serializationId)
+ return true;
-TinyMCE.prototype._getElementById = function(element_id) {
- var elm = document.getElementById(element_id);
- if (!elm) {
- // Check for element in forms
- for (var j=0; j gets converted to .
+ h = h.replace(/\s\/>/g, '>');
+
+ // Since MSIE auto generated emtpy P tags some times we must tell it to keep the real ones
+ h = h.replace(/]*)>\u00A0?<\/p>/gi, '
'); // Keep empty paragraphs
+ h = h.replace(/]*)>\s* \s*<\/p>/gi, '
'); // Keep empty paragraphs
+ h = h.replace(/]*)>\s+<\/p>/gi, '
'); // Keep empty paragraphs
- if (typeof(editor_id) == "undefined" && typeof(doc) == "undefined") {
- var instance;
+ // Remove first comment
+ e.innerHTML = tinyMCE.uniqueTag + h;
+ e.firstChild.removeNode(true);
- for (var instanceName in tinyMCE.instances) {
- instance = tinyMCE.instances[instanceName];
- if (!tinyMCE.isInstance(instance))
- continue;
+ // Remove weird auto generated empty paragraphs unless it's supposed to be there
+ nl = e.getElementsByTagName("p");
+ for (i=nl.length-1; i>=0; i--) {
+ n = nl[i];
- break;
+ if (n.nodeName == 'P' && !n.hasChildNodes() && !n.mce_keep)
+ n.parentNode.removeChild(n);
}
-
- doc = instance.getDoc();
- }
-
- if (typeof(doc) == "undefined") {
- var instance = tinyMCE.getInstanceById(editor_id);
- doc = instance.getDoc();
+ } else {
+ h = this.fixGeckoBaseHREFBug(1, e, h);
+ e.innerHTML = h;
+ this.fixGeckoBaseHREFBug(2, e, h);
}
+};
- if (doc) {
- var styles = tinyMCE.isMSIE ? doc.styleSheets : doc.styleSheets;
+TinyMCE_Engine.prototype.getOuterHTML = function(e) {
+ if (tinyMCE.isMSIE)
+ return e.outerHTML;
- if (styles && styles.length > 0) {
- for (var x=0; x 0)
- tinyMCE.cssClasses = output;
-
- return output;
+ return e;
};
-TinyMCE.prototype.regexpReplace = function(in_str, reg_exp, replace_str, opts) {
- if (in_str == null)
- return in_str;
-
- if (typeof(opts) == "undefined")
- opts = 'g';
-
- var re = new RegExp(reg_exp, opts);
- return in_str.replace(re, replace_str);
-};
+TinyMCE_Engine.prototype.getNodeTree = function(n, na, t, nn) {
+ var i;
-TinyMCE.prototype.trim = function(str) {
- return str.replace(/^\s*|\s*$/g, "");
-};
+ if (typeof(t) == "undefined" || n.nodeType == t && (typeof(nn) == "undefined" || n.nodeName == nn))
+ na[na.length] = n;
-TinyMCE.prototype.cleanupEventStr = function(str) {
- str = "" + str;
- str = str.replace('function anonymous()\n{\n', '');
- str = str.replace('\n}', '');
- str = str.replace(/^return true;/gi, ''); // Remove event blocker
+ if (n.hasChildNodes()) {
+ for (i=0; 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]);
+ do {
+ for (var i=0; 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;
- }
+ n = n.parentNode;
}
- // 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;
+ return null;
};
-TinyMCE.prototype._getThemeFunction = function(suffix, skip_plugins) {
- if (skip_plugins)
- return 'TinyMCE_' + tinyMCE.settings['theme'] + suffix;
+TinyMCE_Engine.prototype.getAttrib = function(elm, name, default_value) {
+ if (typeof(default_value) == "undefined")
+ default_value = "";
- var themePlugins = tinyMCE.getParam('plugins', '', true, ',');
- var templateFunction;
+ // Not a element
+ if (!elm || elm.nodeType != 1)
+ return default_value;
- // 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;
- }
+ var v = elm.getAttribute(name);
- return 'TinyMCE_' + tinyMCE.settings['theme'] + suffix;
-};
+ // Try className for class attrib
+ if (name == "class" && !v)
+ v = elm.className;
+ // Workaround for a issue with Firefox 1.5rc2+
+ if (tinyMCE.isGecko && name == "src" && elm.src != null && elm.src != "")
+ v = elm.src;
-TinyMCE.prototype.isFunc = function(func_name) {
- if (func_name == null || func_name == "")
- return false;
+ // Workaround for a issue with Firefox 1.5rc2+
+ if (tinyMCE.isGecko && name == "href" && elm.href != null && elm.href != "")
+ v = elm.href;
+
+ if (name == "http-equiv" && tinyMCE.isMSIE)
+ v = elm.httpEquiv;
- return eval("typeof(" + func_name + ")") != "undefined";
+ if (name == "style" && !tinyMCE.isOpera)
+ v = elm.style.cssText;
+
+ return (v && v != "") ? v : default_value;
};
-TinyMCE.prototype.exec = function(func_name, args) {
- var str = func_name + '(';
+TinyMCE_Engine.prototype.setAttrib = function(element, name, value, fix_value) {
+ if (typeof(value) == "number" && value != null)
+ value = "" + value;
- // Add all arguments
- for (var i=3; i 1 && tinyMCE.currentConfig != this.settings['index']) {
- tinyMCE.settings = this.settings;
- tinyMCE.currentConfig = this.settings['index'];
- }
+ return a;
};
-TinyMCEControl.prototype.convertAllRelativeURLs = function() {
- var body = this.getBody();
+TinyMCE_Engine.prototype.addCSSClass = function(e, c, b) {
+ var o = this.removeCSSClass(e, c);
- // Convert all image URL:s to absolute URL
- var elms = body.getElementsByTagName("img");
- for (var i=0; i-1; i--) {
+ if (ar[i].specified && ar[i].nodeValue)
+ ne.setAttribute(ar[i].nodeName.toLowerCase(), ar[i].nodeValue);
}
- }
-};
-TinyMCEControl.prototype.getSelectedHTML = function() {
- if (tinyMCE.isSafari) {
- // Not realy perfect!!
+ ar = e.childNodes;
+ for (i=0; i= strTok2.length) {
+ for (var i=0; i= strTok2.length || strTok1[i] != strTok2[i]) {
+ breakPoint = i + 1;
+ break;
+ }
}
- } else {
- var sel = this.getSel();
-
- if (!sel)
- return;
-
- if (tinyMCE.isSafari) {
- sel.realSelection.setBaseAndExtent(node, 0, node, node.innerText.length);
+ }
- if (collapse) {
- if (to_start)
- sel.realSelection.collapseToStart();
- else
- sel.realSelection.collapseToEnd();
+ if (strTok1.length < strTok2.length) {
+ for (var i=0; i= strTok1.length || strTok1[i] != strTok2[i]) {
+ breakPoint = i + 1;
+ break;
}
-
- this.scrollToNode(node);
-
- return;
}
+ }
- var rng = this.getDoc().createRange();
-
- if (select_text_node) {
- // Find first textnode in tree
- var nodes = tinyMCE.getNodeTree(node, new Array(), 3);
- if (nodes.length > 0)
- rng.selectNodeContents(nodes[0]);
- else
- rng.selectNodeContents(node);
- } else
- rng.selectNode(node);
+ if (breakPoint == 1)
+ return targetURL.path;
- 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);
- }
+ for (var i=0; i<(strTok1.length-(breakPoint-1)); i++)
+ outPath += "../";
- sel.removeAllRanges();
- sel.addRange(rng);
+ for (var i=breakPoint-1; i scrollY && pos.absTop < (scrollY - 25 + height)))
- this.contentWindow.scrollTo(pos.absLeft, pos.absTop - height + 25);
-};
+ if ((pos = fileName.lastIndexOf('/')) != -1)
+ fileName = fileName.substring(pos + 1);
-TinyMCEControl.prototype.getBody = function() {
- return this.getDoc().body;
-};
+ // Is local anchor
+ if (fileName == targetURL.path && targetURL.anchor != "")
+ targetURL.path = "";
-TinyMCEControl.prototype.getDoc = function() {
- return this.contentWindow.document;
-};
+ // If empty and not local anchor force filename or slash
+ if (targetURL.path == "" && !targetURL.anchor)
+ targetURL.path = fileName != "" ? fileName : "/";
-TinyMCEControl.prototype.getWin = function() {
- return this.contentWindow;
+ return this.serializeURL(targetURL);
};
-TinyMCEControl.prototype.getSel = function() {
- if (tinyMCE.isMSIE && !tinyMCE.isOpera)
- 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();
+TinyMCE_Engine.prototype.convertRelativeToAbsoluteURL = function(base_url, relative_url) {
+ var baseURL = this.parseURL(base_url);
+ var relURL = this.parseURL(relative_url);
- 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");
+ if (relative_url == "" || relative_url.charAt(0) == '/' || relative_url.indexOf('://') != -1 || relative_url.indexOf('mailto:') != -1 || relative_url.indexOf('javascript:') != -1)
+ return relative_url;
- elm.innerHTML = html;
+ // Split parts
+ baseURLParts = baseURL['path'].split('/');
+ relURLParts = relURL['path'].split('/');
- return elm.firstChild;
- }
+ // Remove empty chunks
+ var newBaseURLParts = new Array();
+ for (var i=baseURLParts.length-1; i>=0; i--) {
+ if (baseURLParts[i].length == 0)
+ continue;
- return doc.createTextNode("UNSUPPORTED, DUE TO LIMITATIONS IN SAFARI!");
- };
+ newBaseURLParts[newBaseURLParts.length] = baseURLParts[i];
+ }
+ baseURLParts = newBaseURLParts.reverse();
- rng.deleteContents = function () {
- doc.execCommand("Delete", false, "");
- };
+ // 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;
- return rng;
+ if (relURLParts[i] == '..') {
+ numBack++;
+ continue;
}
- // 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;};
+ if (numBack > 0) {
+ numBack--;
+ continue;
+ }
- return newSel;
+ newRelURLParts[newRelURLParts.length] = relURLParts[i];
}
- return sel;
-};
-
-TinyMCEControl.prototype.getRng = function() {
- var sel = this.getSel();
- if (sel == null)
- return null;
+ relURLParts = newRelURLParts.reverse();
- if (tinyMCE.isMSIE && !tinyMCE.isOpera)
- return sel.createRange();
+ // Remove end from absolute path
+ var len = baseURLParts.length-numBack;
+ var absPath = (len <= 0 ? "" : "/") + baseURLParts.slice(0, len).join('/') + "/" + relURLParts.join('/');
+ var start = "", end = "";
- if (tinyMCE.isSafari) {
- var rng = this.getDoc().createRange();
- var sel = this.getSel().realSelection;
+ // Build output URL
+ relURL.protocol = baseURL.protocol;
+ relURL.host = baseURL.host;
+ relURL.port = baseURL.port;
- rng.setStart(sel.baseNode, sel.baseOffset);
- rng.setEnd(sel.extentNode, sel.extentOffset);
+ // Re-add trailing slash if it's removed
+ if (relURL.path.charAt(relURL.path.length-1) == "/")
+ absPath += "/";
- return rng;
- }
+ relURL.path = absPath;
- return this.getSel().getRangeAt(0);
+ return this.serializeURL(relURL);
};
-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 + "><" + blockName + "> " + blockName + ">";
- paraAfter = body.childNodes[1];
+ if (href && href != "") {
+ href = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], href);
+ elms[i].setAttribute("href", href);
}
+ }
+};
- this.selectNode(paraAfter, true, true);
+/* file:jscripts/tiny_mce/classes/TinyMCE_Array.class.js */
- return true;
- }
+TinyMCE_Engine.prototype.clearArray = function(a) {
+ for (var k in a)
+ a[k] = null;
- // Place first part within new paragraph
- if (startChop.nodeName == blockName)
- rngBefore.setStart(startChop, 0);
- else
- rngBefore.setStartBefore(startChop);
+ return a;
+};
- rngBefore.setEnd(startNode, startOffset);
- paraBefore.appendChild(rngBefore.cloneContents());
+/* file:jscripts/tiny_mce/classes/TinyMCE_Event.class.js */
- // 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 + "
");
+ if (rng.item) {
+ e = rng.item(0);
- tinyMCE.triggerNodeChange();
- return;
+ nl = doc.getElementsByTagName(e.nodeName);
+ for (i=0; i <" + tag + ">");
- else
- this.getDoc().execCommand(command, user_interface, value);
-
- tinyMCE.triggerNodeChange();
- break;
+ if (tinyMCE.isGecko) {
+ s = tinyMCE.getParentElement(rng.startContainer);
+ for (si=0; si" + this.getSelectedHTML() + "");
- else
- this.getDoc().execCommand(command, user_interface, value);
+ e = tinyMCE.getParentElement(rng.endContainer);
+ for (ei=0; ei bookmark.index) {
+ try {
+ rng.addElement(nl[bookmark.index]);
+ } catch (ex) {
+ // Might be thrown if the node no longer exists
}
}
} else {
- var felm = this.getFocusElement();
- if (sel.isCollapsed || (/td|tr|tbody|table/ig.test(felm.nodeName) && sel.anchorNode == felm.parentNode))
- parentElm = felm;
+ rng = inst.getSel().createRange();
+ rng.moveToElementText(inst.getBody());
+ rng.collapse(true);
+ rng.moveStart('character', bookmark.start);
+ rng.moveEnd('character', bookmark.length);
}
- // Whole element selected
- if (parentElm && !invalidRe.test(parentElm.nodeName)) {
- if (scmd == "setstyle")
- tinyMCE.setStyleAttrib(parentElm, sname, svalue);
+ rng.select();
- if (scmd == "setattrib")
- tinyMCE.setAttrib(parentElm, sname, svalue);
+ win.scrollTo(bookmark.scrollX, bookmark.scrollY);
+ return true;
+ }
- if (scmd == "removeformat") {
- parentElm.style.cssText = '';
- tinyMCE.setAttrib(parentElm, 'class', '');
- }
+ if (tinyMCE.isGecko && bookmark.rng) {
+ sel.removeAllRanges();
+ sel.addRange(bookmark.rng);
+ win.scrollTo(bookmark.scrollX, bookmark.scrollY);
+ return true;
+ }
- // Remove style/attribs from all children
- var ch = tinyMCE.getNodeTree(parentElm, new Array(), 1);
- for (var z=0; z bookmark.start)
+ rng.setStart(nl[bookmark.start].childNodes[bookmark.startIndex], bookmark.startOffset);
+
+ nl = doc.getElementsByTagName(bookmark.endTag);
+ if (nl.length > bookmark.end)
+ rng.setEnd(nl[bookmark.end].childNodes[bookmark.endIndex], bookmark.endOffset);
+
+ sel.removeAllRanges();
+ sel.addRange(rng);
+ /* } catch {
+ // Ignore
+ }*/
- if (scmd == "setstyle")
- tinyMCE.setStyleAttrib(ch[z], sname, '');
+ win.scrollTo(bookmark.scrollX, bookmark.scrollY);
+ return true;
+ }
- if (scmd == "setattrib")
- tinyMCE.setAttrib(ch[z], sname, '');
+ return false;
+ },
- if (scmd == "removeformat") {
- ch[z].style.cssText = '';
- tinyMCE.setAttrib(ch[z], 'class', '');
- }
- }
- } else {
- doc.execCommand("fontname", false, "#mce_temp_font#");
- var elementArray = tinyMCE.getElementsByAttributeValue(this.getBody(), "font", "face", "#mce_temp_font#");
+ selectNode : function(node, collapse, select_text_node, to_start) {
+ var inst = this.instance, sel, rng, nodes;
- // Change them all
- for (var x=0; x=0; i--) {
- var elm = nodes[i];
- var isNew = tinyMCE.getAttrib(elm, "mce_new") == "true";
-
- elm.removeAttribute("mce_new");
-
- // Is only child a element
- if (elm.childNodes && elm.childNodes.length == 1 && elm.childNodes[0].nodeType == 1) {
- //tinyMCE.debug("merge1" + isNew);
- this._mergeElements(scmd, elm, elm.childNodes[0], isNew);
- continue;
+ if (collapse) {
+ if (to_start)
+ sel.collapseToStart();
+ else
+ sel.collapseToEnd();
}
- // Is I the only child
- if (elm.parentNode.childNodes.length == 1 && !invalidRe.test(elm.nodeName) && !invalidRe.test(elm.parentNode.nodeName)) {
- //tinyMCE.debug("merge2" + isNew + "," + elm.nodeName + "," + elm.parentNode.nodeName);
- if (invalidParentsRe == null || !invalidParentsRe.test(elm.parentNode.nodeName))
- this._mergeElements(scmd, elm.parentNode, elm, false);
- }
- }
+ this.scrollToNode(node);
- // Remove empty wrappers
- var nodes = doc.getElementsByTagName(wrapper);
- for (var i=nodes.length-1; i>=0; i--) {
- var elm = nodes[i];
- var isEmpty = true;
+ return;
+ }
- // Check if it has any attribs
- var tmp = doc.createElement("body");
- tmp.appendChild(elm.cloneNode(false));
+ rng = inst.getDoc().createRange();
- // Is empty span, remove it
- tmp.innerHTML = tmp.innerHTML.replace(new RegExp('style=""|class=""', 'gi'), '');
- //tinyMCE.debug(tmp.innerHTML);
- if (new RegExp('', 'gi').test(tmp.innerHTML)) {
- for (var x=0; x 0)
+ rng.selectNodeContents(nodes[0]);
+ else
+ rng.selectNodeContents(node);
+ } else
+ rng.selectNode(node);
- elm.parentNode.removeChild(elm);
- }
+ 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);
}
- // Re add the visual aids
- if (scmd == "removeformat")
- tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this);
+ sel.removeAllRanges();
+ sel.addRange(rng);
+ }
- tinyMCE.triggerNodeChange();
+ this.scrollToNode(node);
- break;
+ // Set selected element
+ tinyMCE.selectedElement = null;
+ if (node.nodeType == 1)
+ tinyMCE.selectedElement = node;
+ },
- case "FontName":
- if (value == null) {
- var s = this.getSel();
-
- // Find font and select it
- if (tinyMCE.isGecko && s.isCollapsed) {
- var f = tinyMCE.getParentElement(this.getFocusElement(), "font");
-
- if (f != null)
- this.selectNode(f, false);
- }
-
- // Remove format
- this.getDoc().execCommand("RemoveFormat", false, null);
-
- // Collapse range if font was found
- if (f != null && tinyMCE.isGecko) {
- var r = this.getRng().cloneRange();
- r.collapse(true);
- s.removeAllRanges();
- s.addRange(r);
- }
- } else
- this.getDoc().execCommand('FontName', false, value);
+ scrollToNode : function(node) {
+ var inst = this.instance;
+ var pos, doc, scrollX, scrollY, height;
+
+ // Scroll to node position
+ pos = tinyMCE.getAbsPosition(node);
+ doc = inst.getDoc();
+ scrollX = doc.body.scrollLeft + doc.documentElement.scrollLeft;
+ scrollY = doc.body.scrollTop + doc.documentElement.scrollTop;
+ height = tinyMCE.isMSIE ? document.getElementById(inst.editorId).style.pixelHeight : inst.targetElement.clientHeight;
+
+ // Only scroll if out of visible area
+ if (!tinyMCE.settings['auto_resize'] && !(pos.absTop > scrollY && pos.absTop < (scrollY - 25 + height)))
+ inst.contentWindow.scrollTo(pos.absLeft, pos.absTop - height + 25);
+ },
+
+ getSel : function() {
+ var inst = this.instance;
- if (tinyMCE.isGecko)
- window.setTimeout('tinyMCE.triggerNodeChange(false);', 1);
+ if (tinyMCE.isMSIE && !tinyMCE.isOpera)
+ return inst.getDoc().selection;
- return;
+ return inst.contentWindow.getSelection();
+ },
- case "FontSize":
- this.getDoc().execCommand('FontSize', false, value);
+ getRng : function() {
+ var inst = this.instance;
+ var sel = this.getSel();
- if (tinyMCE.isGecko)
- window.setTimeout('tinyMCE.triggerNodeChange(false);', 1);
+ if (sel == null)
+ return null;
- return;
+ if (tinyMCE.isMSIE && !tinyMCE.isOpera)
+ return sel.createRange();
- case "forecolor":
- this.getDoc().execCommand('forecolor', false, value);
- break;
+ if (tinyMCE.isSafari && !sel.getRangeAt)
+ return '' + window.getSelection();
- case "HiliteColor":
- if (tinyMCE.isGecko) {
- this.setUseCSS(true);
- this.getDoc().execCommand('hilitecolor', false, value);
- this.setUseCSS(false);
- } else
- this.getDoc().execCommand('BackColor', false, value);
- break;
+ return sel.getRangeAt(0);
+ },
- 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;}');
-
- if (tinyMCE.isOpera && cmdFailed)
- alert('Currently not supported by your browser, use keyboard shortcuts instead.');
-
- // 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');
+ getFocusElement : function() {
+ var inst = this.instance;
- return;
- } else
- tinyMCE.triggerNodeChange();
- break;
+ if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
+ var doc = inst.getDoc();
+ var rng = doc.selection.createRange();
- case "mceSetContent":
- if (!value)
- value = "";
-
- // Call custom cleanup code
- value = tinyMCE.storeAwayURLs(value);
- value = tinyMCE._customCleanup(this, "insert_to_editor", value);
- tinyMCE._setHTML(doc, value);
- tinyMCE.setInnerHTML(doc.body, tinyMCE._cleanupHTML(this, doc, tinyMCE.settings, doc.body));
- this.convertAllRelativeURLs();
- tinyMCE.handleVisualAid(doc.body, true, this.visualAid, this);
- tinyMCE._setEventsEnabled(doc.body, false);
- return true;
+ // if (rng.collapse)
+ // rng.collapse(true);
- case "mceLink":
- var selectedText = "";
+ var elm = rng.item ? rng.item(0) : rng.parentElement();
+ } else {
+ if (inst.isHidden())
+ return inst.getBody();
- if (tinyMCE.isMSIE) {
- var rng = doc.selection.createRange();
- selectedText = rng.text;
- } else
- selectedText = this.getSel().toString();
+ var sel = this.getSel();
+ var rng = this.getRng();
- if (!tinyMCE.linkElement) {
- if ((tinyMCE.selectedElement.nodeName.toLowerCase() != "img") && (selectedText.length <= 0))
- return;
+ if (!sel || !rng)
+ return null;
+
+ var elm = rng.commonAncestorContainer;
+ //var elm = (sel && sel.anchorNode) ? sel.anchorNode : null;
+
+ // Handle selection a image or other control like element such as anchors
+ if (!rng.collapsed) {
+ // Is selection small
+ if (rng.startContainer == rng.endContainer) {
+ if (rng.startOffset - rng.endOffset < 2) {
+ if (rng.startContainer.hasChildNodes())
+ elm = rng.startContainer.childNodes[rng.startOffset];
+ }
+ }
}
- var href = "", target = "", title = "", onclick = "", action = "insert", style_class = "";
+ // Get the element parent of the node
+ elm = tinyMCE.getParentElement(elm);
- if (tinyMCE.selectedElement.nodeName.toLowerCase() == "a")
- tinyMCE.linkElement = tinyMCE.selectedElement;
+ //if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img")
+ // elm = tinyMCE.selectedElement;
+ }
- // Is anchor not a link
- if (tinyMCE.linkElement != null && tinyMCE.getAttrib(tinyMCE.linkElement, 'href') == "")
- tinyMCE.linkElement = null;
+ return elm;
+ }
+};
- 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, 'onclick');
- style_class = tinyMCE.getAttrib(tinyMCE.linkElement, 'class');
+/* file:jscripts/tiny_mce/classes/TinyMCE_UndoRedo.class.js */
- // Try old onclick to if copy/pasted content
- if (onclick == "")
- onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
+function TinyMCE_UndoRedo(inst) {
+ this.instance = inst;
+ this.undoLevels = new Array();
+ this.undoIndex = 0;
+ this.typingUndoIndex = -1;
+ this.undoRedo = true;
+};
- onclick = tinyMCE.cleanupEventStr(onclick);
+TinyMCE_UndoRedo.prototype = {
+ add : function(l) {
+ var b;
- href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
+ if (l) {
+ this.undoLevels[this.undoLevels.length] = l;
+ return true;
+ }
- // Use mce_href if defined
- mceRealHref = tinyMCE.getAttrib(tinyMCE.linkElement, 'mce_href');
- if (mceRealHref != "") {
- href = mceRealHref;
+ var inst = this.instance;
- if (tinyMCE.getParam('convert_urls'))
- href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
- }
+ if (this.typingUndoIndex != -1) {
+ this.undoIndex = this.typingUndoIndex;
+ // tinyMCE.debug("Override: " + this.undoIndex);
+ }
- action = "update";
- }
+ var newHTML = tinyMCE.trim(inst.getBody().innerHTML);
+ if (this.undoLevels[this.undoIndex] && newHTML != this.undoLevels[this.undoIndex].content) {
+ //tinyMCE.debug(newHTML, this.undoLevels[this.undoIndex]);
- 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, inline : "yes"});
- }
- break;
+ tinyMCE.dispatchCallback(inst, 'onchange_callback', 'onChange', inst);
- case "mceImage":
- var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = "";
- var title = "", onmouseover = "", onmouseout = "", action = "insert";
- var img = tinyMCE.imgElement;
+ // Time to compress
+ var customUndoLevels = tinyMCE.settings['custom_undo_redo_levels'];
+ if (customUndoLevels != -1 && this.undoLevels.length > customUndoLevels) {
+ for (var i=0; i 0) {
+ this.undoIndex--;
+ tinyMCE.setInnerHTML(inst.getBody(), this.undoLevels[this.undoIndex].content);
+ inst.repaint();
+ if (inst.settings.custom_undo_redo_restore_selection)
+ inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark);
+ }
- if (tinyMCE.getParam('convert_urls'))
- src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
- }
+ // tinyMCE.debug("Undo - undo levels:" + this.undoLevels.length + ", undo index: " + this.undoIndex);
+ },
- if (onmouseover != "")
- onmouseover = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, img, true);");
+ redo : function() {
+ var inst = this.instance;
- if (onmouseout != "")
- onmouseout = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, img, true);");
+ tinyMCE.execCommand("mceEndTyping");
- action = "update";
- }
+ if (this.undoIndex < (this.undoLevels.length-1)) {
+ this.undoIndex++;
+ tinyMCE.setInnerHTML(inst.getBody(), this.undoLevels[this.undoIndex].content);
+ inst.repaint();
+// if (this.undoIndex > 0)
+// inst.selection.moveToBookmark(this.undoLevels[this.undoIndex-1].bookmark);
+ if (inst.settings.custom_undo_redo_restore_selection)
+ inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark);
+ // tinyMCE.debug("Redo - undo levels:" + this.undoLevels.length + ", undo index: " + this.undoIndex);
+ }
- 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, inline : "yes"});
- break;
+ tinyMCE.triggerNodeChange();
+ }
+};
- case "mceCleanup":
- tinyMCE._setHTML(this.contentDocument, this.getBody().innerHTML);
- tinyMCE.setInnerHTML(this.getBody(), tinyMCE._cleanupHTML(this, this.contentDocument, this.settings, this.getBody(), this.visualAid));
- this.convertAllRelativeURLs();
- tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this);
- tinyMCE._setEventsEnabled(this.getBody(), false);
- this.repaint();
- tinyMCE.triggerNodeChange();
- break;
-
- case "mceReplaceContent":
- this.getWin().focus();
-
- var selectedText = "";
-
- if (tinyMCE.isMSIE) {
- var rng = doc.selection.createRange();
- selectedText = rng.text;
- } else
- selectedText = this.getSel().toString();
+/* file:jscripts/tiny_mce/classes/TinyMCE_ForceParagraphs.class.js */
- if (selectedText.length > 0) {
- value = tinyMCE.replaceVar(value, "selection", selectedText);
- tinyMCE.execCommand('mceInsertContent', false, value);
+var TinyMCE_ForceParagraphs = {
+ _insertPara : function(inst, e) {
+ function isEmpty(para) {
+ function isEmptyHTML(html) {
+ return html.replace(new RegExp('[ \t\r\n]+', 'g'), '').toLowerCase() == "";
}
- tinyMCE.triggerNodeChange();
- break;
+ // Check for images
+ if (para.getElementsByTagName("img").length > 0)
+ return false;
- 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);
+ // Check for tables
+ if (para.getElementsByTagName("table").length > 0)
+ return false;
- if (targetNode) {
- targetNode.setAttribute(value['name'], value['value']);
- tinyMCE.triggerNodeChange();
- }
+ // 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 + "><" + blockName + "> " + blockName + ">";
+ paraAfter = body.childNodes[1];
+ }
- case "mceAddUndoLevel":
- if (tinyMCE.settings['custom_undo_redo'] && this.undoRedo) {
- // tinyMCE.debug("add level");
-
- if (this.typingUndoIndex != -1) {
- this.undoIndex = this.typingUndoIndex;
- // tinyMCE.debug("Override: " + this.undoIndex);
- }
-
- var newHTML = tinyMCE.trim(this.getBody().innerHTML);
- if (newHTML != this.undoLevels[this.undoIndex]) {
- tinyMCE.executeCallback('onchange_callback', '_onchange', 0, this);
-
- // Time to compress
- var customUndoLevels = tinyMCE.settings['custom_undo_redo_levels'];
- if (customUndoLevels != -1 && this.undoLevels.length > customUndoLevels) {
- for (var i=0; i 0) {
- this.undoIndex--;
- tinyMCE.setInnerHTML(this.getBody(), this.undoLevels[this.undoIndex]);
- this.repaint();
- }
+ // Check if it's a empty paragraph
+ if (isEmpty(paraBefore))
+ paraBefore.innerHTML = " ";
- // tinyMCE.debug("Undo - undo levels:" + this.undoLevels.length + ", undo index: " + this.undoIndex);
- tinyMCE.triggerNodeChange();
- } else
- this.getDoc().execCommand(command, user_interface, value);
- break;
+ // Check if it's a empty paragraph
+ if (isEmpty(paraAfter))
+ paraAfter.innerHTML = " ";
- case "Redo":
- if (tinyMCE.settings['custom_undo_redo']) {
- tinyMCE.execCommand("mceEndTyping");
+ // Create a range around everything
+ var rng = doc.createRange();
- if (this.undoIndex < (this.undoLevels.length-1)) {
- this.undoIndex++;
- tinyMCE.setInnerHTML(this.getBody(), this.undoLevels[this.undoIndex]);
- this.repaint();
- // tinyMCE.debug("Redo - undo levels:" + this.undoLevels.length + ", undo index: " + this.undoIndex);
- }
+ if (!startChop.previousSibling && startChop.parentNode.nodeName.toUpperCase() == blockName) {
+ rng.setStartBefore(startChop.parentNode);
+ } else {
+ if (rngBefore.startContainer.nodeName.toUpperCase() == blockName && rngBefore.startOffset == 0)
+ rng.setStartBefore(rngBefore.startContainer);
+ else
+ rng.setStart(rngBefore.startContainer, rngBefore.startOffset);
+ }
- tinyMCE.triggerNodeChange();
- } else
- this.getDoc().execCommand(command, user_interface, value);
- break;
+ if (!endChop.nextSibling && endChop.parentNode.nodeName.toUpperCase() == blockName)
+ rng.setEndAfter(endChop.parentNode);
+ else
+ rng.setEnd(rngAfter.endContainer, rngAfter.endOffset);
- case "mceToggleVisualAid":
- this.visualAid = !this.visualAid;
- tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this);
- tinyMCE.triggerNodeChange();
- break;
+ // Delete all contents and insert new paragraphs
+ rng.deleteContents();
+ rng.insertNode(paraAfter);
+ rng.insertNode(paraBefore);
+ //tinyMCE.debug("2", paraBefore.innerHTML, paraAfter.innerHTML);
+
+ // Normalize
+ paraAfter.normalize();
+ paraBefore.normalize();
- case "Indent":
- this.getDoc().execCommand(command, user_interface, value);
- tinyMCE.triggerNodeChange();
- if (tinyMCE.isMSIE) {
- var n = tinyMCE.getParentElement(this.getFocusElement(), "blockquote");
- do {
- if (n && n.nodeName == "BLOCKQUOTE") {
- n.removeAttribute("dir");
- n.removeAttribute("style");
- }
- } while (n != null && (n = n.parentNode) != null);
- }
- break;
+ inst.selection.selectNode(paraAfter, true, true);
- case "removeformat":
- var text = this.getSelectedText();
+ return true;
+ },
- if (tinyMCE.isOpera) {
- this.getDoc().execCommand("RemoveFormat", false, null);
- return;
- }
+ _handleBackSpace : function(inst) {
+ var r = inst.getRng(), sn = r.startContainer, nv, s = false;
- if (tinyMCE.isMSIE) {
- try {
- var rng = doc.selection.createRange();
- rng.execCommand("RemoveFormat", false, null);
- } catch (e) {
- // Do nothing
- }
+ if (sn && sn.nextSibling && sn.nextSibling.nodeName == "BR") {
+ nv = sn.nodeValue;
- this.execCommand("SetStyleInfo", false, {command : "removeformat"});
- } else {
- this.getDoc().execCommand(command, user_interface, value);
+ // Handle if a backspace is pressed after a space character #bug 1466054
+ if (nv != null && nv.length >= r.startOffset && nv.charAt(r.startOffset - 1) == ' ')
+ s = true;
- this.execCommand("SetStyleInfo", false, {command : "removeformat"});
- }
+ // Only remove BRs if we are at the end of line #bug 1464152
+ if (nv != null && r.startOffset == nv.length)
+ sn.nextSibling.parentNode.removeChild(sn.nextSibling);
+ }
- // Remove class
- if (text.length == 0)
- this.execCommand("mceSetCSSClass", false, "");
+ return s;
+ }
+};
- tinyMCE.triggerNodeChange();
- break;
+/* file:jscripts/tiny_mce/classes/TinyMCE_Layer.class.js */
- default:
- this.getDoc().execCommand(command, user_interface, value);
+function TinyMCE_Layer(id, bm) {
+ this.id = id;
+ this.blockerElement = null;
+ this.events = false;
+ this.element = null;
+ this.blockMode = typeof(bm) != 'undefined' ? bm : true;
+ this.doc = document;
+};
- if (tinyMCE.isGecko)
- window.setTimeout('tinyMCE.triggerNodeChange(false);', 1);
- else
- tinyMCE.triggerNodeChange();
- }
+TinyMCE_Layer.prototype = {
+ moveRelativeTo : function(re, p) {
+ var rep = this.getAbsPosition(re);
+ var w = parseInt(re.offsetWidth);
+ var h = parseInt(re.offsetHeight);
+ var e = this.getElement();
+ var ew = parseInt(e.offsetWidth);
+ var eh = parseInt(e.offsetHeight);
+ var x, y;
- // Add undo level after modification
- if (command != "mceAddUndoLevel" && command != "Undo" && command != "Redo" && command != "mceStartTyping" && command != "mceEndTyping")
- tinyMCE.execCommand("mceAddUndoLevel");
-};
+ switch (p) {
+ case "tl":
+ x = rep.absLeft;
+ y = rep.absTop;
+ break;
-TinyMCEControl.prototype.queryCommandValue = function(command) {
- try {
- return this.getDoc().queryCommandValue(command);
- } catch (ex) {
- return null;
- }
-};
+ case "tr":
+ x = rep.absLeft + w;
+ y = rep.absTop;
+ break;
-TinyMCEControl.prototype.queryCommandState = function(command) {
- return this.getDoc().queryCommandState(command);
-};
+ case "bl":
+ x = rep.absLeft;
+ y = rep.absTop + h;
+ break;
-TinyMCEControl.prototype.onAdd = function(replace_element, form_element_name, target_document) {
- var targetDoc = target_document ? target_document : document;
+ case "br":
+ x = rep.absLeft + w;
+ y = rep.absTop + h;
+ break;
- this.targetDoc = targetDoc;
+ case "cc":
+ x = rep.absLeft + (w / 2) - (ew / 2);
+ y = rep.absTop + (h / 2) - (eh / 2);
+ break;
+ }
- tinyMCE.themeURL = tinyMCE.baseURL + "/themes/" + this.settings['theme'];
- this.settings['themeurl'] = tinyMCE.themeURL;
+ this.moveTo(x, y);
+ },
- if (!replace_element) {
- alert("Error: Could not find the target element.");
- return false;
- }
+ moveBy : function(x, y) {
+ var e = this.getElement();
+ this.moveTo(parseInt(e.style.left) + x, parseInt(e.style.top) + y);
+ },
+
+ moveTo : function(x, y) {
+ var e = this.getElement();
+
+ e.style.left = x + "px";
+ e.style.top = y + "px";
+
+ this.updateBlocker();
+ },
+
+ resizeBy : function(w, h) {
+ var e = this.getElement();
+ this.resizeTo(parseInt(e.style.width) + w, parseInt(e.style.height) + h);
+ },
+
+ resizeTo : function(w, h) {
+ var e = this.getElement();
+
+ if (w != null)
+ e.style.width = w + "px";
+
+ if (h != null)
+ e.style.height = h + "px";
+
+ this.updateBlocker();
+ },
+
+ show : function() {
+ this.getElement().style.display = 'block';
+ this.updateBlocker();
+ },
+
+ hide : function() {
+ this.getElement().style.display = 'none';
+ this.updateBlocker();
+ },
+
+ isVisible : function() {
+ return this.getElement().style.display == 'block';
+ },
+
+ getElement : function() {
+ if (!this.element)
+ this.element = this.doc.getElementById(this.id);
+
+ return this.element;
+ },
+
+ setBlockMode : function(s) {
+ this.blockMode = s;
+ },
+
+ updateBlocker : function() {
+ var e, b, x, y, w, h;
+
+ b = this.getBlocker();
+ if (b) {
+ if (this.blockMode) {
+ e = this.getElement();
+ x = this.parseInt(e.style.left);
+ y = this.parseInt(e.style.top);
+ w = this.parseInt(e.offsetWidth);
+ h = this.parseInt(e.offsetHeight);
+
+ b.style.left = x + 'px';
+ b.style.top = y + 'px';
+ b.style.width = w + 'px';
+ b.style.height = h + 'px';
+ b.style.display = e.style.display;
+ } else
+ b.style.display = 'none';
+ }
+ },
- 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;
- }
+ getBlocker : function() {
+ var d, b;
- var editorTemplate = eval(templateFunction + '(this.settings, this.editorId);');
+ if (!this.blockerElement && this.blockMode) {
+ d = this.doc;
+ b = d.createElement("iframe");
- var deltaWidth = editorTemplate['delta_width'] ? editorTemplate['delta_width'] : 0;
- var deltaHeight = editorTemplate['delta_height'] ? editorTemplate['delta_height'] : 0;
- var html = '' + editorTemplate['html'];
+ b.style.cssText = 'display: none; position: absolute; left: 0; top: 0';
+ b.src = 'javascript:false;';
+ b.frameBorder = '0';
+ b.scrolling = 'no';
- var templateFunction = tinyMCE._getThemeFunction('_handleNodeChange', true);
- if (eval("typeof(" + templateFunction + ")") != 'undefined')
- this.settings['handleNodeChangeCallback'] = templateFunction;
+ d.body.appendChild(b);
+ this.blockerElement = b;
+ }
- html = tinyMCE.replaceVar(html, "editor_id", this.editorId);
- this.settings['default_document'] = tinyMCE.baseURL + "/blank.htm";
+ return this.blockerElement;
+ },
- this.settings['old_width'] = this.settings['width'];
- this.settings['old_height'] = this.settings['height'];
+ getAbsPosition : function(n) {
+ var p = {absLeft : 0, absTop : 0};
- // Set default width, height
- if (this.settings['width'] == -1)
- this.settings['width'] = replace_element.offsetWidth;
+ while (n) {
+ p.absLeft += n.offsetLeft;
+ p.absTop += n.offsetTop;
+ n = n.offsetParent;
+ }
- if (this.settings['height'] == -1)
- this.settings['height'] = replace_element.offsetHeight;
+ return p;
+ },
- // Try the style width
- if (this.settings['width'] == 0)
- this.settings['width'] = replace_element.style.width;
+ create : function(n, c, p) {
+ var d = this.doc, e = d.createElement(n);
- // Try the style height
- if (this.settings['height'] == 0)
- this.settings['height'] = replace_element.style.height;
+ e.setAttribute('id', this.id);
- // If no width/height then default to 320x240, better than nothing
- if (this.settings['width'] == 0)
- this.settings['width'] = 320;
+ if (c)
+ e.className = c;
- if (this.settings['height'] == 0)
- this.settings['height'] = 240;
+ if (!p)
+ p = d.body;
- 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;
+ p.appendChild(e);
- // Special % handling
- if (("" + this.settings['width']).indexOf('%') != -1)
- this.settings['area_width'] = "100%";
+ return this.element = e;
+ },
- if (("" + this.settings['height']).indexOf('%') != -1)
- this.settings['area_height'] = "100%";
+ parseInt : function(s) {
+ if (s == null || s == '')
+ return 0;
- if (("" + replace_element.style.width).indexOf('%') != -1) {
- this.settings['width'] = replace_element.style.width;
- this.settings['area_width'] = "100%";
+ return parseInt(s);
}
+};
- if (("" + replace_element.style.height).indexOf('%') != -1) {
- this.settings['height'] = replace_element.style.height;
- this.settings['area_height'] = "100%";
- }
+/* file:jscripts/tiny_mce/classes/TinyMCE_Menu.class.js */
- html = tinyMCE.applyTemplate(html);
+function TinyMCE_Menu() {
+ var id;
- this.settings['width'] = this.settings['old_width'];
- this.settings['height'] = this.settings['old_height'];
+ if (typeof(tinyMCE.menuCounter) == "undefined")
+ tinyMCE.menuCounter = 0;
- this.visualAid = this.settings['visual'];
- this.formTargetElementId = form_element_name;
+ id = "mc_menu_" + tinyMCE.menuCounter++;
- // Get replace_element contents
- if (replace_element.nodeName == "TEXTAREA" || replace_element.nodeName == "INPUT")
- this.startContent = replace_element.value;
- else
- this.startContent = replace_element.innerHTML;
+ TinyMCE_Layer.call(this, id, true);
- // 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 += ' ';
+ this.id = id;
+ this.items = new Array();
+ this.needsUpdate = true;
+};
- html += ' ';
+// Extends the TinyMCE_Layer class
+TinyMCE_Menu.prototype = tinyMCE.extend(TinyMCE_Layer.prototype, {
+ init : function(s) {
+ var n;
- // Output HTML and set editable
- if (!tinyMCE.isMSIE) {
- var rng = replace_element.ownerDocument.createRange();
- rng.setStartBefore(replace_element);
+ // Default params
+ this.settings = {
+ separator_class : 'mceMenuSeparator',
+ title_class : 'mceMenuTitle',
+ disabled_class : 'mceMenuDisabled',
+ menu_class : 'mceMenu',
+ drop_menu : true
+ };
- var fragment = rng.createContextualFragment(html);
- replace_element.parentNode.replaceChild(fragment, replace_element);
- } else
- replace_element.outerHTML = html;
- } else {
- html += ' ';
+ for (n in s)
+ this.settings[n] = s[n];
- // Just hide the textarea element
- this.oldTargetElement = replace_element;
+ this.create('div', this.settings.menu_class);
+ },
- if (!tinyMCE.settings['debug'])
- this.oldTargetElement.style.display = "none";
+ clear : function() {
+ this.items = new Array();
+ },
- // Output HTML and set editable
- if (!tinyMCE.isMSIE) {
- var rng = replace_element.ownerDocument.createRange();
- rng.setStartBefore(replace_element);
+ addTitle : function(t) {
+ this.add({type : 'title', text : t});
+ },
- var fragment = rng.createContextualFragment(html);
+ addDisabled : function(t) {
+ this.add({type : 'disabled', text : t});
+ },
- if (tinyMCE.isGecko)
- tinyMCE.insertAfter(fragment, replace_element);
- else
- replace_element.parentNode.insertBefore(fragment, replace_element);
- } else
- replace_element.insertAdjacentHTML("beforeBegin", html);
- }
+ addSeparator : function() {
+ this.add({type : 'separator'});
+ },
- // Setup iframe
- var dynamicIFrame = false;
- var tElm = targetDoc.getElementById(this.editorId);
+ addItem : function(t, js) {
+ this.add({text : t, js : js});
+ },
- if (!tinyMCE.isMSIE) {
- if (tElm && tElm.nodeName.toLowerCase() == "span") {
- tElm = tinyMCE._createIFrame(tElm);
- dynamicIFrame = true;
- }
+ add : function(mi) {
+ this.items[this.items.length] = mi;
+ this.needsUpdate = true;
+ },
- this.targetElement = tElm;
- this.iframeElement = tElm;
- this.contentDocument = tElm.contentDocument;
- this.contentWindow = tElm.contentWindow;
+ update : function() {
+ var e = this.getElement(), h = '', i, t, m = this.items, s = this.settings;
- //this.getDoc().designMode = "on";
- } else {
- if (tElm && tElm.nodeName.toLowerCase() == "span")
- tElm = tinyMCE._createIFrame(tElm);
- else
- tElm = targetDoc.frames[this.editorId];
+ if (this.settings.drop_menu)
+ h += '';
- this.targetElement = tElm;
- this.iframeElement = targetDoc.getElementById(this.editorId);
+ h += '';
- if (tinyMCE.isOpera) {
- this.contentDocument = this.iframeElement.contentDocument;
- this.contentWindow = this.iframeElement.contentWindow;
- dynamicIFrame = true;
- } else {
- this.contentDocument = tElm.window.document;
- this.contentWindow = tElm.window;
- }
+ for (i=0; i';
+ break;
- // Setup base HTML
- var doc = this.contentDocument;
- if (dynamicIFrame) {
- var html = tinyMCE.getParam('doctype') + 'blank_page ';
+ case 'title':
+ h += ' ' + t + ' ';
+ break;
- try {
- if (!this.isHidden())
- this.getDoc().designMode = "on";
+ case 'disabled':
+ h += '' + t + ' ';
+ break;
- doc.open();
- doc.write(html);
- doc.close();
- } catch (e) {
- // Failed Mozilla 1.3
- this.getDoc().location.href = tinyMCE.baseURL + "/blank.htm";
+ default:
+ h += '' + t + ' ';
+ }
+
+ h += ' ';
}
- }
- // 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);
+ h += '
';
- tinyMCE.setupContent(this.editorId, true);
+ e.innerHTML = h;
- return true;
-};
+ this.needsUpdate = false;
+ this.updateBlocker();
+ },
-TinyMCEControl.prototype.getFocusElement = function() {
- if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
- var doc = this.getDoc();
- var rng = doc.selection.createRange();
+ show : function() {
+ var nl, i;
-// if (rng.collapse)
-// rng.collapse(true);
+ if (tinyMCE.lastMenu == this)
+ return;
- var elm = rng.item ? rng.item(0) : rng.parentElement();
- } else {
- if (this.isHidden())
- return this.getBody();
+ if (this.needsUpdate)
+ this.update();
- var sel = this.getSel();
- var rng = this.getRng();
+ if (tinyMCE.lastMenu && tinyMCE.lastMenu != this)
+ tinyMCE.lastMenu.hide();
- var elm = rng.commonAncestorContainer;
- //var elm = (sel && sel.anchorNode) ? sel.anchorNode : null;
+ TinyMCE_Layer.prototype.show.call(this);
- // Handle selection a image or other control like element such as anchors
- if (!rng.collapsed) {
- // Is selection small
- if (rng.startContainer == rng.endContainer) {
- if (rng.startOffset - rng.endOffset < 2) {
- if (rng.startContainer.hasChildNodes())
- elm = rng.startContainer.childNodes[rng.startOffset];
- }
- }
+ if (!tinyMCE.isOpera) {
+ // Accessibility stuff
+/* nl = this.getElement().getElementsByTagName("a");
+ if (nl.length > 0)
+ nl[0].focus();*/
}
- // Get the element parent of the node
- elm = tinyMCE.getParentElement(elm);
+ tinyMCE.lastMenu = this;
+ }
+});
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Debug.class.js */
+
+TinyMCE_Engine.prototype.debug = function() {
+ var m = "", e, a, i;
+
+ e = document.getElementById("tinymce_debug");
+ if (!e) {
+ var d = document.createElement("div");
+ d.setAttribute("className", "debugger");
+ d.className = "debugger";
+ d.innerHTML = 'Debug output: ';
- //if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img")
- // elm = tinyMCE.selectedElement;
+ document.body.appendChild(d);
+ e = document.getElementById("tinymce_debug");
}
- return elm;
-};
+ a = this.debug.arguments;
+ for (i=0; i';
- html += ' ';
@@ -57,10 +57,10 @@
var html = "";
html += '';
- html += ' ';
@@ -74,7 +74,7 @@
tinyMCEPopup.openBrowser(target_form_element, type, option);
}
-function selectByValue(form_obj, field_name, value, add_custom) {
+function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
if (!form_obj || !form_obj.elements[field_name])
return;
@@ -84,7 +84,7 @@
for (var i=0; i x && mx < x + w && my > y && my < y + h)) {
+ MCLayer.visibleLayer = null;
+
+ if (l.autoHideCallback && l.autoHideCallback(l, e, mx, my))
+ return true;
+
+ l.hide();
+ }
+ }
+ },
+
+ addCSSClass : function(e, c) {
+ this.removeCSSClass(e, c);
+ var a = this.explode(' ', e.className);
+ a[a.length] = c;
+ e.className = a.join(' ');
+ },
+
+ removeCSSClass : function(e, c) {
+ var a = this.explode(' ', e.className), i;
+
+ for (i=0; isetQuery( $query );
- $id = $database->loadResult();
- $mambot = new mosMambot( $database );
- $mambot->load( $id );
+ $database->loadObject($mambot);
+
$params = new mosParameters( $mambot->params );
$theme = $params->get( 'theme', 'advanced' );
@@ -51,8 +50,10 @@
$invalid_elements = $params->def( 'invalid_elements', 'script,applet,iframe' );
$newlines = $params->def( 'newlines', 0 );
$cleanup = $params->def( 'cleanup', 1 );
+ $cleanup_startup = $params->def( 'cleanup_startup', 0 );
$compressed = $params->def( 'compressed', 0 );
-
+ $relative_urls = $params->def( 'relative_urls', 0 );
+
// Plugins
// preview
$preview = $params->def( 'preview', 1 );
@@ -76,6 +77,18 @@
$hr = $params->def( 'hr', 1 );
// fullscreen
$fullscreen = $params->def( 'fullscreen', 1 );
+ // autosave
+ $autosave = $params->def( 'autosave', 0 );
+ // layer
+ $layer = $params->def( 'layer', 1 );
+ // style
+ $style = $params->def( 'style', 1 );
+
+ if ( $relative_urls ) {
+ $relative_urls = 'true';
+ } else {
+ $relative_urls = 'false';
+ }
if ( $content_css_custom ) {
$content_css = 'content_css : "'. $content_css_custom .'", ';
@@ -110,10 +123,16 @@
$elements[] = '';
if ( $cleanup ) {
- $cleanup = 'true';
+ $cleanup = 'true';
} else {
- $cleanup = 'false';
+ $cleanup = 'false';
}
+
+ if ( $cleanup_startup ) {
+ $cleanup_startup = 'true';
+ } else {
+ $cleanup_startup = 'false';
+ }
if ( $newlines ) {
$br_newlines = 'true';
@@ -178,11 +197,28 @@
$plugins[] = 'fullscreen';
$buttons3[] = 'fullscreen';
}
-
- $buttons2 = implode( ',', $buttons2 );
- $buttons3 = implode( ',', $buttons3 );
- $plugins = implode( ',', $plugins );
- $elements = implode( ',', $elements );
+ // autosave
+ if ( $autosave ) {
+ $plugins[] = 'autosave';
+ }
+ // layer
+ if ( $layer ) {
+ $plugins[] = 'layer';
+ $buttons2[] = 'insertlayer';
+ $buttons2[] = 'moveforward';
+ $buttons2[] = 'movebackward';
+ $buttons2[] = 'absolute';
+ }
+ // style
+ if ( $style ) {
+ $plugins[] = 'style';
+ $buttons3[] = 'styleprops';
+ }
+
+ $buttons2 = implode( ', ', $buttons2 );
+ $buttons3 = implode( ', ', $buttons3 );
+ $plugins = implode( ', ', $plugins );
+ $elements = implode( ', ', $elements );
return << ';
+ $buttons[] = ' ';
}
}
$buttons = implode( "", $buttons );
diff -urN joomla-1.0.7/mambots/editors/tinymce.xml joomla-1.0.10/mambots/editors/tinymce.xml
--- joomla-1.0.7/mambots/editors/tinymce.xml 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/editors/tinymce.xml 2006-06-25 16:54:36.000000000 -0400
@@ -15,7 +15,15 @@
Advanced
-
+
+ Off
+ On
+
+
+ Off
+ On
+
+
Off
On
@@ -28,6 +36,10 @@
Left to Right
Right to Left
+
+ Absolute
+ Relative
+
No
@@ -60,6 +72,14 @@
Hide
Show
+
+ Hide
+ Show
+
+
+ Hide
+ Show
+
Hide
@@ -67,7 +87,7 @@
-
+
Hide
Show
diff -urN joomla-1.0.7/mambots/search/categories.searchbot.php joomla-1.0.10/mambots/search/categories.searchbot.php
--- joomla-1.0.7/mambots/search/categories.searchbot.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/search/categories.searchbot.php 2006-06-25 16:54:19.000000000 -0400
@@ -1,6 +1,6 @@
_search_mambot_params['categories']) ) {
+ // load mambot params info
+ $query = "SELECT params"
+ . "\n FROM #__mambots"
+ . "\n WHERE element = 'categories.searchbot'"
+ . "\n AND folder = 'search'"
+ ;
+ $database->setQuery( $query );
+ $database->loadObject($mambot);
+
+ // save query to class variable
+ $_MAMBOTS->_search_mambot_params['categories'] = $mambot;
+ }
+
+ // pull query data from class variable
+ $mambot = $_MAMBOTS->_search_mambot_params['categories'];
- // load mambot params info
- $query = "SELECT id"
- . "\n FROM #__mambots"
- . "\n WHERE element = 'categories.searchbot'"
- . "\n AND folder = 'search'"
- ;
- $database->setQuery( $query );
- $id = $database->loadResult();
- $mambot = new mosMambot( $database );
- $mambot->load( $id );
$botParams = new mosParameters( $mambot->params );
$limit = $botParams->def( 'search_limit', 50 );
@@ -75,7 +83,9 @@
. "\n OR a.title LIKE '%$text%'"
. "\n OR a.description LIKE '%$text%' )"
. "\n AND a.published = 1"
+ . "\n AND s.published = 1"
. "\n AND a.access <= $my->gid"
+ . "\n AND s.access <= $my->gid"
. "\n AND ( m.type = 'content_section' OR m.type = 'content_blog_section'"
. "\n OR m.type = 'content_category' OR m.type = 'content_blog_category')"
. "\n GROUP BY a.id"
diff -urN joomla-1.0.7/mambots/search/contacts.searchbot.php joomla-1.0.10/mambots/search/contacts.searchbot.php
--- joomla-1.0.7/mambots/search/contacts.searchbot.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/search/contacts.searchbot.php 2006-06-25 16:54:19.000000000 -0400
@@ -1,6 +1,6 @@
_search_mambot_params['contacts']) ) {
+ // load mambot params info
+ $query = "SELECT params"
+ . "\n FROM #__mambots"
+ . "\n WHERE element = 'contacts.searchbot'"
+ . "\n AND folder = 'search'"
+ ;
+ $database->setQuery( $query );
+ $database->loadObject($mambot);
+
+ // save query to class variable
+ $_MAMBOTS->_search_mambot_params['contacts'] = $mambot;
+ }
+
+ // pull query data from class variable
+ $mambot = $_MAMBOTS->_search_mambot_params['contacts'];
- // load mambot params info
- $query = "SELECT id"
- . "\n FROM #__mambots"
- . "\n WHERE element = 'contacts.searchbot'"
- . "\n AND folder = 'search'"
- ;
- $database->setQuery( $query );
- $id = $database->loadResult();
- $mambot = new mosMambot( $database );
- $mambot->load( $id );
$botParams = new mosParameters( $mambot->params );
$limit = $botParams->def( 'search_limit', 50 );
@@ -71,9 +79,9 @@
. "\n '' AS created,"
. "\n CONCAT_WS( ' / ', '$section', b.title ) AS section,"
. "\n '2' AS browsernav,"
- . "\n CONCAT( 'index.php?option=com_contact&task=view&&contact_id=', a.id ) AS href"
+ . "\n CONCAT( 'index.php?option=com_contact&task=view&contact_id=', a.id ) AS href"
. "\n FROM #__contact_details AS a"
- . "\n INNER JOIN #__categories AS b ON b.id = a.catid AND b.access <= '$my->gid'"
+ . "\n INNER JOIN #__categories AS b ON b.id = a.catid"
. "\n WHERE ( a.name LIKE '%$text%'"
. "\n OR a.misc LIKE '%$text%'"
. "\n OR a.con_position LIKE '%$text%'"
@@ -85,6 +93,9 @@
. "\n OR a.telephone LIKE '%$text%'"
. "\n OR a.fax LIKE '%$text%' )"
. "\n AND a.published = 1"
+ . "\n AND b.published = 1"
+ . "\n AND a.access <= $my->gid"
+ . "\n AND b.access <= $my->gid"
. "\n GROUP BY a.id"
. "\n ORDER BY $order"
;
diff -urN joomla-1.0.7/mambots/search/content.searchbot.php joomla-1.0.10/mambots/search/content.searchbot.php
--- joomla-1.0.7/mambots/search/content.searchbot.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/search/content.searchbot.php 2006-06-25 16:54:19.000000000 -0400
@@ -1,6 +1,6 @@
setQuery( $query );
- $id = $database->loadResult();
- $mambot = new mosMambot( $database );
- $mambot->load( $id );
+ global $database, $my, $_MAMBOTS;
+
+ // check if param query has previously been processed
+ if ( !isset($_MAMBOTS->_search_mambot_params['content']) ) {
+ // load mambot params info
+ $query = "SELECT params"
+ . "\n FROM #__mambots"
+ . "\n WHERE element = 'content.searchbot'"
+ . "\n AND folder = 'search'"
+ ;
+ $database->setQuery( $query );
+ $database->loadObject($mambot);
+
+ // save query to class variable
+ $_MAMBOTS->_search_mambot_params['content'] = $mambot;
+ }
+
+ // pull query data from class variable
+ $mambot = $_MAMBOTS->_search_mambot_params['content'];
+
$botParams = new mosParameters( $mambot->params );
$limit = $botParams->def( 'search_limit', 50 );
+ $nonmenu = $botParams->def( 'nonmenu', 1 );
$nullDate = $database->getNullDate();
- $now = date( 'Y-m-d H:i:s', time()+$mosConfig_offset*60*60 );
+ $now = _CURRENT_SERVER_TIME;
$text = trim( $text );
if ($text == '') {
@@ -112,17 +120,20 @@
. "\n CONCAT(a.introtext, a.fulltext) AS text,"
. "\n CONCAT_WS( '/', u.title, b.title ) AS section,"
. "\n CONCAT( 'index.php?option=com_content&task=view&id=', a.id ) AS href,"
- . "\n '2' AS browsernav"
+ . "\n '2' AS browsernav,"
+ . "\n 'content' AS type"
. "\n FROM #__content AS a"
- . "\n INNER JOIN #__categories AS b ON b.id=a.catid AND b.access <= '$my->gid'"
- . "\n LEFT JOIN #__sections AS u ON u.id = a.sectionid"
+ . "\n INNER JOIN #__categories AS b ON b.id=a.catid"
+ . "\n INNER JOIN #__sections AS u ON u.id = a.sectionid"
. "\n WHERE ( $where )"
- . "\n AND a.state = '1'"
- . "\n AND a.access <= '$my->gid'"
- . "\n AND u.published = '1'"
- . "\n AND b.published = '1'"
- . "\n AND ( publish_up = '$nullDate' OR publish_up <= '$now' )"
- . "\n AND ( publish_down = '$nullDate' OR publish_down >= '$now' )"
+ . "\n AND a.state = 1"
+ . "\n AND u.published = 1"
+ . "\n AND b.published = 1"
+ . "\n AND a.access <= $my->gid"
+ . "\n AND b.access <= $my->gid"
+ . "\n AND u.access <= $my->gid"
+ . "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )"
+ . "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )"
. "\n GROUP BY a.id"
. "\n ORDER BY $order"
;
@@ -130,18 +141,21 @@
$list = $database->loadObjectList();
// search static content
- $query = "SELECT a.title AS title, a.created AS created,"
+ $query = "SELECT a.title AS title,"
+ . "\n a.created AS created,"
. "\n a.introtext AS text,"
+ . "\n '". _STATIC_CONTENT ."' AS section,"
. "\n CONCAT( 'index.php?option=com_content&task=view&id=', a.id, '&Itemid=', m.id ) AS href,"
- . "\n '2' as browsernav, 'Menu' AS section"
+ . "\n '2' AS browsernav,"
+ . "\n a.id"
. "\n FROM #__content AS a"
. "\n LEFT JOIN #__menu AS m ON m.componentid = a.id"
. "\n WHERE ($where)"
. "\n AND a.state = 1"
. "\n AND a.access <= $my->gid"
. "\n AND m.type = 'content_typed'"
- . "\n AND ( publish_up = '0000-00-00 00:00:00' OR publish_up <= '$now' )"
- . "\n AND ( publish_down = '0000-00-00 00:00:00' OR publish_down >= '$now' )"
+ . "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )"
+ . "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )"
. "\n ORDER BY ". ($morder ? $morder : $order)
;
$database->setQuery( $query, 0, $limit );
@@ -153,20 +167,60 @@
. "\n a.introtext AS text,"
. "\n CONCAT_WS( '/', '". _SEARCH_ARCHIVED ." ', u.title, b.title ) AS section,"
. "\n CONCAT('index.php?option=com_content&task=view&id=',a.id) AS href,"
- . "\n '2' AS browsernav"
+ . "\n '2' AS browsernav,"
+ . "\n 'content' AS type"
. "\n FROM #__content AS a"
- . "\n INNER JOIN #__categories AS b ON b.id=a.catid AND b.access <='$my->gid'"
- . "\n LEFT JOIN #__sections AS u ON u.id = a.sectionid"
+ . "\n INNER JOIN #__categories AS b ON b.id=a.catid"
+ . "\n INNER JOIN #__sections AS u ON u.id = a.sectionid"
. "\n WHERE ( $where )"
. "\n AND a.state = -1"
+ . "\n AND u.published = 1"
+ . "\n AND b.published = 1"
. "\n AND a.access <= $my->gid"
- . "\n AND ( publish_up = '0000-00-00 00:00:00' OR publish_up <= '$now' )"
- . "\n AND ( publish_down = '0000-00-00 00:00:00' OR publish_down >= '$now' )"
+ . "\n AND b.access <= $my->gid"
+ . "\n AND u.access <= $my->gid"
+ . "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )"
+ . "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )"
. "\n ORDER BY $order"
;
$database->setQuery( $query, 0, $limit );
$list3 = $database->loadObjectList();
- return array_merge( $list, $list2, $list3 );
+ // check if search of nonmenu linked static content is allowed
+ if ($nonmenu) {
+ // collect ids of static content items linked to menu items
+ // so they can be removed from query that follows
+ $ids = null;
+ if(count($list2)) {
+ foreach($list2 as $static) {
+ $ids[] = $static->id;
+ }
+ $ids = implode( '\',\'', $ids );
+ }
+
+ // search static content not connected to a menu
+ $query = "SELECT a.title AS title,"
+ . "\n a.created AS created,"
+ . "\n a.introtext AS text,"
+ . "\n '2' as browsernav, '". _STATIC_CONTENT ."' AS section,"
+ . "\n CONCAT( 'index.php?option=com_content&task=view&id=', a.id ) AS href,"
+ . "\n a.id"
+ . "\n FROM #__content AS a"
+ . "\n WHERE ($where)"
+ . "\n AND a.id NOT IN ( '$ids' )"
+ . "\n AND a.state = 1"
+ . "\n AND a.access <= $my->gid"
+ . "\n AND a.sectionid = 0"
+ . "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )"
+ . "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )"
+ . "\n ORDER BY $order"
+ ;
+ $database->setQuery( $query, 0, $limit );
+ $list4 = $database->loadObjectList();
+ } else {
+ $list4 = array();
+ }
+
+ return array_merge( $list, $list2, $list3, $list4 );
}
?>
\ No newline at end of file
diff -urN joomla-1.0.7/mambots/search/content.searchbot.xml joomla-1.0.10/mambots/search/content.searchbot.xml
--- joomla-1.0.7/mambots/search/content.searchbot.xml 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/search/content.searchbot.xml 2006-06-25 16:54:19.000000000 -0400
@@ -14,5 +14,9 @@
+
+ No
+ Yes
+
diff -urN joomla-1.0.7/mambots/search/newsfeeds.searchbot.php joomla-1.0.10/mambots/search/newsfeeds.searchbot.php
--- joomla-1.0.7/mambots/search/newsfeeds.searchbot.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/search/newsfeeds.searchbot.php 2006-06-25 16:54:19.000000000 -0400
@@ -1,6 +1,6 @@
_search_mambot_params['newsfeeds']) ) {
+ // load mambot params info
+ $query = "SELECT params"
+ . "\n FROM #__mambots"
+ . "\n WHERE element = 'newsfeeds.searchbot'"
+ . "\n AND folder = 'search'"
+ ;
+ $database->setQuery( $query );
+ $database->loadObject($mambot);
+
+ // save query to class variable
+ $_MAMBOTS->_search_mambot_params['newsfeeds'] = $mambot;
+ }
+
+ // pull query data from class variable
+ $mambot = $_MAMBOTS->_search_mambot_params['newsfeeds'];
- // load mambot params info
- $query = "SELECT id"
- . "\n FROM #__mambots"
- . "\n WHERE element = 'newsfeeds.searchbot'"
- . "\n AND folder = 'search'"
- ;
- $database->setQuery( $query );
- $id = $database->loadResult();
- $mambot = new mosMambot( $database );
- $mambot->load( $id );
$botParams = new mosParameters( $mambot->params );
$limit = $botParams->def( 'search_limit', 50 );
@@ -95,9 +103,11 @@
. "\n CONCAT( 'index.php?option=com_newsfeeds&task=view&feedid=', a.id ) AS href,"
. "\n '1' AS browsernav"
. "\n FROM #__newsfeeds AS a"
- . "\n INNER JOIN #__categories AS b ON b.id = a.catid AND b.access <= '$my->gid'"
+ . "\n INNER JOIN #__categories AS b ON b.id = a.catid"
. "\n WHERE ( $where )"
. "\n AND a.published = 1"
+ . "\n AND b.published = 1"
+ . "\n AND b.access <= $my->gid"
. "\n ORDER BY $order"
;
$database->setQuery( $query, 0, $limit );
diff -urN joomla-1.0.7/mambots/search/sections.searchbot.php joomla-1.0.10/mambots/search/sections.searchbot.php
--- joomla-1.0.7/mambots/search/sections.searchbot.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/search/sections.searchbot.php 2006-06-25 16:54:19.000000000 -0400
@@ -1,6 +1,6 @@
_search_mambot_params['sections']) ) {
+ // load mambot params info
+ $query = "SELECT params"
+ . "\n FROM #__mambots"
+ . "\n WHERE element = 'sections.searchbot'"
+ . "\n AND folder = 'search'"
+ ;
+ $database->setQuery( $query );
+ $database->loadObject($mambot);
+
+ // save query to class variable
+ $_MAMBOTS->_search_mambot_params['sections'] = $mambot;
+ }
+
+ // pull query data from class variable
+ $mambot = $_MAMBOTS->_search_mambot_params['sections'];
- // load mambot params info
- $query = "SELECT id"
- . "\n FROM #__mambots"
- . "\n WHERE element = 'sections.searchbot'"
- . "\n AND folder = 'search'"
- ;
- $database->setQuery( $query );
- $id = $database->loadResult();
- $mambot = new mosMambot( $database );
- $mambot->load( $id );
$botParams = new mosParameters( $mambot->params );
$limit = $botParams->def( 'search_limit', 50 );
diff -urN joomla-1.0.7/mambots/search/weblinks.searchbot.php joomla-1.0.10/mambots/search/weblinks.searchbot.php
--- joomla-1.0.7/mambots/search/weblinks.searchbot.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/mambots/search/weblinks.searchbot.php 2006-06-25 16:54:19.000000000 -0400
@@ -1,6 +1,6 @@
_search_mambot_params['weblinks']) ) {
+ // load mambot params info
+ $query = "SELECT params"
+ . "\n FROM #__mambots"
+ . "\n WHERE element = 'weblinks.searchbot'"
+ . "\n AND folder = 'search'"
+ ;
+ $database->setQuery( $query );
+ $database->loadObject($mambot);
+
+ // save query to class variable
+ $_MAMBOTS->_search_mambot_params['weblinks'] = $mambot;
+ }
+
+ // pull query data from class variable
+ $mambot = $_MAMBOTS->_search_mambot_params['weblinks'];
- // load mambot params info
- $query = "SELECT id"
- . "\n FROM #__mambots"
- . "\n WHERE element = 'weblinks.searchbot'"
- . "\n AND folder = 'search'"
- ;
- $database->setQuery( $query );
- $id = $database->loadResult();
- $mambot = new mosMambot( $database );
- $mambot->load( $id );
$botParams = new mosParameters( $mambot->params );
$limit = $botParams->def( 'search_limit', 50 );
@@ -104,9 +112,11 @@
. "\n '1' AS browsernav,"
. "\n a.url AS href"
. "\n FROM #__weblinks AS a"
- . "\n INNER JOIN #__categories AS b ON b.id = a.catid AND b.access <= '$my->gid'"
+ . "\n INNER JOIN #__categories AS b ON b.id = a.catid"
. "\n WHERE ($where)"
. "\n AND a.published = 1"
+ . "\n AND b.published = 1"
+ . "\n AND b.access <= $my->gid"
. "\n ORDER BY $order"
;
$database->setQuery( $query, 0, $limit );
diff -urN joomla-1.0.7/modules/custom.xml joomla-1.0.10/modules/custom.xml
--- joomla-1.0.7/modules/custom.xml 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/modules/custom.xml 2006-06-25 16:54:37.000000000 -0400
@@ -11,6 +11,11 @@
Custom Module
+
+ No
+ Yes
+
+
Yes
@@ -30,9 +35,6 @@
No
-
- No
- Yes
-
+
diff -urN joomla-1.0.7/modules/mod_archive.php joomla-1.0.10/modules/mod_archive.php
--- joomla-1.0.7/modules/mod_archive.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/modules/mod_archive.php 2006-06-25 16:54:37.000000000 -0400
@@ -1,6 +1,6 @@
def( 'count', 10 ) );
-$now = date( 'Y-m-d H:i:s', time() + $mosConfig_offset * 60 * 60 );
+$now = _CURRENT_SERVER_TIME;
$query = "SELECT MONTH( created ) AS created_month, created, id, sectionid, title, YEAR(created) AS created_year"
. "\n FROM #__content"
diff -urN joomla-1.0.7/modules/mod_banners.php joomla-1.0.10/modules/mod_banners.php
--- joomla-1.0.7/modules/mod_banners.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/modules/mod_banners.php 2006-06-25 16:54:37.000000000 -0400
@@ -1,6 +1,6 @@
setQuery( $query );
-$numrows = $database->loadResult();
-if ($numrows === null) {
- echo $database->stderr( true );
- return;
-}
+$banners = $database->loadObjectList();
+$numrows = count( $banners );
$bannum = 0;
if ($numrows > 1) {
@@ -43,61 +41,53 @@
}
if ($numrows){
- $query = "SELECT *"
- . "\n FROM #__banner WHERE showBanner=1 "
- . $where
- . "\n LIMIT $bannum, 1";
- $database->setQuery( $query );
- if ($database->loadObject( $banner )) {
-
- $query = "UPDATE #__banner"
- . "\n SET impmade = impmade + 1"
- . "\n WHERE bid = $banner->bid"
- ;
- $database->setQuery( $query );
- if(!$database->query()) {
- echo $database->stderr( true );
- return;
- }
- $banner->impmade++;
-
- if ($numrows > 0) {
- // Check if this impression is the last one and print the banner
- if ($banner->imptotal == $banner->impmade) {
-
- $query = "INSERT INTO #__bannerfinish ( cid, type, name, impressions, clicks, imageurl, datestart, dateend )"
- . "\n VALUES ( $banner->cid, '$banner->type', '$banner->name', $banner->impmade, $banner->clicks, '$banner->imageurl', '$banner->date', 'now()' )"
- ;
- $database->setQuery($query);
- if(!$database->query()) {
- die($database->stderr(true));
- }
-
- $query = "DELETE FROM #__banner"
- . "\n WHERE bid = $banner->bid"
- ;
- $database->setQuery($query);
- if(!$database->query()) {
- die($database->stderr(true));
- }
- }
-
- if (trim( $banner->custombannercode )) {
- echo $banner->custombannercode;
- } else if (eregi( "(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$", $banner->imageurl )) {
- $imageurl = $mosConfig_live_site .'/images/banners/'. $banner->imageurl;
- $link = sefRelToAbs( 'index.php?option=com_banners&task=click&bid='. $banner->bid );
- echo ' ';
-
- } else if (eregi("\.swf$", $banner->imageurl)) {
- $imageurl = "$mosConfig_live_site/images/banners/".$banner->imageurl;
- echo "
- ";
- }
- }
- } else {
- echo " ";
- }
+ $banner = $banners[$bannum];
+
+ $query = "UPDATE #__banner"
+ . "\n SET impmade = impmade + 1"
+ . "\n WHERE bid = $banner->bid"
+ ;
+ $database->setQuery( $query );
+ if(!$database->query()) {
+ echo $database->stderr( true );
+ return;
+ }
+ $banner->impmade++;
+
+ if ($numrows > 0) {
+ // Check if this impression is the last one and print the banner
+ if ($banner->imptotal == $banner->impmade) {
+
+ $query = "INSERT INTO #__bannerfinish ( cid, type, name, impressions, clicks, imageurl, datestart, dateend )"
+ . "\n VALUES ( $banner->cid, '$banner->type', '$banner->name', $banner->impmade, $banner->clicks, '$banner->imageurl', '$banner->date', 'now()' )"
+ ;
+ $database->setQuery($query);
+ if(!$database->query()) {
+ die($database->stderr(true));
+ }
+
+ $query = "DELETE FROM #__banner"
+ . "\n WHERE bid = $banner->bid"
+ ;
+ $database->setQuery($query);
+ if(!$database->query()) {
+ die($database->stderr(true));
+ }
+ }
+
+ if (trim( $banner->custombannercode )) {
+ echo $banner->custombannercode;
+ } else if (eregi( "(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$", $banner->imageurl )) {
+ $imageurl = $mosConfig_live_site .'/images/banners/'. $banner->imageurl;
+ $link = sefRelToAbs( 'index.php?option=com_banners&task=click&bid='. $banner->bid );
+ echo ' ';
+
+ } else if (eregi("\.swf$", $banner->imageurl)) {
+ $imageurl = "$mosConfig_live_site/images/banners/".$banner->imageurl;
+ echo "
+ ";
+ }
+ }
} else {
echo " ";
}
diff -urN joomla-1.0.7/modules/mod_banners.xml joomla-1.0.10/modules/mod_banners.xml
--- joomla-1.0.7/modules/mod_banners.xml 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/modules/mod_banners.xml 2006-06-25 16:54:37.000000000 -0400
@@ -14,6 +14,6 @@
-
+
diff -urN joomla-1.0.7/modules/mod_latestnews.php joomla-1.0.10/modules/mod_latestnews.php
--- joomla-1.0.7/modules/mod_latestnews.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/modules/mod_latestnews.php 2006-06-25 16:54:37.000000000 -0400
@@ -1,6 +1,6 @@
get( 'catid' ) );
$secid = trim( $params->get( 'secid' ) );
$show_front = $params->get( 'show_front', 1 );
-$now = date( 'Y-m-d H:i:s', time() + $mosConfig_offset * 60 * 60 );
+
+$now = _CURRENT_SERVER_TIME;
$access = !$mainframe->getCfg( 'shownoauth' );
+$nullDate = $database->getNullDate();
-$nullDate = $database->getNullDate();
// select between Content Items, Static Content or both
switch ( $type ) {
case 2:
@@ -38,27 +39,39 @@
. "\n ORDER BY a.created DESC"
. "\n LIMIT $count"
;
+ $database->setQuery( $query );
+ $rows = $database->loadObjectList();
break;
case 3:
//Both
- $query = "SELECT a.id, a.title, a.sectionid, a.catid"
+ $query = "SELECT a.id, a.title, a.sectionid, a.catid, cc.access AS cat_access, s.access AS sec_access, cc.published AS cat_state, s.published AS sec_state"
. "\n FROM #__content AS a"
. "\n LEFT JOIN #__content_frontpage AS f ON f.content_id = a.id"
- . "\n INNER JOIN #__categories AS cc ON cc.id = a.catid"
- . "\n INNER JOIN #__sections AS s ON s.id = a.sectionid"
+ . "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid"
+ . "\n LEFT JOIN #__sections AS s ON s.id = a.sectionid"
. "\n WHERE a.state = 1"
. "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )"
. "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )"
- . ( $access ? "\n AND a.access <= '$my->gid'" : '' )
+ . ( $access ? "\n AND a.access <= $my->gid" : '' )
. ( $catid ? "\n AND ( a.catid IN ( $catid ) )" : '' )
. ( $secid ? "\n AND ( a.sectionid IN ( $secid ) )" : '' )
. ( $show_front == '0' ? "\n AND f.content_id IS NULL" : '' )
- . "\n AND s.published = 1"
- . "\n AND cc.published = 1"
. "\n ORDER BY a.created DESC"
. "\n LIMIT $count"
;
+ $database->setQuery( $query );
+ $temp = $database->loadObjectList();
+
+ $rows = array();
+ if (count($temp)) {
+ foreach ($temp as $row ) {
+ if (($row->cat_state == 1 || $row->cat_state == '') && ($row->sec_state == 1 || $row->sec_state == '') && ($row->cat_access <= $my->gid || $row->cat_access == '' || !$access) && ($row->sec_access <= $my->gid || $row->sec_access == '' || !$access)) {
+ $rows[] = $row;
+ }
+ }
+ }
+ unset($temp);
break;
case 1:
@@ -72,7 +85,7 @@
. "\n WHERE ( a.state = 1 AND a.sectionid > 0 )"
. "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )"
. "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )"
- . ( $access ? "\n AND a.access <= '$my->gid'" : '' )
+ . ( $access ? "\n AND a.access <= $my->gid AND cc.access <= $my->gid AND s.access <= $my->gid" : '' )
. ( $catid ? "\n AND ( a.catid IN ( $catid ) )" : '' )
. ( $secid ? "\n AND ( a.sectionid IN ( $secid ) )" : '' )
. ( $show_front == '0' ? "\n AND f.content_id IS NULL" : '' )
@@ -81,11 +94,11 @@
. "\n ORDER BY a.created DESC"
. "\n LIMIT $count"
;
+ $database->setQuery( $query );
+ $rows = $database->loadObjectList();
break;
}
-$database->setQuery( $query );
-$rows = $database->loadObjectList();
// needed to reduce queries used by getItemid for Content Items
if ( ( $type == 1 ) || ( $type == 3 ) ) {
diff -urN joomla-1.0.7/modules/mod_login.php joomla-1.0.10/modules/mod_login.php
--- joomla-1.0.7/modules/mod_login.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/modules/mod_login.php 2006-06-25 16:54:37.000000000 -0400
@@ -1,6 +1,6 @@
getCfg( 'allowUserRegistration' );
-$message_login = $params->def( 'login_message', 0 );
-$message_logout = $params->def( 'logout_message', 0 );
+$message_login = $params->def( 'login_message', 0 );
+$message_logout = $params->def( 'logout_message', 0 );
+$login = $params->def( 'login', $return );
+$logout = $params->def( 'logout', $return );
+$name = $params->def( 'name', 1 );
+$greeting = $params->def( 'greeting', 1 );
$pretext = $params->get( 'pretext' );
$posttext = $params->get( 'posttext' );
-$login = $params->def( 'login', $return );
-$logout = $params->def( 'logout', $return );
-$name = $params->def( 'name', 1 );
-$greeting = $params->def( 'greeting', 1 );
-
-if ( $name ) {
- $query = "SELECT name"
- . "\n FROM #__users"
- . "\n WHERE id = $my->id"
- ;
- $database->setQuery( $query );
- $name = $database->loadResult();
-} else {
- $name = $my->username;
-}
if ( $my->id ) {
// Logout output
// ie HTML when already logged in and trying to logout
+ if ( $name ) {
+ $name = $my->name;
+ } else {
+ $name = $my->username;
+ }
?>
-
+
+
+
@@ -64,11 +87,14 @@
} else {
// Login output
// ie HTML when not logged in and trying to login
+ // used for spoof hardening
+ $validate = josSpoofValue(1);
?>
+
@@ -89,14 +115,13 @@
-
-
-
+
+
+
+
type) {
case 'separator':
case 'component_item_link':
- break;
- case 'content_item_link':
- $temp = split("&task=view&id=", $mitem->link);
- $mitem->link .= '&Itemid='. $mainframe->getItemid($temp[1]);
- break;
+ break;
+
case 'url':
- if ( eregi( 'index.php\?', $mitem->link ) ) {
- if ( !eregi( 'Itemid=', $mitem->link ) ) {
- $mitem->link .= '&Itemid='. $mitem->id;
+ if ( eregi( 'index.php\?', $mitem->link ) ) {
+ if ( !eregi( 'Itemid=', $mitem->link ) ) {
+ $mitem->link .= '&Itemid='. $mitem->id;
+ }
}
- }
- break;
+ break;
+
+ case 'content_item_link':
case 'content_typed':
+ // load menu params
+ $menuparams = new mosParameters( $mitem->params, $mainframe->getPath( 'menu_xml', $mitem->type ), 'menu' );
+
+ $unique_itemid = $menuparams->get( 'unique_itemid', 1 );
+
+ if ( $unique_itemid ) {
+ $mitem->link .= '&Itemid='. $mitem->id;
+ } else {
+ $temp = split('&task=view&id=', $mitem->link);
+
+ if ( $mitem->type == 'content_typed' ) {
+ $mitem->link .= '&Itemid='. $mainframe->getItemid($temp[1], 1, 0);
+ } else {
+ $mitem->link .= '&Itemid='. $mainframe->getItemid($temp[1], 0, 1);
+ }
+ }
+ break;
+
default:
- $mitem->link .= '&Itemid='. $mitem->id;
- break;
+ $mitem->link .= '&Itemid='. $mitem->id;
+ break;
}
// Active Menu highlighting
@@ -58,44 +76,68 @@
$id = '';
}
+ if ( $params->get( 'full_active_id' ) ) {
+ // support for `active_menu` of 'Link - Component Item'
+ if ( $id == '' && $mitem->type == 'component_item_link' ) {
+ parse_str( $mitem->link, $url );
+ if ( $url['Itemid'] == $current_itemid ) {
+ $id = 'id="active_menu'. $params->get( 'class_sfx' ) .'"';
+ }
+ }
+
+ // support for `active_menu` of 'Link - Url' if link is relative
+ if ( $id == '' && $mitem->type == 'url' && strpos( 'http', $mitem->link ) === false) {
+ parse_str( $mitem->link, $url );
+ if ( isset( $url['Itemid'] ) ) {
+ if ( $url['Itemid'] == $current_itemid ) {
+ $id = 'id="active_menu'. $params->get( 'class_sfx' ) .'"';
+ }
+ }
+ }
+ }
+
+ // replace & with amp; for xhtml compliance
$mitem->link = ampReplace( $mitem->link );
- if ( strcasecmp( substr( $mitem->link,0,4 ), 'http' ) ) {
- $mitem->link = sefRelToAbs( $mitem->link );
- }
+ // run through SEF convertor
+ $mitem->link = sefRelToAbs( $mitem->link );
$menuclass = 'mainlevel'. $params->get( 'class_sfx' );
if ($level > 0) {
$menuclass = 'sublevel'. $params->get( 'class_sfx');
}
+
+ // replace & with amp; for xhtml compliance
+ // remove slashes from excaped characters
+ $mitem->name = stripslashes( ampReplace($mitem->name) );
switch ($mitem->browserNav) {
// cases are slightly different
case 1:
- // open in a new window
- $txt = '';
- break;
+ // open in a new window
+ $txt = '';
+ break;
case 2:
- // open in a popup window
- $txt = "link ."', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false\" class=\"$menuclass\" ". $id .">". $mitem->name ." \n";
- break;
+ // open in a popup window
+ $txt = "link ."', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false\" class=\"$menuclass\" ". $id .">". $mitem->name ." \n";
+ break;
case 3:
- // don't link it
- $txt = '';
- break;
-
- default: // formerly case 2
- // open in parent window
- $txt = '';
- break;
+ // don't link it
+ $txt = '';
+ break;
+
+ default:
+ // open in parent window
+ $txt = '';
+ break;
}
if ( $params->get( 'menu_images' ) ) {
- $menu_params = new stdClass();
- $menu_params = new mosParameters( $mitem->params );
- $menu_image = $menu_params->def( 'menu_image', -1 );
+ $menu_params = new stdClass();
+ $menu_params = new mosParameters( $mitem->params );
+ $menu_image = $menu_params->def( 'menu_image', -1 );
if ( ( $menu_image != '-1' ) && $menu_image ) {
$image = ' ';
if ( $params->get( 'menu_images_align' ) ) {
@@ -153,83 +195,83 @@
$intUserType = 0;
}
- if ($mosConfig_shownoauth) {
- $sql = "SELECT m.*"
- . "\n FROM #__menu AS m"
- . "\n WHERE menutype = '". $params->get( 'menutype' ) ."'"
- . "\n AND published = 1"
- . "\n ORDER BY parent, ordering";
- } else {
- $sql = "SELECT m.*"
- . "\n FROM #__menu AS m"
- . "\n WHERE menutype = '". $params->get( 'menutype' ) ."'"
- . "\n AND published = 1"
- . "\n AND access <= $my->gid"
- . "\n ORDER BY parent, ordering";
- }
+ $and = '';
+ if ( !$mosConfig_shownoauth ) {
+ $and = "\n AND access <= $my->gid";
+ }
+ $sql = "SELECT m.*"
+ . "\n FROM #__menu AS m"
+ . "\n WHERE menutype = '". $params->get( 'menutype' ) ."'"
+ . "\n AND published = 1"
+ . $and
+ . "\n ORDER BY parent, ordering";
$database->setQuery( $sql );
$rows = $database->loadObjectList( 'id' );
// indent icons
switch ( $params->get( 'indent_image' ) ) {
case '1':
- // Default images
- $imgpath = $mosConfig_live_site .'/images/M_images';
- for ( $i = 1; $i < 7; $i++ ) {
- $img[$i] = ' ';
- }
- break;
+ // Default images
+ $imgpath = $mosConfig_live_site .'/images/M_images';
+ for ( $i = 1; $i < 7; $i++ ) {
+ $img[$i] = ' ';
+ }
+ break;
+
case '2':
- // Use Params
- $imgpath = $mosConfig_live_site .'/images/M_images';
- for ( $i = 1; $i < 7; $i++ ) {
- if ( $params->get( 'indent_image'. $i ) == '-1' ) {
- $img[$i] = NULL;
- } else {
- $img[$i] = ' ';
+ // Use Params
+ $imgpath = $mosConfig_live_site .'/images/M_images';
+ for ( $i = 1; $i < 7; $i++ ) {
+ if ( $params->get( 'indent_image'. $i ) == '-1' ) {
+ $img[$i] = NULL;
+ } else {
+ $img[$i] = ' ';
+ }
}
- }
- break;
+ break;
+
case '3':
- // None
- for ( $i = 1; $i < 7; $i++ ) {
- $img[$i] = NULL;
- }
- break;
+ // None
+ for ( $i = 1; $i < 7; $i++ ) {
+ $img[$i] = NULL;
+ }
+ break;
+
default:
- // Template
- $imgpath = $mosConfig_live_site .'/templates/'. $cur_template .'/images';
- for ( $i = 1; $i < 7; $i++ ) {
- $img[$i] = ' ';
- }
- break;
+ // Template
+ $imgpath = $mosConfig_live_site .'/templates/'. $cur_template .'/images';
+ for ( $i = 1; $i < 7; $i++ ) {
+ $img[$i] = ' ';
+ }
+ break;
}
$indents = array(
- // block prefix / item prefix / item suffix / block suffix
- array( '' ),
- array( '', ''. $img[1] , '
', '' ),
- array( '', ''. $img[2] , '
', '' ),
- array( '', ''. $img[3] , '
', '' ),
- array( '', ''. $img[4] , '
', '' ),
- array( '', ''. $img[5] , '
', '' ),
- array( '', ''. $img[6] , '
', '' ),
+ // block prefix / item prefix / item suffix / block suffix
+ array( '' ),
+ array( '', ''. $img[1] , '
', '' ),
+ array( '', ''. $img[2] , '
', '' ),
+ array( '', ''. $img[3] , '
', '' ),
+ array( '', ''. $img[4] , '
', '' ),
+ array( '', ''. $img[5] , '
', '' ),
+ array( '', ''. $img[6] , '
', '' ),
);
// establish the hierarchy of the menu
$children = array();
// first pass - collect children
foreach ($rows as $v ) {
- $pt = $v->parent;
- $list = @$children[$pt] ? $children[$pt] : array();
+ $pt = $v->parent;
+ $list = @$children[$pt] ? $children[$pt] : array();
array_push( $list, $v );
$children[$pt] = $list;
}
// second pass - collect 'open' menus
- $open = array( $Itemid );
- $count = 20; // maximum levels - to prevent runaway loop
- $id = $Itemid;
+ $open = array( $Itemid );
+ $count = 20; // maximum levels - to prevent runaway loop
+ $id = $Itemid;
+
while (--$count) {
if (isset($rows[$id]) && $rows[$id]->parent > 0) {
$id = $rows[$id]->parent;
@@ -247,7 +289,6 @@
* hierarchial menu
*/
function mosRecurseVIMenu( $id, $level, &$children, &$open, &$indents, &$params ) {
- global $Itemid;
if (@$children[$id]) {
$n = min( $level, count( $indents )-1 );
@@ -303,53 +344,71 @@
if (count( $links )) {
switch ($style) {
case 1:
- echo '';
- break;
+ echo '';
+ break;
+
default:
- echo '';
- echo '';
- echo '';
- echo '';
- echo implode( '', $links );
- echo '';
- echo ' ';
- echo '
';
- break;
+ $spacer_start = $params->get( 'spacer' );
+ $spacer_end = $params->get( 'end_spacer' );
+
+ echo '';
+ echo '';
+ echo '';
+
+ if ( $spacer_end ) {
+ echo '';
+ }
+
+ if ( $spacer_start ) {
+ $html = '';
+ echo implode( $html, $links );
+ } else {
+ echo implode( '', $links );
+ }
+
+ if ( $spacer_end ) {
+ echo '';
+ }
+
+ echo ' ';
+ echo ' ';
+ echo '
';
+ break;
}
}
}
}
-$params->def( 'menutype', 'mainmenu' );
-$params->def( 'class_sfx', '' );
-$params->def( 'menu_images', 0 );
-$params->def( 'menu_images_align', 0 );
-$params->def( 'expand_menu', 0 );
-$params->def( 'activate_parent', 0 );
-$params->def( 'indent_image', 0 );
-$params->def( 'indent_image1', 'indent1.png' );
-$params->def( 'indent_image2', 'indent2.png' );
-$params->def( 'indent_image3', 'indent3.png' );
-$params->def( 'indent_image4', 'indent4.png' );
-$params->def( 'indent_image5', 'indent5.png' );
-$params->def( 'indent_image6', 'indent.png' );
-$params->def( 'spacer', '' );
-$params->def( 'end_spacer', '' );
-$menu_style = $params->get( 'menu_style', 'vert_indent' );
+$params->def('menutype', 'mainmenu');
+$params->def('class_sfx', '');
+$params->def('menu_images', 0);
+$params->def('menu_images_align', 0);
+$params->def('expand_menu', 0);
+$params->def('activate_parent', 0);
+$params->def('indent_image', 0);
+$params->def('indent_image1', 'indent1.png');
+$params->def('indent_image2', 'indent2.png');
+$params->def('indent_image3', 'indent3.png');
+$params->def('indent_image4', 'indent4.png');
+$params->def('indent_image5', 'indent5.png');
+$params->def('indent_image6', 'indent.png');
+$params->def('spacer', '');
+$params->def('end_spacer', '');
+$params->def('full_active_id', 0);
-switch ( $menu_style ) {
+switch ( $params->get( 'menu_style', 'vert_indent' ) ) {
case 'list_flat':
mosShowHFMenu( $params, 1 );
break;
-
+
case 'horiz_flat':
mosShowHFMenu( $params, 0 );
break;
-
+
default:
mosShowVIMenu( $params );
break;
diff -urN joomla-1.0.7/modules/mod_mainmenu.xml joomla-1.0.10/modules/mod_mainmenu.xml
--- joomla-1.0.7/modules/mod_mainmenu.xml 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/modules/mod_mainmenu.xml 2006-06-25 16:54:37.000000000 -0400
@@ -22,6 +22,12 @@
Horizontal
Flat List
+
+
+ No
+ Yes
+
+
No
Yes
diff -urN joomla-1.0.7/modules/mod_mostread.php joomla-1.0.10/modules/mod_mostread.php
--- joomla-1.0.7/modules/mod_mostread.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/modules/mod_mostread.php 2006-06-25 16:54:37.000000000 -0400
@@ -1,6 +1,6 @@
get( 'catid' ) );
$secid = trim( $params->get( 'secid' ) );
$show_front = $params->get( 'show_front', 1 );
-$now = date( 'Y-m-d H:i:s', time()+$mosConfig_offset*60*60 );
-$access = !$mainframe->getCfg( 'shownoauth' );
-$nullDate = $database->getNullDate();
+$now = _CURRENT_SERVER_TIME;
+$access = !$mainframe->getCfg( 'shownoauth' );
+$nullDate = $database->getNullDate();
// select between Content Items, Static Content or both
switch ( $type ) {
case 2:
@@ -44,8 +44,10 @@
case 3:
//Both
- $query = "SELECT a.id, a.title, a.sectionid"
+ $query = "SELECT a.id, a.title, a.sectionid, a.catid, cc.access AS cat_access, s.access AS sec_access, cc.published AS cat_state, s.published AS sec_state"
. "\n FROM #__content AS a"
+ . "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid"
+ . "\n LEFT JOIN #__sections AS s ON s.id = a.sectionid"
. "\n WHERE a.state = 1"
. "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )"
. "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )"
@@ -54,7 +56,17 @@
. "\n LIMIT $count"
;
$database->setQuery( $query );
- $rows = $database->loadObjectList();
+ $temp = $database->loadObjectList();
+
+ $rows = array();
+ if (count($temp)) {
+ foreach ($temp as $row ) {
+ if (($row->cat_state == 1 || $row->cat_state == '') && ($row->sec_state == 1 || $row->sec_state == '') && ($row->cat_access <= $my->gid || $row->cat_access == '' || !$access) && ($row->sec_access <= $my->gid || $row->sec_access == '' || !$access)) {
+ $rows[] = $row;
+ }
+ }
+ }
+ unset($temp);
break;
case 1:
@@ -68,7 +80,7 @@
. "\n WHERE ( a.state = 1 AND a.sectionid > 0 )"
. "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )"
. "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )"
- . ( $access ? "\n AND a.access <= $my->gid" : '' )
+ . ( $access ? "\n AND a.access <= $my->gid AND cc.access <= $my->gid AND s.access <= $my->gid" : '' )
. ( $catid ? "\n AND ( a.catid IN ( $catid ) )" : '' )
. ( $secid ? "\n AND ( a.sectionid IN ( $secid ) )" : '' )
. ( $show_front == "0" ? "\n AND f.content_id IS NULL" : '' )
diff -urN joomla-1.0.7/modules/mod_newsflash.php joomla-1.0.10/modules/mod_newsflash.php
--- joomla-1.0.7/modules/mod_newsflash.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/modules/mod_newsflash.php 2006-06-25 16:54:37.000000000 -0400
@@ -1,6 +1,6 @@
text = $row->introtext;
$row->groups = '';
- $row->readmore = (trim( $row->fulltext ) != '');
-
- $bs = $mainframe->getBlogSectionCount();
- $bc = $mainframe->getBlogCategoryCount();
- $gbs = $mainframe->getGlobalBlogSectionCount();
- $ItemidCount = $mainframe->getItemid( $row->id, 0, 0, $bs, $bc, $gbs );
-
- HTML_content::show( $row, $params, $access, 0, 'com_content', $ItemidCount );
+ $row->readmore = (trim( $row->fulltext ) != '');
+ $row->metadesc = '';
+ $row->metakey = '';
+ $row->access = '';
+ $row->created = '';
+ $row->modified = '';
+
+ HTML_content::show( $row, $params, $access, 0 );
}
}
@@ -44,82 +44,69 @@
$access->canEditOwn = 0;
$access->canPublish = 0;
-$now = date( 'Y-m-d H:i:s', time()+$mosConfig_offset*60*60 );
+$now = _CURRENT_SERVER_TIME;
+$noauth = !$mainframe->getCfg( 'shownoauth' );
+$nullDate = $database->getNullDate();
$catid = intval( $params->get( 'catid' ) );
-$style = $params->get( 'style' );
-$items = intval( $params->get( 'items' ) );
+$items = intval( $params->get( 'items', 0 ) );
+$style = $params->get( 'style', 'flash' );
$moduleclass_sfx = $params->get( 'moduleclass_sfx' );
$link_titles = $params->get( 'link_titles', $mosConfig_link_titles );
-$params->set( 'intro_only', 1 );
-$params->set( 'hide_author', 1 );
-$params->set( 'hide_createdate', 0 );
-$params->set( 'hide_modifydate', 1 );
-$params->set( 'link_titles', $link_titles );
-
-if ( $items ) {
- $limit = "LIMIT $items";
-} else {
- $limit = '';
-}
-
-$noauth = !$mainframe->getCfg( 'shownoauth' );
-$nullDate = $database->getNullDate();
+$params->set( 'intro_only', 1 );
+$params->set( 'hide_author', 1 );
+$params->set( 'hide_createdate', 0 );
+$params->set( 'hide_modifydate', 1 );
+$params->set( 'link_titles', $link_titles );
// query to determine article count
-$query = "SELECT a.id"
+$query = "SELECT a.id, a.introtext, a.fulltext , a.images, a.attribs, a.title, a.state"
."\n FROM #__content AS a"
-."\n INNER JOIN #__categories AS b ON b.id = a.catid"
+."\n INNER JOIN #__categories AS cc ON cc.id = a.catid"
+."\n INNER JOIN #__sections AS s ON s.id = a.sectionid"
."\n WHERE a.state = 1"
-. ( $noauth ? "\n AND a.access <= $my->gid AND b.access <= $my->gid" : '' )
+. ( $noauth ? "\n AND a.access <= $my->gid AND cc.access <= $my->gid AND s.access <= $my->gid" : '' )
."\n AND (a.publish_up = '$nullDate' OR a.publish_up <= '$now' ) "
."\n AND (a.publish_down = '$nullDate' OR a.publish_down >= '$now' )"
-."\n AND catid = $catid"
+."\n AND a.catid = $catid"
+."\n AND cc.published = 1"
+."\n AND s.published = 1"
."\n ORDER BY a.ordering"
-."\n $limit"
;
-$database->setQuery( $query );
-$rows = $database->loadResultArray();
-$numrows = count( $rows );
+$database->setQuery( $query, 0, $items );
+$rows = $database->loadObjectList();
-$row = new mosContent( $database );
+$numrows = count( $rows );
-switch ($style) {
- case 'horiz':
- echo '';
- echo '';
- foreach ($rows as $id) {
- $row->load( $id );
-
- echo '';
-
- output_newsflash( $row, $params, $access );
-
- echo ' ';
- }
- echo '
';
- break;
-
- case 'vert':
- foreach ($rows as $id) {
- $row->load( $id );
+// check if any results returned
+if ( $numrows ) {
+ switch ($style) {
+ case 'horiz':
+ echo '';
+ echo '';
+ foreach ($rows as $row) {
+ echo '';
+ output_newsflash( $row, $params, $access );
+ echo ' ';
+ }
+ echo '
';
+ break;
+
+ case 'vert':
+ foreach ($rows as $row) {
+ output_newsflash( $row, $params, $access );
+ }
+ break;
+
+ case 'flash':
+ default:
+ srand ((double) microtime() * 1000000);
+ $flashnum = rand( 0, $numrows-1 );
+ $row = $rows[$flashnum];
output_newsflash( $row, $params, $access );
- }
- break;
-
- case 'flash':
- default:
- if ($numrows > 0) {
- srand ((double) microtime() * 1000000);
- $flashnum = $rows[rand( 0, $numrows-1 )];
- } else {
- $flashnum = 0;
- }
- $row->load( $flashnum );
-
- output_newsflash( $row, $params, $access );
- break;
+ break;
+ }
}
?>
\ No newline at end of file
diff -urN joomla-1.0.7/modules/mod_newsflash.xml joomla-1.0.10/modules/mod_newsflash.xml
--- joomla-1.0.7/modules/mod_newsflash.xml 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/modules/mod_newsflash.xml 2006-06-25 16:54:37.000000000 -0400
@@ -41,6 +41,6 @@
No
Yes
-
+
diff -urN joomla-1.0.7/modules/mod_poll.php joomla-1.0.10/modules/mod_poll.php
--- joomla-1.0.7/modules/mod_poll.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/modules/mod_poll.php 2006-06-25 16:54:37.000000000 -0400
@@ -1,6 +1,6 @@
setQuery( $query );
+ $_Itemid = $database->loadResult();
+
+ if ($_Itemid) {
+ $_Itemid = '&Itemid='. $_Itemid;
+ }
+
+ $z = 1;
foreach ($polls as $poll) {
if ($poll->id && $poll->title) {
@@ -54,7 +69,9 @@
return;
}
- poll_vote_form_html( $poll, $options, $Itemid, $moduleclass_sfx );
+ poll_vote_form_html( $poll, $options, $_Itemid, $params, $z );
+
+ $z++;
}
}
}
@@ -65,18 +82,48 @@
* @param int The current menu item
* @param string CSS suffix
*/
- function poll_vote_form_html( &$poll, &$options, $Itemid, $moduleclass_sfx ) {
- $tabclass_arr = array( 'sectiontableentry2', 'sectiontableentry1' );
- $tabcnt = 0;
+ function poll_vote_form_html( &$poll, &$options, $_Itemid, &$params, $z ) {
+ $tabclass_arr = array( 'sectiontableentry2', 'sectiontableentry1' );
+ $tabcnt = 0;
+ $moduleclass_sfx = $params->get('moduleclass_sfx');
+
+ $cookiename = "voted$poll->id";
+ $voted = mosGetParam( $_COOKIE, $cookiename, 'z' );
?>
- ">
+
+ ">
+
-
- title; ?>
+
+ title; ?>
+
@@ -106,9 +153,9 @@
-
+
- id"); ?>';" />
+ id$_Itemid"); ?>';" />
@@ -121,5 +168,5 @@
}
}
-show_poll_vote_form( $Itemid, $moduleclass_sfx );
+show_poll_vote_form( $Itemid, $params );
?>
\ No newline at end of file
diff -urN joomla-1.0.7/modules/mod_random_image.php joomla-1.0.10/modules/mod_random_image.php
--- joomla-1.0.7/modules/mod_random_image.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/modules/mod_random_image.php 2006-06-25 16:54:37.000000000 -0400
@@ -1,6 +1,6 @@
get( 'link' );
$width = $params->get( 'width' );
$height = $params->get( 'height' );
-$abspath_folder = $mosConfig_absolute_path .'/'. $folder;
$the_array = array();
$the_image = array();
+// if folder includes livesite info, remove
+if ( strpos($folder, $mosConfig_live_site) === 0 ) {
+ $folder = str_replace( $mosConfig_live_site, '', $folder );
+}
+// if folder includes absolute path, remove
+if ( strpos($folder, $mosConfig_absolute_path) === 0 ) {
+ $folder= str_replace( $mosConfig_absolute_path, '', $folder );
+}
+// if folder doesnt contain slash to start, add
+if ( strpos($folder, '/') !== 0 ) {
+ $folder = '/'. $folder;
+}
+// construct absolute path to directory
+$abspath_folder = $mosConfig_absolute_path . $folder;
+
+// check if directory exists
if (is_dir($abspath_folder)) {
if ($handle = opendir($abspath_folder)) {
while (false !== ($file = readdir($handle))) {
@@ -44,45 +59,42 @@
}
if (!$the_image) {
- echo 'No images';
+ echo _NO_IMAGES;
} else {
-
- $i = count($the_image);
- $random = mt_rand(0, $i - 1);
- $image_name = $the_image[$random];
-
- $i = $abspath_folder . '/'. $image_name;
- $size = getimagesize ($i);
-
- if ($width == '') {
- $width = 100;
- }
- if ($height == '') {
- $coeff = $size[0]/$size[1];
- $height = (int) ($width/$coeff);
- }
-
- $image = $mosConfig_live_site .'/'. $folder .'/'. $image_name;
-
+ $i = count($the_image);
+ $random = mt_rand(0, $i - 1);
+ $image_name = $the_image[$random];
+ $abspath_image = $abspath_folder . '/'. $image_name;
+ $size = getimagesize ($abspath_image);
+
+ if ($width == '') {
+ ($size[0] > 100 ? $width = 100 : $width = $size[0]);
+ }
+ if ($height == '') {
+ $coeff = $size[0]/$size[1];
+ $height = (int) ($width/$coeff);
+ }
+
+ $image = $mosConfig_live_site . $folder .'/'. $image_name;
+ ?>
+
+
-
-
\ No newline at end of file
diff -urN joomla-1.0.7/modules/mod_related_items.php joomla-1.0.10/modules/mod_related_items.php
--- joomla-1.0.7/modules/mod_related_items.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/modules/mod_related_items.php 2006-06-25 16:54:37.000000000 -0400
@@ -1,6 +1,6 @@
getNullDate();
if ($option == 'com_content' && $task == 'view' && $id) {
// select the meta keywords from the item
@@ -42,33 +43,48 @@
if (count( $likes )) {
// select other items based on the metakey field 'like' the keys found
- $query = "SELECT id, title"
- . "\n FROM #__content"
- . "\n WHERE id != $id"
- . "\n AND state = 1"
- . "\n AND access <= $my->gid"
- . "\n AND ( metakey LIKE '%" . implode( "%' OR metakey LIKE '%", $likes ) ."%' )"
- . "\n AND ( publish_up = '$nullDate' OR publish_up <= '$now' )"
- . "\n AND ( publish_down = '$nullDate' OR publish_down >= '$now' )"
+ $query = "SELECT a.id, a.title, a.sectionid, a.catid, cc.access AS cat_access, s.access AS sec_access, cc.published AS cat_state, s.published AS sec_state"
+ . "\n FROM #__content AS a"
+ . "\n LEFT JOIN #__content_frontpage AS f ON f.content_id = a.id"
+ . "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid"
+ . "\n LEFT JOIN #__sections AS s ON s.id = a.sectionid"
+ . "\n WHERE a.id != $id"
+ . "\n AND a.state = 1"
+ . "\n AND a.access <= $my->gid"
+ . "\n AND ( a.metakey LIKE '%" . implode( "%' OR a.metakey LIKE '%", $likes ) ."%' )"
+ . "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )"
+ . "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )"
;
$database->setQuery( $query );
- if ( $related = $database->loadObjectList() ) {
+ $temp = $database->loadObjectList();
+
+ $related = array();
+ if (count($temp)) {
+ foreach ($temp as $row ) {
+ if (($row->cat_state == 1 || $row->cat_state == '') && ($row->sec_state == 1 || $row->sec_state == '') && ($row->cat_access <= $my->gid || $row->cat_access == '') && ($row->sec_access <= $my->gid || $row->sec_access == '')) {
+ $related[] = $row;
+ }
+ }
+ }
+ unset($temp);
+
+ if ( count( $related ) ) {
?>
- getItemid($item->id);
+ getItemid($item->id);
+ }
+ $href = sefRelToAbs( "index.php?option=com_content&task=view&id=$item->id&Itemid=$Itemid" );
+ ?>
+
+
+ title; ?>
+
+ id&Itemid=$Itemid" );
?>
-
-
- title; ?>
-
-
get( 'rss091', 1 );
$rss10 = $params->get( 'rss10', 1 );
$rss20 = $params->get( 'rss20', 1 );
-$atom = $params->get( 'atom', 1 );
+$atom03 = $params->get( 'atom', 1 );
$opml = $params->get( 'opml', 1 );
$rss091_image = $params->get( 'rss091_image', '' );
$rss10_image = $params->get( 'rss10_image', '' );
@@ -48,6 +48,40 @@
$t_path = $mosConfig_live_site .'/templates/'. $cur_template .'/images/';
$d_path = $mosConfig_live_site .'/images/M_images/';
+// needed to reduce query
+if ( isset( $GLOBALS['syndicateParams'] ) ) {
+// load value stored in GLOBALS
+ $syndicateParams = $GLOBALS['syndicateParams'];
+} else {
+// query to oull syndication component params
+ $query = "SELECT a.*"
+ . "\n FROM #__components AS a"
+ . "\n WHERE ( a.admin_menu_link = 'option=com_syndicate' OR a.admin_menu_link = 'option=com_syndicate&hidemainmenu=1' )"
+ . "\n AND a.option = 'com_syndicate'"
+ ;
+ $database->setQuery( $query );
+ $database->loadObject( $row );
+
+ // get params definitions
+ $syndicateParams = new mosParameters( $row->params, $mainframe->getPath( 'com_xml', $row->option ), 'component' );
+}
+
+// check for disabling/enabling of selected feed types
+if ( !$syndicateParams->get( 'rss091', 1 ) ) {
+ $rss091 = 0;
+}
+if ( !$syndicateParams->get( 'rss10', 1 ) ) {
+ $rss10 = 0;
+}
+if ( !$syndicateParams->get( 'rss20', 1 ) ) {
+ $rss20 = 0;
+}
+if ( !$syndicateParams->get( 'atom03', 1 ) ) {
+ $atom03 = 0;
+}
+if ( !$syndicateParams->get( 'opml', 1 ) ) {
+ $opml = 0;
+}
?>
get( 'button_text', _SEARCH_TITLE );
$width = intval( $params->get( 'width', 20 ) );
$text = $params->get( 'text', _SEARCH_BOX );
+$set_Itemid = intval( $params->get( 'set_itemid', 0 ) );
$output = '
';
@@ -47,19 +48,29 @@
break;
}
-$query = "SELECT id"
-. "\n FROM #__menu"
-. "\n WHERE link = 'index.php?option=com_search'"
-;
-$database->setQuery( $query );
-$rows = $database->loadObjectList();
-
-if ( count( $rows ) ) {
- $_Itemid = $rows[0]->id;
- $link = 'index.php?option=com_search&Itemid='. $_Itemid;
+// set Itemid id for links
+if ( $set_Itemid ) {
+ // use param setting
+ $_Itemid = $set_Itemid;
+ $link = 'index.php?option=com_search&Itemid='. $set_Itemid;
} else {
- $_Itemid = '';
- $link = 'index.php?option=com_search';
+ $query = "SELECT id"
+ . "\n FROM #__menu"
+ . "\n WHERE link = 'index.php?option=com_search'"
+ . "\n AND published = 1"
+ ;
+ $database->setQuery( $query );
+ $rows = $database->loadObjectList();
+
+ // try to auto detect search component Itemid
+ if ( count( $rows ) ) {
+ $_Itemid = $rows[0]->id;
+ $link = 'index.php?option=com_search&Itemid='. $_Itemid;
+ } else {
+ // Assign no Itemid
+ $_Itemid = '';
+ $link = 'index.php?option=com_search';
+ }
}
?>
diff -urN joomla-1.0.7/modules/mod_search.xml joomla-1.0.10/modules/mod_search.xml
--- joomla-1.0.7/modules/mod_search.xml 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/modules/mod_search.xml 2006-06-25 16:54:37.000000000 -0400
@@ -20,6 +20,8 @@
Yes
+
+
diff -urN joomla-1.0.7/modules/mod_sections.php joomla-1.0.10/modules/mod_sections.php
--- joomla-1.0.7/modules/mod_sections.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/modules/mod_sections.php 2006-06-25 16:54:37.000000000 -0400
@@ -1,6 +1,6 @@
get( 'count', 20 ) );
-$access = !$mainframe->getCfg( 'shownoauth' );
-$now = date( 'Y-m-d H:i:s', time() + $mosConfig_offset * 60 * 60 );
-$nullDate = $database->getNullDate();
+$count = intval( $params->get( 'count', 20 ) );
+$access = !$mainframe->getCfg( 'shownoauth' );
+$now = _CURRENT_SERVER_TIME;
+$nullDate = $database->getNullDate();
$query = "SELECT a.id AS id, a.title AS title, COUNT(b.id) as cnt"
. "\n FROM #__sections as a"
diff -urN joomla-1.0.7/modules/mod_whosonline.php joomla-1.0.10/modules/mod_whosonline.php
--- joomla-1.0.7/modules/mod_whosonline.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/modules/mod_whosonline.php 2006-06-25 16:54:37.000000000 -0400
@@ -1,6 +1,6 @@
get( 'showmode' );
+$showmode = $params->get( 'showmode', 0 );
-$content = '';
+$output = '';
+// show online count
if ($showmode==0 || $showmode==2) {
- $query = "SELECT COUNT( session_id ) AS guest_online"
+ $query = "SELECT guest, usertype"
. "\n FROM #__session"
- . "\n WHERE guest = 1"
- . "\n AND ( usertype is NULL OR usertype = '' )";
- $database->setQuery( $query );
- $guest_array = $database->loadResult();
-
- $query = "SELECT COUNT( DISTINCT( username ) ) AS user_online"
- . "\n FROM #__session"
- . "\n WHERE guest = 0"
;
$database->setQuery( $query );
- $user_array = $database->loadResult();
+ $sessions = $database->loadObjectList();
- if ($guest_array != 0 && $user_array==0) {
- if ($guest_array==1) {
- $content.=_WE_HAVE;
- $content.=_GUEST_COUNT;
- $content.=_ONLINE;
- eval ("\$content = \"$content\";");
- } else {
- $content.=_WE_HAVE;
- $content.=_GUESTS_COUNT;
- $content.=_ONLINE;
- eval ("\$content = \"$content\";");
+ // calculate number of guests and members
+ $user_array = 0;
+ $guest_array = 0;
+ foreach( $sessions as $session ) {
+ // if guest increase guest count by 1
+ if ( $session->guest == 1 && !$session->usertype ) {
+ $guest_array++;
}
- }
-
- if ($guest_array==0 && $user_array != 0) {
- if ($user_array==1) {
- $content.=_WE_HAVE;
- $content.=_MEMBER_COUNT;
- $content.=_ONLINE;
- eval ("\$content = \"$content\";");
- } else {
- $content.=_WE_HAVE;
- $content.=_MEMBERS_COUNT;
- $content.=_ONLINE;
- eval ("\$content = \"$content\";");
+ // if member increase member count by 1
+ if ( $session->guest == 0 ) {
+ $user_array++;
}
}
-
- if ($guest_array != 0 && $user_array != 0) {
- if ($guest_array==1) {
- $content.=_WE_HAVE;
- $content.=_GUEST_COUNT;
- $content.=_AND;
- eval ("\$content = \"$content\";");
- } else {
- $content.=_WE_HAVE;
- $content.=_GUESTS_COUNT;
- $content.=_ONLINE;
- $content.=_AND;
- eval ("\$content = \"$content\";");
- }
-
- if ($user_array==1) {
- $content.=_MEMBER_COUNT;
- $content.=_ONLINE;
- eval ("\$content = \"$content\";");
- } else {
- $content.=_MEMBERS_COUNT;
- $content.=_ONLINE;
- eval ("\$content = \"$content\";");
+
+ // check if any guest or member is on the site
+ if ($guest_array != 0 || $user_array != 0) {
+ $output .= _WE_HAVE;
+
+ // guest count handling
+ if ($guest_array == 1) {
+ // 1 guest only
+ $output .= sprintf( _GUEST_COUNT, $guest_array );
+ } else if ($guest_array > 1) {
+ // more than 1 guest
+ $output .= sprintf( _GUESTS_COUNT, $guest_array );
}
-
+
+ // if there are guests and members online
+ if ($guest_array != 0 && $user_array != 0) {
+ $output .= _AND;
+ }
+
+ // member count handling
+ if ($user_array == 1) {
+ // 1 member only
+ $output .= sprintf( _MEMBER_COUNT, $user_array );
+ } else if ($user_array > 1) {
+ // more than 1 member
+ $output .= sprintf( _MEMBERS_COUNT, $user_array );
+ }
+
+ $output .= _ONLINE;
}
}
-if ($showmode==1 || $showmode==2) {
+// show online member names
+if ($showmode > 0) {
$query = "SELECT DISTINCT a.username"
."\n FROM #__session AS a"
."\n WHERE a.guest = 0"
;
$database->setQuery($query);
$rows = $database->loadObjectList();
- $content .= "
\n";
- foreach($rows as $row) {
- $content .= "" . $row->username . " \n";
- }
- $content .= " \n";
-
- if ( !$content ) {
- echo _NONE ."\n";
+
+ if ( count( $rows ) ) {
+ // output
+ $output .= '
';
+ foreach($rows as $row) {
+ $output .= '';
+ $output .= '';
+ $output .= $row->username;
+ $output .= ' ';
+ $output .= ' ';
+ }
+ $output .= ' ';
}
}
+
+echo $output;
?>
\ No newline at end of file
diff -urN joomla-1.0.7/modules/mod_wrapper.php joomla-1.0.10/modules/mod_wrapper.php
--- joomla-1.0.7/modules/mod_wrapper.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/modules/mod_wrapper.php 2006-06-25 16:54:37.000000000 -0400
@@ -1,6 +1,6 @@
get( 'url' );
if ( $params->get( 'add' ) ) {
- // adds "http://" if none is set
- if ( !strstr( $url, 'http' ) && !strstr( $url, 'https' ) ) {
+ // adds 'http://' if none is set
+ if ( substr( $url, 0, 1 ) == '/' ) {
+ // relative url in component. use server http_host.
+ $url = 'http://'. $_SERVER['HTTP_HOST'] . $url;
+ } elseif ( !strstr( $url, 'http' ) && !strstr( $url, 'https' ) ) {
$url = 'http://'. $url;
+ } else {
+ $url = $url;
}
}
// auto height control
-if ( $params->get( 'height_auto' ) ) {
- $load = "window.onload = iFrameHeight;\n";
+if ( $params->def( 'height_auto' ) ) {
+ $load = 'onload="iFrameHeight()"';
} else {
$load = '';
}
?>
\ No newline at end of file
diff -urN joomla-1.0.7/offline.php joomla-1.0.10/offline.php
--- joomla-1.0.7/offline.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/offline.php 2006-06-25 16:54:37.000000000 -0400
@@ -1,6 +1,6 @@
id = mosGetParam( $_SESSION, 'session_user_id', '' );
- $admin->username = mosGetParam( $_SESSION, 'session_username', '' );
- $admin->usertype = mosGetParam( $_SESSION, 'session_usertype', '' );
+ $admin->id = intval( mosGetParam( $_SESSION, 'session_user_id', '' ) );
+ $admin->username = strval( mosGetParam( $_SESSION, 'session_username', '' ) );
+ $admin->usertype = strval( mosGetParam( $_SESSION, 'session_usertype', '' ) );
$session_id = mosGetParam( $_SESSION, 'session_id', '' );
$logintime = mosGetParam( $_SESSION, 'session_logintime', '' );
@@ -55,6 +53,7 @@
}
if (!defined( '_ADMIN_OFFLINE' ) || defined( '_INSTALL_CHECK' )) {
+ @include_once ('language/' . $mosConfig_lang . '.php' );
$cur_template = 'rhuk_solarflare_ii';
// needed to seperate the ISO number from the language file constant _ISO
diff -urN joomla-1.0.7/pathway.php joomla-1.0.10/pathway.php
--- joomla-1.0.7/pathway.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/pathway.php 2006-06-25 16:54:37.000000000 -0400
@@ -1,6 +1,6 @@
-
+
-
-
+
+
diff -urN joomla-1.0.7/templates/rhuk_solarflare_ii/css/template_css.css joomla-1.0.10/templates/rhuk_solarflare_ii/css/template_css.css
--- joomla-1.0.7/templates/rhuk_solarflare_ii/css/template_css.css 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/templates/rhuk_solarflare_ii/css/template_css.css 2006-06-25 16:54:38.000000000 -0400
@@ -29,7 +29,8 @@
#buttons_inner {
border: 1px solid #cccccc;
- height: 21px;
+ height: 21px !important;
+ height: 23px;
}
#pathway_text {
@@ -592,7 +593,6 @@
a.sublevel#active_menu {
color: #333;
- text-decoration: bold;
}
.highlight {
@@ -625,7 +625,6 @@
background: #efefef;
padding: 1px 2px;
color: #666;
- text-transform: normal;
font-size: 10px;
border-top: 1px solid #cccccc;
}
diff -urN joomla-1.0.7/templates/rhuk_solarflare_ii/index.php joomla-1.0.10/templates/rhuk_solarflare_ii/index.php
--- joomla-1.0.7/templates/rhuk_solarflare_ii/index.php 2006-01-16 04:17:12.000000000 -0500
+++ joomla-1.0.10/templates/rhuk_solarflare_ii/index.php 2006-06-25 16:54:38.000000000 -0400
@@ -40,7 +40,7 @@
}
?>
-
+
@@ -93,11 +93,11 @@
-
+
-
+
@@ -127,7 +127,7 @@
if ( $colspan == 3) {
?>
-
+
-
+
10/20/05
rhuk
GNU/GPL
-
rhuk@jamboworks
-
http://www.jamboworks.com
+
rhuk@rockettheme.com.com
+
http://www.rockettheme.com
2.2
SolarFlare II is a simple and stylish template. The clean design of this template makes it very lightweight and fast. This is a significatn upgrade for the original SolarFlare template in that is has a completely revised layout that uses an alternate box model hack that makes it easier to modify. Also a table has been introduced in the main content area that better constricts layout causing less problems with 'problematic' components. New headers and menu elements give this template a 'fresher' look.