From 32ca1f9fc8a78e092565b51cc97faa724bb4e6cf Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Sat, 30 May 2009 05:09:57 -0400
Subject: [PATCH] - css fixes (#1485869)
---
program/js/tiny_mce/plugins/searchreplace/js/searchreplace.js | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/program/js/tiny_mce/plugins/searchreplace/js/searchreplace.js b/program/js/tiny_mce/plugins/searchreplace/js/searchreplace.js
index 890eb37..a8585cc 100644
--- a/program/js/tiny_mce/plugins/searchreplace/js/searchreplace.js
+++ b/program/js/tiny_mce/plugins/searchreplace/js/searchreplace.js
@@ -42,6 +42,9 @@
ca = f[m + '_panel_casesensitivebox'].checked;
rs = f['replace_panel_replacestring'].value;
+ if (s == '')
+ return;
+
function fix() {
// Correct Firefox graphics glitches
r = se.getRng().cloneRange();
@@ -62,6 +65,10 @@
switch (a) {
case 'all':
+ // Move caret to beginning of text
+ ed.execCommand('SelectAll');
+ ed.selection.collapse(true);
+
if (tinymce.isIE) {
while (r.findText(s, b ? -1 : 1, fl)) {
r.scrollIntoView();
@@ -79,14 +86,16 @@
}
if (fo)
- wm.alert(ed.getLang('searchreplace_dlg.allreplaced'));
+ tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced'));
else
- wm.alert(ed.getLang('searchreplace_dlg.notfound'));
+ tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
return;
case 'current':
- replace();
+ if (!ed.selection.isCollapsed())
+ replace();
+
break;
}
@@ -102,12 +111,12 @@
r.scrollIntoView();
r.select();
} else
- wm.alert(ed.getLang('searchreplace_dlg.notfound'));
+ tinyMCEPopup.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'));
+ tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
else
fix();
}
--
Gitblit v1.9.1