event refactor, landing on HEAD!
[freeside.git] / httemplate / elements / fckeditor / editor / dialog / fck_tablecell.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  * Cell properties dialog window.\r
23 -->\r
24 <html xmlns="http://www.w3.org/1999/xhtml">\r
25 <head>\r
26         <title>Table Cell Properties</title>\r
27         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
28         <meta name="robots" content="noindex, nofollow" />\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 // Array of selected Cells\r
38 var aCells = oEditor.FCKTableHandler.GetSelectedCells() ;\r
39 \r
40 window.onload = function()\r
41 {\r
42         // First of all, translate the dialog box texts\r
43         oEditor.FCKLanguageManager.TranslatePage( document ) ;\r
44 \r
45         SetStartupValue() ;\r
46 \r
47         window.parent.SetOkButton( true ) ;\r
48         window.parent.SetAutoSize( true ) ;\r
49 }\r
50 \r
51 function SetStartupValue()\r
52 {\r
53         if ( aCells.length > 0 )\r
54         {\r
55                 var oCell = aCells[0] ;\r
56                 var iWidth = GetAttribute( oCell, 'width' ) ;\r
57 \r
58                 if ( iWidth.indexOf && iWidth.indexOf( '%' ) >= 0 )\r
59                 {\r
60                         iWidth = iWidth.substr( 0, iWidth.length - 1 ) ;\r
61                         GetE('selWidthType').value = 'percent' ;\r
62                 }\r
63 \r
64                 if ( oCell.attributes['noWrap'] != null && oCell.attributes['noWrap'].specified )\r
65                         GetE('selWordWrap').value = !oCell.noWrap ;\r
66 \r
67                 GetE('txtWidth').value                  = iWidth ;\r
68                 GetE('txtHeight').value                 = GetAttribute( oCell, 'height' ) ;\r
69                 GetE('selHAlign').value                 = GetAttribute( oCell, 'align' ) ;\r
70                 GetE('selVAlign').value                 = GetAttribute( oCell, 'vAlign' ) ;\r
71                 GetE('txtRowSpan').value                = GetAttribute( oCell, 'rowSpan' ) ;\r
72                 GetE('txtCollSpan').value               = GetAttribute( oCell, 'colSpan' ) ;\r
73                 GetE('txtBackColor').value              = GetAttribute( oCell, 'bgColor' ) ;\r
74                 GetE('txtBorderColor').value    = GetAttribute( oCell, 'borderColor' ) ;\r
75 //              GetE('cmbFontStyle').value              = oCell.className ;\r
76         }\r
77 }\r
78 \r
79 // Fired when the user press the OK button\r
80 function Ok()\r
81 {\r
82         for( i = 0 ; i < aCells.length ; i++ )\r
83         {\r
84                 if ( GetE('txtWidth').value.length > 0 )\r
85                         aCells[i].width = GetE('txtWidth').value + ( GetE('selWidthType').value == 'percent' ? '%' : '') ;\r
86                 else\r
87                         aCells[i].removeAttribute( 'width', 0 ) ;\r
88 \r
89                 if ( GetE('selWordWrap').value == 'false' )\r
90                         aCells[i].noWrap = true ;\r
91                 else\r
92                         aCells[i].removeAttribute( 'noWrap' ) ;\r
93 \r
94                 SetAttribute( aCells[i], 'height'               , GetE('txtHeight').value ) ;\r
95                 SetAttribute( aCells[i], 'align'                , GetE('selHAlign').value ) ;\r
96                 SetAttribute( aCells[i], 'vAlign'               , GetE('selVAlign').value ) ;\r
97                 SetAttribute( aCells[i], 'rowSpan'              , GetE('txtRowSpan').value ) ;\r
98                 SetAttribute( aCells[i], 'colSpan'              , GetE('txtCollSpan').value ) ;\r
99                 SetAttribute( aCells[i], 'bgColor'              , GetE('txtBackColor').value ) ;\r
100                 SetAttribute( aCells[i], 'borderColor'  , GetE('txtBorderColor').value ) ;\r
101 //              SetAttribute( aCells[i], 'className'    , GetE('cmbFontStyle').value ) ;\r
102         }\r
103 \r
104         return true ;\r
105 }\r
106 \r
107 function SelectBackColor( color )\r
108 {\r
109         if ( color && color.length > 0 )\r
110                 GetE('txtBackColor').value = color ;\r
111 }\r
112 \r
113 function SelectBorderColor( color )\r
114 {\r
115         if ( color && color.length > 0 )\r
116                 GetE('txtBorderColor').value = color ;\r
117 }\r
118 \r
119 function SelectColor( wich )\r
120 {\r
121         oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, wich == 'Back' ? SelectBackColor : SelectBorderColor, window ) ;\r
122 }\r
123 \r
124         </script>\r
125 </head>\r
126 <body scroll="no" style="overflow: hidden">\r
127         <table cellspacing="0" cellpadding="0" width="100%" border="0" height="100%">\r
128                 <tr>\r
129                         <td>\r
130                                 <table cellspacing="1" cellpadding="1" width="100%" border="0">\r
131                                         <tr>\r
132                                                 <td>\r
133                                                         <table cellspacing="0" cellpadding="0" border="0">\r
134                                                                 <tr>\r
135                                                                         <td nowrap="nowrap">\r
136                                                                                 <span fcklang="DlgCellWidth">Width</span>:</td>\r
137                                                                         <td>\r
138                                                                                 &nbsp;<input onkeypress="return IsDigit(event);" id="txtWidth" type="text" maxlength="4"\r
139                                                                                         size="3" name="txtWidth" />&nbsp;<select id="selWidthType" name="selWidthType">\r
140                                                                                                 <option fcklang="DlgCellWidthPx" value="pixels" selected="selected">pixels</option>\r
141                                                                                                 <option fcklang="DlgCellWidthPc" value="percent">percent</option>\r
142                                                                                         </select></td>\r
143                                                                 </tr>\r
144                                                                 <tr>\r
145                                                                         <td nowrap="nowrap">\r
146                                                                                 <span fcklang="DlgCellHeight">Height</span>:</td>\r
147                                                                         <td>\r
148                                                                                 &nbsp;<input id="txtHeight" type="text" maxlength="4" size="3" name="txtHeight" onkeypress="return IsDigit(event);" />&nbsp;<span\r
149                                                                                         fcklang="DlgCellWidthPx">pixels</span></td>\r
150                                                                 </tr>\r
151                                                                 <tr>\r
152                                                                         <td>\r
153                                                                                 &nbsp;</td>\r
154                                                                         <td>\r
155                                                                                 &nbsp;</td>\r
156                                                                 </tr>\r
157                                                                 <tr>\r
158                                                                         <td nowrap="nowrap">\r
159                                                                                 <span fcklang="DlgCellWordWrap">Word Wrap</span>:</td>\r
160                                                                         <td>\r
161                                                                                 &nbsp;<select id="selWordWrap" name="selAlignment">\r
162                                                                                         <option fcklang="DlgCellWordWrapYes" value="true" selected="selected">Yes</option>\r
163                                                                                         <option fcklang="DlgCellWordWrapNo" value="false">No</option>\r
164                                                                                 </select></td>\r
165                                                                 </tr>\r
166                                                                 <tr>\r
167                                                                         <td>\r
168                                                                                 &nbsp;</td>\r
169                                                                         <td>\r
170                                                                                 &nbsp;</td>\r
171                                                                 </tr>\r
172                                                                 <tr>\r
173                                                                         <td nowrap="nowrap">\r
174                                                                                 <span fcklang="DlgCellHorAlign">Horizontal Alignment</span>:</td>\r
175                                                                         <td>\r
176                                                                                 &nbsp;<select id="selHAlign" name="selAlignment">\r
177                                                                                         <option fcklang="DlgCellHorAlignNotSet" value="" selected>&lt;Not set&gt;</option>\r
178                                                                                         <option fcklang="DlgCellHorAlignLeft" value="left">Left</option>\r
179                                                                                         <option fcklang="DlgCellHorAlignCenter" value="center">Center</option>\r
180                                                                                         <option fcklang="DlgCellHorAlignRight" value="right">Right</option>\r
181                                                                                 </select></td>\r
182                                                                 </tr>\r
183                                                                 <tr>\r
184                                                                         <td nowrap="nowrap">\r
185                                                                                 <span fcklang="DlgCellVerAlign">Vertical Alignment</span>:</td>\r
186                                                                         <td>\r
187                                                                                 &nbsp;<select id="selVAlign" name="selAlignment">\r
188                                                                                         <option fcklang="DlgCellVerAlignNotSet" value="" selected>&lt;Not set&gt;</option>\r
189                                                                                         <option fcklang="DlgCellVerAlignTop" value="top">Top</option>\r
190                                                                                         <option fcklang="DlgCellVerAlignMiddle" value="middle">Middle</option>\r
191                                                                                         <option fcklang="DlgCellVerAlignBottom" value="bottom">Bottom</option>\r
192                                                                                         <option fcklang="DlgCellVerAlignBaseline" value="baseline">Baseline</option>\r
193                                                                                 </select></td>\r
194                                                                 </tr>\r
195                                                         </table>\r
196                                                 </td>\r
197                                                 <td>\r
198                                                         &nbsp;&nbsp;&nbsp;</td>\r
199                                                 <td align="right">\r
200                                                         <table cellspacing="0" cellpadding="0" border="0">\r
201                                                                 <tr>\r
202                                                                         <td nowrap="nowrap">\r
203                                                                                 <span fcklang="DlgCellRowSpan">Rows Span</span>:</td>\r
204                                                                         <td>\r
205                                                                                 &nbsp;\r
206                                                                                 <input onkeypress="return IsDigit(event);" id="txtRowSpan" type="text" maxlength="3" size="2"\r
207                                                                                         name="txtRows"></td>\r
208                                                                         <td>\r
209                                                                         </td>\r
210                                                                 </tr>\r
211                                                                 <tr>\r
212                                                                         <td nowrap="nowrap">\r
213                                                                                 <span fcklang="DlgCellCollSpan">Columns Span</span>:</td>\r
214                                                                         <td>\r
215                                                                                 &nbsp;\r
216                                                                                 <input onkeypress="return IsDigit(event);" id="txtCollSpan" type="text" maxlength="2"\r
217                                                                                         size="2" name="txtColumns"></td>\r
218                                                                         <td>\r
219                                                                         </td>\r
220                                                                 </tr>\r
221                                                                 <tr>\r
222                                                                         <td>\r
223                                                                                 &nbsp;</td>\r
224                                                                         <td>\r
225                                                                                 &nbsp;</td>\r
226                                                                         <td>\r
227                                                                                 &nbsp;</td>\r
228                                                                 </tr>\r
229                                                                 <tr>\r
230                                                                         <td nowrap="nowrap">\r
231                                                                                 <span fcklang="DlgCellBackColor">Background Color</span>:</td>\r
232                                                                         <td>\r
233                                                                                 &nbsp;<input id="txtBackColor" type="text" size="8" name="txtCellSpacing"></td>\r
234                                                                         <td>\r
235                                                                                 &nbsp;\r
236                                                                                 <input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Back' )"></td>\r
237                                                                 </tr>\r
238                                                                 <tr>\r
239                                                                         <td nowrap="nowrap">\r
240                                                                                 <span fcklang="DlgCellBorderColor">Border Color</span>:</td>\r
241                                                                         <td>\r
242                                                                                 &nbsp;<input id="txtBorderColor" type="text" size="8" name="txtCellPadding" /></td>\r
243                                                                         <td>\r
244                                                                                 &nbsp;\r
245                                                                                 <input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Border' )" /></td>\r
246                                                                 </tr>\r
247                                                         </table>\r
248                                                 </td>\r
249                                         </tr>\r
250                                 </table>\r
251                         </td>\r
252                 </tr>\r
253         </table>\r
254 </body>\r
255 </html>\r