1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3
* FCKeditor - The text editor for internet
4
* Copyright (C) 2003-2005 Frederico Caldeira Knabben
6
* Licensed under the terms of the GNU Lesser General Public License:
7
* http://www.opensource.org/licenses/lgpl-license.php
9
* For further information visit:
10
* http://www.fckeditor.net/
12
* "Support Open Source software. What about a donation today?"
14
* File Name: fck_find.html
15
* "Find" dialog window.
18
* Frederico Caldeira Knabben (fredck@fckeditor.net)
22
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
23
<meta content="noindex, nofollow" name="robots">
24
<script type="text/javascript">
26
var oEditor = window.parent.InnerDialogLoaded() ;
30
// Whole word is available on IE only.
31
if ( oEditor.FCKBrowserInfo.IsIE )
32
document.getElementById('divWord').style.display = '' ;
34
// First of all, translate the dialog box texts.
35
oEditor.FCKLanguageManager.TranslatePage( document ) ;
37
window.parent.SetAutoSize( true ) ;
42
document.getElementById('btnFind').disabled =
43
( document.getElementById('txtFind').value.length == 0 ) ;
46
function ReplaceTextNodes( parentNode, regex, replaceValue, replaceAll )
48
for ( var i = 0 ; i < parentNode.childNodes.length ; i++ )
50
var oNode = parentNode.childNodes[i] ;
51
if ( oNode.nodeType == 3 )
53
var sReplaced = oNode.nodeValue.replace( regex, replaceValue ) ;
54
if ( oNode.nodeValue != sReplaced )
56
oNode.nodeValue = sReplaced ;
63
if ( ReplaceTextNodes( oNode, regex, replaceValue ) )
70
function GetRegexExpr()
72
if ( document.getElementById('chkWord').checked )
73
var sExpr = '\\b' + document.getElementById('txtFind').value + '\\b' ;
75
var sExpr = document.getElementById('txtFind').value ;
82
return ( document.getElementById('chkCase').checked ? '' : 'i' ) ;
87
if ( document.getElementById('txtFind').value.length == 0 )
90
if ( oEditor.FCKBrowserInfo.IsIE )
98
if ( oEditor.FCKBrowserInfo.IsIE )
99
oRange = oEditor.FCK.EditorDocument.body.createTextRange() ;
105
if ( chkCase.checked )
106
iFlags = iFlags | 4 ;
108
if ( chkWord.checked )
109
iFlags = iFlags | 2 ;
111
var bFound = oRange.findText( document.getElementById('txtFind').value, 1, iFlags ) ;
115
oRange.scrollIntoView() ;
117
oRange.collapse(false) ;
118
oLastRangeFound = oRange ;
122
oRange = oEditor.FCK.EditorDocument.body.createTextRange() ;
123
alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
129
var bCase = document.getElementById('chkCase').checked ;
130
var bWord = document.getElementById('chkWord').checked ;
132
// window.find( searchString, caseSensitive, backwards, wrapAround, wholeWord, searchInFrames, showDialog ) ;
133
oEditor.FCK.EditorWindow.find( document.getElementById('txtFind').value, bCase, false, false, bWord, false, false ) ;
138
<body onload="OnLoad()" scroll="no" style="OVERFLOW: hidden">
139
<table cellSpacing="3" cellPadding="2" width="100%" border="0">
142
<label for="txtFind" fckLang="DlgReplaceFindLbl">Find what:</label>
145
<input id="txtFind" style="WIDTH: 100%" tabIndex="1" type="text">
148
<input id="btnFind" style="WIDTH: 100%; PADDING-RIGHT: 5px; PADDING-LEFT: 5px" onclick="Ok();"
149
type="button" value="Find" fckLang="DlgFindFindBtn">
153
<td valign="bottom" colSpan="3">
154
<input id="chkCase" tabIndex="3" type="checkbox"><label for="chkCase" fckLang="DlgReplaceCaseChk">Match
157
<div id="divWord" style="DISPLAY: none">
158
<input id="chkWord" tabIndex="4" type="checkbox"><label for="chkWord" fckLang="DlgReplaceWordChk">Match