~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to wiki/htdocs/applets/FCKeditor/editor/dialog/fck_find.html

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20080622211713-inlv5k4eifxckelr
ImportĀ upstreamĀ versionĀ 1.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
function Ok()
 
86
{
 
87
        if ( document.getElementById('txtFind').value.length == 0 )
 
88
                return ;
 
89
 
 
90
        if ( oEditor.FCKBrowserInfo.IsIE )
 
91
                FindIE() ;
 
92
        else
 
93
                FindGecko() ;
 
94
}
 
95
 
 
96
var oRange ;
 
97
 
 
98
if ( oEditor.FCKBrowserInfo.IsIE )
 
99
        oRange = oEditor.FCK.EditorDocument.body.createTextRange() ;
 
100
 
 
101
function FindIE()
 
102
{
 
103
        var iFlags = 0 ;
 
104
 
 
105
        if ( chkCase.checked )
 
106
                iFlags = iFlags | 4 ;
 
107
 
 
108
        if ( chkWord.checked )
 
109
                iFlags = iFlags | 2 ;
 
110
 
 
111
        var bFound = oRange.findText( document.getElementById('txtFind').value, 1, iFlags ) ;
 
112
 
 
113
        if ( bFound )
 
114
        {
 
115
                oRange.scrollIntoView() ;
 
116
                oRange.select() ;
 
117
                oRange.collapse(false) ;
 
118
                oLastRangeFound = oRange ;
 
119
        }
 
120
        else
 
121
        {
 
122
                oRange = oEditor.FCK.EditorDocument.body.createTextRange() ;
 
123
                alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
 
124
        }
 
125
}
 
126
 
 
127
function FindGecko()
 
128
{
 
129
        var bCase = document.getElementById('chkCase').checked ;
 
130
        var bWord = document.getElementById('chkWord').checked ;
 
131
 
 
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 ) ;
 
134
 
 
135
}
 
136
                </script>
 
137
        </head>
 
138
        <body onload="OnLoad()" scroll="no" style="OVERFLOW: hidden">
 
139
                <table cellSpacing="3" cellPadding="2" width="100%" border="0">
 
140
                        <tr>
 
141
                                <td nowrap>
 
142
                                        <label for="txtFind" fckLang="DlgReplaceFindLbl">Find what:</label>&nbsp;
 
143
                                </td>
 
144
                                <td width="100%">
 
145
                                        <input id="txtFind" style="WIDTH: 100%" tabIndex="1" type="text">
 
146
                                </td>
 
147
                                <td>
 
148
                                        <input id="btnFind" style="WIDTH: 100%; PADDING-RIGHT: 5px; PADDING-LEFT: 5px" onclick="Ok();"
 
149
                                                type="button" value="Find" fckLang="DlgFindFindBtn">
 
150
                                </td>
 
151
                        </tr>
 
152
                        <tr>
 
153
                                <td valign="bottom" colSpan="3">
 
154
                                        &nbsp;<input id="chkCase" tabIndex="3" type="checkbox"><label for="chkCase" fckLang="DlgReplaceCaseChk">Match 
 
155
                                                case</label>
 
156
                                        <br>
 
157
                                        <div id="divWord" style="DISPLAY: none">
 
158
                                                &nbsp;<input id="chkWord" tabIndex="4" type="checkbox"><label for="chkWord" fckLang="DlgReplaceWordChk">Match 
 
159
                                                        whole word</label>
 
160
                                        </div>
 
161
                                </td>
 
162
                        </tr>
 
163
                </table>
 
164
        </body>
 
165
</html>