comparison wiki/htdocs/applets/FCKeditor/editor/dialog/fck_find.html @ 0:77665d8e2254

tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0 (automatically generated log message) imported from: moin--main--1.5--base-0
author Thomas Waldmann <tw-public@gmx.de>
date Thu, 22 Sep 2005 15:09:50 +0000
parents
children 79dbcefdff31
comparison
equal deleted inserted replaced
-1:000000000000 0:77665d8e2254
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <!--
3 * FCKeditor - The text editor for internet
4 * Copyright (C) 2003-2005 Frederico Caldeira Knabben
5 *
6 * Licensed under the terms of the GNU Lesser General Public License:
7 * http://www.opensource.org/licenses/lgpl-license.php
8 *
9 * For further information visit:
10 * http://www.fckeditor.net/
11 *
12 * "Support Open Source software. What about a donation today?"
13 *
14 * File Name: fck_find.html
15 * "Find" dialog window.
16 *
17 * File Authors:
18 * Frederico Caldeira Knabben (fredck@fckeditor.net)
19 -->
20 <html>
21 <head>
22 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
23 <meta content="noindex, nofollow" name="robots">
24 <script type="text/javascript">
25
26 var oEditor = window.parent.InnerDialogLoaded() ;
27
28 function OnLoad()
29 {
30 // Whole word is available on IE only.
31 if ( oEditor.FCKBrowserInfo.IsIE )
32 document.getElementById('divWord').style.display = '' ;
33
34 // First of all, translate the dialog box texts.
35 oEditor.FCKLanguageManager.TranslatePage( document ) ;
36
37 window.parent.SetAutoSize( true ) ;
38 }
39
40 function btnStat(frm)
41 {
42 document.getElementById('btnFind').disabled =
43 ( document.getElementById('txtFind').value.length == 0 ) ;
44 }
45
46 function ReplaceTextNodes( parentNode, regex, replaceValue, replaceAll )
47 {
48 for ( var i = 0 ; i < parentNode.childNodes.length ; i++ )
49 {
50 var oNode = parentNode.childNodes[i] ;
51 if ( oNode.nodeType == 3 )
52 {
53 var sReplaced = oNode.nodeValue.replace( regex, replaceValue ) ;
54 if ( oNode.nodeValue != sReplaced )
55 {
56 oNode.nodeValue = sReplaced ;
57 if ( ! replaceAll )
58 return true ;
59 }
60 }
61 else
62 {
63 if ( ReplaceTextNodes( oNode, regex, replaceValue ) )
64 return true ;
65 }
66 }
67 return false ;
68 }
69
70 function GetRegexExpr()
71 {
72 if ( document.getElementById('chkWord').checked )
73 var sExpr = '\\b' + document.getElementById('txtFind').value + '\\b' ;
74 else
75 var sExpr = document.getElementById('txtFind').value ;
76
77 return sExpr ;
78 }
79
80 function GetCase()
81 {
82 return ( document.getElementById('chkCase').checked ? '' : 'i' ) ;
83 }
84
85 var oRange = oEditor.FCK.EditorDocument.body.createTextRange() ;
86
87 function Ok()
88 {
89 if ( document.getElementById('txtFind').value.length == 0 )
90 return ;
91
92 if ( oEditor.FCKBrowserInfo.IsIE )
93 FindIE() ;
94 else
95 FindGecko() ;
96 }
97
98 function FindIE()
99 {
100 var iFlags = 0 ;
101
102 if ( chkCase.checked )
103 iFlags = iFlags | 4 ;
104
105 if ( chkWord.checked )
106 iFlags = iFlags | 2 ;
107
108 var bFound = oRange.findText( document.getElementById('txtFind').value, 1, iFlags ) ;
109
110 if ( bFound )
111 {
112 oRange.scrollIntoView() ;
113 oRange.select() ;
114 oRange.collapse(false) ;
115 oLastRangeFound = oRange ;
116 }
117 else
118 {
119 oRange = oEditor.FCK.EditorDocument.body.createTextRange() ;
120 alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
121 }
122 }
123
124 function FindGecko()
125 {
126 var bCase = document.getElementById('chkCase').checked ;
127 var bWord = document.getElementById('chkWord').checked ;
128
129 // window.find( searchString, caseSensitive, backwards, wrapAround, wholeWord, searchInFrames, showDialog ) ;
130 oEditor.FCK.EditorWindow.find( document.getElementById('txtFind').value, bCase, false, false, bWord, false, false ) ;
131
132 }
133 </script>
134 </head>
135 <body onload="OnLoad()" scroll="no" style="OVERFLOW: hidden">
136 <table cellSpacing="3" cellPadding="2" width="100%" border="0">
137 <tr>
138 <td nowrap>
139 <label for="txtFind" fckLang="DlgReplaceFindLbl">Find what:</label>&nbsp;
140 </td>
141 <td width="100%">
142 <input id="txtFind" style="WIDTH: 100%" tabIndex="1" type="text">
143 </td>
144 <td>
145 <input id="btnFind" style="WIDTH: 100%; PADDING-RIGHT: 5px; PADDING-LEFT: 5px" onclick="Ok();"
146 type="button" value="Find" fckLang="DlgFindFindBtn">
147 </td>
148 </tr>
149 <tr>
150 <td valign="bottom" colSpan="3">
151 &nbsp;<input id="chkCase" tabIndex="3" type="checkbox"><label for="chkCase" fckLang="DlgReplaceCaseChk">Match
152 case</label>
153 <br>
154 <div id="divWord" style="DISPLAY: none">
155 &nbsp;<input id="chkWord" tabIndex="4" type="checkbox"><label for="chkWord" fckLang="DlgReplaceWordChk">Match
156 whole word</label>
157 </div>
158 </td>
159 </tr>
160 </table>
161 </body>
162 </html>