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-2007 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
* Select dialog window.
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">
33
var oEditor = window.parent.InnerDialogLoaded() ;
35
// Gets the document DOM
36
var oDOM = oEditor.FCK.EditorDocument ;
38
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
43
window.onload = function()
45
// First of all, translate the dialog box texts
46
oEditor.FCKLanguageManager.TranslatePage(document) ;
48
oListText = document.getElementById( 'cmbText' ) ;
49
oListValue = document.getElementById( 'cmbValue' ) ;
51
if ( oActiveEl && oActiveEl.tagName == 'SELECT' )
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 ;
58
// Load the actual options
59
for ( var i = 0 ; i < oActiveEl.options.length ; i++ )
61
var sText = HTMLDecode( oActiveEl.options[i].innerHTML ) ;
62
var sValue = oActiveEl.options[i].value ;
64
AddComboOption( oListText, sText, sText ) ;
65
AddComboOption( oListValue, sValue, sValue ) ;
71
window.parent.SetOkButton( true ) ;
76
var sSize = GetE('txtLines').value ;
77
if ( sSize == null || isNaN( sSize ) || sSize <= 1 )
82
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'SELECT' ) ;
83
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
86
SetAttribute( oActiveEl, 'name' , GetE('txtName').value ) ;
87
SetAttribute( oActiveEl, 'size' , sSize ) ;
88
oActiveEl.multiple = ( sSize.length > 0 && GetE('chkMultiple').checked ) ;
90
// Remove all options.
91
while ( oActiveEl.options.length > 0 )
94
// Add all available options.
95
for ( var i = 0 ; i < oListText.options.length ; i++ )
97
var sText = oListText.options[i].value ;
98
var sValue = oListValue.options[i].value ;
99
if ( sValue.length == 0 ) sValue = sText ;
101
var oOption = AddComboOption( oActiveEl, sText, sValue, oDOM ) ;
103
if ( sValue == GetE('txtSelValue').value )
105
SetAttribute( oOption, 'selected', 'selected' ) ;
106
oOption.selected = true ;
115
<body style='OVERFLOW: hidden' scroll='no'>
116
<table width="100%" height="100%">
121
<td nowrap><span fckLang="DlgSelectName">Name</span> </td>
122
<td width="100%" colSpan="2"><input id="txtName" style="WIDTH: 100%" type="text"></td>
125
<td nowrap><span fckLang="DlgSelectValue">Value</span> </td>
126
<td width="100%" colSpan="2"><input id="txtSelValue" style="WIDTH: 100%; BACKGROUND-COLOR: buttonface" type="text" readonly></td>
129
<td nowrap><span fckLang="DlgSelectSize">Size</span> </td>
130
<td nowrap><input id="txtLines" type="text" size="2" value=""> <span fckLang="DlgSelectLines">lines</span></td>
131
<td nowrap align="right"><input id="chkMultiple" name="chkMultiple" type="checkbox"><label for="chkMultiple" fckLang="DlgSelectChkMulti">Allow
132
multiple selections</label></td>
136
<hr style="POSITION: absolute">
137
<span style="LEFT: 10px; POSITION: relative; TOP: -7px" class="BackColor"> <span fckLang="DlgSelectOpAvail">Available
138
Options</span> </span>
141
<td width="50%"><span fckLang="DlgSelectOpText">Text</span><br>
142
<input id="txtText" style="WIDTH: 100%" type="text" name="txtText">
144
<td width="50%"><span fckLang="DlgSelectOpValue">Value</span><br>
145
<input id="txtValue" style="WIDTH: 100%" type="text" name="txtValue">
147
<td vAlign="bottom"><input onclick="Add();" type="button" fckLang="DlgSelectBtnAdd" value="Add"></td>
148
<td vAlign="bottom"><input onclick="Modify();" type="button" fckLang="DlgSelectBtnModify" value="Modify"></td>
151
<td rowSpan="2"><select id="cmbText" style="WIDTH: 100%" onchange="GetE('cmbValue').selectedIndex = this.selectedIndex;Select(this);"
152
size="5" name="cmbText"></select>
154
<td rowSpan="2"><select id="cmbValue" style="WIDTH: 100%" onchange="GetE('cmbText').selectedIndex = this.selectedIndex;Select(this);"
155
size="5" name="cmbValue"></select>
157
<td vAlign="top" colSpan="2">
161
<td vAlign="bottom" colSpan="2"><input style="WIDTH: 100%" onclick="Move(-1);" type="button" fckLang="DlgSelectBtnUp" value="Up">
163
<input style="WIDTH: 100%" onclick="Move(1);" type="button" fckLang="DlgSelectBtnDown"
168
<TD vAlign="bottom" colSpan="4"><INPUT onclick="SetSelectedValue();" type="button" fckLang="DlgSelectBtnSetValue" value="Set as selected value">
169
<input onclick="Delete();" type="button" fckLang="DlgSelectBtnDelete" value="Delete"></TD>