updating tinymce to 1.43 and fixed some bugs

This commit is contained in:
JT Smith 2005-03-09 00:51:58 +00:00
parent 98dc54e16d
commit 914f29b169
209 changed files with 2183 additions and 1506 deletions

View file

@ -1,2 +1,2 @@
/* Import theme specific language pack */
tinyMCE.importPluginLanguagePack('advimage','en,de,sv,zh_cn,cs');function TinyMCE_advimage_getInsertImageTemplate(){var template=new Array();template['file']='../../plugins/advimage/image.htm';template['width']=380;template['height']=380;template['width']+=tinyMCE.getLang('lang_insert_image_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_image_delta_height',0);return template;}
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('advimage','en,de,sv,zh_cn,cs,fa,fr_ca,fr');function TinyMCE_advimage_getInsertImageTemplate(){var template=new Array();template['file']='../../plugins/advimage/image.htm';template['width']=430;template['height']=380;template['width']+=tinyMCE.getLang('lang_insert_image_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_image_delta_height',0);return template;}function TinyMCE_advimage_handleEvent(editor_id,body,doc){alert(editor_id+","+body.innerHTML);}

View file

@ -1,5 +1,5 @@
/* Import theme specific language pack */
tinyMCE.importPluginLanguagePack('advimage', 'en,de,sv,zh_cn,cs');
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('advimage', 'en,de,sv,zh_cn,cs,fa,fr_ca,fr');
/**
* Insert image template function.
@ -8,7 +8,7 @@ function TinyMCE_advimage_getInsertImageTemplate() {
var template = new Array();
template['file'] = '../../plugins/advimage/image.htm';
template['width'] = 380;
template['width'] = 430;
template['height'] = 380;
// Language specific width and height addons
@ -16,4 +16,13 @@ function TinyMCE_advimage_getInsertImageTemplate() {
template['height'] += tinyMCE.getLang('lang_insert_image_delta_height', 0);
return template;
}
}
/**
* Setup content function.
*/
function TinyMCE_advimage_handleEvent(editor_id, body, doc) {
// Convert all links to absolute
alert(editor_id + "," + body.innerHTML);
}

View file

