Subversion Repositories Applications.papyrus

Rev

Rev 1688 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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