import torrus 1.0.9
[freeside.git] / httemplate / elements / fckeditor / editor / dialog / fck_select.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >\r
2 <!--\r
3  * FCKeditor - The text editor for Internet - http://www.fckeditor.net\r
4  * Copyright (C) 2003-2010 Frederico Caldeira Knabben\r
5  *\r
6  * == BEGIN LICENSE ==\r
7  *\r
8  * Licensed under the terms of any of the following licenses at your\r
9  * choice:\r
10  *\r
11  *  - GNU General Public License Version 2 or later (the "GPL")\r
12  *    http://www.gnu.org/licenses/gpl.html\r
13  *\r
14  *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")\r
15  *    http://www.gnu.org/licenses/lgpl.html\r
16  *\r
17  *  - Mozilla Public License Version 1.1 or later (the "MPL")\r
18  *    http://www.mozilla.org/MPL/MPL-1.1.html\r
19  *\r
20  * == END LICENSE ==\r
21  *\r
22  * Select dialog window.\r
23 -->\r
24 <html>\r
25         <head>\r
26                 <title>Select Properties</title>\r
27                 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">\r
28                 <meta content="noindex, nofollow" name="robots">\r
29                 <script src="common/fck_dialog_common.js" type="text/javascript"></script>\r
30                 <script type="text/javascript" src="fck_select/fck_select.js"></script>\r
31                 <script type="text/javascript">\r
32 \r
33 var dialog      = window.parent ;\r
34 var oEditor = dialog.InnerDialogLoaded() ;\r
35 \r
36 // Gets the document DOM\r
37 var oDOM = oEditor.FCK.EditorDocument ;\r
38 \r
39 var oActiveEl = dialog.Selection.GetSelectedElement() ;\r
40 \r
41 var oListText ;\r
42 var oListValue ;\r
43 \r
44 window.onload = function()\r
45 {\r
46         // First of all, translate the dialog box texts\r
47         oEditor.FCKLanguageManager.TranslatePage(document) ;\r
48 \r
49         oListText       = document.getElementById( 'cmbText' ) ;\r
50         oListValue      = document.getElementById( 'cmbValue' ) ;\r
51 \r
52         // Fix the lists widths. (Bug #970)\r
53         oListText.style.width = oListText.offsetWidth ;\r
54         oListValue.style.width = oListValue.offsetWidth ;\r
55 \r
56         if ( oActiveEl && oActiveEl.tagName == 'SELECT' )\r
57         {\r
58                 GetE('txtName').value           = oActiveEl.name ;\r
59                 GetE('txtSelValue').value       = oActiveEl.value ;\r
60                 GetE('txtLines').value          = GetAttribute( oActiveEl, 'size' ) ;\r
61                 GetE('chkMultiple').checked     = oActiveEl.multiple ;\r
62 \r
63                 // Load the actual options\r
64                 for ( var i = 0 ; i < oActiveEl.options.length ; i++ )\r
65                 {\r
66                         var sText       = HTMLDecode( oActiveEl.options[i].innerHTML ) ;\r
67                         var sValue      = oActiveEl.options[i].value ;\r
68 \r
69                         AddComboOption( oListText, sText, sText ) ;\r
70                         AddComboOption( oListValue, sValue, sValue ) ;\r
71                 }\r
72         }\r
73         else\r
74                 oActiveEl = null ;\r
75 \r
76         dialog.SetOkButton( true ) ;\r
77         dialog.SetAutoSize( true ) ;\r
78         SelectField( 'txtName' ) ;\r
79 }\r
80 \r
81 function Ok()\r
82 {\r
83         oEditor.FCKUndo.SaveUndoStep() ;\r
84 \r
85         var sSize = GetE('txtLines').value ;\r
86         if ( sSize == null || isNaN( sSize ) || sSize <= 1 )\r
87                 sSize = '' ;\r
88 \r
89         oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'SELECT', {name: GetE('txtName').value} ) ;\r
90 \r
91         SetAttribute( oActiveEl, 'size' , sSize ) ;\r
92         oActiveEl.multiple = ( sSize.length > 0 && GetE('chkMultiple').checked ) ;\r
93 \r
94         // Remove all options.\r
95         while ( oActiveEl.options.length > 0 )\r
96                 oActiveEl.remove(0) ;\r
97 \r
98         // Add all available options.\r
99         for ( var i = 0 ; i < oListText.options.length ; i++ )\r
100         {\r
101                 var sText       = oListText.options[i].value ;\r
102                 var sValue      = oListValue.options[i].value ;\r
103                 if ( sValue.length == 0 ) sValue = sText ;\r
104 \r
105                 var oOption = AddComboOption( oActiveEl, sText, sValue, oDOM ) ;\r
106 \r
107                 if ( sValue == GetE('txtSelValue').value )\r
108                 {\r
109                         SetAttribute( oOption, 'selected', 'selected' ) ;\r
110                         oOption.selected = true ;\r
111                 }\r
112         }\r
113 \r
114         return true ;\r
115 }\r
116 \r
117                 </script>\r
118         </head>\r
119         <body style="overflow: hidden">\r
120                 <table width="100%" height="100%">\r
121                         <tr>\r
122                                 <td>\r
123                                         <table width="100%">\r
124                                                 <tr>\r
125                                                         <td nowrap><span fckLang="DlgSelectName">Name</span>&nbsp;</td>\r
126                                                         <td width="100%" colSpan="2"><input id="txtName" style="WIDTH: 100%" type="text"></td>\r
127                                                 </tr>\r
128                                                 <tr>\r
129                                                         <td nowrap><span fckLang="DlgSelectValue">Value</span>&nbsp;</td>\r
130                                                         <td width="100%" colSpan="2"><input id="txtSelValue" style="WIDTH: 100%; BACKGROUND-COLOR: buttonface" type="text" readonly></td>\r
131                                                 </tr>\r
132                                                 <tr>\r
133                                                         <td nowrap><span fckLang="DlgSelectSize">Size</span>&nbsp;</td>\r
134                                                         <td nowrap><input id="txtLines" type="text" size="2" value="">&nbsp;<span fckLang="DlgSelectLines">lines</span></td>\r
135                                                         <td nowrap align="right"><input id="chkMultiple" type="checkbox"><label for="chkMultiple" fckLang="DlgSelectChkMulti">Allow\r
136                                                                         multiple selections</label></td>\r
137                                                 </tr>\r
138                                         </table>\r
139                                         <br>\r
140                                         <hr style="POSITION: absolute">\r
141                                         <span style="LEFT: 10px; POSITION: relative; TOP: -7px" class="BackColor">&nbsp;<span fckLang="DlgSelectOpAvail">Available\r
142                                                         Options</span>&nbsp;</span>\r
143                                         <table width="100%">\r
144                                                 <tr>\r
145                                                         <td width="50%"><span fckLang="DlgSelectOpText">Text</span><br>\r
146                                                                 <input id="txtText" style="WIDTH: 100%" type="text">\r
147                                                         </td>\r
148                                                         <td width="50%"><span fckLang="DlgSelectOpValue">Value</span><br>\r
149                                                                 <input id="txtValue" style="WIDTH: 100%" type="text">\r
150                                                         </td>\r
151                                                         <td vAlign="bottom"><input onclick="Add();" type="button" fckLang="DlgSelectBtnAdd" value="Add"></td>\r
152                                                         <td vAlign="bottom"><input onclick="Modify();" type="button" fckLang="DlgSelectBtnModify" value="Modify"></td>\r
153                                                 </tr>\r
154                                                 <tr>\r
155                                                         <td rowSpan="2"><select id="cmbText" style="WIDTH: 100%" onchange="GetE('cmbValue').selectedIndex = this.selectedIndex;Select(this);"\r
156                                                                         size="5"></select>\r
157                                                         </td>\r
158                                                         <td rowSpan="2"><select id="cmbValue" style="WIDTH: 100%" onchange="GetE('cmbText').selectedIndex = this.selectedIndex;Select(this);"\r
159                                                                         size="5"></select>\r
160                                                         </td>\r
161                                                         <td vAlign="top" colSpan="2">\r
162                                                         </td>\r
163                                                 </tr>\r
164                                                 <tr>\r
165                                                         <td vAlign="bottom" colSpan="2"><input style="WIDTH: 100%" onclick="Move(-1);" type="button" fckLang="DlgSelectBtnUp" value="Up">\r
166                                                                 <br>\r
167                                                                 <input style="WIDTH: 100%" onclick="Move(1);" type="button" fckLang="DlgSelectBtnDown"\r
168                                                                         value="Down">\r
169                                                         </td>\r
170                                                 </tr>\r
171                                                 <TR>\r
172                                                         <TD vAlign="bottom" colSpan="4"><INPUT onclick="SetSelectedValue();" type="button" fckLang="DlgSelectBtnSetValue" value="Set as selected value">&nbsp;&nbsp;\r
173                                                                 <input onclick="Delete();" type="button" fckLang="DlgSelectBtnDelete" value="Delete"></TD>\r
174                                                 </TR>\r
175                                         </table>\r
176                                 </td>\r
177                         </tr>\r
178                 </table>\r
179         </body>\r
180 </html>\r