source: trunk/admin/inc/FCKeditor/editor/dialog/fck_select.html@ 2

Last change on this file since 2 was 2, checked in by root, 15 years ago

importo il progetto

File size: 5.8 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2<!--
3 * FCKeditor - The text editor for internet
4 * Copyright (C) 2003-2006 Frederico Caldeira Knabben
5 *
6 * Licensed under the terms of the GNU Lesser General Public License:
7 * http://www.opensource.org/licenses/lgpl-license.php
8 *
9 * For further information visit:
10 * http://www.fckeditor.net/
11 *
12 * "Support Open Source software. What about a donation today?"
13 *
14 * File Name: fck_select.html
15 * Select dialog window.
16 *
17 * File Authors:
18 * Frederico Caldeira Knabben (fredck@fckeditor.net)
19-->
20<html>
21 <head>
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">
28
29var oEditor = window.parent.InnerDialogLoaded() ;
30
31// Gets the document DOM
32var oDOM = oEditor.FCK.EditorDocument ;
33
34var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
35
36var oListText ;
37var oListValue ;
38
39window.onload = function()
40{
41 // First of all, translate the dialog box texts
42 oEditor.FCKLanguageManager.TranslatePage(document) ;
43
44 oListText = document.getElementById( 'cmbText' ) ;
45 oListValue = document.getElementById( 'cmbValue' ) ;
46
47 if ( oActiveEl && oActiveEl.tagName == 'SELECT' )
48 {
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 ;
53
54 // Load the actual options
55 for ( var i = 0 ; i < oActiveEl.options.length ; i++ )
56 {
57 var sText = oActiveEl.options[i].innerHTML ;
58 var sValue = oActiveEl.options[i].value ;
59
60 AddComboOption( oListText, sText, sText ) ;
61 AddComboOption( oListValue, sValue, sValue ) ;
62 }
63 }
64 else
65 oActiveEl = null ;
66
67 window.parent.SetOkButton( true ) ;
68}
69
70function Ok()
71{
72 var sSize = GetE('txtLines').value ;
73 if ( sSize == null || isNaN( sSize ) || sSize <= 1 )
74 sSize = '' ;
75
76 if ( !oActiveEl )
77 {
78 oActiveEl = oEditor.FCK.EditorDocument.createElement( 'SELECT' ) ;
79 oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
80 }
81
82 SetAttribute( oActiveEl, 'name' , GetE('txtName').value ) ;
83 SetAttribute( oActiveEl, 'size' , sSize ) ;
84 oActiveEl.multiple = ( sSize.length > 0 && GetE('chkMultiple').checked ) ;
85
86 // Remove all options.
87 while ( oActiveEl.options.length > 0 )
88 oActiveEl.remove(0) ;
89
90 // Add all available options.
91 for ( var i = 0 ; i < oListText.options.length ; i++ )
92 {
93 var sText = oListText.options[i].value ;
94 var sValue = oListValue.options[i].value ;
95 if ( sValue.length == 0 ) sValue = sText ;
96
97 var oOption = AddComboOption( oActiveEl, sText, sValue, oDOM ) ;
98
99 if ( sValue == GetE('txtSelValue').value )
100 {
101 SetAttribute( oOption, 'selected', 'selected' ) ;
102 oOption.selected = true ;
103 }
104 }
105
106 return true ;
107}
108
109 </script>
110 </head>
111 <body style='OVERFLOW: hidden' scroll='no'>
112 <table width="100%" height="100%">
113 <tr>
114 <td>
115 <table width="100%">
116 <tr>
117 <td nowrap><span fckLang="DlgSelectName">Name</span>&nbsp;</td>
118 <td width="100%" colSpan="2"><input id="txtName" style="width: 100%" type="text"></td>
119 </tr>
120 <tr>
121 <td nowrap><span fckLang="DlgSelectValue">Value</span>&nbsp;</td>
122 <td width="100%" colSpan="2"><input id="txtSelValue" style="width: 100%; BACKGROUND-COLOR: buttonface" type="text" readonly></td>
123 </tr>
124 <tr>
125 <td nowrap><span fckLang="DlgSelectSize">Size</span>&nbsp;</td>
126 <td nowrap><input id="txtLines" type="text" size="2" value="">&nbsp;<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>
129 </tr>
130 </table>
131 <br>
132 <hr style="POSITION: absolute">
133 <span style="LEFT: 10px; POSITION: relative; TOP: -7px" class="BackColor">&nbsp;<span fckLang="DlgSelectOpAvail">Available
134 Options</span>&nbsp;</span>
135 <table width="100%">
136 <tr>
137 <td width="50%"><span fckLang="DlgSelectOpText">Text</span><br>
138 <input id="txtText" style="width: 100%" type="text" name="txtText">
139 </td>
140 <td width="50%"><span fckLang="DlgSelectOpValue">Value</span><br>
141 <input id="txtValue" style="width: 100%" type="text" name="txtValue">
142 </td>
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>
145 </tr>
146 <tr>
147 <td rowSpan="2"><select id="cmbText" style="width: 100%" onchange="GetE('cmbValue').selectedIndex = this.selectedIndex;Select(this);"
148 size="5" name="cmbText"></select>
149 </td>
150 <td rowSpan="2"><select id="cmbValue" style="width: 100%" onchange="GetE('cmbText').selectedIndex = this.selectedIndex;Select(this);"
151 size="5" name="cmbValue"></select>
152 </td>
153 <td vAlign="top" colSpan="2">
154 </td>
155 </tr>
156 <tr>
157 <td vAlign="bottom" colSpan="2"><input style="width: 100%" onclick="Move(-1);" type="button" fckLang="DlgSelectBtnUp" value="Up">
158 <br>
159 <input style="width: 100%" onclick="Move(1);" type="button" fckLang="DlgSelectBtnDown"
160 value="Down">
161 </td>
162 </tr>
163 <TR>
164 <TD vAlign="bottom" colSpan="4"><INPUT onclick="SetSelectedValue();" type="button" fckLang="DlgSelectBtnSetValue" value="Set as selected value">&nbsp;&nbsp;
165 <input onclick="Delete();" type="button" fckLang="DlgSelectBtnDelete" value="Delete"></TD>
166 </TR>
167 </table>
168 </td>
169 </tr>
170 </table>
171 </body>
172</html>
Note: See TracBrowser for help on using the repository browser.