1
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
|
2
|
<!--
|
3
|
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
4
|
* Copyright (C) 2003-2009 Frederico Caldeira Knabben
|
5
|
*
|
6
|
* == BEGIN LICENSE ==
|
7
|
*
|
8
|
* Licensed under the terms of any of the following licenses at your
|
9
|
* choice:
|
10
|
*
|
11
|
* - GNU General Public License Version 2 or later (the "GPL")
|
12
|
* http://www.gnu.org/licenses/gpl.html
|
13
|
*
|
14
|
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
15
|
* http://www.gnu.org/licenses/lgpl.html
|
16
|
*
|
17
|
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
18
|
* http://www.mozilla.org/MPL/MPL-1.1.html
|
19
|
*
|
20
|
* == END LICENSE ==
|
21
|
*
|
22
|
* Text field dialog window.
|
23
|
-->
|
24
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
25
|
<head>
|
26
|
<title></title>
|
27
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
28
|
<meta content="noindex, nofollow" name="robots" />
|
29
|
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
|
30
|
<script type="text/javascript">
|
31
|
|
32
|
var dialog = window.parent ;
|
33
|
var oEditor = dialog.InnerDialogLoaded() ;
|
34
|
|
35
|
// Gets the document DOM
|
36
|
var oDOM = oEditor.FCK.EditorDocument ;
|
37
|
|
38
|
var oActiveEl = dialog.Selection.GetSelectedElement() ;
|
39
|
|
40
|
window.onload = function()
|
41
|
{
|
42
|
// First of all, translate the dialog box texts
|
43
|
oEditor.FCKLanguageManager.TranslatePage(document) ;
|
44
|
|
45
|
if ( oActiveEl && oActiveEl.tagName == 'INPUT' && ( oActiveEl.type == 'text' || oActiveEl.type == 'password' ) )
|
46
|
{
|
47
|
GetE('txtName').value = oActiveEl.name ;
|
48
|
GetE('txtValue').value = oActiveEl.value ;
|
49
|
GetE('txtSize').value = GetAttribute( oActiveEl, 'size' ) ;
|
50
|
GetE('txtMax').value = GetAttribute( oActiveEl, 'maxLength' ) ;
|
51
|
GetE('txtType').value = oActiveEl.type ;
|
52
|
}
|
53
|
else
|
54
|
oActiveEl = null ;
|
55
|
|
56
|
dialog.SetOkButton( true ) ;
|
57
|
dialog.SetAutoSize( true ) ;
|
58
|
SelectField( 'txtName' ) ;
|
59
|
}
|
60
|
|
61
|
function Ok()
|
62
|
{
|
63
|
if ( isNaN( GetE('txtMax').value ) || GetE('txtMax').value < 0 )
|
64
|
{
|
65
|
alert( "Maximum characters must be a positive number." ) ;
|
66
|
GetE('txtMax').focus() ;
|
67
|
return false ;
|
68
|
}
|
69
|
else if( isNaN( GetE('txtSize').value ) || GetE('txtSize').value < 0 )
|
70
|
{
|
71
|
alert( "Width must be a positive number." ) ;
|
72
|
GetE('txtSize').focus() ;
|
73
|
return false ;
|
74
|
}
|
75
|
|
76
|
oEditor.FCKUndo.SaveUndoStep() ;
|
77
|
|
78
|
oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'INPUT', {name: GetE('txtName').value, type: GetE('txtType').value } ) ;
|
79
|
|
80
|
SetAttribute( oActiveEl, 'value' , GetE('txtValue').value ) ;
|
81
|
SetAttribute( oActiveEl, 'size' , GetE('txtSize').value ) ;
|
82
|
SetAttribute( oActiveEl, 'maxlength', GetE('txtMax').value ) ;
|
83
|
|
84
|
return true ;
|
85
|
}
|
86
|
|
87
|
</script>
|
88
|
</head>
|
89
|
<body style="overflow: hidden">
|
90
|
<table width="100%" style="height: 100%">
|
91
|
<tr>
|
92
|
<td align="center">
|
93
|
<table cellspacing="0" cellpadding="0" border="0">
|
94
|
<tr>
|
95
|
<td>
|
96
|
<span fcklang="DlgTextName">Name</span><br />
|
97
|
<input id="txtName" type="text" size="20" />
|
98
|
</td>
|
99
|
<td>
|
100
|
</td>
|
101
|
<td>
|
102
|
<span fcklang="DlgTextValue">Value</span><br />
|
103
|
<input id="txtValue" type="text" size="25" />
|
104
|
</td>
|
105
|
</tr>
|
106
|
<tr>
|
107
|
<td>
|
108
|
<span fcklang="DlgTextCharWidth">Character Width</span><br />
|
109
|
<input id="txtSize" type="text" size="5" />
|
110
|
</td>
|
111
|
<td>
|
112
|
</td>
|
113
|
<td>
|
114
|
<span fcklang="DlgTextMaxChars">Maximum Characters</span><br />
|
115
|
<input id="txtMax" type="text" size="5" />
|
116
|
</td>
|
117
|
</tr>
|
118
|
<tr>
|
119
|
<td>
|
120
|
<span fcklang="DlgTextType">Type</span><br />
|
121
|
<select id="txtType">
|
122
|
<option value="text" selected="selected" fcklang="DlgTextTypeText">Text</option>
|
123
|
<option value="password" fcklang="DlgTextTypePass">Password</option>
|
124
|
</select>
|
125
|
</td>
|
126
|
<td>
|
127
|
</td>
|
128
|
<td>
|
129
|
</td>
|
130
|
</tr>
|
131
|
</table>
|
132
|
</td>
|
133
|
</tr>
|
134
|
</table>
|
135
|
</body>
|
136
|
</html>
|