summaryrefslogtreecommitdiff
path: root/program/js/tiny_mce/plugins/searchreplace
diff options
context:
space:
mode:
authorsvncommit <devs@roundcube.net>2008-04-15 21:22:00 +0000
committersvncommit <devs@roundcube.net>2008-04-15 21:22:00 +0000
commitd9344fc349e8c5765898c90bf5061e56cd21c8a0 (patch)
treea5916f5f3f88df8d6336b43dde8cdbb49cb47bdc /program/js/tiny_mce/plugins/searchreplace
parentd7a411f099596cbc8e749e1f0802ac2bb2c6289e (diff)
HTML editing fixes, upgrade to TinyMCE v3.0.6
Diffstat (limited to 'program/js/tiny_mce/plugins/searchreplace')
-rw-r--r--program/js/tiny_mce/plugins/searchreplace/css/searchreplace.css24
-rw-r--r--program/js/tiny_mce/plugins/searchreplace/editor_plugin.js2
-rw-r--r--program/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js213
-rw-r--r--program/js/tiny_mce/plugins/searchreplace/images/replace.gifbin125 -> 0 bytes
-rw-r--r--program/js/tiny_mce/plugins/searchreplace/images/replace_all_button_bg.gifbin669 -> 0 bytes
-rw-r--r--program/js/tiny_mce/plugins/searchreplace/images/replace_button_bg.gifbin669 -> 0 bytes
-rw-r--r--program/js/tiny_mce/plugins/searchreplace/images/search.gifbin191 -> 0 bytes
-rw-r--r--program/js/tiny_mce/plugins/searchreplace/js/searchreplace.js117
-rw-r--r--program/js/tiny_mce/plugins/searchreplace/jscripts/searchreplace.js86
-rw-r--r--program/js/tiny_mce/plugins/searchreplace/langs/en.js21
-rw-r--r--program/js/tiny_mce/plugins/searchreplace/langs/en_dlg.js16
-rw-r--r--program/js/tiny_mce/plugins/searchreplace/readme.txt1
-rw-r--r--program/js/tiny_mce/plugins/searchreplace/searchreplace.htm56
13 files changed, 213 insertions, 323 deletions
diff --git a/program/js/tiny_mce/plugins/searchreplace/css/searchreplace.css b/program/js/tiny_mce/plugins/searchreplace/css/searchreplace.css
index 4c7bd13c4..ecdf58c7b 100644
--- a/program/js/tiny_mce/plugins/searchreplace/css/searchreplace.css
+++ b/program/js/tiny_mce/plugins/searchreplace/css/searchreplace.css
@@ -1,20 +1,6 @@
-/* stylesheet for advsearchreplace plugin*/
+.panel_wrapper {height:85px;}
+.panel_wrapper div.current {height:85px;}
-.panel_wrapper { height: 85px; }
-.panel_wrapper div.current { height: 85px; }
-
-/* MS IE only styles */
-* html .panel_wrapper { height: 100px; }
-* html .panel_wrapper div.current { height: 100px; }
-
-#replaceBtn, #replaceAllBtn {
- padding-bottom: 2px;
- font-weight: bold;
- width: 90px;
- height: 21px;
- border: 0;
- cursor: pointer;
-}
-
-#replaceBtn { background: url(../images/replace_button_bg.gif); }
-#replaceAllBtn { background: url(../images/replace_all_button_bg.gif); }
+/* IE */
+* html .panel_wrapper {height:100px;}
+* html .panel_wrapper div.current {height:100px;}
diff --git a/program/js/tiny_mce/plugins/searchreplace/editor_plugin.js b/program/js/tiny_mce/plugins/searchreplace/editor_plugin.js
index 959e9cc5c..7fd913b2b 100644
--- a/program/js/tiny_mce/plugins/searchreplace/editor_plugin.js
+++ b/program/js/tiny_mce/plugins/searchreplace/editor_plugin.js
@@ -1 +1 @@
-tinyMCE.importPluginLanguagePack('searchreplace');var TinyMCE_SearchReplacePlugin={getInfo:function(){return{longname:'Search/Replace',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){inst.addShortcut('ctrl','f','lang_searchreplace_search_desc','mceSearch',true);},getControlHTML:function(cn){switch(cn){case"search":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_search_desc','{$pluginurl}/images/search.gif','mceSearch',true);case"replace":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_replace_desc','{$pluginurl}/images/replace.gif','mceSearchReplace',true)}return""},execCommand:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id),selectedText=inst.selection.getSelectedText(),rng;function defValue(key,default_value){value[key]=typeof(value[key])=="undefined"?default_value:value[key]}function replaceSel(search_str,str,back){if(!inst.selection.isCollapsed()){if(tinyMCE.isRealIE)inst.selection.getRng().duplicate().pasteHTML(str);else inst.execCommand('mceInsertContent',false,str)}}if(!value)value=[];defValue("editor_id",editor_id);defValue("searchstring",selectedText);defValue("replacestring",null);defValue("replacemode","none");defValue("casesensitive",false);defValue("backwards",false);defValue("wrap",false);defValue("wholeword",false);defValue("inline","yes");defValue("resizable","no");switch(command){case"mceSearch":if(user_interface){var template=new Array();template['file']='../../plugins/searchreplace/searchreplace.htm';template['width']=380;template['height']=155+(tinyMCE.isNS7?20:0)+(tinyMCE.isMSIE?15:0);template['width']+=tinyMCE.getLang('lang_searchreplace_delta_width',0);template['height']+=tinyMCE.getLang('lang_searchreplace_delta_height',0);inst.selection.collapse(true);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;var awin=value.win,found;if(body.innerHTML==""){awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));return true}if(value['replacemode']=="current"){replaceSel(value['string'],value['replacestring'],value['backwards']);value['replacemode']="none";}inst.selection.collapse(value['backwards']);if(tinyMCE.isMSIE){var rng=inst.selection.getRng();var flags=0;if(value['wholeword'])flags=flags|2;if(value['casesensitive'])flags=flags|4;if(!rng.findText){awin.alert('This operation is currently not supported by this browser.');return true}if(value['replacemode']=="all"){found=false;while(rng.findText(value['string'],value['backwards']?-1:1,flags)){found=true;rng.scrollIntoView();rng.select();replaceSel(value['string'],value['replacestring'],value['backwards'])}if(found)awin.alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));else awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));return true}if(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select()}else awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'))}else{if(value['replacemode']=="all"){found=false;while(win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false)){found=true;replaceSel(value['string'],value['replacestring'],value['backwards'])}if(found)awin.alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));else awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));return true}if(!win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'))}}return true;case"mceSearchReplace":value['replacestring']="";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true}return false}};tinyMCE.addPlugin("searchreplace",TinyMCE_SearchReplacePlugin); \ No newline at end of file
+(function(){tinymce.create('tinymce.plugins.SearchReplacePlugin',{init:function(ed,url){function open(m){ed.windowManager.open({file:url+'/searchreplace.htm',width:420+parseInt(ed.getLang('searchreplace.delta_width',0)),height:160+parseInt(ed.getLang('searchreplace.delta_height',0)),inline:1,auto_focus:0},{mode:m,search_string:ed.selection.getContent({format:'text'}),plugin_url:url});};ed.addCommand('mceSearch',function(){open('search');});ed.addCommand('mceReplace',function(){open('replace');});ed.addButton('search',{title:'searchreplace.search_desc',cmd:'mceSearch'});ed.addButton('replace',{title:'searchreplace.replace_desc',cmd:'mceReplace'});ed.addShortcut('ctrl+f','searchreplace.search_desc','mceSearch');},getInfo:function(){return{longname:'Search/Replace',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('searchreplace',tinymce.plugins.SearchReplacePlugin);})(); \ No newline at end of file
diff --git a/program/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js b/program/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js
index cd2f3a85c..59edc3b25 100644
--- a/program/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js
+++ b/program/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js
@@ -1,173 +1,54 @@
/**
- * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
+ * $Id: editor_plugin_src.js 686 2008-03-09 18:13:49Z spocke $
*
* @author Moxiecode
- * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
-tinyMCE.importPluginLanguagePack('searchreplace');
-
-var TinyMCE_SearchReplacePlugin = {
- getInfo : function() {
- return {
- longname : 'Search/Replace',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',
- version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
- };
- },
-
- initInstance : function (inst) {
- inst.addShortcut('ctrl', 'f', 'lang_searchreplace_search_desc', 'mceSearch', true);
- // No CTRL+R for "replace" because browsers will reload page instead of executing plugin
- },
-
- getControlHTML : function (cn) {
- switch (cn) {
- case "search" :
- return tinyMCE.getButtonHTML(cn, 'lang_searchreplace_search_desc', '{$pluginurl}/images/search.gif','mceSearch', true);
-
- case "replace" :
- return tinyMCE.getButtonHTML(cn, 'lang_searchreplace_replace_desc', '{$pluginurl}/images/replace.gif', 'mceSearchReplace', true);
- }
-
- return "";
- },
-
- execCommand : function (editor_id, element, command, user_interface, value) {
- var inst = tinyMCE.getInstanceById(editor_id), selectedText = inst.selection.getSelectedText(), rng;
-
- function defValue(key, default_value) {
- value[key] = typeof(value[key]) == "undefined" ? default_value : value[key];
- }
-
- function replaceSel(search_str, str, back) {
- if (!inst.selection.isCollapsed()) {
- if (tinyMCE.isRealIE)
- inst.selection.getRng().duplicate().pasteHTML(str); // Needs to be duplicated due to selection bug in IE
- else
- inst.execCommand('mceInsertContent', false, str);
- }
+(function() {
+ tinymce.create('tinymce.plugins.SearchReplacePlugin', {
+ init : function(ed, url) {
+ function open(m) {
+ ed.windowManager.open({
+ file : url + '/searchreplace.htm',
+ width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)),
+ height : 160 + parseInt(ed.getLang('searchreplace.delta_height', 0)),
+ inline : 1,
+ auto_focus : 0
+ }, {
+ mode : m,
+ search_string : ed.selection.getContent({format : 'text'}),
+ plugin_url : url
+ });
+ };
+
+ // Register commands
+ ed.addCommand('mceSearch', function() {
+ open('search');
+ });
+
+ ed.addCommand('mceReplace', function() {
+ open('replace');
+ });
+
+ // Register buttons
+ ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'});
+ ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'});
+
+ ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch');
+ },
+
+ getInfo : function() {
+ return {
+ longname : 'Search/Replace',
+ author : 'Moxiecode Systems AB',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
+ };
}
+ });
- if (!value)
- value = [];
-
- defValue("editor_id", editor_id);
- defValue("searchstring", selectedText);
- defValue("replacestring", null);
- defValue("replacemode", "none");
- defValue("casesensitive", false);
- defValue("backwards", false);
- defValue("wrap", false);
- defValue("wholeword", false);
- defValue("inline", "yes");
- defValue("resizable", "no");
-
- switch (command) {
- case "mceSearch" :
- if (user_interface) {
- var template = new Array();
-
- template['file'] = '../../plugins/searchreplace/searchreplace.htm';
- template['width'] = 380;
- template['height'] = 155 + (tinyMCE.isNS7 ? 20 : 0) + (tinyMCE.isMSIE ? 15 : 0);
- template['width'] += tinyMCE.getLang('lang_searchreplace_delta_width', 0);
- template['height'] += tinyMCE.getLang('lang_searchreplace_delta_height', 0);
-
- inst.selection.collapse(true);
-
- 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;
- var awin = value.win, found;
-
- if (body.innerHTML == "") {
- awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));
- return true;
- }
-
- if (value['replacemode'] == "current") {
- replaceSel(value['string'], value['replacestring'], value['backwards']);
- value['replacemode'] = "none";
- //tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value);
- //return true;
- }
-
- inst.selection.collapse(value['backwards']);
-
- if (tinyMCE.isMSIE) {
- var rng = inst.selection.getRng();
- var flags = 0;
- if (value['wholeword'])
- flags = flags | 2;
-
- if (value['casesensitive'])
- flags = flags | 4;
-
- if (!rng.findText) {
- awin.alert('This operation is currently not supported by this browser.');
- return true;
- }
-
- if (value['replacemode'] == "all") {
- found = false;
-
- while (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) {
- found = true;
- rng.scrollIntoView();
- rng.select();
- replaceSel(value['string'], value['replacestring'], value['backwards']);
- }
-
- if (found)
- awin.alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));
- else
- awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));
-
- return true;
- }
-
- if (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) {
- rng.scrollIntoView();
- rng.select();
- } else
- awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));
- } else {
- if (value['replacemode'] == "all") {
- found = false;
-
- while (win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false)) {
- found = true;
- replaceSel(value['string'], value['replacestring'], value['backwards']);
- }
-
- if (found)
- awin.alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));
- else
- awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));
-
- return true;
- }
-
- if (!win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false))
- awin.alert(tinyMCE.getLang('lang_searchreplace_notfound'));
- }
- }
-
- return true;
-
- case "mceSearchReplace" :
- value['replacestring'] = "";
- tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value, false);
- return true;
- }
-
- return false;
- }
-};
-
-tinyMCE.addPlugin("searchreplace", TinyMCE_SearchReplacePlugin); \ No newline at end of file
+ // Register plugin
+ tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin);
+})(); \ No newline at end of file
diff --git a/program/js/tiny_mce/plugins/searchreplace/images/replace.gif b/program/js/tiny_mce/plugins/searchreplace/images/replace.gif
deleted file mode 100644
index 784c73e2a..000000000
--- a/program/js/tiny_mce/plugins/searchreplace/images/replace.gif
+++ /dev/null
Binary files differ
diff --git a/program/js/tiny_mce/plugins/searchreplace/images/replace_all_button_bg.gif b/program/js/tiny_mce/plugins/searchreplace/images/replace_all_button_bg.gif
deleted file mode 100644
index 123fa5bf5..000000000
--- a/program/js/tiny_mce/plugins/searchreplace/images/replace_all_button_bg.gif
+++ /dev/null
Binary files differ
diff --git a/program/js/tiny_mce/plugins/searchreplace/images/replace_button_bg.gif b/program/js/tiny_mce/plugins/searchreplace/images/replace_button_bg.gif
deleted file mode 100644
index cc2c56e61..000000000
--- a/program/js/tiny_mce/plugins/searchreplace/images/replace_button_bg.gif
+++ /dev/null
Binary files differ
diff --git a/program/js/tiny_mce/plugins/searchreplace/images/search.gif b/program/js/tiny_mce/plugins/searchreplace/images/search.gif
deleted file mode 100644
index cfe76b5d5..000000000
--- a/program/js/tiny_mce/plugins/searchreplace/images/search.gif
+++ /dev/null
Binary files differ
diff --git a/program/js/tiny_mce/plugins/searchreplace/js/searchreplace.js b/program/js/tiny_mce/plugins/searchreplace/js/searchreplace.js
new file mode 100644
index 000000000..890eb37f1
--- /dev/null
+++ b/program/js/tiny_mce/plugins/searchreplace/js/searchreplace.js
@@ -0,0 +1,117 @@
+tinyMCEPopup.requireLangPack();
+
+var SearchReplaceDialog = {
+ init : function(ed) {
+ var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");
+
+ this.switchMode(m);
+
+ f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string");
+
+ // Focus input field
+ f[m + '_panel_searchstring'].focus();
+ },
+
+ switchMode : function(m) {
+ var f, lm = this.lastMode;
+
+ if (lm != m) {
+ f = document.forms[0];
+
+ if (lm) {
+ f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value;
+ f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked;
+ f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked;
+ f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked;
+ }
+
+ mcTabs.displayTab(m + '_tab', m + '_panel');
+ document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none";
+ document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none";
+ this.lastMode = m;
+ }
+ },
+
+ searchNext : function(a) {
+ var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;
+
+ // Get input
+ f = document.forms[0];
+ s = f[m + '_panel_searchstring'].value;
+ b = f[m + '_panel_backwardsu'].checked;
+ ca = f[m + '_panel_casesensitivebox'].checked;
+ rs = f['replace_panel_replacestring'].value;
+
+ function fix() {
+ // Correct Firefox graphics glitches
+ r = se.getRng().cloneRange();
+ ed.getDoc().execCommand('SelectAll', false, null);
+ se.setRng(r);
+ };
+
+ function replace() {
+ if (tinymce.isIE)
+ ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE
+ else
+ ed.getDoc().execCommand('InsertHTML', false, rs);
+ };
+
+ // IE flags
+ if (ca)
+ fl = fl | 4;
+
+ switch (a) {
+ case 'all':
+ if (tinymce.isIE) {
+ while (r.findText(s, b ? -1 : 1, fl)) {
+ r.scrollIntoView();
+ r.select();
+ replace();
+ fo = 1;
+ }
+
+ tinyMCEPopup.storeSelection();
+ } else {
+ while (w.find(s, ca, b, false, false, false, false)) {
+ replace();
+ fo = 1;
+ }
+ }
+
+ if (fo)
+ wm.alert(ed.getLang('searchreplace_dlg.allreplaced'));
+ else
+ wm.alert(ed.getLang('searchreplace_dlg.notfound'));
+
+ return;
+
+ case 'current':
+ replace();
+ break;
+ }
+
+ se.collapse(b);
+ r = se.getRng();
+
+ // Whats the point
+ if (!s)
+ return;
+
+ if (tinymce.isIE) {
+ if (r.findText(s, b ? -1 : 1, fl)) {
+ r.scrollIntoView();
+ r.select();
+ } else
+ wm.alert(ed.getLang('searchreplace_dlg.notfound'));
+
+ tinyMCEPopup.storeSelection();
+ } else {
+ if (!w.find(s, ca, b, false, false, false, false))
+ wm.alert(ed.getLang('searchreplace_dlg.notfound'));
+ else
+ fix();
+ }
+ }
+};
+
+tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog);
diff --git a/program/js/tiny_mce/plugins/searchreplace/jscripts/searchreplace.js b/program/js/tiny_mce/plugins/searchreplace/jscripts/searchreplace.js
deleted file mode 100644
index ac6cdf6fc..000000000
--- a/program/js/tiny_mce/plugins/searchreplace/jscripts/searchreplace.js
+++ /dev/null
@@ -1,86 +0,0 @@
-function init() {
- tinyMCEPopup.resizeToInnerSize();
-
- // start with appropiate tab
- var task = (tinyMCE.getWindowArg("replacestring") != null) ? "replace" : "search";
- mcTabs.displayTab(task + '_tab', task +'_panel');
- manageReplaceButtons();
-
- var formObj = document.forms[0];
-
- formObj[task + "_panel_searchstring"].value = tinyMCE.getWindowArg("searchstring");
- formObj["replace_panel_replacestring"].value = (tinyMCE.getWindowArg("replacestring") != null) ? tinyMCE.getWindowArg("replacestring") : "";
- formObj[task + "_panel_casesensitivebox"].checked = tinyMCE.getWindowArg("casesensitive");
- formObj[task + "_panel_backwardsu"].checked = tinyMCE.getWindowArg("backwards");
- formObj[task + "_panel_backwardsd"].checked = !tinyMCE.getWindowArg("backwards");
-}
-
-function searchNext(replacemode) {
- // "search" or "replace" mode of operation?
- var task = (document.getElementById("search_tab").className == "current") ? "search" : "replace";
-
- var formObj = document.forms[0];
-
- if (task == "replace") {
- // Whats the point?
- if (formObj[task + "_panel_searchstring"].value == "" || formObj[task + "_panel_searchstring"].value == formObj[task + "_panel_replacestring"].value)
- return false;
- }
-
- // Do search
- tinyMCEPopup.execCommand('mceSearch', false, {
- string : formObj[task + "_panel_searchstring"].value,
- replacestring : formObj["replace_panel_replacestring"].value,
- replacemode : replacemode,
- casesensitive : formObj[task + "_panel_casesensitivebox"].checked,
- backwards : formObj[task + "_panel_backwardsu"].checked,
- win : window
- }, false);
-
- window.focus();
-
- return false;
-}
-
-function cancelAction() {
- tinyMCEPopup.close();
-}
-
-function manageReplaceButtons() {
- // "search" or "replace" mode of operation?
- var task = (document.getElementById("search_tab").className == "current") ? "search" : "replace";
- document.getElementById("replace_buttons").style.visibility = (task == "replace") ? "visible" : "hidden";
-}
-
-function copyValues(link) {
- // check if tab is already active
- var tab = link;
- while (tab.tagName && tab.tagName.toLowerCase() != "li") tab = tab.parentNode;
- if (tab.className) return false; // tab is already active -> no need to copy any values!
-
- // copy values from one panel to the other (if they exist there)
- var from_panel_name = tab.id.match(/^search/i) ? "replace_panel" : "search_panel";
- var to_panel_name = (from_panel_name == "search_panel") ? "replace_panel" : "search_panel";
-
- // find all elements with IDs to copy their values
- var elms = document.getElementById(from_panel_name).getElementsByTagName("*");
- for (var i = 0; i < elms.length; i++) {
- if (elms[i].id && elms[i].id != "") {
- var checked = "undefined";
- if (elms[i].type.toLowerCase() == "checkbox" || elms[i].type.toLowerCase() == "radio")
- checked = elms[i].checked;
-
- // copy values if element exists in other panel
- var to_elm_name = to_panel_name + elms[i].id.substring(from_panel_name.length, elms[i].id.length);
- var to_elm = document.getElementById(to_elm_name);
- if (to_elm) {
- if (checked != "undefined")
- to_elm.checked = checked;
- else
- to_elm.value = elms[i].value;
- }
- }
- }
-
- return false;
-} \ No newline at end of file
diff --git a/program/js/tiny_mce/plugins/searchreplace/langs/en.js b/program/js/tiny_mce/plugins/searchreplace/langs/en.js
deleted file mode 100644
index 32af8282e..000000000
--- a/program/js/tiny_mce/plugins/searchreplace/langs/en.js
+++ /dev/null
@@ -1,21 +0,0 @@
-// UK lang variables
-
-tinyMCE.addToLang('',{
-searchreplace_search_desc : 'Find',
-searchreplace_searchnext_desc : 'Find again',
-searchreplace_replace_desc : 'Find/Replace',
-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 were replaced.',
-searchreplace_findwhat : 'Find what',
-searchreplace_replacewith : 'Replace with',
-searchreplace_direction : 'Direction',
-searchreplace_up : 'Up',
-searchreplace_down : 'Down',
-searchreplace_case : 'Match case',
-searchreplace_findnext : 'Find&nbsp;next',
-searchreplace_replace : 'Replace',
-searchreplace_replaceall : 'Replace&nbsp;all',
-searchreplace_cancel : 'Cancel'
-});
diff --git a/program/js/tiny_mce/plugins/searchreplace/langs/en_dlg.js b/program/js/tiny_mce/plugins/searchreplace/langs/en_dlg.js
new file mode 100644
index 000000000..370959afa
--- /dev/null
+++ b/program/js/tiny_mce/plugins/searchreplace/langs/en_dlg.js
@@ -0,0 +1,16 @@
+tinyMCE.addI18n('en.searchreplace_dlg',{
+searchnext_desc:"Find again",
+notfound:"The search has been completed. The search string could not be found.",
+search_title:"Find",
+replace_title:"Find/Replace",
+allreplaced:"All occurrences of the search string were replaced.",
+findwhat:"Find what",
+replacewith:"Replace with",
+direction:"Direction",
+up:"Up",
+down:"Down",
+mcase:"Match case",
+findnext:"Find next",
+replace:"Replace",
+replaceall:"Replace all"
+}); \ No newline at end of file
diff --git a/program/js/tiny_mce/plugins/searchreplace/readme.txt b/program/js/tiny_mce/plugins/searchreplace/readme.txt
deleted file mode 100644
index 4fdb78aec..000000000
--- a/program/js/tiny_mce/plugins/searchreplace/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-Check the TinyMCE documentation for details on this plugin.
diff --git a/program/js/tiny_mce/plugins/searchreplace/searchreplace.htm b/program/js/tiny_mce/plugins/searchreplace/searchreplace.htm
index 192e0cbc6..9c95a6a30 100644
--- a/program/js/tiny_mce/plugins/searchreplace/searchreplace.htm
+++ b/program/js/tiny_mce/plugins/searchreplace/searchreplace.htm
@@ -1,39 +1,39 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>{$lang_searchreplace_replace_title}</title>
- <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
- <script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
- <script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
- <script language="javascript" type="text/javascript" src="jscripts/searchreplace.js"></script>
+ <title>{#searchreplace_dlg.replace_title}</title>
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>
+ <script type="text/javascript" src="js/searchreplace.js"></script>
<link rel="stylesheet" type="text/css" href="css/searchreplace.css" />
<base target="_self" />
</head>
-<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none; margin: 4px;">
-<form onsubmit="return false;" action="#">
+<body style="display:none;">
+<form onsubmit="SearchReplaceDialog.searchNext('none');return false;" action="#">
<div class="tabs">
<ul>
- <li id="search_tab"><span><a href="javascript:mcTabs.displayTab('search_tab','search_panel');manageReplaceButtons();" onmousedown="return copyValues(this);">{$lang_searchreplace_search_desc}</a></span></li>
- <li id="replace_tab"><span><a href="javascript:mcTabs.displayTab('replace_tab','replace_panel');manageReplaceButtons();" onmousedown="return copyValues(this);">{$lang_searchreplace_replace}</a></span></li>
+ <li id="search_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('search');" onmousedown="return false;">{#searchreplace.search_desc}</a></span></li>
+ <li id="replace_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('replace');" onmousedown="return false;">{#searchreplace_dlg.replace}</a></span></li>
</ul>
</div>
<div class="panel_wrapper">
-
<div id="search_panel" class="panel">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
- <td><label for="search_panel_searchstring">{$lang_searchreplace_findwhat}</label></td>
+ <td><label for="search_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
<td><input type="text" id="search_panel_searchstring" name="search_panel_searchstring" style="width: 200px" /></td>
</tr>
<tr>
<td colspan="2">
<table border="0" cellspacing="0" cellpadding="0" class="direction">
<tr>
- <td><label>{$lang_searchreplace_direction}</label></td>
+ <td><label>{#searchreplace_dlg.direction}</label></td>
<td><input id="search_panel_backwardsu" name="search_panel_backwards" class="radio" type="radio" /></td>
- <td><label for="search_panel_backwardsu">{$lang_searchreplace_up}</label></td>
- <td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" /></td>
- <td><label for="search_panel_backwardsd">{$lang_searchreplace_down}</label></td>
+ <td><label for="search_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
+ <td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" checked="checked" /></td>
+ <td><label for="search_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
</tr>
</table>
</td>
@@ -43,7 +43,7 @@
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input id="search_panel_casesensitivebox" name="search_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
- <td><label for="search_panel_casesensitivebox">{$lang_searchreplace_case}</label></td>
+ <td><label for="search_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
</tr>
</table>
</td>
@@ -54,22 +54,22 @@
<div id="replace_panel" class="panel">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
- <td><label for="replace_panel_searchstring">{$lang_searchreplace_findwhat}</label></td>
+ <td><label for="replace_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
<td><input type="text" id="replace_panel_searchstring" name="replace_panel_searchstring" style="width: 200px" /></td>
</tr>
<tr>
- <td><label for="replace_panel_replacestring">{$lang_searchreplace_replacewith}</label></td>
+ <td><label for="replace_panel_replacestring">{#searchreplace_dlg.replacewith}</label></td>
<td><input type="text" id="replace_panel_replacestring" name="replace_panel_replacestring" style="width: 200px" /></td>
</tr>
<tr>
<td colspan="2">
<table border="0" cellspacing="0" cellpadding="0" class="direction">
<tr>
- <td><label>{$lang_searchreplace_direction}</label></td>
+ <td><label>{#searchreplace_dlg.direction}</label></td>
<td><input id="replace_panel_backwardsu" name="replace_panel_backwards" class="radio" type="radio" /></td>
- <td><label for="replace_panel_backwardsu">{$lang_searchreplace_up}</label></td>
- <td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" /></td>
- <td><label for="replace_panel_backwardsd">{$lang_searchreplace_down}</label></td>
+ <td><label for="replace_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
+ <td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" checked="checked" /></td>
+ <td><label for="replace_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
</tr>
</table>
</td>
@@ -79,7 +79,7 @@
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input id="replace_panel_casesensitivebox" name="replace_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
- <td><label for="replace_panel_casesensitivebox">{$lang_searchreplace_case}</label></td>
+ <td><label for="replace_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
</tr>
</table>
</td>
@@ -91,15 +91,13 @@
<div class="mceActionPanel">
<div style="float: left">
- <input type="button" id="insert" name="insert" value="{$lang_searchreplace_findnext}" onclick="searchNext('none');" />
- <span id="replace_buttons">
- <input type="button" id="replaceBtn" name="replaceBtn" value="{$lang_searchreplace_replace}" onclick="searchNext('current');" />
- <input type="button" id="replaceAllBtn" name="replaceAllBtn" value="{$lang_searchreplace_replaceall}" onclick="searchNext('all');;" />
- </span>
+ <input type="submit" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" />
+ <input type="button" class="button" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" />
+ <input type="button" class="button" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" />
</div>
<div style="float: right">
- <input type="button" id="cancel" name="cancel" value="{$lang_searchreplace_cancel}" onclick="tinyMCEPopup.close();" />
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
</div>
</div>
</form>