event refactor, landing on HEAD!
[freeside.git] / httemplate / elements / fckeditor / editor / dialog / fck_button.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  * Button dialog window.\r
23 -->\r
24 <html xmlns="http://www.w3.org/1999/xhtml">\r
25 <head>\r
26         <title>Button 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">\r
31 \r
32 var oEditor = window.parent.InnerDialogLoaded() ;\r
33 \r
34 // Gets the document DOM\r
35 var oDOM = oEditor.FCK.EditorDocument ;\r
36 \r
37 var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;\r
38 \r
39 window.onload = function()\r
40 {\r
41         // First of all, translate the dialog box texts\r
42         oEditor.FCKLanguageManager.TranslatePage(document) ;\r
43 \r
44         if ( oActiveEl && oActiveEl.tagName.toUpperCase() == "INPUT" && ( oActiveEl.type == "button" || oActiveEl.type == "submit" || oActiveEl.type == "reset" ) )\r
45         {\r
46                 GetE('txtName').value   = oActiveEl.name ;\r
47                 GetE('txtValue').value  = oActiveEl.value ;\r
48                 GetE('txtType').value   = oActiveEl.type ;\r
49 \r
50                 GetE('txtType').disabled = true ;\r
51         }\r
52         else\r
53                 oActiveEl = null ;\r
54 \r
55         window.parent.SetOkButton( true ) ;\r
56 }\r
57 \r
58 function Ok()\r
59 {\r
60         if ( !oActiveEl )\r
61         {\r
62                 oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;\r
63                 oActiveEl.type = GetE('txtType').value ;\r
64                 oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;\r
65         }\r
66 \r
67         oActiveEl.name = GetE('txtName').value ;\r
68         SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;\r
69 \r
70         return true ;\r
71 }\r
72 \r
73         </script>\r
74 </head>\r
75 <body style="overflow: hidden">\r
76         <table width="100%" style="height: 100%">\r
77                 <tr>\r
78                         <td align="center">\r
79                                 <table border="0" cellpadding="0" cellspacing="0" width="80%">\r
80                                         <tr>\r
81                                                 <td colspan="">\r
82                                                         <span fcklang="DlgCheckboxName">Name</span><br />\r
83                                                         <input type="text" size="20" id="txtName" style="width: 100%" />\r
84                                                 </td>\r
85                                         </tr>\r
86                                         <tr>\r
87                                                 <td>\r
88                                                         <span fcklang="DlgButtonText">Text (Value)</span><br />\r
89                                                         <input type="text" id="txtValue" style="width: 100%" />\r
90                                                 </td>\r
91                                         </tr>\r
92                                         <tr>\r
93                                                 <td>\r
94                                                         <span fcklang="DlgButtonType">Type</span><br />\r
95                                                         <select id="txtType">\r
96                                                                 <option fcklang="DlgButtonTypeBtn" value="button" selected="selected">Button</option>\r
97                                                                 <option fcklang="DlgButtonTypeSbm" value="submit">Submit</option>\r
98                                                                 <option fcklang="DlgButtonTypeRst" value="reset">Reset</option>\r
99                                                         </select>\r
100                                                 </td>\r
101                                         </tr>\r
102                                 </table>\r
103                         </td>\r
104                 </tr>\r
105         </table>\r
106 </body>\r
107 </html>\r