event refactor, landing on HEAD!
[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-2007 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 oEditor = window.parent.InnerDialogLoaded() ;\r
34 \r
35 // Gets the document DOM\r
36 var oDOM = oEditor.FCK.EditorDocument ;\r
37 \r
38 var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;\r
39 \r
40 var oListText ;\r
41 var oListValue ;\r
42 \r
43 window.onload = function()\r
44 {\r
45         // First of all, translate the dialog box texts\r
46         oEditor.FCKLanguageManager.TranslatePage(document) ;\r
47 \r
48         oListText       = document.getElementById( 'cmbText' ) ;\r
49         oListValue      = document.getElementById( 'cmbValue' ) ;\r
50 \r
51         if ( oActiveEl && oActiveEl.tagName == 'SELECT' )\r
52         {\r
53                 GetE('txtName').value           = oActiveEl.name ;\r
54                 GetE('txtSelValue').value       = oActiveEl.value ;\r
55                 GetE('txtLines').value          = GetAttribute( oActiveEl, 'size' ) ;\r
56                 GetE('chkMultiple').checked     = oActiveEl.multiple ;\r
57 \r
58                 // Load the actual options\r
59                 for ( var i = 0 ; i < oActiveEl.options.length ; i++ )\r
60                 {\r
61                         var sText       = HTMLDecode( oActiveEl.options[i].innerHTML ) ;\r
62                         var sValue      = oActiveEl.options[i].value ;\r
63 \r
64                         AddComboOption( oListText, sText, sText ) ;\r
65                         AddComboOption( oListValue, sValue, sValue ) ;\r
66                 }\r
67         }\r
68         else\r
69                 oActiveEl = null ;\r
70 \r
71         window.parent.SetOkButton( true ) ;\r
72 }\r
73 \r
74 function Ok()\r
75 {\r
76         var sSize = GetE('txtLines').value ;\r
77         if ( sSize == null || isNaN( sSize ) || sSize <= 1 )\r
78                 sSize = '' ;\r
79 \r
80         if ( !oActiveEl )\r
81         {\r
82                 oActiveEl = oEditor.FCK.EditorDocument.createElement( 'SELECT' ) ;\r
83                 oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;\r
84         }\r
85 \r
86         SetAttribute( oActiveEl, 'name' , GetE('txtName').value ) ;\r
87         SetAttribute( oActiveEl, 'size' , sSize ) ;\r
88         oActiveEl.multiple = ( sSize.length > 0 && GetE('chkMultiple').checked ) ;\r
89 \r
90         // Remove all options.\r
91         while ( oActiveEl.options.length > 0 )\r
92                 oActiveEl.remove(0) ;\r
93 \r
94         // Add all available options.\r
95         for ( var i = 0 ; i < oListText.options.length ; i++ )\r
96         {\r
97                 var sText       = oListText.options[i].value ;\r
98                 var sValue      = oListValue.options[i].value ;\r
99                 if ( sValue.length == 0 ) sValue = sText ;\r
100 \r
101                 var oOption = AddComboOption( oActiveEl, sText, sValue, oDOM ) ;\r
102 \r
103                 if ( sValue == GetE('txtSelValue').value )\r
104                 {\r
105                         SetAttribute( oOption, 'selected', 'selected' ) ;\r
106                         oOption.selected = true ;\r
107                 }\r
108         }\r
109 \r
110         return true ;\r
111 }\r
112 \r
113                 </script>\r
114         </head>\r
115         <body style='OVERFLOW: hidden' scroll='no'>\r
116                 <table width="100%" height="100%">\r
117                         <tr>\r
118                                 <td>\r
119                                         <table width="100%">\r
120                                                 <tr>\r
121                                                         <td nowrap><span fckLang="DlgSelectName">Name</span>&nbsp;</td>\r
122                                                         <td width="100%" colSpan="2"><input id="txtName" style="WIDTH: 100%" type="text"></td>\r
123                                                 </tr>\r
124                                                 <tr>\r
125                                                         <td nowrap><span fckLang="DlgSelectValue">Value</span>&nbsp;</td>\r
126                                                         <td width="100%" colSpan="2"><input id="txtSelValue" style="WIDTH: 100%; BACKGROUND-COLOR: buttonface" type="text" readonly></td>\r
127                                                 </tr>\r
128                                                 <tr>\r
129                                                         <td nowrap><span fckLang="DlgSelectSize">Size</span>&nbsp;</td>\r
130                                                         <td nowrap><input id="txtLines" type="text" size="2" value="">&nbsp;<span fckLang="DlgSelectLines">lines</span></td>\r
131                                                         <td nowrap align="right"><input id="chkMultiple" name="chkMultiple" type="checkbox"><label for="chkMultiple" fckLang="DlgSelectChkMulti">Allow\r
132                                                                         multiple selections</label></td>\r
133                                                 </tr>\r
134                                         </table>\r
135                                         <br>\r
136                                         <hr style="POSITION: absolute">\r
137                                         <span style="LEFT: 10px; POSITION: relative; TOP: -7px" class="BackColor">&nbsp;<span fckLang="DlgSelectOpAvail">Available\r
138                                                         Options</span>&nbsp;</span>\r
139                                         <table width="100%">\r
140                                                 <tr>\r
141                                                         <td width="50%"><span fckLang="DlgSelectOpText">Text</span><br>\r
142                                                                 <input id="txtText" style="WIDTH: 100%" type="text" name="txtText">\r
143                                                         </td>\r
144                                                         <td width="50%"><span fckLang="DlgSelectOpValue">Value</span><br>\r
145                                                                 <input id="txtValue" style="WIDTH: 100%" type="text" name="txtValue">\r
146                                                         </td>\r
147                                                         <td vAlign="bottom"><input onclick="Add();" type="button" fckLang="DlgSelectBtnAdd" value="Add"></td>\r
148                                                         <td vAlign="bottom"><input onclick="Modify();" type="button" fckLang="DlgSelectBtnModify" value="Modify"></td>\r
149                                                 </tr>\r
150                                                 <tr>\r
151                                                         <td rowSpan="2"><select id="cmbText" style="WIDTH: 100%" onchange="GetE('cmbValue').selectedIndex = this.selectedIndex;Select(this);"\r
152                                                                         size="5" name="cmbText"></select>\r
153                                                         </td>\r
154                                                         <td rowSpan="2"><select id="cmbValue" style="WIDTH: 100%" onchange="GetE('cmbText').selectedIndex = this.selectedIndex;Select(this);"\r
155                                                                         size="5" name="cmbValue"></select>\r
156                                                         </td>\r
157                                                         <td vAlign="top" colSpan="2">\r
158                                                         </td>\r
159                                                 </tr>\r
160                                                 <tr>\r
161                                                         <td vAlign="bottom" colSpan="2"><input style="WIDTH: 100%" onclick="Move(-1);" type="button" fckLang="DlgSelectBtnUp" value="Up">\r
162                                                                 <br>\r
163                                                                 <input style="WIDTH: 100%" onclick="Move(1);" type="button" fckLang="DlgSelectBtnDown"\r
164                                                                         value="Down">\r
165                                                         </td>\r
166                                                 </tr>\r
167                                                 <TR>\r
168                                                         <TD vAlign="bottom" colSpan="4"><INPUT onclick="SetSelectedValue();" type="button" fckLang="DlgSelectBtnSetValue" value="Set as selected value">&nbsp;&nbsp;\r
169                                                                 <input onclick="Delete();" type="button" fckLang="DlgSelectBtnDelete" value="Delete"></TD>\r
170                                                 </TR>\r
171                                         </table>\r
172                                 </td>\r
173                         </tr>\r
174                 </table>\r
175         </body>\r
176 </html>\r