<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- * FCKeditor - The text editor for internet * Copyright (C) 2003-2006 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: fck_replace.html * "Replace" dialog box window. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) * Abdul-Aziz A. Al-Oraij (aziz.oraij.com) --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta content="noindex, nofollow" name="robots" /> <script type="text/javascript"> var oEditor = window.parent.InnerDialogLoaded() ; function OnLoad() { // First of all, translate the dialog box texts oEditor.FCKLanguageManager.TranslatePage( document ) ; window.parent.SetAutoSize( true ) ; oEditor.FCKUndo.SaveUndoStep() ; } function btnStat(frm) { document.getElementById('btnReplace').disabled = document.getElementById('btnReplaceAll').disabled = ( document.getElementById('txtFind').value.length == 0 ) ; } function ReplaceTextNodes( parentNode, regex, replaceValue, replaceAll, hasFound ) { for ( var i = 0 ; i < parentNode.childNodes.length ; i++ ) { var oNode = parentNode.childNodes[i] ; if ( oNode.nodeType == 3 ) { var sReplaced = oNode.nodeValue.replace( regex, replaceValue ) ; if ( oNode.nodeValue != sReplaced ) { oNode.nodeValue = sReplaced ; if ( ! replaceAll ) return true ; hasFound = true ; } } hasFound = ReplaceTextNodes( oNode, regex, replaceValue, replaceAll, hasFound ) ; if ( ! replaceAll && hasFound ) return true ; } return hasFound ; } function GetRegexExpr() { var sExpr = EscapeRegexString( document.getElementById('txtFind').value ) ; if ( document.getElementById('chkWord').checked ) sExpr = '\\b' + sExpr + '\\b' ; return sExpr ; } function GetCase() { return ( document.getElementById('chkCase').checked ? '' : 'i' ) ; } function GetReplacement() { return document.getElementById('txtReplace').value.replace( /\$/g, '$$$$' ) ; } function EscapeRegexString( str ) { return str.replace( /[\\\^\$\*\+\?\{\}\.\(\)\!\|\[\]\-]/g, '\\$&' ) ; } function Replace() { var oRegex = new RegExp( GetRegexExpr(), GetCase() ) ; if ( !ReplaceTextNodes( oEditor.FCK.EditorDocument.body, oRegex, GetReplacement(), false, false ) ) alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ; } function ReplaceAll() { var oRegex = new RegExp( GetRegexExpr(), GetCase() + 'g' ) ; if ( !ReplaceTextNodes( oEditor.FCK.EditorDocument.body, oRegex, GetReplacement(), true, false ) ) alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ; window.parent.Cancel() ; } </script> </head> <body onload="OnLoad()" style="overflow: hidden"> <table cellspacing="3" cellpadding="2" width="100%" border="0"> <tr> <td nowrap="nowrap"> <label for="txtFind" fcklang="DlgReplaceFindLbl"> Find what:</label> </td> <td width="100%"> <input id="txtFind" onkeyup="btnStat(this.form)" style="width: 100%" tabindex="1" type="text" /> </td> <td> <input id="btnReplace" style="width: 100%" disabled="disabled" onclick="Replace();" type="button" value="Replace" fcklang="DlgReplaceReplaceBtn" /> </td> </tr> <tr> <td valign="top" nowrap="nowrap"> <label for="txtReplace" fcklang="DlgReplaceReplaceLbl"> Replace with:</label> </td> <td valign="top"> <input id="txtReplace" style="width: 100%" tabindex="2" type="text" /> </td> <td> <input id="btnReplaceAll" disabled="disabled" onclick="ReplaceAll()" type="button" value="Replace All" fcklang="DlgReplaceReplAllBtn" /> </td> </tr> <tr> <td valign="bottom" colspan="3"> <input id="chkCase" tabindex="3" type="checkbox" /><label for="chkCase" fcklang="DlgReplaceCaseChk">Match case</label> <br /> <input id="chkWord" tabindex="4" type="checkbox" /><label for="chkWord" fcklang="DlgReplaceWordChk">Match whole word</label> </td> </tr> </table> </body> </html>
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
common | Folder | 0755 |
|
|
fck_about | Folder | 0755 |
|
|
fck_docprops | Folder | 0755 |
|
|
fck_flash | Folder | 0755 |
|
|
fck_image | Folder | 0755 |
|
|
fck_link | Folder | 0755 |
|
|
fck_select | Folder | 0755 |
|
|
fck_spellerpages | Folder | 0755 |
|
|
fck_template | Folder | 0755 |
|
|
fck_universalkey | Folder | 0755 |
|
|
fck_about.html | File | 4.43 KB | 0644 |
|
fck_anchor.html | File | 2.5 KB | 0644 |
|
fck_button.html | File | 2.86 KB | 0644 |
|
fck_checkbox.html | File | 2.87 KB | 0644 |
|
fck_colorselector.html | File | 4.85 KB | 0644 |
|
fck_docprops.html | File | 21.03 KB | 0644 |
|
fck_find.html | File | 4.17 KB | 0644 |
|
fck_flash.html | File | 5.19 KB | 0644 |
|
fck_form.html | File | 2.58 KB | 0644 |
|
fck_hiddenfield.html | File | 2.33 KB | 0644 |
|
fck_image.html | File | 9.06 KB | 0644 |
|
fck_link.html | File | 12.09 KB | 0644 |
|
fck_listprop.html | File | 3.5 KB | 0644 |
|
fck_paste.html | File | 7.22 KB | 0644 |
|
fck_radiobutton.html | File | 2.89 KB | 0644 |
|
fck_replace.html | File | 4.17 KB | 0644 |
|
fck_select.html | File | 5.79 KB | 0644 |
|
fck_smiley.html | File | 2.55 KB | 0644 |
|
fck_source.html | File | 1.96 KB | 0644 |
|
fck_specialchar.html | File | 4.21 KB | 0644 |
|
fck_spellerpages.html | File | 1.77 KB | 0644 |
|
fck_table.html | File | 10.44 KB | 0644 |
|
fck_tablecell.html | File | 8.32 KB | 0644 |
|
fck_template.html | File | 5.85 KB | 0644 |
|
fck_textarea.html | File | 2.43 KB | 0644 |
|
fck_textfield.html | File | 3.64 KB | 0644 |
|
fck_universalkey.html | File | 1.88 KB | 0644 |
|