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-2007 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
32var oEditor = window.parent.InnerDialogLoaded() ;
33
34// Gets the document DOM
35var oDOM = oEditor.FCK.EditorDocument ;
36
37var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
38
39window.onload = function()
40{
41	// First of all, translate the dialog box texts
42	oEditor.FCKLanguageManager.TranslatePage(document) ;
43
44	if ( oActiveEl && oActiveEl.tagName == 'INPUT' && ( oActiveEl.type == 'text' || oActiveEl.type == 'password' ) )
45	{
46		GetE('txtName').value	= oActiveEl.name ;
47		GetE('txtValue').value	= oActiveEl.value ;
48		GetE('txtSize').value	= GetAttribute( oActiveEl, 'size' ) ;
49		GetE('txtMax').value	= GetAttribute( oActiveEl, 'maxLength' ) ;
50		GetE('txtType').value	= oActiveEl.type ;
51
52		GetE('txtType').disabled = true ;
53	}
54	else
55		oActiveEl = null ;
56
57	window.parent.SetOkButton( true ) ;
58}
59
60function Ok()
61{
62	if ( isNaN( GetE('txtMax').value ) || GetE('txtMax').value < 0 )
63	{
64		alert( "Maximum characters must be a positive number." ) ;
65		GetE('txtMax').focus() ;
66		return false ;
67	}
68	else if( isNaN( GetE('txtSize').value ) || GetE('txtSize').value < 0 )
69	{
70		alert( "Width must be a positive number." ) ;
71		GetE('txtSize').focus() ;
72		return false ;
73	}
74
75	if ( !oActiveEl )
76	{
77		oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
78		oActiveEl.type = GetE('txtType').value ;
79		oEditor.FCKUndo.SaveUndoStep() ;
80		oActiveEl = oEditor.FCK.InsertElement( oActiveEl ) ;
81	}
82
83	oActiveEl.name = GetE('txtName').value ;
84	SetAttribute( oActiveEl, 'value'	, GetE('txtValue').value ) ;
85	SetAttribute( oActiveEl, 'size'		, GetE('txtSize').value ) ;
86	SetAttribute( oActiveEl, 'maxlength', GetE('txtMax').value ) ;
87
88	return true ;
89}
90
91	</script>
92</head>
93<body style="overflow: hidden">
94	<table width="100%" style="height: 100%">
95		<tr>
96			<td align="center">
97				<table cellspacing="0" cellpadding="0" border="0">
98					<tr>
99						<td>
100							<span fcklang="DlgTextName">Name</span><br />
101							<input id="txtName" type="text" size="20" />
102						</td>
103						<td>
104						</td>
105						<td>
106							<span fcklang="DlgTextValue">Value</span><br />
107							<input id="txtValue" type="text" size="25" />
108						</td>
109					</tr>
110					<tr>
111						<td>
112							<span fcklang="DlgTextCharWidth">Character Width</span><br />
113							<input id="txtSize" type="text" size="5" />
114						</td>
115						<td>
116						</td>
117						<td>
118							<span fcklang="DlgTextMaxChars">Maximum Characters</span><br />
119							<input id="txtMax" type="text" size="5" />
120						</td>
121					</tr>
122					<tr>
123						<td>
124							<span fcklang="DlgTextType">Type</span><br />
125							<select id="txtType">
126								<option value="text" selected="selected" fcklang="DlgTextTypeText">Text</option>
127								<option value="password" fcklang="DlgTextTypePass">Password</option>
128							</select>
129						</td>
130						<td>
131							&nbsp;</td>
132						<td>
133						</td>
134					</tr>
135				</table>
136			</td>
137		</tr>
138	</table>
139</body>
140</html>
141