- assigned_to: nobody --> fredck
the window.find function returns false if the searched
string isn't found, so it can be used to show an alert
like it's done in IE:
in dialog/fck_find.html:
function FindGecko()
{
var bCase = document.getElementById('chkCase').checked ;
var bWord = document.getElementById('chkWord').checked ;
// window.find( searchString, caseSensitive,
backwards, wrapAround, wholeWord, searchInFrames,
showDialog ) ;
if (!oEditor.FCK.EditorWindow.find(
document.getElementById('txtFind').value, bCase, false,
false, bWord, false, false ) )
alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
}
As a note, the reason that wholeWord doesn't work in
Gecko is https://bugzilla.mozilla.org/show_bug.cgi?id=14871
In that dialog I've also removed the width:100%; in the
btnFind button as it seemed to corrupt its display.
For the replace dialog I think that it's also better to
let know if nothing has been replaced:
in dialog/fck_replace.html
function Replace()
{
var oRegex = new RegExp( GetRegexExpr(), GetCase() ) ;
if (!ReplaceTextNodes(
oEditor.FCK.EditorDocument.body, oRegex,
document.getElementById('txtReplace').value, false,
false ) )
alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
}
function ReplaceAll()
{
var oRegex = new RegExp( GetRegexExpr(), GetCase() +
'g' ) ;
if (!ReplaceTextNodes(
oEditor.FCK.EditorDocument.body, oRegex,
document.getElementById('txtReplace').value, true,
false ) )
alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
window.parent.Cancel() ;
}
Logged In: YES
user_id=572424
Hi,
This patch, or a similar implementation, has been included in
FCKeditor and has been committed in the SVN. It will be
available in the next release.
For more information about the FCKeditor SVN system, please use
the following URL:
https://sourceforge.net/svn/?group_id=75348
Best regards,
FredCK
http://www.fckeditor.net
"Support Open Source Software... What about a donation today?"
PS.: This is a canned response.
Log in to post a comment.