1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
3
* FCKeditor - The text editor for internet
4
* Copyright (C) 2003-2005 Frederico Caldeira Knabben
6
* Licensed under the terms of the GNU Lesser General Public License:
7
* http://www.opensource.org/licenses/lgpl-license.php
9
* For further information visit:
10
* http://www.fckeditor.net/
12
* "Support Open Source software. What about a donation today?"
14
* File Name: fck_textfield.html
15
* Text field dialog window.
18
* Frederico Caldeira Knabben (fredck@fckeditor.net)
22
<title>Text Field Properties</title>
23
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
24
<meta content="noindex, nofollow" name="robots">
25
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
26
<script type="text/javascript">
28
var oEditor = window.parent.InnerDialogLoaded() ;
30
// Gets the document DOM
31
var oDOM = oEditor.FCK.EditorDocument ;
33
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
35
window.onload = function()
37
// First of all, translate the dialog box texts
38
oEditor.FCKLanguageManager.TranslatePage(document) ;
40
if ( oActiveEl && oActiveEl.tagName == 'INPUT' && ( oActiveEl.type == 'text' || oActiveEl.type == 'password' ) )
42
GetE('txtName').value = oActiveEl.name ;
43
GetE('txtValue').value = oActiveEl.value ;
44
GetE('txtSize').value = GetAttribute( oActiveEl, 'size' ) ;
45
GetE('txtMax').value = GetAttribute( oActiveEl, 'maxLength' ) ;
46
GetE('txtType').value = oActiveEl.type ;
48
GetE('txtType').disabled = true ;
53
window.parent.SetOkButton( true ) ;
58
if ( isNaN( GetE('txtMax').value ) || GetE('txtMax').value < 0 )
60
alert( "Maximum characters must be a positive number." ) ;
61
GetE('txtMax').focus() ;
64
else if( isNaN( GetE('txtSize').value ) || GetE('txtSize').value < 0 )
66
alert( "Width must be a positive number." ) ;
67
GetE('txtSize').focus() ;
73
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
74
oActiveEl.type = GetE('txtType').value ;
75
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
78
oActiveEl.name = GetE('txtName').value ;
79
SetAttribute( oActiveEl, 'value' , GetE('txtValue').value ) ;
80
SetAttribute( oActiveEl, 'size' , GetE('txtSize').value ) ;
81
SetAttribute( oActiveEl, 'maxlength', GetE('txtMax').value ) ;
88
<body style="OVERFLOW: hidden" scroll="no">
89
<table height="100%" width="100%">
92
<table cellSpacing="0" cellPadding="0" border="0">
95
<span fckLang="DlgTextName">Name</span><br>
96
<input id="txtName" type="text" size="20">
100
<span fckLang="DlgTextValue">Value</span><br>
101
<input id="txtValue" type="text" size="25">
106
<span fckLang="DlgTextCharWidth">Character Width</span><br>
107
<input id="txtSize" type="text" size="5">
111
<span fckLang="DlgTextMaxChars">Maximum Characters</span><br>
112
<input id="txtMax" type="text" size="5">
117
<span fckLang="DlgTextType">Type</span><br>
118
<select id="txtType">
119
<option value="text" selected fckLang="DlgTextTypeText">Text</option>
120
<option value="password" fckLang="DlgTextTypePass">Password</option>
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
3
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
8
* Licensed under the terms of any of the following licenses at your
11
* - GNU General Public License Version 2 or later (the "GPL")
12
* http://www.gnu.org/licenses/gpl.html
14
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
* http://www.gnu.org/licenses/lgpl.html
17
* - Mozilla Public License Version 1.1 or later (the "MPL")
18
* http://www.mozilla.org/MPL/MPL-1.1.html
22
* Text field dialog window.
24
<html xmlns="http://www.w3.org/1999/xhtml">
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">
32
var dialog = window.parent ;
33
var oEditor = dialog.InnerDialogLoaded() ;
35
// Gets the document DOM
36
var oDOM = oEditor.FCK.EditorDocument ;
38
var oActiveEl = dialog.Selection.GetSelectedElement() ;
40
window.onload = function()
42
// First of all, translate the dialog box texts
43
oEditor.FCKLanguageManager.TranslatePage(document) ;
45
if ( oActiveEl && oActiveEl.tagName == 'INPUT' && ( oActiveEl.type == 'text' || oActiveEl.type == 'password' ) )
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 ;
56
dialog.SetOkButton( true ) ;
57
dialog.SetAutoSize( true ) ;
58
SelectField( 'txtName' ) ;
63
if ( isNaN( GetE('txtMax').value ) || GetE('txtMax').value < 0 )
65
alert( "Maximum characters must be a positive number." ) ;
66
GetE('txtMax').focus() ;
69
else if( isNaN( GetE('txtSize').value ) || GetE('txtSize').value < 0 )
71
alert( "Width must be a positive number." ) ;
72
GetE('txtSize').focus() ;
76
oEditor.FCKUndo.SaveUndoStep() ;
78
oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'INPUT', {name: GetE('txtName').value, type: GetE('txtType').value } ) ;
80
SetAttribute( oActiveEl, 'value' , GetE('txtValue').value ) ;
81
SetAttribute( oActiveEl, 'size' , GetE('txtSize').value ) ;
82
SetAttribute( oActiveEl, 'maxlength', GetE('txtMax').value ) ;
89
<body style="overflow: hidden">
90
<table width="100%" style="height: 100%">
93
<table cellspacing="0" cellpadding="0" border="0">
96
<span fcklang="DlgTextName">Name</span><br />
97
<input id="txtName" type="text" size="20" />
102
<span fcklang="DlgTextValue">Value</span><br />
103
<input id="txtValue" type="text" size="25" />
108
<span fcklang="DlgTextCharWidth">Character Width</span><br />
109
<input id="txtSize" type="text" size="5" />
114
<span fcklang="DlgTextMaxChars">Maximum Characters</span><br />
115
<input id="txtMax" type="text" size="5" />
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>