event refactor, landing on HEAD!
[freeside.git] / httemplate / elements / fckeditor / editor / dialog / fck_select.html
diff --git a/httemplate/elements/fckeditor/editor/dialog/fck_select.html b/httemplate/elements/fckeditor/editor/dialog/fck_select.html
new file mode 100644 (file)
index 0000000..cb48b50
--- /dev/null
@@ -0,0 +1,176 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >\r
+<!--\r
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net\r
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben\r
+ *\r
+ * == BEGIN LICENSE ==\r
+ *\r
+ * Licensed under the terms of any of the following licenses at your\r
+ * choice:\r
+ *\r
+ *  - GNU General Public License Version 2 or later (the "GPL")\r
+ *    http://www.gnu.org/licenses/gpl.html\r
+ *\r
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")\r
+ *    http://www.gnu.org/licenses/lgpl.html\r
+ *\r
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")\r
+ *    http://www.mozilla.org/MPL/MPL-1.1.html\r
+ *\r
+ * == END LICENSE ==\r
+ *\r
+ * Select dialog window.\r
+-->\r
+<html>\r
+       <head>\r
+               <title>Select Properties</title>\r
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8">\r
+               <meta content="noindex, nofollow" name="robots">\r
+               <script src="common/fck_dialog_common.js" type="text/javascript"></script>\r
+               <script type="text/javascript" src="fck_select/fck_select.js"></script>\r
+               <script type="text/javascript">\r
+\r
+var oEditor = window.parent.InnerDialogLoaded() ;\r
+\r
+// Gets the document DOM\r
+var oDOM = oEditor.FCK.EditorDocument ;\r
+\r
+var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;\r
+\r
+var oListText ;\r
+var oListValue ;\r
+\r
+window.onload = function()\r
+{\r
+       // First of all, translate the dialog box texts\r
+       oEditor.FCKLanguageManager.TranslatePage(document) ;\r
+\r
+       oListText       = document.getElementById( 'cmbText' ) ;\r
+       oListValue      = document.getElementById( 'cmbValue' ) ;\r
+\r
+       if ( oActiveEl && oActiveEl.tagName == 'SELECT' )\r
+       {\r
+               GetE('txtName').value           = oActiveEl.name ;\r
+               GetE('txtSelValue').value       = oActiveEl.value ;\r
+               GetE('txtLines').value          = GetAttribute( oActiveEl, 'size' ) ;\r
+               GetE('chkMultiple').checked     = oActiveEl.multiple ;\r
+\r
+               // Load the actual options\r
+               for ( var i = 0 ; i < oActiveEl.options.length ; i++ )\r
+               {\r
+                       var sText       = HTMLDecode( oActiveEl.options[i].innerHTML ) ;\r
+                       var sValue      = oActiveEl.options[i].value ;\r
+\r
+                       AddComboOption( oListText, sText, sText ) ;\r
+                       AddComboOption( oListValue, sValue, sValue ) ;\r
+               }\r
+       }\r
+       else\r
+               oActiveEl = null ;\r
+\r
+       window.parent.SetOkButton( true ) ;\r
+}\r
+\r
+function Ok()\r
+{\r
+       var sSize = GetE('txtLines').value ;\r
+       if ( sSize == null || isNaN( sSize ) || sSize <= 1 )\r
+               sSize = '' ;\r
+\r
+       if ( !oActiveEl )\r
+       {\r
+               oActiveEl = oEditor.FCK.EditorDocument.createElement( 'SELECT' ) ;\r
+               oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;\r
+       }\r
+\r
+       SetAttribute( oActiveEl, 'name' , GetE('txtName').value ) ;\r
+       SetAttribute( oActiveEl, 'size' , sSize ) ;\r
+       oActiveEl.multiple = ( sSize.length > 0 && GetE('chkMultiple').checked ) ;\r
+\r
+       // Remove all options.\r
+       while ( oActiveEl.options.length > 0 )\r
+               oActiveEl.remove(0) ;\r
+\r
+       // Add all available options.\r
+       for ( var i = 0 ; i < oListText.options.length ; i++ )\r
+       {\r
+               var sText       = oListText.options[i].value ;\r
+               var sValue      = oListValue.options[i].value ;\r
+               if ( sValue.length == 0 ) sValue = sText ;\r
+\r
+               var oOption = AddComboOption( oActiveEl, sText, sValue, oDOM ) ;\r
+\r
+               if ( sValue == GetE('txtSelValue').value )\r
+               {\r
+                       SetAttribute( oOption, 'selected', 'selected' ) ;\r
+                       oOption.selected = true ;\r
+               }\r
+       }\r
+\r
+       return true ;\r
+}\r
+\r
+               </script>\r
+       </head>\r
+       <body style='OVERFLOW: hidden' scroll='no'>\r
+               <table width="100%" height="100%">\r
+                       <tr>\r
+                               <td>\r
+                                       <table width="100%">\r
+                                               <tr>\r
+                                                       <td nowrap><span fckLang="DlgSelectName">Name</span>&nbsp;</td>\r
+                                                       <td width="100%" colSpan="2"><input id="txtName" style="WIDTH: 100%" type="text"></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td nowrap><span fckLang="DlgSelectValue">Value</span>&nbsp;</td>\r
+                                                       <td width="100%" colSpan="2"><input id="txtSelValue" style="WIDTH: 100%; BACKGROUND-COLOR: buttonface" type="text" readonly></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td nowrap><span fckLang="DlgSelectSize">Size</span>&nbsp;</td>\r
+                                                       <td nowrap><input id="txtLines" type="text" size="2" value="">&nbsp;<span fckLang="DlgSelectLines">lines</span></td>\r
+                                                       <td nowrap align="right"><input id="chkMultiple" name="chkMultiple" type="checkbox"><label for="chkMultiple" fckLang="DlgSelectChkMulti">Allow\r
+                                                                       multiple selections</label></td>\r
+                                               </tr>\r
+                                       </table>\r
+                                       <br>\r
+                                       <hr style="POSITION: absolute">\r
+                                       <span style="LEFT: 10px; POSITION: relative; TOP: -7px" class="BackColor">&nbsp;<span fckLang="DlgSelectOpAvail">Available\r
+                                                       Options</span>&nbsp;</span>\r
+                                       <table width="100%">\r
+                                               <tr>\r
+                                                       <td width="50%"><span fckLang="DlgSelectOpText">Text</span><br>\r
+                                                               <input id="txtText" style="WIDTH: 100%" type="text" name="txtText">\r
+                                                       </td>\r
+                                                       <td width="50%"><span fckLang="DlgSelectOpValue">Value</span><br>\r
+                                                               <input id="txtValue" style="WIDTH: 100%" type="text" name="txtValue">\r
+                                                       </td>\r
+                                                       <td vAlign="bottom"><input onclick="Add();" type="button" fckLang="DlgSelectBtnAdd" value="Add"></td>\r
+                                                       <td vAlign="bottom"><input onclick="Modify();" type="button" fckLang="DlgSelectBtnModify" value="Modify"></td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td rowSpan="2"><select id="cmbText" style="WIDTH: 100%" onchange="GetE('cmbValue').selectedIndex = this.selectedIndex;Select(this);"\r
+                                                                       size="5" name="cmbText"></select>\r
+                                                       </td>\r
+                                                       <td rowSpan="2"><select id="cmbValue" style="WIDTH: 100%" onchange="GetE('cmbText').selectedIndex = this.selectedIndex;Select(this);"\r
+                                                                       size="5" name="cmbValue"></select>\r
+                                                       </td>\r
+                                                       <td vAlign="top" colSpan="2">\r
+                                                       </td>\r
+                                               </tr>\r
+                                               <tr>\r
+                                                       <td vAlign="bottom" colSpan="2"><input style="WIDTH: 100%" onclick="Move(-1);" type="button" fckLang="DlgSelectBtnUp" value="Up">\r
+                                                               <br>\r
+                                                               <input style="WIDTH: 100%" onclick="Move(1);" type="button" fckLang="DlgSelectBtnDown"\r
+                                                                       value="Down">\r
+                                                       </td>\r
+                                               </tr>\r
+                                               <TR>\r
+                                                       <TD vAlign="bottom" colSpan="4"><INPUT onclick="SetSelectedValue();" type="button" fckLang="DlgSelectBtnSetValue" value="Set as selected value">&nbsp;&nbsp;\r
+                                                               <input onclick="Delete();" type="button" fckLang="DlgSelectBtnDelete" value="Delete"></TD>\r
+                                               </TR>\r
+                                       </table>\r
+                               </td>\r
+                       </tr>\r
+               </table>\r
+       </body>\r
+</html>\r