@ -1,6 +1,4 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<title>{$lang_insert_image_title}</title>
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
@ -11,7 +9,6 @@ if (url != null)
</script>
<script language="javascript" type="text/javascript">
<!--
function myRegexpReplace(in_str, reg_exp, replace_str, opts) {
if (typeof opts == "undefined")
opts = 'g';
@ -46,7 +43,6 @@ if (url != null)
window.opener.tinyMCE.insertImage(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout);
top.close();
}
}
@ -68,6 +64,8 @@ if (url != null)
formObj.height.value = tinyMCE.getWindowArg('height');
formObj.height.value = tinyMCE.getWindowArg('height');
formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('action'), 'Insert', true);
// added 2004-11-10 by Michael Keck (me@michaelkeck.de)
// supporting onmouse over / out for image swap ...
arrOnOver = tinyMCE.getWindowArg('onmouseover').split(';');
@ -108,7 +106,7 @@ if (url != null)
// Handle file browser
if (tinyMCE.getParam("file_browser_callback") != null) {
document.getElementById('src').style.width = '180px';
document.getElementById('src').style.width = '260px';
var html = '';
@ -116,16 +114,45 @@ if (url != null)
html += ' onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');"';
html += ' onmouseout="tinyMCE.restoreClass(this);"';
html += ' onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');"';
html += ' onclick="javascript:tinyMCE.openFileBrowser(\'src\',document.forms[0].src.value,\'image\');"';
html += ' onclick="javascript:tinyMCE.openFileBrowser(\'src\',document.forms[0].src.value,\'image\',window);"';
html += ' width="20" height="18" border="0" title="' + tinyMCE.getLang('lang_browse') + '"';
html += ' class="mceButtonNormal" alt="' + tinyMCE.getLang('lang_browse') + '" />';
document.getElementById('browser').innerHTML = html;
}
// Auto select image in list
selectByValue(formObj, "image_list", tinyMCE.getWindowArg('src'));
selectByValue(formObj, "image_list2", strOnOver);
selectByValue(formObj, "image_list3", strOnOut);
// Handle preview
var htmlprev = '';
var src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], document.forms[0].src.value);
if (src == "")
src = "about:blank";
htmlprev += ' <iframe id="preview" name="preview" scrolling="auto" '
htmlprev += ' marginwidth="0" marginheight="0" frameborder="0" src="' + src + '"'
htmlprev += ' style="margin:0px;border: 1px solid black;width:135px;height:135px"></iframe>';
document.getElementById('prev').innerHTML = htmlprev;
window.focus();
}
function selectByValue(form_obj, field_name, value) {
if (!form_obj || !form_obj.elements[field_name])
return;
for (var i=0; i<form_obj.elements[field_name].options.length; i++) {
var option = form_obj.elements[field_name].options[i];
if (option.value == value)
option.selected = true;
}
}
// added 2004-11-10 by Michael Keck (me@michaelkeck.de)
// supporting onmouse over / out for image swap ...
// this function is needed for visual show, if onmouse over/out available
@ -138,10 +165,10 @@ if (url != null)
document.getElementById('showInput1').style.color="#000000";
document.getElementById('showInput2').style.color="#000000";
}
formObj.onmouseout.value = formObj.src.value;
formObj.onmouseout.value = formObj.src.value;
} else {
formObj.onmouseover.disabled = true;
formObj.onmouseout.disabled =true;
formObj.onmouseout.disabled = true;
if (document.getElementById) {
document.getElementById('showInput1').style.color="#666666";
document.getElementById('showInput2').style.color="#666666";
@ -152,141 +179,173 @@ if (url != null)
function cancelAction() {
top.close();
}
var preloadImg = new Image();
function resetImageData() {
var formObj = document.forms[0];
formObj.width.value = formObj.height.value = "";
}
function updateImageData() {
var formObj = document.forms[0];
if (formObj.width.value == "")
formObj.width.value = preloadImg.width;
if (formObj.height.value == "")
formObj.height.value = preloadImg.height;
}
function getImageData() {
preloadImg = new Image();
tinyMCE.addEvent(preloadImg, "load", updateImageData);
tinyMCE.addEvent(preloadImg, "error", function () {var formObj = document.forms[0];formObj.width.value = formObj.height.value = "";});
preloadImg.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], document.forms[0].src.value);
var src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], document.forms[0].src.value);
if (src == "")
src = "about:blank";
self.preview.location = src;
}
//-->
</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 align="right" nowrap="nowrap">{$lang_insert_image_src}:</td>
<td> <table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input name="src" type="text" id="src" value="" style="width: 200px" /></td>
<td id="browser"></td>
</tr>
</table></td>
</tr>
<!-- Image list -->
<script language="javascript">
if (typeof(tinyMCEImageList) != "undefined" && tinyMCEImageList.length > 0) {
var html = "";
<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="3" class="title">{$lang_insert_image_title}</td>
</tr>
<tr>
<td align="right" nowrap="nowrap">{$lang_insert_image_src}:</td>
<td colspan="2"> <table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input name="src" type="text" id="src" value="" style="width: 280px" onchange="getImageData();" /></td>
<td id="browser"></td>
</tr>
</table></td>
</tr>
<!-- Image list -->
<script language="javascript">
if (typeof(tinyMCEImageList) != "undefined" && tinyMCEImageList.length > 0) {
var html = "";
html += '<tr><td align="right" nowrap="nowrap">{$lang_image_list}:</td>';
html += '<td><select name="image_list" style="width: 200px" onchange="this.form.src.value=this.options[this.selectedIndex].value;">';
html += '<option value="">---</option>';
html += '<tr><td align="right" nowrap="nowrap">{$lang_image_list}:</td>';
html += '<td colspan="2"><select name="image_list" style="width: 280px" onchange="this.form.src.value=this.options[this.selectedIndex].value;resetImageData();getImageData();">';
html += '<option value="">---</option>';
for (var i=0; i<tinyMCEImageList.length; i++)
html += '<option value="' + tinyMCEImageList[i][1] + '">' + tinyMCEImageList[i][0] + '</option>';
for (var i=0; i<tinyMCEImageList.length; i++)
html += '<option value="' + tinyMCEImageList[i][1] + '">' + tinyMCEImageList[i][0] + '</option>';
html += '</select></td></tr>';
html += '</select></td></tr>';
document.write(html);
}
</script>
<!-- /Image list -->
<tr>
<td align="right" nowrap="nowrap">{$lang_insert_image_alt}:</td>
<td><input name="alt" type="text" id="alt" value="" style="width: 200px" onblur="if(document.forms[0].title.value==''){ document.forms[0].title.value=this.value; }" onfocus="if(document.forms[0].title.value==''){ document.forms[0].title.value=this.value; }" /></td>
</tr>
<tr>
<td align="right" nowrap="nowrap">{$lang_insert_image_alt2}:</td>
<td><input name="title" type="text" id="title" value="" style="width: 200px" /></td>
</tr>
<tr>
<td align="right" nowrap="nowrap">{$lang_insert_image_dimensions}:</td>
<td nowrap="nowrap">
<input name="width" type="text" id="width" value="" size="5" maxlength="5" style="vertical-align: middle; width: 50px; text-align: center;" /> x
<input name="height" type="text" id="height" value="" size="5" maxlength="5" style="vertical-align: middle; width: 50px; text-align: center;" /> px
document.write(html);
}
</script>
<!-- /Image list -->
<tr>
<td align="right" nowrap="nowrap">{$lang_insert_image_alt}:</td>
<td colspan="2"><input name="alt" type="text" id="alt" value="" style="width: 280px" onblur="if(document.forms[0].title.value==''){ document.forms[0].title.value=this.value; }" onfocus="if(document.forms[0].title.value==''){ document.forms[0].title.value=this.value; }" /></td>
</tr>
<tr>
<td align="right" nowrap="nowrap">{$lang_insert_image_alt2}:</td>
<td colspan="2"><input name="title" type="text" id="title" value="" style="width: 280px" /></td>
</tr>
<tr>
<td align="right" nowrap="nowrap">{$lang_insert_image_dimensions}:</td>
<td nowrap="nowrap">
<input name="width" type="text" id="width" value="" size="5" maxlength="5" style="vertical-align: middle; width: 50px; text-align: center;" /> x
<input name="height" type="text" id="height" value="" size="5" maxlength="5" style="vertical-align: middle; width: 50px; text-align: center;" /> px
</td>
</tr>
<tr>
<td align="right" nowrap="nowrap">{$lang_insert_image_border}:</td>
<td><input name="border" type="text" id="border" value="" size="3" maxlength="3" style="vertical-align: middle; width: 30px; text-align: center;" /></td>
</tr>
<tr>
<td align="right" nowrap="nowrap">{$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 align="right" nowrap="nowrap">{$lang_insert_image_vspace}:</td>
<td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" style="vertical-align: middle; width: 30px; text-align: center;" /></td>
</tr>
<tr>
<td align="right" nowrap="nowrap">{$lang_insert_image_hspace}:</td>
<td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" style="vertical-align: middle; width: 30px; text-align: center;" /></td>
</tr>
<tr>
<td colspan="2" nowrap="nowrap"><input type="checkbox" name="onmousemove" id="onmousemove" style="border: 1px none #000000; background-color: transparent; vertical-align: middle;" onclick="if(this.checked==true){ setOnMouseInput('enabled'); }else{ setOnMouseInput('enable'); }" /><label for="onmousemove"><b>{$lang_insert_image_onmousemove}</b>:</label></td>
</tr>
<tr>
<td align="right" nowrap="nowrap" id="showInput1">{$lang_insert_image_mouseover}:</td>
<td><input name="onmouseover" type="text" id="onmouseover" value="" style="width: 200px" /></td>
</tr>
<!-- Image list -->
<script language="javascript">
if (typeof(tinyMCEImageList) != "undefined" && tinyMCEImageList.length > 0) {
var html = "";
<td rowspan="6" valign="top"><div id="prev" name="prev" style="margin:0px;border:none;width:135px;height:135px"></div></td>
</tr>
<tr>
<td align="right" nowrap="nowrap">{$lang_insert_image_border}:</td>
<td colspan="2"><input name="border" type="text" id="border" value="" size="3" maxlength="3" style="vertical-align: middle; width: 30px; text-align: center;" /></td>
</tr>
<tr>
<td align="right" nowrap="nowrap">{$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 align="right" nowrap="nowrap">{$lang_insert_image_vspace}:</td>
<td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" style="vertical-align: middle; width: 30px; text-align: center;" /></td>
</tr>
<tr>
<td align="right" nowrap="nowrap">{$lang_insert_image_hspace}:</td>
<td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" style="vertical-align: middle; width: 30px; text-align: center;" /></td>
</tr>
<tr>
<td colspan="2" nowrap="nowrap"><input type="checkbox" name="onmousemove" id="onmousemove" style="border: 1px none #000000; background-color: transparent; vertical-align: middle;" onclick="if(this.checked==true){ setOnMouseInput('enabled'); }else{ setOnMouseInput('enable'); }" /><label for="onmousemove"><b>{$lang_insert_image_onmousemove}</b>:</label></td>
</tr>
<tr>
<td align="right" nowrap="nowrap" id="showInput1">{$lang_insert_image_mouseover}:</td>
<td colspan="2"><input name="onmouseover" type="text" id="onmouseover" value="" style="width: 280px" /></td>
</tr>
<!-- Image list -->
<script language="javascript">
if (typeof(tinyMCEImageList) != "undefined" && tinyMCEImageList.length > 0) {
var html = "";
html += '<tr><td align="right" nowrap="nowrap">{$lang_image_list}:</td>';
html += '<td><select name="image_list2" style="width: 200px" onchange="this.form.onmouseover.value=this.options[this.selectedIndex].value;">';
html += '<option value="">---</option>';
html += '<tr><td align="right" nowrap="nowrap">{$lang_image_list}:</td>';
html += '<td colspan="2"><select name="image_list2" style="width: 280px" onchange="this.form.onmouseover.value=this.options[this.selectedIndex].value;">';
html += '<option value="">---</option>';
for (var i=0; i<tinyMCEImageList.length; i++)
html += '<option value="' + tinyMCEImageList[i][1] + '">' + tinyMCEImageList[i][0] + '</option>';
for (var i=0; i<tinyMCEImageList.length; i++)
html += '<option value="' + tinyMCEImageList[i][1] + '">' + tinyMCEImageList[i][0] + '</option>';
html += '</select></td></tr>';
html += '</select></td></tr>';
document.write(html);
}
</script>
<!-- /Image list -->
<tr>
<td align="right" nowrap="nowrap" id="showInput2">{$lang_insert_image_mouseout}:</td>
<td><input name="onmouseout" type="text" id="onmouseout" value="" style="width: 200px" /></td>
</tr>
<!-- Image list -->
<script language="javascript">
if (typeof(tinyMCEImageList) != "undefined" && tinyMCEImageList.length > 0) {
var html = "";
document.write(html);
}
</script>
<!-- /Image list -->
<tr>
<td align="right" nowrap="nowrap" id="showInput2">{$lang_insert_image_mouseout}:</td>
<td colspan="2"><input name="onmouseout" type="text" id="onmouseout" value="" style="width: 280px" /></td>
</tr>
<!-- Image list -->
<script language="javascript">
if (typeof(tinyMCEImageList) != "undefined" && tinyMCEImageList.length > 0) {
var html = "";
html += '<tr><td align="right" nowrap="nowrap">{$lang_image_list}:</td>';
html += '<td><select name="image_list3" style="width: 200px" onchange="this.form.onmouseout.value=this.options[this.selectedIndex].value;">';
html += '<option value="">---</option>';
html += '<tr><td align="right" nowrap="nowrap">{$lang_image_list}:</td>';
html += '<td colspan="2"><select name="image_list3" style="width: 280px" onchange="this.form.onmouseout.value=this.options[this.selectedIndex].value;">';
html += '<option value="">---</option>';
for (var i=0; i<tinyMCEImageList.length; i++)
html += '<option value="' + tinyMCEImageList[i][1] + '">' + tinyMCEImageList[i][0] + '</option>';
for (var i=0; i<tinyMCEImageList.length; i++)
html += '<option value="' + tinyMCEImageList[i][1] + '">' + tinyMCEImageList[i][0] + '</option>';
html += '</select></td></tr>';
html += '</select></td></tr>';
document.write(html);
}
</script>
<!-- /Image list -->
<tr>
<td><input type="button" name="insert" value="{$lang_insert}" onclick="insertImage();" id="insert" /></td>
<td align="right"><input type="button" name="cancel" value="{$lang_cancel}" onclick="cancelAction();" id="cancel" /></td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>
document.write(html);
}
</script>
<!-- /Image list -->
<tr>
<td><input type="button" name="insert" value="{$lang_insert}" onclick="insertImage();" id="insert" /></td>
<td>&nbsp;</td>
<td align="right"><input type="button" name="cancel" value="{$lang_cancel}" onclick="cancelAction();" id="cancel" /></td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>

View file

@ -0,0 +1,11 @@
// IR lang variables
// Persian (Farsi) language pack (for IRAN)
// By: Morteza Zafari
// Lost@LostLord.com
// http://www.LostLord.com
tinyMCELang['lang_dir'] = 'rtl';
tinyMCELang['lang_insert_image_alt2'] = 'عنوان عکس';
tinyMCELang['lang_insert_image_onmousemove'] = 'عکس جایگزین'
tinyMCELang['lang_insert_image_mouseover'] = 'عکس جایگزین هنگام ورود نشانگر ماوس';
tinyMCELang['lang_insert_image_mouseout'] = 'عکس جایگزین هنگام خروج نشانگر ماوس';

View file

@ -0,0 +1,6 @@
// CA_FR lang variables
tinyMCELang['lang_insert_image_alt2'] = 'Titre de l\'image';
tinyMCELang['lang_insert_image_onmousemove'] = 'Image alternative';
tinyMCELang['lang_insert_image_mouseover'] = 'pour le «mouse over»';
tinyMCELang['lang_insert_image_mouseout'] = 'pour le «mouse out»';

View file

@ -0,0 +1,6 @@
// French lang variables by Laurent Dran
tinyMCELang['lang_insert_image_alt2'] = 'Titre de l\'image';
tinyMCELang['lang_insert_image_onmousemove'] = 'Image alternative'
tinyMCELang['lang_insert_image_mouseover'] = 'Pour la souris au dessus';
tinyMCELang['lang_insert_image_mouseout'] = 'Pour la souris en dehors';

View file

@ -1,6 +1,6 @@
// SE lang variables
tinyMCELang['lang_insert_image_alt2'] = 'Bildens titel';
tinyMCELang['lang_insert_image_alt2'] = 'Bildentitel';
tinyMCELang['lang_insert_image_onmousemove'] = 'Alternativ bild'
tinyMCELang['lang_insert_image_mouseover'] = 'n&auml;r pekaren &auml;r &ouml;ver';
tinyMCELang['lang_insert_image_mouseout'] = 'n&auml;r pekaren &auml;r utanf&ouml;r';