Project

General

Profile

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
 * Select dialog window.
23
-->
24
<html>
25
	<head>
26
		<title>Select Properties</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" src="fck_select/fck_select.js"></script>
31
		<script type="text/javascript">
32

    
33
var oEditor = window.parent.InnerDialogLoaded() ;
34

    
35
// Gets the document DOM
36
var oDOM = oEditor.FCK.EditorDocument ;
37

    
38
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
39

    
40
var oListText ;
41
var oListValue ;
42

    
43
window.onload = function()
44
{
45
	// First of all, translate the dialog box texts
46
	oEditor.FCKLanguageManager.TranslatePage(document) ;
47

    
48
	oListText	= document.getElementById( 'cmbText' ) ;
49
	oListValue	= document.getElementById( 'cmbValue' ) ;
50

    
51
	if ( oActiveEl && oActiveEl.tagName == 'SELECT' )
52
	{
53
		GetE('txtName').value		= oActiveEl.name ;
54
		GetE('txtSelValue').value	= oActiveEl.value ;
55
		GetE('txtLines').value		= GetAttribute( oActiveEl, 'size' ) ;
56
		GetE('chkMultiple').checked	= oActiveEl.multiple ;
57

    
58
		// Load the actual options
59
		for ( var i = 0 ; i < oActiveEl.options.length ; i++ )
60
		{
61
			var sText	= HTMLDecode( oActiveEl.options[i].innerHTML ) ;
62
			var sValue	= oActiveEl.options[i].value ;
63

    
64
			AddComboOption( oListText, sText, sText ) ;
65
			AddComboOption( oListValue, sValue, sValue ) ;
66
		}
67
	}
68
	else
69
		oActiveEl = null ;
70

    
71
	window.parent.SetOkButton( true ) ;
72
	window.parent.SetAutoSize( true ) ;
73
}
74

    
75
function Ok()
76
{
77
	oEditor.FCKUndo.SaveUndoStep() ;
78
	
79
	var sSize = GetE('txtLines').value ;
80
	if ( sSize == null || isNaN( sSize ) || sSize <= 1 )
81
		sSize = '' ;
82

    
83
	if ( !oActiveEl )
84
	{
85
		oActiveEl = oEditor.FCK.InsertElement( 'select' ) ;
86
	}
87

    
88
	SetAttribute( oActiveEl, 'name'	, GetE('txtName').value ) ;
89
	SetAttribute( oActiveEl, 'size'	, sSize ) ;
90
	oActiveEl.multiple = ( sSize.length > 0 && GetE('chkMultiple').checked ) ;
91

    
92
	// Remove all options.
93
	while ( oActiveEl.options.length > 0 )
94
		oActiveEl.remove(0) ;
95

    
96
	// Add all available options.
97
	for ( var i = 0 ; i < oListText.options.length ; i++ )
98
	{
99
		var sText	= oListText.options[i].value ;
100
		var sValue	= oListValue.options[i].value ;
101
		if ( sValue.length == 0 ) sValue = sText ;
102

    
103
		var oOption = AddComboOption( oActiveEl, sText, sValue, oDOM ) ;
104

    
105
		if ( sValue == GetE('txtSelValue').value )
106
		{
107
			SetAttribute( oOption, 'selected', 'selected' ) ;
108
			oOption.selected = true ;
109
		}
110
	}
111

    
112
	return true ;
113
}
114

    
115
		</script>
116
	</head>
117
	<body style="overflow: hidden">
118
		<table width="100%" height="100%">
119
			<tr>
120
				<td>
121
					<table width="100%">
122
						<tr>
123
							<td nowrap><span fckLang="DlgSelectName">Name</span>&nbsp;</td>
124
							<td width="100%" colSpan="2"><input id="txtName" style="WIDTH: 100%" type="text"></td>
125
						</tr>
126
						<tr>
127
							<td nowrap><span fckLang="DlgSelectValue">Value</span>&nbsp;</td>
128
							<td width="100%" colSpan="2"><input id="txtSelValue" style="WIDTH: 100%; BACKGROUND-COLOR: buttonface" type="text" readonly></td>
129
						</tr>
130
						<tr>
131
							<td nowrap><span fckLang="DlgSelectSize">Size</span>&nbsp;</td>
132
							<td nowrap><input id="txtLines" type="text" size="2" value="">&nbsp;<span fckLang="DlgSelectLines">lines</span></td>
133
							<td nowrap align="right"><input id="chkMultiple" name="chkMultiple" type="checkbox"><label for="chkMultiple" fckLang="DlgSelectChkMulti">Allow
134
									multiple selections</label></td>
135
						</tr>
136
					</table>
137
					<br>
138
					<hr style="POSITION: absolute">
139
					<span style="LEFT: 10px; POSITION: relative; TOP: -7px" class="BackColor">&nbsp;<span fckLang="DlgSelectOpAvail">Available
140
							Options</span>&nbsp;</span>
141
					<table width="100%">
142
						<tr>
143
							<td width="50%"><span fckLang="DlgSelectOpText">Text</span><br>
144
								<input id="txtText" style="WIDTH: 100%" type="text" name="txtText">
145
							</td>
146
							<td width="50%"><span fckLang="DlgSelectOpValue">Value</span><br>
147
								<input id="txtValue" style="WIDTH: 100%" type="text" name="txtValue">
148
							</td>
149
							<td vAlign="bottom"><input onclick="Add();" type="button" fckLang="DlgSelectBtnAdd" value="Add"></td>
150
							<td vAlign="bottom"><input onclick="Modify();" type="button" fckLang="DlgSelectBtnModify" value="Modify"></td>
151
						</tr>
152
						<tr>
153
							<td rowSpan="2"><select id="cmbText" style="WIDTH: 100%" onchange="GetE('cmbValue').selectedIndex = this.selectedIndex;Select(this);"
154
									size="5" name="cmbText"></select>
155
							</td>
156
							<td rowSpan="2"><select id="cmbValue" style="WIDTH: 100%" onchange="GetE('cmbText').selectedIndex = this.selectedIndex;Select(this);"
157
									size="5" name="cmbValue"></select>
158
							</td>
159
							<td vAlign="top" colSpan="2">
160
							</td>
161
						</tr>
162
						<tr>
163
							<td vAlign="bottom" colSpan="2"><input style="WIDTH: 100%" onclick="Move(-1);" type="button" fckLang="DlgSelectBtnUp" value="Up">
164
								<br>
165
								<input style="WIDTH: 100%" onclick="Move(1);" type="button" fckLang="DlgSelectBtnDown"
166
									value="Down">
167
							</td>
168
						</tr>
169
						<TR>
170
							<TD vAlign="bottom" colSpan="4"><INPUT onclick="SetSelectedValue();" type="button" fckLang="DlgSelectBtnSetValue" value="Set as selected value">&nbsp;&nbsp;
171
								<input onclick="Delete();" type="button" fckLang="DlgSelectBtnDelete" value="Delete"></TD>
172
						</TR>
173
					</table>
174
				</td>
175
			</tr>
176
		</table>
177
	</body>
178
</html>
(16-16/26)