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_select.html
15
* Select dialog window.
18
* Frederico Caldeira Knabben (fredck@fckeditor.net)
22
<title>Select 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" src="fck_select/fck_select.js"></script>
27
<script type="text/javascript">
29
var oEditor = window.parent.InnerDialogLoaded() ;
31
// Gets the document DOM
32
var oDOM = oEditor.FCK.EditorDocument ;
34
var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
39
window.onload = function()
41
// First of all, translate the dialog box texts
42
oEditor.FCKLanguageManager.TranslatePage(document) ;
44
oListText = document.getElementById( 'cmbText' ) ;
45
oListValue = document.getElementById( 'cmbValue' ) ;
47
if ( oActiveEl && oActiveEl.tagName == 'SELECT' )
49
GetE('txtName').value = oActiveEl.name ;
50
GetE('txtSelValue').value = oActiveEl.value ;
51
GetE('txtLines').value = GetAttribute( oActiveEl, 'size' ) ;
52
GetE('chkMultiple').checked = oActiveEl.multiple ;
54
// Load the actual options
55
for ( var i = 0 ; i < oActiveEl.options.length ; i++ )
57
var sText = oActiveEl.options[i].innerHTML ;
58
var sValue = oActiveEl.options[i].value ;
60
AddComboOption( oListText, sText, sText ) ;
61
AddComboOption( oListValue, sValue, sValue ) ;
67
window.parent.SetOkButton( true ) ;
72
var sSize = GetE('txtLines').value ;
73
if ( sSize == null || isNaN( sSize ) || sSize <= 1 )
78
oActiveEl = oEditor.FCK.EditorDocument.createElement( 'SELECT' ) ;
79
oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
82
SetAttribute( oActiveEl, 'name' , GetE('txtName').value ) ;
83
SetAttribute( oActiveEl, 'size' , sSize ) ;
84
oActiveEl.multiple = ( sSize.length > 0 && GetE('chkMultiple').checked ) ;
86
// Remove all options.
87
while ( oActiveEl.options.length > 0 )
90
// Add all available options.
91
for ( var i = 0 ; i < oListText.options.length ; i++ )
93
var sText = oListText.options[i].value ;
94
var sValue = oListValue.options[i].value ;
95
if ( sValue.length == 0 ) sValue = sText ;
97
var oOption = AddComboOption( oActiveEl, sText, sValue, oDOM ) ;
99
if ( sValue == GetE('txtSelValue').value )
101
SetAttribute( oOption, 'selected', 'selected' ) ;
102
oOption.selected = true ;
111
<body style='OVERFLOW: hidden' scroll='no'>
112
<table width="100%" height="100%">
117
<td nowrap><span fckLang="DlgSelectName">Name</span> </td>
118
<td width="100%" colSpan="2"><input id="txtName" style="WIDTH: 100%" type="text"></td>
121
<td nowrap><span fckLang="DlgSelectValue">Value</span> </td>
122
<td width="100%" colSpan="2"><input id="txtSelValue" style="WIDTH: 100%; BACKGROUND-COLOR: buttonface" type="text" readonly></td>
125
<td nowrap><span fckLang="DlgSelectSize">Size</span> </td>
126
<td nowrap><input id="txtLines" type="text" size="2" value=""> <span fckLang="DlgSelectLines">lines</span></td>
127
<td nowrap align="right"><input id="chkMultiple" name="chkMultiple" type="checkbox"><label for="chkMultiple" fckLang="DlgSelectChkMulti">Allow
128
multiple selections</label></td>
132
<hr style="POSITION: absolute">
133
<span style="LEFT: 10px; POSITION: relative; TOP: -7px" class="BackColor"> <span fckLang="DlgSelectOpAvail">Available
134
Options</span> </span>
137
<td width="50%"><span fckLang="DlgSelectOpText">Text</span><br>
138
<input id="txtText" style="WIDTH: 100%" type="text" name="txtText">
140
<td width="50%"><span fckLang="DlgSelectOpValue">Value</span><br>
141
<input id="txtValue" style="WIDTH: 100%" type="text" name="txtValue">
143
<td vAlign="bottom"><input onclick="Add();" type="button" fckLang="DlgSelectBtnAdd" value="Add"></td>
144
<td vAlign="bottom"><input onclick="Modify();" type="button" fckLang="DlgSelectBtnModify" value="Modify"></td>
147
<td rowSpan="2"><select id="cmbText" style="WIDTH: 100%" onchange="GetE('cmbValue').selectedIndex = this.selectedIndex;Select(this);"
148
size="5" name="cmbText"></select>
150
<td rowSpan="2"><select id="cmbValue" style="WIDTH: 100%" onchange="GetE('cmbText').selectedIndex = this.selectedIndex;Select(this);"
151
size="5" name="cmbValue"></select>
153
<td vAlign="top" colSpan="2">
157
<td vAlign="bottom" colSpan="2"><input style="WIDTH: 100%" onclick="Move(-1);" type="button" fckLang="DlgSelectBtnUp" value="Up">
159
<input style="WIDTH: 100%" onclick="Move(1);" type="button" fckLang="DlgSelectBtnDown"
164
<TD vAlign="bottom" colSpan="4"><INPUT onclick="SetSelectedValue();" type="button" fckLang="DlgSelectBtnSetValue" value="Set as selected value">
165
<input onclick="Delete();" type="button" fckLang="DlgSelectBtnDelete" value="Delete"></TD>