aboutsummaryrefslogtreecommitdiffstats
path: root/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js
diff options
context:
space:
mode:
authorAlexander Kampmann <programmer@nurfuerspam.de>2012-03-22 12:50:02 +0100
committerAlexander Kampmann <programmer@nurfuerspam.de>2012-03-22 12:50:02 +0100
commitcea7ca1df4fd8065c38a4f43a0f13ba89e8b94e2 (patch)
treeb88556dbafbabac5753bdec9e51fcb24ec4ca3b8 /library/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js
parent29900febb341cfbec6e4445d4ea1c2dc782a521a (diff)
parent808180ce5f9471aa36faf8861fb84d04b412f412 (diff)
downloadvolse-hubzilla-cea7ca1df4fd8065c38a4f43a0f13ba89e8b94e2.tar.gz
volse-hubzilla-cea7ca1df4fd8065c38a4f43a0f13ba89e8b94e2.tar.bz2
volse-hubzilla-cea7ca1df4fd8065c38a4f43a0f13ba89e8b94e2.zip
Merge branch 'master' of git://github.com/friendica/friendica
Conflicts: boot.php database.sql include/template_processor.php update.php
Diffstat (limited to 'library/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js')
-rw-r--r--[-rwxr-xr-x]library/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js24
1 files changed, 18 insertions, 6 deletions
diff --git a/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js b/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js
index c0a624329..80284b9f3 100755..100644
--- a/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js
+++ b/library/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js
@@ -2,14 +2,18 @@ tinyMCEPopup.requireLangPack();
var SearchReplaceDialog = {
init : function(ed) {
- var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");
+ var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");
- this.switchMode(m);
+ t.switchMode(m);
f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string");
// Focus input field
f[m + '_panel_searchstring'].focus();
+
+ mcTabs.onChange.add(function(tab_id, panel_id) {
+ t.switchMode(tab_id.substring(0, tab_id.indexOf('_')));
+ });
},
switchMode : function(m) {
@@ -42,21 +46,23 @@ var SearchReplaceDialog = {
ca = f[m + '_panel_casesensitivebox'].checked;
rs = f['replace_panel_replacestring'].value;
+ if (tinymce.isIE) {
+ r = ed.getDoc().selection.createRange();
+ }
+
if (s == '')
return;
function fix() {
// Correct Firefox graphics glitches
+ // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions?
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);
+ ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE
};
// IE flags
@@ -70,6 +76,9 @@ var SearchReplaceDialog = {
ed.selection.collapse(true);
if (tinymce.isIE) {
+ ed.focus();
+ r = ed.getDoc().selection.createRange();
+
while (r.findText(s, b ? -1 : 1, fl)) {
r.scrollIntoView();
r.select();
@@ -111,6 +120,9 @@ var SearchReplaceDialog = {
return;
if (tinymce.isIE) {
+ ed.focus();
+ r = ed.getDoc().selection.createRange();
+
if (r.findText(s, b ? -1 : 1, fl)) {
r.scrollIntoView();
r.select();