Update of /cvsroot/phpslash/phpslash-dev/public_html/scripts/tinymce/jscripts/tiny_mce/themes/advanced
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17564/phpslash-dev/public_html/scripts/tinymce/jscripts/tiny_mce/themes/advanced
Added Files:
anchor.htm charmap.htm color_picker.htm editor_content.css
editor_popup.css editor_template.js editor_template_src.js
editor_ui.css image.htm link.htm source_editor.htm table.htm
Log Message:
complete tinyMCE addition
--- NEW FILE: anchor.htm ---
<html>
<head>
<title>{$lang_insert_anchor_title}</title>
<script language="javascript" src="../../tiny_mce_popup.js"></script>
<script language="javascript">
function init() {
document.forms[0].anchorName.value = tinyMCE.getWindowArg('name');
window.focus();
}
function insertAnchor() {
if (window.opener) {
tinyMCE.execInstanceCommand(tinyMCE.getWindowArg('editor_id'), 'mceAnchor', false, document.forms[0].anchorName.value);
top.close();
}
}
function cancelAction() {
top.close();
}
</script>
</head>
<body onload="init();">
<form onsubmit="insertAnchor();return false;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="middle"><table border="0" cellpadding="4" cellspacing="0">
<tr>
<td colspan="2" class="title">{$lang_insert_anchor_title}</td>
</tr>
<tr>
<td>{$lang_insert_anchor_name}:</td>
<td><input name="anchorName" type="text" id="anchorName" value="" style="width: 200px"></td>
</tr>
<tr>
<td><input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertAnchor();">
</td>
<td align="right"><input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="cancelAction();"></td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>
--- NEW FILE: charmap.htm ---
<html>
<head>
<title>{$lang_theme_charmap_title}</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="javascript" src="../../tiny_mce_popup.js"></script>
<script language="javascript" type="text/javascript">
var charmap = [ "€","‚","ƒ","„","…","†","‡","ˆ","‰","Š","‹",
"Œ","Ž","‘","’","“","”","•","–","—","˜","™",
"š","›","œ","ž","Ÿ","¡","¢","£","¤","¥","¦",
"§","¨","©","ª","«","¬","","®","¯","°",
"±","²","³","´","µ","¶","·","¸","¹",
"º","»","¼","½","¾","¿","À","Á",
"Â","Ã","Ä","Å","Æ","Ç","È","É",
"Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò",
"Ó","Ô","Õ","Ö","×","Ø","Ù","Ú",
"Û","Ü","Ý","Þ","ß","à","á","â",
"ã","ä","å","æ","ç","è","é","ê",
"ë","ì","í","î","ï","ð","ñ","ò",
"ó","ô","õ","ö","÷","ø","ù","ú",
"û","ü","ý","þ","ÿ" ];
function renderCharMapHTML() {
var html = '<table border="1" class="charmap" cellspacing="0"><tr>';
var charsPerRow = 19;
for (var i=0; i<charmap.length; i++) {
html += '<td class="charmap" onmouseover="tinyMCE.switchClass(this,\'charmapOver\');previewChar(\'' + charmap[i] + '\');" onmouseout="tinyMCE.restoreClass(this,\'charmapOver\');"><a class="charmap" href="javascript:insertChar(\'' + charmap[i] + '\');">' + charmap[i] + '</a></td>';
if ((i+1) % charsPerRow == 0)
html += '</tr><tr>';
}
if (i % charsPerRow > 0) {
var padd = charsPerRow - (i % charsPerRow);
// Padd
for (var i=0; i<padd; i++)
html += '<td class="charmap"> </td>';
}
html += '</tr></table>';
document.write(html);
}
function insertChar(chr) {
tinyMCE.execInstanceCommand(tinyMCE.getWindowArg('editor_id'), 'mceInsertContent', false, chr);
window.close();
}
function previewChar(chr) {
//var elm = document.getElementById('preview');
//elm.innerHTML = chr;
}
window.focus();
</script>
</head>
<body>
<div class="title">{$lang_theme_charmap_title}</div>
<br>
<div align="center">
<script language="javascript" type="text/javascript">
renderCharMapHTML();
</script>
</div>
</body>
</html>
--- NEW FILE: color_picker.htm ---
<html>
<head>
<title>{$lang_theme_colorpicker_title}</title>
<script language="javascript" src="../../tiny_mce_popup.js"></script>
<script language="javascript">
function selectColor() {
var color = document.getElementById("selectedColorBox").value;
if (window.opener)
window.opener.tinyMCE.execInstanceCommand(tinyMCE.getWindowArg('editor_id'),tinyMCE.getWindowArg('command'),false,color);
window.close();
}
function showColor(color) {
document.getElementById("selectedColor").style.backgroundColor = color;
document.getElementById("selectedColorBox").value = color;
}
window.focus();
var colorPicker = "";
var colors = new Array(
"#000000","#000033","#000066","#000099","#0000CC","#0000FF","#330000","#330033","#330066","#330099","#3300CC",
"#3300FF","#660000","#660033","#660066","#660099","#6600CC","#6600FF","#990000","#990033","#990066","#990099",
"#9900CC","#9900FF","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#FF0000","#FF0033","#FF0066",
"#FF0099","#FF00CC","#FF00FF","#003300","#003333","#003366","#003399","#0033CC","#0033FF","#333300","#333333",
"#333366","#333399","#3333CC","#3333FF","#663300","#663333","#663366","#663399","#6633CC","#6633FF","#993300",
"#993333","#993366","#993399","#9933CC","#9933FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF",
"#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#006600","#006633","#006666","#006699","#0066CC",
"#0066FF","#336600","#336633","#336666","#336699","#3366CC","#3366FF","#666600","#666633","#666666","#666699",
"#6666CC","#6666FF","#996600","#996633","#996666","#996699","#9966CC","#9966FF","#CC6600","#CC6633","#CC6666",
"#CC6699","#CC66CC","#CC66FF","#FF6600","#FF6633","#FF6666","#FF6699","#FF66CC","#FF66FF","#009900","#009933",
"#009966","#009999","#0099CC","#0099FF","#339900","#339933","#339966","#339999","#3399CC","#3399FF","#669900",
"#669933","#669966","#669999","#6699CC","#6699FF","#999900","#999933","#999966","#999999","#9999CC","#9999FF",
"#CC9900","#CC9933","#CC9966","#CC9999","#CC99CC","#CC99FF","#FF9900","#FF9933","#FF9966","#FF9999","#FF99CC",
"#FF99FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#33CC00","#33CC33","#33CC66","#33CC99",
"#33CCCC","#33CCFF","#66CC00","#66CC33","#66CC66","#66CC99","#66CCCC","#66CCFF","#99CC00","#99CC33","#99CC66",
"#99CC99","#99CCCC","#99CCFF","#CCCC00","#CCCC33","#CCCC66","#CCCC99","#CCCCCC","#CCCCFF","#FFCC00","#FFCC33",
"#FFCC66","#FFCC99","#FFCCCC","#FFCCFF","#00FF00","#00FF33","#00FF66","#00FF99","#00FFCC","#00FFFF","#33FF00",
"#33FF33","#33FF66","#33FF99","#33FFCC","#33FFFF","#66FF00","#66FF33","#66FF66","#66FF99","#66FFCC","#66FFFF",
"#99FF00","#99FF33","#99FF66","#99FF99","#99FFCC","#99FFFF","#CCFF00","#CCFF33","#CCFF66","#CCFF99","#CCFFCC",
"#CCFFFF","#FFFF00","#FFFF33","#FFFF66","#FFFF99","#FFFFCC","#FFFFFF");
colorPicker += '<table border="0" cellspacing="1" cellpadding="0">';
colorPicker += '<tr>';
for (var i=0; i<colors.length; i++) {
colorPicker += '<td bgcolor="' + colors[i] + '"><a href="javascript:void(0);" onclick="selectColor();" onmouseover="showColor(\'' + colors[i] + '\');"><img border="0" src="images/spacer.gif" width="8" height="12"></a></td>';
if ((i+1) % 18 == 0)
colorPicker += '</tr><tr>';
}
colorPicker += '<tr><td colspan="18">';
colorPicker += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
colorPicker += '<tr><td><img id="selectedColor" style="background-color:' + tinyMCE.getWindowArg('input_color') + '" border="0" src="images/spacer.gif" width="80" height="16"></td><td align="right"><input id="selectedColorBox" name="selectedColorBox" type="text" size="7" maxlength="7" style="width:65px" value="' + tinyMCE.getWindowArg('input_color') + '"></td></tr>';
colorPicker += '</table><input type="button" id="insert" name="insert" value="{$lang_theme_colorpicker_apply}" style="margin-top:3px" onclick="selectColor();"></td></tr>';
colorPicker += '</table>';
</script>
</head>
<body marginheight="3" topmargin="3" leftmargin="3" marginwidth="3">
<div align="center">
<script language="JavaScript">
document.write(colorPicker);
</script>
</div>
</body>
</html>
--- NEW FILE: editor_content.css ---
body {
background-color: #FFFFFF;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
scrollbar-3dlight-color: #F0F0EE;
scrollbar-arrow-color: #676662;
scrollbar-base-color: #F0F0EE;
scrollbar-darkshadow-color: #DDDDDD;
scrollbar-face-color: #E0E0DD;
scrollbar-highlight-color: #F0F0EE;
scrollbar-shadow-color: #F0F0EE;
scrollbar-track-color: #F5F5F5;
}
td {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
pre {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
--- NEW FILE: editor_popup.css ---
body {
background-color: #F0F0EE;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
scrollbar-3dlight-color: #F0F0EE;
scrollbar-arrow-color: #676662;
scrollbar-base-color: #F0F0EE;
scrollbar-darkshadow-color: #DDDDDD;
scrollbar-face-color: #E0E0DD;
scrollbar-highlight-color: #F0F0EE;
scrollbar-shadow-color: #F0F0EE;
scrollbar-track-color: #F5F5F5;
}
td {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
}
input {
background: #FFFFFF;
border: 1px solid #cccccc;
}
td, input, select, textarea {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
input, select, textarea {
border: 1px solid #808080;
}
.input_noborder {
border: 0px solid #808080;
}
#insert {
font-weight: bold;
}
#cancel {
font-weight: bold;
}
.title {
font-size: 12px;
font-weight: bold;
}
table.charmap {
border-style: solid;
border-width: 1px;
border-color: #AAAAAA;
}
td.charmap, td.charmapOver {
color: #000000;
border-color: #AAAAAA;
border-style: solid;
border-width: 1px;
text-align: center;
font-size: 12px;
}
td.charmapOver {
background-color: #CCCCCC
}
a.charmap {
cursor: hand;
color: #000000;
text-decoration: none
}
--- NEW FILE: editor_template.js ---
/* Import theme specific language pack */
tinyMCE.importThemeLanguagePack();var TinyMCE_advanced_autoImportCSSClasses=true;var TinyMCE_advanced_foreColor="#000000";var TinyMCE_advanced_anchorName="";var TinyMCE_advanced_buttons=[['bold','{$lang_bold_img}','{$lang_bold_desc}','Bold'],['italic','{$lang_italic_img}','{$lang_italic_desc}','Italic'],['underline','{$lang_underline_img}','{$lang_underline_desc}','Underline'],['strikethrough','strikethrough.gif','{$lang_striketrough_desc}','Strikethrough'],['justifyleft','left.gif','{$lang_justifyleft_desc}','JustifyLeft'],['justifycenter','center.gif','{$lang_justifycenter_desc}','JustifyCenter'],['justifyright','right.gif','{$lang_justifyright_desc}','JustifyRight'],['justifyfull','full.gif','{$lang_justifyfull_desc}','JustifyFull'],['bullist','bullist.gif','{$lang_bullist_desc}','InsertUnorderedList'],['numlist','numlist.gif','{$lang_numlist_desc}','InsertOrderedList'],['outdent','outdent.gif','{$lang_outdent_desc}','Outdent'],['indent','indent.gif','{$lang_indent_desc}','Indent'],['undo','undo.gif','{$lang_undo_desc}','Undo'],['redo','redo.gif','{$lang_redo_desc}','Redo'],['link','link.gif','{$lang_link_desc}','mceLink',true],['unlink','unlink.gif','{$lang_unlink_desc}','unlink'],['image','image.gif','{$lang_image_desc}','mceImage',true],['cleanup','cleanup.gif','{$lang_cleanup_desc}','mceCleanup'],['help','help.gif','{$lang_help_desc}','mceHelp'],['code','code.gif','{$lang_theme_code_desc}','mceCodeEditor'],['table','table.gif','{$lang_theme_table_desc}','mceInsertTable',true],['row_before','table_insert_row_before.gif','{$lang_theme_table_insert_row_before_desc}','mceTableInsertRowBefore'],['row_after','table_insert_row_after.gif','{$lang_theme_table_insert_row_after_desc}','mceTableInsertRowAfter'],['delete_row','table_delete_row.gif','{$lang_theme_table_delete_row_desc}','mceTableDeleteRow'],['col_before','table_insert_col_before.gif','{$lang_theme_table_insert_col_before_desc}','mceTableInsertColBefore'],['col_after','table_insert_col_after.gif','{$lang_theme_table_insert_col_after_desc}','mceTableInsertColAfter'],['delete_col','table_delete_col.gif','{$lang_theme_table_delete_col_desc}','mceTableDeleteCol'],['hr','hr.gif','{$lang_theme_hr_desc}','inserthorizontalrule'],['removeformat','removeformat.gif','{$lang_theme_removeformat_desc}','removeformat'],['sub','sub.gif','{$lang_theme_sub_desc}','subscript'],['sup','sup.gif','{$lang_theme_sup_desc}','superscript'],['forecolor','forecolor.gif','{$lang_theme_forecolor_desc}','mceForeColor'],['charmap','charmap.gif','{$lang_theme_charmap_desc}','mceCharMap'],['visualaid','visualaid.gif','{$lang_theme_visualaid_desc}','mceToggleVisualAid'],['anchor','anchor.gif','{$lang_theme_anchor_desc}','mceInsertAnchor']];function TinyMCE_advanced_getControlHTML(button_name){for(var i=0;i<TinyMCE_advanced_buttons.length;i++){var but=TinyMCE_advanced_buttons[i];if(but[0]==button_name)return '<img id="{$editor_id}_'+but[0]+'" src="{$themeurl}/images/'+but[1]+'" title="'+but[2]+'" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+but[3]+'\', '+(but.length>4?but[4]:false)+(but.length>5?', \''+but[5]+'\'':'')+')">';}switch(button_name){case "formatselect":var html='<select id="{$editor_id}_formatSelect" name="{$editor_id}_formatSelect" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FormatBlock\',false,this.options[this.selectedIndex].value);" class="mceSelectList">';var formats=tinyMCE.getParam("theme_advanced_blockformats","p,address,pre,h1,h2,h3,h4,h5,h6",true).split(',');var lookup=[['p','{$lang_theme_paragraph}'],['address','{$lang_theme_address}'],['pre','{$lang_theme_pre}'],['h1','{$lang_theme_h1}'],['h2','{$lang_theme_h2}'],['h3','{$lang_theme_h3}'],['h4','{$lang_theme_h4}'],['h5','{$lang_theme_h5}'],['h6','{$lang_theme_h6}']];for(var i=0;i<formats.length;i++){for(var x=0;x<lookup.length;x++){if(formats[i]==lookup[x][0])html+='<option value="<'+lookup[x][0]+'>">'+lookup[x][1]+'</option>';}}html+='</select>';return html;case "styleselect":return '<select id="{$editor_id}_styleSelect" onmousedown="TinyMCE_advanced_setupCSSClasses(\'{$editor_id}\');" name="{$editor_id}_styleSelect" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSetCSSClass\',false,this.options[this.selectedIndex].value);" class="mceSelectList">{$style_select_options}</select>';case "fontselect":return '<select id="{$editor_id}_fontNameSelect" name="{$editor_id}_fontNameSelect" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontName\',false,this.options[this.selectedIndex].value);" class="mceSelectList">\
<option value="">{$lang_theme_fontdefault}</option>\
<option value="arial,helvetica,sans-serif">Arial</option>\
<option value="times new roman,times,serif">Times New Roman</option>\
<option value="verdana,arial,helvetica,sans-serif">Verdana</option>\
<option value="courier new,courier,monospace">Courier</option>\
<option value="georgia,times new roman,times,serif">Georgia</option>\
<option value="tahoma,arial,helvetica,sans-serif">Tahoma</option>\
</select>';case "fontsizeselect":return '<select id="{$editor_id}_fontSizeSelect" name="{$editor_id}_fontSizeSelect" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontSize\',false,this.options[this.selectedIndex].value);" class="mceSelectList">\
<option value="1">1 (8 pt)</option>\
<option value="2">2 (10 pt)</option>\
<option value="3">3 (12 pt)</option>\
<option value="4">4 (14 pt)</option>\
<option value="5">5 (18 pt)</option>\
<option value="6">6 (24 pt)</option>\
<option value="7">7 (36 pt)</option>\
</select>';case "separator":return '<img src="{$themeurl}/images/spacer.gif" width="1" height="15" class="mceSeparatorLine">';case "rowseparator":return '<br>';}return "";}function TinyMCE_advanced_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceForeColor":var template=new Array();var inputColor=TinyMCE_advanced_foreColor;if(!inputColor)inputColor="#000000";template['file']='color_picker.htm';template['width']=190;template['height']=235;tinyMCE.openWindow(template,{editor_id:editor_id,command:"forecolor",input_color:inputColor});return true;case "mceCodeEditor":var template=new Array();template['file']='source_editor.htm';template['width']=tinyMCE.getParam("theme_advanced_source_editor_width",440);template['height']=tinyMCE.getParam("theme_advanced_source_editor_height",370);tinyMCE.openWindow(template,{editor_id:editor_id,resizable:"yes",scrollbars:"yes"});return true;case "mceCharMap":var template=new Array();template['file']='charmap.htm';template['width']=320;template['height']=210;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case "mceInsertAnchor":var template=new Array();template['file']='anchor.htm';template['width']=320;template['height']=130;tinyMCE.openWindow(template,{editor_id:editor_id,name:TinyMCE_advanced_anchorName});return true;}return false;}function TinyMCE_advanced_getEditorTemplate(settings){function removeFromArray(in_array,remove_array){var outArray=new Array();for(var i=0;i<in_array.length;i++){skip=false;for(var j=0;j<remove_array.length;j++){if(in_array[i]==remove_array[j])skip=true;}if(!skip)outArray[outArray.length]=in_array[i];}return outArray;}function addToArray(in_array,add_array){for(var i=0;i<add_array.length;i++)in_array[in_array.length]=add_array[i];return in_array;}var template=new Array();var toolbarHTML="";var toolbarLocation=tinyMCE.getParam("theme_advanced_toolbar_location","bottom");var buttonNamesRow1=tinyMCE.getParam("theme_advanced_buttons1","bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect",true,',');buttonNamesRow1=removeFromArray(buttonNamesRow1,tinyMCE.getParam("theme_advanced_disable","",true,','));buttonNamesRow1=addToArray(buttonNamesRow1,tinyMCE.getParam("theme_advanced_buttons1_add","",true,','));for(var i=0;i<buttonNamesRow1.length;i++)toolbarHTML+=tinyMCE.getControlHTML(buttonNamesRow1[i]);if(buttonNamesRow1.length>0)toolbarHTML+="<br>";var buttonNamesRow2=tinyMCE.getParam("theme_advanced_buttons2","bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",true,',');buttonNamesRow2=removeFromArray(buttonNamesRow2,tinyMCE.getParam("theme_advanced_disable","",true,','));buttonNamesRow2=addToArray(buttonNamesRow2,tinyMCE.getParam("theme_advanced_buttons2_add","",true,','));for(var i=0;i<buttonNamesRow2.length;i++)toolbarHTML+=tinyMCE.getControlHTML(buttonNamesRow2[i]);if(buttonNamesRow2.length>0)toolbarHTML+="<br>";var buttonNamesRow3=tinyMCE.getParam("theme_advanced_buttons3","table,separator,row_before,row_after,delete_row,separator,col_before,col_after,delete_col,separator,hr,removeformat,visualaid,separator,sub,sup,separator,charmap",true,',');buttonNamesRow3=removeFromArray(buttonNamesRow3,tinyMCE.getParam("theme_advanced_disable","",true,','));buttonNamesRow3=addToArray(buttonNamesRow3,tinyMCE.getParam("theme_advanced_buttons3_add","",true,','));for(var i=0;i<buttonNamesRow3.length;i++)toolbarHTML+=tinyMCE.getControlHTML(buttonNamesRow3[i]);template['html']='<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}">';if(toolbarLocation=="top")template['html']+='<tr><td class="mceToolbarTop" align="center" height="1">'+toolbarHTML+'</td></tr>';template['html']+='<tr><td align="center">\
<span id="{$editor_id}"></span>\
</td></tr>';if(toolbarLocation=="bottom")template['html']+='<tr><td class="mceToolbarBottom" align="center" height="1">'+toolbarHTML+'</td></tr>';template['html']+='</table>';var styleSelectHTML='<option value="">-- {$lang_theme_style_select} --</option>';if(settings['theme_advanced_styles']){var stylesAr=settings['theme_advanced_styles'].split(';');for(var i=0;i<stylesAr.length;i++){var key,value;key=stylesAr[i].split('=')[0];value=stylesAr[i].split('=')[1];styleSelectHTML+='<option value="'+value+'">'+key+'</option>';}TinyMCE_advanced_autoImportCSSClasses=false;}template['html']=tinyMCE.replaceVar(template['html'],'style_select_options',styleSelectHTML);template['delta_width']=0;template['delta_height']=-40;return template;}function TinyMCE_advanced_getInsertLinkTemplate(){var template=new Array();template['file']='link.htm';template['width']=320;template['height']=170;template['width']+=tinyMCE.getLang('lang_insert_link_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_link_delta_height',0);return template;}function TinyMCE_advanced_getInsertImageTemplate(){var template=new Array();template['file']='image.htm';template['width']=340;template['height']=280;template['width']+=tinyMCE.getLang('lang_insert_image_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_image_delta_height',0);return template;}function TinyMCE_advanced_getInsertTableTemplate(settings){var template=new Array();template['file']='table.htm';template['width']=340;template['height']=220;template['width']+=tinyMCE.getLang('lang_insert_table_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_table_delta_height',0);return template;}function TinyMCE_advanced_handleNodeChange(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){function selectByValue(select_elm,value){if(select_elm){for(var i=0;i<select_elm.options.length;i++){if(select_elm.options[i].value==value){select_elm.selectedIndex=i;return true;}}}return false;}var colorElm=tinyMCE.getParentElement(node,"font","color");if(colorElm)TinyMCE_advanced_foreColor=""+colorElm.color.toUpperCase();tinyMCE.switchClassSticky(editor_id+'_justifyleft','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_justifyright','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_justifycenter','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_justifyfull','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_underline','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_numlist','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_sub','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_sup','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_table','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+'_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+'_outdent','mceButtonDisabled',true);var anchorName=tinyMCE.getParentElement(node,"a","name");TinyMCE_advanced_anchorName="";if(anchorName){TinyMCE_advanced_anchorName=anchorName.getAttribute("name");tinyMCE.switchClassSticky(editor_id+'_anchor','mceButtonSelected');}var anchorLink=tinyMCE.getParentElement(node,"a","href");if(anchorLink||any_selection){tinyMCE.switchClassSticky(editor_id+'_link',anchorLink?'mceButtonSelected':'mceButtonNormal',false);tinyMCE.switchClassSticky(editor_id+'_unlink',anchorLink?'mceButtonSelected':'mceButtonNormal',false);}tinyMCE.switchClassSticky(editor_id+'_visualaid',visual_aid?'mceButtonSelected':'mceButtonNormal',false);if(undo_levels!=-1){tinyMCE.switchClassSticky(editor_id+'_undo','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_redo','mceButtonDisabled',true);}if(tinyMCE.getParentElement(node,"td")){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);}if(tinyMCE.getParentElement(node,"table"))tinyMCE.switchClassSticky(editor_id+'_table','mceButtonSelected');if(tinyMCE.getParentElement(node,"li,blockquote"))tinyMCE.switchClassSticky(editor_id+'_outdent','mceButtonNormal',false);if(undo_index!=-1&&(undo_index<undo_levels-1&&undo_levels>0))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<selectElm.options.length;i++){if(selectElm.options[i].value==classNode.className){index=i;breakOut=true;break;}}}}while(!breakOut&&(classNode=classNode.parentNode));selectElm.selectedIndex=index;}var selectElm=document.getElementById(editor_id+"_formatSelect");if(selectElm){var elm=tinyMCE.getParentElement(node,"p,div,h1,h2,h3,h4,h5,h6,pre,address");if(elm){selectByValue(selectElm,"<"+elm.nodeName.toLowerCase()+">");}else selectByValue(selectElm,"<p>");}var selectElm=document.getElementById(editor_id+"_fontNameSelect");if(selectElm){var elm=tinyMCE.getParentElement(node,"font","face");if(elm)selectByValue(selectElm,elm.getAttribute("face"));else selectByValue(selectElm,"");}var selectElm=document.getElementById(editor_id+"_fontSizeSelect");if(selectElm){var elm=tinyMCE.getParentElement(node,"font","size");if(elm)selectByValue(selectElm,elm.getAttribute("size"));else selectByValue(selectElm,"1");}alignNode=node;breakOut=false;do{if(!alignNode.getAttribute||!alignNode.getAttribute('align'))continue;switch(alignNode.getAttribute('align').toLowerCase()){case "left":tinyMCE.switchClassSticky(editor_id+'_justifyleft','mceButtonSelected');breakOut=true;break;case "right":tinyMCE.switchClassSticky(editor_id+'_justifyright','mceButtonSelected');breakOut=true;break;case "middle":case "center":tinyMCE.switchClassSticky(editor_id+'_justifycenter','mceButtonSelected');breakOut=true;break;case "justify":tinyMCE.switchClassSticky(editor_id+'_justifyfull','mceButtonSelected');breakOut=true;break;}}while(!breakOut&&(alignNode=alignNode.parentNode));do{switch(node.nodeName.toLowerCase()){case "b":case "strong":tinyMCE.switchClassSticky(editor_id+'_bold','mceButtonSelected');break;case "i":case "em":tinyMCE.switchClassSticky(editor_id+'_italic','mceButtonSelected');break;case "u":tinyMCE.switchClassSticky(editor_id+'_underline','mceButtonSelected');break;case "strike":tinyMCE.switchClassSticky(editor_id+'_strikethrough','mceButtonSelected');break;case "ul":tinyMCE.switchClassSticky(editor_id+'_bullist','mceButtonSelected');break;case "ol":tinyMCE.switchClassSticky(editor_id+'_numlist','mceButtonSelected');break;case "sub":tinyMCE.switchClassSticky(editor_id+'_sub','mceButtonSelected');break;case "sup":tinyMCE.switchClassSticky(editor_id+'_sup','mceButtonSelected');break;}}while((node=node.parentNode));}function TinyMCE_advanced_setupCSSClasses(editor_id){if(!TinyMCE_advanced_autoImportCSSClasses)return;var selectElm=document.getElementById(editor_id+'_styleSelect');if(selectElm&&selectElm
.getAttribute('cssImported')!='true'){var csses=tinyMCE.getCSSClasses(editor_id);if(csses&&selectElm){for(var i=0;i<csses.length;i++)selectElm.options[selectElm.length]=new Option(csses[i],csses[i]);}if(csses!=null&&csses.length>0)selectElm.setAttribute('cssImported','true');}}
--- NEW FILE: editor_template_src.js ---
/* Import theme specific language pack */
tinyMCE.importThemeLanguagePack();
// Variable declarations
var TinyMCE_advanced_autoImportCSSClasses = true;
var TinyMCE_advanced_foreColor = "#000000";
var TinyMCE_advanced_anchorName = "";
var TinyMCE_advanced_buttons = [
// Control id, button img, button title, command, user_interface, value
['bold', '{$lang_bold_img}', '{$lang_bold_desc}', 'Bold'],
['italic', '{$lang_italic_img}', '{$lang_italic_desc}', 'Italic'],
['underline', '{$lang_underline_img}', '{$lang_underline_desc}', 'Underline'],
['strikethrough', 'strikethrough.gif', '{$lang_striketrough_desc}', 'Strikethrough'],
['justifyleft', 'left.gif', '{$lang_justifyleft_desc}', 'JustifyLeft'],
['justifycenter', 'center.gif', '{$lang_justifycenter_desc}', 'JustifyCenter'],
['justifyright', 'right.gif', '{$lang_justifyright_desc}', 'JustifyRight'],
['justifyfull', 'full.gif', '{$lang_justifyfull_desc}', 'JustifyFull'],
['bullist', 'bullist.gif', '{$lang_bullist_desc}', 'InsertUnorderedList'],
['numlist', 'numlist.gif', '{$lang_numlist_desc}', 'InsertOrderedList'],
['outdent', 'outdent.gif', '{$lang_outdent_desc}', 'Outdent'],
['indent', 'indent.gif', '{$lang_indent_desc}', 'Indent'],
['undo', 'undo.gif', '{$lang_undo_desc}', 'Undo'],
['redo', 'redo.gif', '{$lang_redo_desc}', 'Redo'],
['link', 'link.gif', '{$lang_link_desc}', 'mceLink', true],
['unlink', 'unlink.gif', '{$lang_unlink_desc}', 'unlink'],
['image', 'image.gif', '{$lang_image_desc}', 'mceImage', true],
['cleanup', 'cleanup.gif', '{$lang_cleanup_desc}', 'mceCleanup'],
['help', 'help.gif', '{$lang_help_desc}', 'mceHelp'],
['code', 'code.gif', '{$lang_theme_code_desc}', 'mceCodeEditor'],
['table', 'table.gif', '{$lang_theme_table_desc}', 'mceInsertTable', true],
['row_before', 'table_insert_row_before.gif', '{$lang_theme_table_insert_row_before_desc}', 'mceTableInsertRowBefore'],
['row_after', 'table_insert_row_after.gif', '{$lang_theme_table_insert_row_after_desc}', 'mceTableInsertRowAfter'],
['delete_row', 'table_delete_row.gif', '{$lang_theme_table_delete_row_desc}', 'mceTableDeleteRow'],
['col_before', 'table_insert_col_before.gif', '{$lang_theme_table_insert_col_before_desc}', 'mceTableInsertColBefore'],
['col_after', 'table_insert_col_after.gif', '{$lang_theme_table_insert_col_after_desc}', 'mceTableInsertColAfter'],
['delete_col', 'table_delete_col.gif', '{$lang_theme_table_delete_col_desc}', 'mceTableDeleteCol'],
['hr', 'hr.gif', '{$lang_theme_hr_desc}', 'inserthorizontalrule'],
['removeformat', 'removeformat.gif', '{$lang_theme_removeformat_desc}', 'removeformat'],
['sub', 'sub.gif', '{$lang_theme_sub_desc}', 'subscript'],
['sup', 'sup.gif', '{$lang_theme_sup_desc}', 'superscript'],
['forecolor', 'forecolor.gif', '{$lang_theme_forecolor_desc}', 'mceForeColor'],
['charmap', 'charmap.gif', '{$lang_theme_charmap_desc}', 'mceCharMap'],
['visualaid', 'visualaid.gif', '{$lang_theme_visualaid_desc}', 'mceToggleVisualAid'],
['anchor', 'anchor.gif', '{$lang_theme_anchor_desc}', 'mceInsertAnchor']
];
/**
* Returns HTML code for the specificed control.
*/
function TinyMCE_advanced_getControlHTML(button_name) {
// Lookup button in button list
for (var i=0; i<TinyMCE_advanced_buttons.length; i++) {
var but = TinyMCE_advanced_buttons[i];
if (but[0] == button_name)
return '<img id="{$editor_id}_' + but[0] + '" src="{$themeurl}/images/' + but[1] + '" title="' + but[2] + '" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + but[3] + '\', ' + (but.length > 4 ? but[4] : false) + (but.length > 5 ? ', \'' + but[5] + '\'' : '') + ')">';
}
// Custom controlls other than buttons
switch (button_name) {
case "formatselect":
var html = '<select id="{$editor_id}_formatSelect" name="{$editor_id}_formatSelect" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FormatBlock\',false,this.options[this.selectedIndex].value);" class="mceSelectList">';
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}']
];
// Build format select
for (var i=0; i<formats.length; i++) {
for (var x=0; x<lookup.length; x++) {
if (formats[i] == lookup[x][0])
html += '<option value="<' + lookup[x][0] + '>">' + lookup[x][1] + '</option>';
}
}
html += '</select>';
return html;
case "styleselect":
return '<select id="{$editor_id}_styleSelect" onmousedown="TinyMCE_advanced_setupCSSClasses(\'{$editor_id}\');" name="{$editor_id}_styleSelect" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSetCSSClass\',false,this.options[this.selectedIndex].value);" class="mceSelectList">{$style_select_options}</select>';
case "fontselect":
return '<select id="{$editor_id}_fontNameSelect" name="{$editor_id}_fontNameSelect" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontName\',false,this.options[this.selectedIndex].value);" class="mceSelectList">\
<option value="">{$lang_theme_fontdefault}</option>\
<option value="arial,helvetica,sans-serif">Arial</option>\
<option value="times new roman,times,serif">Times New Roman</option>\
<option value="verdana,arial,helvetica,sans-serif">Verdana</option>\
<option value="courier new,courier,monospace">Courier</option>\
<option value="georgia,times new roman,times,serif">Georgia</option>\
<option value="tahoma,arial,helvetica,sans-serif">Tahoma</option>\
</select>';
case "fontsizeselect":
return '<select id="{$editor_id}_fontSizeSelect" name="{$editor_id}_fontSizeSelect" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontSize\',false,this.options[this.selectedIndex].value);" class="mceSelectList">\
<option value="1">1 (8 pt)</option>\
<option value="2">2 (10 pt)</option>\
<option value="3">3 (12 pt)</option>\
<option value="4">4 (14 pt)</option>\
<option value="5">5 (18 pt)</option>\
<option value="6">6 (24 pt)</option>\
<option value="7">7 (36 pt)</option>\
</select>';
case "separator":
return '<img src="{$themeurl}/images/spacer.gif" width="1" height="15" class="mceSeparatorLine">';
case "rowseparator":
return '<br>';
}
return "";
}
/**
* Theme specific exec command handeling.
*/
function TinyMCE_advanced_execCommand(editor_id, element, command, user_interface, value) {
switch (command) {
case "mceForeColor":
var template = new Array();
var inputColor = TinyMCE_advanced_foreColor;
if (!inputColor)
inputColor = "#000000";
template['file'] = 'color_picker.htm';
template['width'] = 190;
template['height'] = 235;
tinyMCE.openWindow(template, {editor_id : editor_id, command : "forecolor", input_color : inputColor});
return true;
case "mceCodeEditor":
var template = new Array();
template['file'] = 'source_editor.htm';
template['width'] = tinyMCE.getParam("theme_advanced_source_editor_width", 440);
template['height'] = tinyMCE.getParam("theme_advanced_source_editor_height", 370);
tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "yes"});
return true;
case "mceCharMap":
var template = new Array();
template['file'] = 'charmap.htm';
template['width'] = 320;
template['height'] = 210;
tinyMCE.openWindow(template, {editor_id : editor_id});
return true;
case "mceInsertAnchor":
var template = new Array();
template['file'] = 'anchor.htm';
template['width'] = 320;
template['height'] = 130;
tinyMCE.openWindow(template, {editor_id : editor_id, name : TinyMCE_advanced_anchorName});
return true;
}
// Default behavior
return false;
}
/**
* Editor instance template function.
*/
function TinyMCE_advanced_getEditorTemplate(settings) {
function removeFromArray(in_array, remove_array) {
var outArray = new Array();
for (var i=0; i<in_array.length; i++) {
skip = false;
for (var j=0; j<remove_array.length; j++) {
if (in_array[i] == remove_array[j])
skip = true;
}
if (!skip)
outArray[outArray.length] = in_array[i];
}
return outArray;
}
function addToArray(in_array, add_array) {
for (var i=0; i<add_array.length; i++)
in_array[in_array.length] = add_array[i];
return in_array;
}
var template = new Array();
var toolbarHTML = "";
var toolbarLocation = tinyMCE.getParam("theme_advanced_toolbar_location", "bottom");
// Render row 1
var buttonNamesRow1 = tinyMCE.getParam("theme_advanced_buttons1", "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect", true, ',');
buttonNamesRow1 = removeFromArray(buttonNamesRow1, tinyMCE.getParam("theme_advanced_disable", "", true, ','));
buttonNamesRow1 = addToArray(buttonNamesRow1, tinyMCE.getParam("theme_advanced_buttons1_add", "", true, ','));
for (var i=0; i<buttonNamesRow1.length; i++)
toolbarHTML += tinyMCE.getControlHTML(buttonNamesRow1[i]);
if (buttonNamesRow1.length > 0)
toolbarHTML += "<br>";
// Render row 2
var buttonNamesRow2 = tinyMCE.getParam("theme_advanced_buttons2", "bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code", true, ',');
buttonNamesRow2 = removeFromArray(buttonNamesRow2, tinyMCE.getParam("theme_advanced_disable", "", true, ','));
buttonNamesRow2 = addToArray(buttonNamesRow2, tinyMCE.getParam("theme_advanced_buttons2_add", "", true, ','));
for (var i=0; i<buttonNamesRow2.length; i++)
toolbarHTML += tinyMCE.getControlHTML(buttonNamesRow2[i]);
if (buttonNamesRow2.length > 0)
toolbarHTML += "<br>";
// Render row 3
var buttonNamesRow3 = tinyMCE.getParam("theme_advanced_buttons3", "table,separator,row_before,row_after,delete_row,separator,col_before,col_after,delete_col,separator,hr,removeformat,visualaid,separator,sub,sup,separator,charmap", true, ',');
buttonNamesRow3 = removeFromArray(buttonNamesRow3, tinyMCE.getParam("theme_advanced_disable", "", true, ','));
buttonNamesRow3 = addToArray(buttonNamesRow3, tinyMCE.getParam("theme_advanced_buttons3_add", "", true, ','));
for (var i=0; i<buttonNamesRow3.length; i++)
toolbarHTML += tinyMCE.getControlHTML(buttonNamesRow3[i]);
// Setup template html
template['html'] = '<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}">';
if (toolbarLocation == "top")
template['html'] += '<tr><td class="mceToolbarTop" align="center" height="1">' + toolbarHTML + '</td></tr>';
/* template['html'] += '<tr><td align="center">\
<iframe id="{$editor_id}" class="mceEditorArea" border="1" frameborder="0" src="{$default_document}" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" style="width:{$area_width};height:{$area_height}" width="{$area_width}" height="{$area_height}"></iframe>\
</td></tr>';*/
template['html'] += '<tr><td align="center">\
<span id="{$editor_id}"></span>\
</td></tr>';
if (toolbarLocation == "bottom")
template['html'] += '<tr><td class="mceToolbarBottom" align="center" height="1">' + toolbarHTML + '</td></tr>';
template['html'] += '</table>';
// Setup style select options
var styleSelectHTML = '<option value="">-- {$lang_theme_style_select} --</option>';
if (settings['theme_advanced_styles']) {
var stylesAr = settings['theme_advanced_styles'].split(';');
for (var i=0; i<stylesAr.length; i++) {
var key, value;
key = stylesAr[i].split('=')[0];
value = stylesAr[i].split('=')[1];
styleSelectHTML += '<option value="' + value + '">' + key + '</option>';
}
TinyMCE_advanced_autoImportCSSClasses = false;
}
template['html'] = tinyMCE.replaceVar(template['html'], 'style_select_options', styleSelectHTML);
template['delta_width'] = 0;
template['delta_height'] = -40;
return template;
}
/**
* Insert link template function.
*/
function TinyMCE_advanced_getInsertLinkTemplate() {
var template = new Array();
template['file'] = 'link.htm';
template['width'] = 320;
template['height'] = 170;
// Language specific width and height addons
template['width'] += tinyMCE.getLang('lang_insert_link_delta_width', 0);
template['height'] += tinyMCE.getLang('lang_insert_link_delta_height', 0);
return template;
}
/**
* Insert image template function.
*/
function TinyMCE_advanced_getInsertImageTemplate() {
var template = new Array();
template['file'] = 'image.htm';
template['width'] = 340;
template['height'] = 280;
// Language specific width and height addons
template['width'] += tinyMCE.getLang('lang_insert_image_delta_width', 0);
template['height'] += tinyMCE.getLang('lang_insert_image_delta_height', 0);
return template;
}
/**
* Insert table template function.
*/
function TinyMCE_advanced_getInsertTableTemplate(settings) {
var template = new Array();
template['file'] = 'table.htm';
template['width'] = 340;
template['height'] = 220;
// Language specific width and height addons
template['width'] += tinyMCE.getLang('lang_insert_table_delta_width', 0);
template['height'] += tinyMCE.getLang('lang_insert_table_delta_height', 0);
return template;
}
/**
* Node change handler.
*/
function TinyMCE_advanced_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
function selectByValue(select_elm, value) {
if (select_elm) {
for (var i=0; i<select_elm.options.length; i++) {
if (select_elm.options[i].value == value) {
select_elm.selectedIndex = i;
return true;
}
}
}
return false;
}
// Get element color
var colorElm = tinyMCE.getParentElement(node, "font", "color");
if (colorElm)
TinyMCE_advanced_foreColor = "" + colorElm.color.toUpperCase();
// Reset old states
tinyMCE.switchClassSticky(editor_id + '_justifyleft', 'mceButtonNormal');
tinyMCE.switchClassSticky(editor_id + '_justifyright', 'mceButtonNormal');
tinyMCE.switchClassSticky(editor_id + '_justifycenter', 'mceButtonNormal');
tinyMCE.switchClassSticky(editor_id + '_justifyfull', 'mceButtonNormal');
tinyMCE.switchClassSticky(editor_id + '_bold', 'mceButtonNormal');
tinyMCE.switchClassSticky(editor_id + '_italic', 'mceButtonNormal');
tinyMCE.switchClassSticky(editor_id + '_underline', 'mceButtonNormal');
tinyMCE.switchClassSticky(editor_id + '_strikethrough', 'mceButtonNormal');
tinyMCE.switchClassSticky(editor_id + '_bullist', 'mceButtonNormal');
tinyMCE.switchClassSticky(editor_id + '_numlist', 'mceButtonNormal');
tinyMCE.switchClassSticky(editor_id + '_sub', 'mceButtonNormal');
tinyMCE.switchClassSticky(editor_id + '_sup', 'mceButtonNormal');
tinyMCE.switchClassSticky(editor_id + '_table', '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 + '_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 + '_outdent', 'mceButtonDisabled', true);
// Get anchor name
var anchorName = tinyMCE.getParentElement(node, "a", "name");
TinyMCE_advanced_anchorName = "";
if (anchorName) {
TinyMCE_advanced_anchorName = anchorName.getAttribute("name");
tinyMCE.switchClassSticky(editor_id + '_anchor', 'mceButtonSelected');
}
// Get link
var anchorLink = tinyMCE.getParentElement(node, "a", "href");
if (anchorLink || any_selection) {
tinyMCE.switchClassSticky(editor_id + '_link', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal', false);
tinyMCE.switchClassSticky(editor_id + '_unlink', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal', false);
}
// Handle visual aid
tinyMCE.switchClassSticky(editor_id + '_visualaid', visual_aid ? 'mceButtonSelected' : 'mceButtonNormal', false);
if (undo_levels != -1) {
tinyMCE.switchClassSticky(editor_id + '_undo', 'mceButtonDisabled', true);
tinyMCE.switchClassSticky(editor_id + '_redo', 'mceButtonDisabled', true);
}
// Within a td element
if (tinyMCE.getParentElement(node, "td")) {
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);
}
// Within table
if (tinyMCE.getParentElement(node, "table"))
tinyMCE.switchClassSticky(editor_id + '_table', 'mceButtonSelected');
// Within li, blockquote
if (tinyMCE.getParentElement(node, "li,blockquote"))
tinyMCE.switchClassSticky(editor_id + '_outdent', 'mceButtonNormal', false);
// Has redo levels
if (undo_index != -1 && (undo_index < undo_levels-1 && undo_levels > 0))
tinyMCE.switchClassSticky(editor_id + '_redo', 'mceButtonNormal', false);
// Has undo levels
if (undo_index != -1 && (undo_index > 0 && undo_levels > 0))
tinyMCE.switchClassSticky(editor_id + '_undo', 'mceButtonNormal', false);
// Select class in select box
var selectElm = document.getElementById(editor_id + "_styleSelect");
if (selectElm) {
TinyMCE_advanced_setupCSSClasses(editor_id);
classNode = node;
breakOut = false;
var index = 0;
do {
if (classNode && classNode.className) {
for (var i=0; i<selectElm.options.length; i++) {
if (selectElm.options[i].value == classNode.className) {
index = i;
breakOut = true;
break;
}
}
}
} while (!breakOut && (classNode = classNode.parentNode));
selectElm.selectedIndex = index;
}
// Select formatblock
var selectElm = document.getElementById(editor_id + "_formatSelect");
if (selectElm) {
var elm = tinyMCE.getParentElement(node, "p,div,h1,h2,h3,h4,h5,h6,pre,address");
if (elm) {
selectByValue(selectElm, "<" + elm.nodeName.toLowerCase() + ">");
} else
selectByValue(selectElm, "<p>");
}
// Select fontselect
var selectElm = document.getElementById(editor_id + "_fontNameSelect");
if (selectElm) {
var elm = tinyMCE.getParentElement(node, "font", "face");
if (elm)
selectByValue(selectElm, elm.getAttribute("face"));
else
selectByValue(selectElm, "");
}
// Select fontsize
var selectElm = document.getElementById(editor_id + "_fontSizeSelect");
if (selectElm) {
var elm = tinyMCE.getParentElement(node, "font", "size");
if (elm)
selectByValue(selectElm, elm.getAttribute("size"));
else
selectByValue(selectElm, "1");
}
// Handle align attributes
alignNode = node;
breakOut = false;
do {
if (!alignNode.getAttribute || !alignNode.getAttribute('align'))
continue;
switch (alignNode.getAttribute('align').toLowerCase()) {
case "left":
tinyMCE.switchClassSticky(editor_id + '_justifyleft', 'mceButtonSelected');
breakOut = true;
break;
case "right":
tinyMCE.switchClassSticky(editor_id + '_justifyright', 'mceButtonSelected');
breakOut = true;
break;
case "middle":
case "center":
tinyMCE.switchClassSticky(editor_id + '_justifycenter', 'mceButtonSelected');
breakOut = true;
break;
case "justify":
tinyMCE.switchClassSticky(editor_id + '_justifyfull', 'mceButtonSelected');
breakOut = true;
break;
}
} while (!breakOut && (alignNode = alignNode.parentNode));
// Handle elements
do {
switch (node.nodeName.toLowerCase()) {
case "b":
case "strong":
tinyMCE.switchClassSticky(editor_id + '_bold', 'mceButtonSelected');
break;
case "i":
case "em":
tinyMCE.switchClassSticky(editor_id + '_italic', 'mceButtonSelected');
break;
case "u":
tinyMCE.switchClassSticky(editor_id + '_underline', 'mceButtonSelected');
break;
case "strike":
tinyMCE.switchClassSticky(editor_id + '_strikethrough', 'mceButtonSelected');
break;
case "ul":
tinyMCE.switchClassSticky(editor_id + '_bullist', 'mceButtonSelected');
break;
case "ol":
tinyMCE.switchClassSticky(editor_id + '_numlist', 'mceButtonSelected');
break;
case "sub":
tinyMCE.switchClassSticky(editor_id + '_sub', 'mceButtonSelected');
break;
case "sup":
tinyMCE.switchClassSticky(editor_id + '_sup', 'mceButtonSelected');
break;
}
} while ((node = node.parentNode));
}
// This function auto imports CSS classes into the class selection droplist
function TinyMCE_advanced_setupCSSClasses(editor_id) {
if (!TinyMCE_advanced_autoImportCSSClasses)
return;
var selectElm = document.getElementById(editor_id + '_styleSelect');
if (selectElm && selectElm.getAttribute('cssImported') != 'true') {
var csses = tinyMCE.getCSSClasses(editor_id);
if (csses && selectElm) {
for (var i=0; i<csses.length; i++)
selectElm.options[selectElm.length] = new Option(csses[i], csses[i]);
}
// Only do this once
if (csses != null && csses.length > 0)
selectElm.setAttribute('cssImported', 'true');
}
}
--- NEW FILE: editor_ui.css ---
.mceButtonNormal, .mceButtonOver, .mceButtonDown, .mceSeparator, .mceButtonDisabled, .mceButtonSelected {
margin-top: 1px;
margin-left: 1px;
}
.mceButtonNormal {
border-top: 1px solid;
border-left: 1px solid;
border-bottom: 1px solid;
border-right: 1px solid;
border-color: #F0F0EE;
cursor: hand
}
.mceButtonOver {
border-top: 1px solid buttonhighlight;
border-left: 1px solid buttonhighlight;
border-bottom: 1px solid buttonshadow;
border-right: 1px solid buttonshadow;
cursor: hand
}
.mceButtonDown {
border-bottom: 1px solid buttonhighlight;
border-right: 1px solid buttonhighlight;
border-top: 1px solid buttonshadow;
border-left: 1px solid buttonshadow;
cursor: hand
}
.mceButtonSelected {
border-bottom: 1px solid;
border-right: 1px solid;
border-top: 1px solid;
border-left: 1px solid;
border-color: #C0C0BB;
cursor: hand
}
.mceButtonDisabled {
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
-moz-opacity:0.3;
opacity: 0.3;
border-top: 1px solid;
border-left: 1px solid;
border-bottom: 1px solid;
border-right: 1px solid;
border-color: #F0F0EE;
cursor: text
}
.mceSeparator {
border-top: 1px solid buttonhighlight;
border-left: 1px solid buttonhighlight;
border-bottom: 1px solid buttonshadow;
border-right: 1px solid buttonshadow;
margin-right: 2px;
margin-left: 2px;
}
.mceSeparatorLine {
margin:2px;
margin-left: 4px;
background-color: #F0F0EE;
border-top: 1px solid buttonshadow;
border-left: 1px solid buttonshadow;
border-bottom: 1px solid buttonhighlight;
border-right: 1px solid buttonhighlight;
width: 0px;
height: 15px;
}
.mceSelectList {
font-family: "MS Sans Serif";
font-size: 7pt;
font-weight: normal;
margin-top: 3px;
padding: 0px;
display: inline;
vertical-align: top;
background-color: #F0F0EE
}
.mceLabel, .mceLabelDisabled {
font-family: "MS Sans Serif";
font-size: 9pt;
}
.mceLabel {
color: #000000;
}
.mceLabelDisabled {
cursor: text;
color: #999999;
}
.mceEditor {
background: #F0F0EE;
border: 1px solid #cccccc;
}
.mceEditorArea {
font-family: "MS Sans Serif";
background: #FFFFFF;
}
.mceToolbarTop, .mceToolbarBottom {
background: #F0F0EE;
}
.mceToolbarTop {
border-bottom: 1px solid #cccccc;
}
.mceToolbarBottom {
border-top: 1px solid #cccccc;
}
--- NEW FILE: image.htm ---
<html>
<head>
<title>{$lang_insert_image_title}</title>
<script language="javascript" src="../../tiny_mce_popup.js"></script>
<script language="javascript">
function insertImage() {
if (window.opener) {
var src = document.forms[0].src.value;
var alt = document.forms[0].alt.value;
var border = document.forms[0].border.value;
var vspace = document.forms[0].vspace.value;
var hspace = document.forms[0].hspace.value;
var width = document.forms[0].width.value;
var height = document.forms[0].height.value;
var align = document.forms[0].align.options[document.forms[0].align.selectedIndex].value;
window.opener.tinyMCE.insertImage(src, alt, border, hspace, vspace, width, height, align);
top.close();
}
}
function init() {
var formObj = document.forms[0];
for (var i=0; i<document.forms[0].align.options.length; i++) {
if (document.forms[0].align.options[i].value == tinyMCE.getWindowArg('align'))
document.forms[0].align.options.selectedIndex = i;
}
formObj.src.value = tinyMCE.getWindowArg('src');
formObj.alt.value = tinyMCE.getWindowArg('alt');
formObj.border.value = tinyMCE.getWindowArg('border');
formObj.vspace.value = tinyMCE.getWindowArg('vspace');
formObj.hspace.value = tinyMCE.getWindowArg('hspace');
formObj.width.value = tinyMCE.getWindowArg('width');
formObj.height.value = tinyMCE.getWindowArg('height');
formObj.height.value = tinyMCE.getWindowArg('height');
window.focus();
}
function cancelAction() {
top.close();
}
</script>
</head>
<body onload="window.focus();init();">
<form onsubmit="insertImage();return false;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="middle"><table border="0" cellpadding="4" cellspacing="0">
<tr>
<td colspan="2" class="title">{$lang_insert_image_title}</td>
</tr>
<tr>
<td>{$lang_insert_image_src}:</td>
<td><input name="src" type="text" id="src" value="" style="width: 200px"></td>
</tr>
<tr>
<td>{$lang_insert_image_alt}:</td>
<td><input name="alt" type="text" id="alt" value="" style="width: 200px"></td>
</tr>
<tr>
<td>{$lang_insert_image_align}:</td>
<td><select name="align">
<option value="">{$lang_insert_image_align_default}</option>
<option value="baseline">{$lang_insert_image_align_baseline}</option>
<option value="top">{$lang_insert_image_align_top}</option>
<option value="middle">{$lang_insert_image_align_middle}</option>
<option value="bottom">{$lang_insert_image_align_bottom}</option>
<option value="texttop">{$lang_insert_image_align_texttop}</option>
<option value="absmiddle">{$lang_insert_image_align_absmiddle}</option>
<option value="absbottom">{$lang_insert_image_align_absbottom}</option>
<option value="left">{$lang_insert_image_align_left}</option>
<option value="right">{$lang_insert_image_align_right}</option>
</select></td>
</tr>
<tr>
<td>{$lang_insert_image_dimensions}:</td>
<td><input name="width" type="text" id="width" value="" size="3" maxlength="3">
x
<input name="height" type="text" id="height" value="" size="3" maxlength="3"></td>
</tr>
<tr>
<td>{$lang_insert_image_border}:</td>
<td><input name="border" type="text" id="border" value="" size="3" maxlength="3"></td>
</tr>
<tr>
<td>{$lang_insert_image_vspace}:</td>
<td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3"></td>
</tr>
<tr>
<td>{$lang_insert_image_hspace}:</td>
<td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3"></td>
</tr>
<tr>
<td><input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertImage();">
</td>
<td align="right"><input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="cancelAction();"></td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>
--- NEW FILE: link.htm ---
<html>
<head>
<title>{$lang_insert_link_title}</title>
<script language="javascript" src="../../tiny_mce_popup.js"></script>
<script language="javascript">
function init() {
for (var i=0; i<document.forms[0].target.options.length; i++) {
var option = document.forms[0].target.options[i];
if (option.value == tinyMCE.getWindowArg('target'))
option.selected = true;
}
document.forms[0].href.value = tinyMCE.getWindowArg('href');
document.forms[0].linktitle.value = tinyMCE.getWindowArg('title');
window.focus();
}
function insertLink() {
if (window.opener) {
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;
window.opener.tinyMCE.insertLink(href, target, title);
top.close();
}
}
function cancelAction() {
top.close();
}
</script>
</head>
<body onload="init();">
<form onsubmit="insertLink();return false;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="middle"><table border="0" cellpadding="4" cellspacing="0">
<tr>
<td colspan="2" class="title">{$lang_insert_link_title}</td>
</tr>
<tr>
<td>{$lang_insert_link_url}:</td>
<td><input name="href" type="text" id="href" value="" style="width: 200px"></td>
</tr>
<tr>
<td>{$lang_insert_link_target}:</td>
<td><select name="target" style="width: 200px">
<option value="_self">{$lang_insert_link_target_same}</option>
<option value="_blank">{$lang_insert_link_target_blank}</option>
</select></td>
</tr>
<tr>
<td>{$lang_theme_insert_link_...
[truncated message content] |