upgrading tinymce to 2.0.5.1
This commit is contained in:
parent
cb2a8d025e
commit
00d46f6148
342 changed files with 13043 additions and 11487 deletions
File diff suppressed because one or more lines are too long
|
|
@ -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 '<a href="javascript:' + cmd + '" onclick="' + cmd + '" target="_self" onmousedown="return false;"><img id="{$editor_id}_search" src="{$pluginurl}/images/search.gif" title="{$lang_searchreplace_search_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';
|
||||
|
||||
case "replace":
|
||||
var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSearchReplace\',true);return false;';
|
||||
return '<a href="javascript:' + cmd + '" onclick="' + cmd + '" target="_self" onmousedown="return false;"><img id="{$editor_id}_replace" src="{$pluginurl}/images/replace.gif" title="{$lang_searchreplace_replace_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';
|
||||
}
|
||||
|
||||
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');
|
||||
|
||||
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 "";
|
||||
},
|
||||
|
||||
/**
|
||||
* Executes the search/replace commands.
|
||||
*/
|
||||
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];
|
||||
}
|
||||
|
||||
// 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);
|
||||
function replaceSel(search_str, str, back) {
|
||||
instance.execCommand('mceInsertContent', false, str);
|
||||
}
|
||||
}
|
||||
|
||||
var instance = tinyMCE.getInstanceById(editor_id);
|
||||
if (!value)
|
||||
value = new Array();
|
||||
|
||||
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");
|
||||
|
||||
// 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;
|
||||
|
||||
// Handle commands
|
||||
switch (command) {
|
||||
case "mceResetSearch":
|
||||
tinyMCE.lastSearchRng = null;
|
||||
return true;
|
||||
case "mceSearch":
|
||||
if (user_interface) {
|
||||
// Open search dialog
|
||||
var template = new Array();
|
||||
|
||||
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 (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);
|
||||
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 {
|
||||
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);
|
||||
}
|
||||
var win = tinyMCE.getInstanceById(editor_id).contentWindow;
|
||||
var doc = tinyMCE.getInstanceById(editor_id).contentWindow.document;
|
||||
var body = tinyMCE.getInstanceById(editor_id).contentWindow.document.body;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
// 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);
|
||||
|
||||
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.');
|
||||
// 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);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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']);
|
||||
}
|
||||
|
||||
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'));
|
||||
}
|
||||
|
||||
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;
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ function init() {
|
|||
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 @@ function searchNext(replacemode) {
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
* Czech lang variables
|
||||
* encoding: utf-8
|
||||
*
|
||||
* $Id: cs.js,v 1.4 2005/10/18 13:59:43 spocke Exp $
|
||||
* $Id: cs.js,v 1.5 2006/01/11 14:25:49 spocke Exp $
|
||||
*/
|
||||
|
||||
tinyMCE.addToLang('',{
|
||||
|
|
|
|||
|
|
@ -1,20 +1,20 @@
|
|||
// DK lang variables contributed by Jan Moelgaard
|
||||
// DK lang variables contributed by Jan Moelgaard, John Dalsgaard and Bo Frederiksen.
|
||||
|
||||
tinyMCE.addToLang('',{
|
||||
searchreplace_search_desc : 'Søg',
|
||||
searchreplace_searchnext_desc : 'Søg igen',
|
||||
searchreplace_replace_desc : 'Søg og erstat',
|
||||
searchreplace_notfound : 'Søgningen er færdig. Søgeudtrykket kunne ikke findes.',
|
||||
searchreplace_search_title : 'Søg',
|
||||
searchreplace_replace_title : 'Søg og erstat',
|
||||
searchreplace_allreplaced : 'Alle forekomster af søgeudtrykket blev erstattet.',
|
||||
searchreplace_findwhat : 'Hvad skal vi søge efter',
|
||||
searchreplace_search_desc : 'Søg',
|
||||
searchreplace_searchnext_desc : 'Søg igen',
|
||||
searchreplace_replace_desc : 'Søg og erstat',
|
||||
searchreplace_notfound : 'Søgningen er færdig. Søgeudtrykket kunne ikke findes.',
|
||||
searchreplace_search_title : 'Søg',
|
||||
searchreplace_replace_title : 'Søg og erstat',
|
||||
searchreplace_allreplaced : 'Alle forekomster af søgeudtrykket blev erstattet.',
|
||||
searchreplace_findwhat : 'Hvad skal vi søge efter',
|
||||
searchreplace_replacewith : 'Erstat det med',
|
||||
searchreplace_direction : 'Retning',
|
||||
searchreplace_up : 'Op',
|
||||
searchreplace_down : 'Ned',
|
||||
searchreplace_case : 'Skelne mellem store og små bogstaver',
|
||||
searchreplace_findnext : 'Søg efter næste',
|
||||
searchreplace_case : 'Skelne mellem store og små; bogstaver',
|
||||
searchreplace_findnext : 'Søg efter næste',
|
||||
searchreplace_replace : 'Erstat',
|
||||
searchreplace_replaceall : 'Erstat alle',
|
||||
searchreplace_cancel : 'Fortryd'
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ tinyMCE.addToLang('',{
|
|||
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',
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
// Simplified Chinese lang variables contributed by tom_cat (thomaswangyang@gmail.com)
|
||||
// Simplified Chinese lang variables contributed by TinyMCE_China_Team ( tinymce_china {AT} yahoogroups {DOT} com ).
|
||||
// visit our homepage at: http://www.cube316.net/tinymce/ for more information.
|
||||
|
||||
tinyMCE.addToLang('',{
|
||||
searchreplace_search_desc : '²éÕÒ',
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<td><input type="text" id="replacestring" name="replacestring" style="width: 200px" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
|
||||
<td colspan="2"><!--<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><label>{$lang_searchreplace_direction}</label></td>
|
||||
<td><input id="backwardsu" name="backwards" class="radio" type="radio" value="true" /></td>
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
<td><input id="backwardsd" name="backwards" class="radio" type="radio" value="false" /></td>
|
||||
<td><label for="backwardsd">{$lang_searchreplace_down}</label></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</table>--></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue