#199 Show DlgFindNotFoundMsg for Firefox and in Replace dialog

Version 2.x
closed
Editor (144)
5
2006-06-02
2006-01-16
No

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() ;
}

Discussion

  • Frederico Caldeira Knabben

    • assigned_to: nobody --> fredck
     
  • Frederico Caldeira Knabben

    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.

     
  • Frederico Caldeira Knabben

    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks