OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / scripts / fckeditor2.6.6 / editor / dialog / fck_tablecell.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2 <!--
3  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4  * Copyright (C) 2003-2010 Frederico Caldeira Knabben
5  *
6  * == BEGIN LICENSE ==
7  *
8  * Licensed under the terms of any of the following licenses at your
9  * choice:
10  *
11  *  - GNU General Public License Version 2 or later (the "GPL")
12  *    http://www.gnu.org/licenses/gpl.html
13  *
14  *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15  *    http://www.gnu.org/licenses/lgpl.html
16  *
17  *  - Mozilla Public License Version 1.1 or later (the "MPL")
18  *    http://www.mozilla.org/MPL/MPL-1.1.html
19  *
20  * == END LICENSE ==
21  *
22  * Cell properties dialog window.
23 -->
24 <html xmlns="http://www.w3.org/1999/xhtml">
25 <head>
26         <title>Table Cell Properties</title>
27         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28         <meta name="robots" content="noindex, nofollow" />
29         <script src="common/fck_dialog_common.js" type="text/javascript"></script>
30         <script type="text/javascript">
31
32 var dialog      = window.parent ;
33 var oEditor = dialog.InnerDialogLoaded() ;
34
35 var FCKDomTools = oEditor.FCKDomTools ;
36
37 // Array of selected Cells
38 var aCells = oEditor.FCKTableHandler.GetSelectedCells() ;
39
40 window.onload = function()
41 {
42         // First of all, translate the dialog box texts
43         oEditor.FCKLanguageManager.TranslatePage( document ) ;
44
45         SetStartupValue() ;
46
47         dialog.SetOkButton( true ) ;
48         dialog.SetAutoSize( true ) ;
49         SelectField( 'txtWidth' ) ;
50 }
51
52 function SetStartupValue()
53 {
54         if ( aCells.length > 0 )
55         {
56                 var oCell = aCells[0] ;
57                 var iWidth = GetAttribute( oCell, 'width' ) ;
58
59                 if ( iWidth.indexOf && iWidth.indexOf( '%' ) >= 0 )
60                 {
61                         iWidth = iWidth.substr( 0, iWidth.length - 1 ) ;
62                         GetE('selWidthType').value = 'percent' ;
63                 }
64
65                 if ( oCell.attributes['noWrap'] != null && oCell.attributes['noWrap'].specified )
66                         GetE('selWordWrap').value = !oCell.noWrap ;
67
68                 GetE('txtWidth').value                  = iWidth ;
69                 GetE('txtHeight').value                 = GetAttribute( oCell, 'height' ) ;
70                 GetE('selHAlign').value                 = GetAttribute( oCell, 'align' ) ;
71                 GetE('selVAlign').value                 = GetAttribute( oCell, 'vAlign' ) ;
72                 GetE('txtRowSpan').value                = GetAttribute( oCell, 'rowSpan' ) ;
73                 GetE('txtCollSpan').value               = GetAttribute( oCell, 'colSpan' ) ;
74                 GetE('txtBackColor').value              = GetAttribute( oCell, 'bgColor' ) ;
75                 GetE('txtBorderColor').value    = GetAttribute( oCell, 'borderColor' ) ;
76                 GetE('selCellType').value     = oCell.nodeName.toLowerCase() ;
77         }
78 }
79
80 // Fired when the user press the OK button
81 function Ok()
82 {
83         oEditor.FCKUndo.SaveUndoStep() ;
84
85         for( i = 0 ; i < aCells.length ; i++ )
86         {
87                 if ( GetE('txtWidth').value.length > 0 )
88                         aCells[i].width = GetE('txtWidth').value + ( GetE('selWidthType').value == 'percent' ? '%' : '') ;
89                 else
90                         aCells[i].removeAttribute( 'width', 0 ) ;
91
92                 if ( GetE('selWordWrap').value == 'false' )
93                         SetAttribute( aCells[i], 'noWrap', 'nowrap' ) ;
94                 else
95                         aCells[i].removeAttribute( 'noWrap' ) ;
96
97                 SetAttribute( aCells[i], 'height'               , GetE('txtHeight').value ) ;
98                 SetAttribute( aCells[i], 'align'                , GetE('selHAlign').value ) ;
99                 SetAttribute( aCells[i], 'vAlign'               , GetE('selVAlign').value ) ;
100                 SetAttribute( aCells[i], 'rowSpan'              , GetE('txtRowSpan').value ) ;
101                 SetAttribute( aCells[i], 'colSpan'              , GetE('txtCollSpan').value ) ;
102                 SetAttribute( aCells[i], 'bgColor'              , GetE('txtBackColor').value ) ;
103                 SetAttribute( aCells[i], 'borderColor'  , GetE('txtBorderColor').value ) ;
104
105                 var cellType = GetE('selCellType').value ;
106                 if ( aCells[i].nodeName.toLowerCase() != cellType )
107                         aCells[i] = RenameNode( aCells[i], cellType ) ;
108         }
109
110         // The cells need to be reselected, otherwise the caret will appear inside the table borders (Gecko)
111         // or sent back to the beginning of the document (Opera and Safari).
112         // Strangely, IE works ok so no change is needed for IE.
113         if ( !oEditor.FCKBrowserInfo.IsIE )
114         {
115                 var selection = oEditor.FCK.EditorWindow.getSelection() ;
116                 selection.removeAllRanges() ;
117                 for ( var i = 0 ; i < aCells.length ; i++ )
118                 {
119                         var range = oEditor.FCK.EditorDocument.createRange() ;
120                         range.selectNode( aCells[i] ) ;
121                         selection.addRange( range ) ;
122                 }
123         }
124
125         return true ;
126 }
127
128 function SelectBackColor( color )
129 {
130         if ( color && color.length > 0 )
131                 GetE('txtBackColor').value = color ;
132 }
133
134 function SelectBorderColor( color )
135 {
136         if ( color && color.length > 0 )
137                 GetE('txtBorderColor').value = color ;
138 }
139
140 function SelectColor( wich )
141 {
142         oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, wich == 'Back' ? SelectBackColor : SelectBorderColor ) ;
143 }
144
145         </script>
146 </head>
147 <body scroll="no" style="overflow: hidden">
148         <table cellspacing="0" cellpadding="0" width="100%" border="0" height="100%">
149                 <tr>
150                         <td>
151                                 <table cellspacing="1" cellpadding="1" width="100%" border="0">
152                                         <tr>
153                                                 <td>
154                                                         <table cellspacing="0" cellpadding="0" border="0">
155                                                                 <tr>
156                                                                         <td nowrap="nowrap">
157                                                                                 <span fcklang="DlgCellWidth">Width</span>:</td>
158                                                                         <td>
159                                                                                 &nbsp;<input onkeypress="return IsDigit(event);" id="txtWidth" type="text" maxlength="4"
160                                                                                         size="3" />&nbsp;<select id="selWidthType">
161                                                                                                 <option fcklang="DlgCellWidthPx" value="pixels" selected="selected">pixels</option>
162                                                                                                 <option fcklang="DlgCellWidthPc" value="percent">percent</option>
163                                                                                         </select></td>
164                                                                 </tr>
165                                                                 <tr>
166                                                                         <td nowrap="nowrap">
167                                                                                 <span fcklang="DlgCellHeight">Height</span>:</td>
168                                                                         <td>
169                                                                                 &nbsp;<input id="txtHeight" type="text" maxlength="4" size="3" onkeypress="return IsDigit(event);" />&nbsp;<span
170                                                                                         fcklang="DlgCellWidthPx">pixels</span></td>
171                                                                 </tr>
172                                                                 <tr>
173                                                                         <td>
174                                                                                 &nbsp;</td>
175                                                                         <td>
176                                                                                 &nbsp;</td>
177                                                                 </tr>
178                                                                 <tr>
179                                                                         <td nowrap="nowrap">
180                                                                                 <span fcklang="DlgCellWordWrap">Word Wrap</span>:</td>
181                                                                         <td>
182                                                                                 &nbsp;<select id="selWordWrap">
183                                                                                         <option fcklang="DlgCellWordWrapYes" value="true" selected="selected">Yes</option>
184                                                                                         <option fcklang="DlgCellWordWrapNo" value="false">No</option>
185                                                                                 </select></td>
186                                                                 </tr>
187                                                                 <tr>
188                                                                         <td>
189                                                                                 &nbsp;</td>
190                                                                         <td>
191                                                                                 &nbsp;</td>
192                                                                 </tr>
193                                                                 <tr>
194                                                                         <td nowrap="nowrap">
195                                                                                 <span fcklang="DlgCellHorAlign">Horizontal Alignment</span>:</td>
196                                                                         <td>
197                                                                                 &nbsp;<select id="selHAlign">
198                                                                                         <option fcklang="DlgCellHorAlignNotSet" value="" selected>&lt;Not set&gt;</option>
199                                                                                         <option fcklang="DlgCellHorAlignLeft" value="left">Left</option>
200                                                                                         <option fcklang="DlgCellHorAlignCenter" value="center">Center</option>
201                                                                                         <option fcklang="DlgCellHorAlignRight" value="right">Right</option>
202                                                                                 </select></td>
203                                                                 </tr>
204                                                                 <tr>
205                                                                         <td nowrap="nowrap">
206                                                                                 <span fcklang="DlgCellVerAlign">Vertical Alignment</span>:</td>
207                                                                         <td>
208                                                                                 &nbsp;<select id="selVAlign">
209                                                                                         <option fcklang="DlgCellVerAlignNotSet" value="" selected>&lt;Not set&gt;</option>
210                                                                                         <option fcklang="DlgCellVerAlignTop" value="top">Top</option>
211                                                                                         <option fcklang="DlgCellVerAlignMiddle" value="middle">Middle</option>
212                                                                                         <option fcklang="DlgCellVerAlignBottom" value="bottom">Bottom</option>
213                                                                                         <option fcklang="DlgCellVerAlignBaseline" value="baseline">Baseline</option>
214                                                                                 </select></td>
215                                                                 </tr>
216                                                         </table>
217                                                 </td>
218                                                 <td>
219                                                         &nbsp;&nbsp;&nbsp;</td>
220                                                 <td align="right">
221                                                         <table cellspacing="0" cellpadding="0" border="0">
222                                                                 <tr>
223                                                                         <td nowrap="nowrap">
224                                                                          <span fcklang="DlgCellType">Cell Type</span>:</td>
225                                                                         <td colspan="2">
226                                                                                 &nbsp; <select id="selCellType">
227                                                                                         <option fcklang="DlgCellTypeData" value="td">Data</option>
228                                                                                         <option fcklang="DlgCellTypeHeader" value="th">Header</option>
229                                                                                 </select>
230                                                                 </tr>
231                                                                 <tr>
232                                                                         <td>
233                                                                                 &nbsp;</td>
234                                                                         <td>
235                                                                                 &nbsp;</td>
236                                                                         <td>
237                                                                                 &nbsp;</td>
238                                                                 </tr>
239                                                                 <tr>
240                                                                         <td nowrap="nowrap">
241                                                                                 <span fcklang="DlgCellRowSpan">Rows Span</span>:</td>
242                                                                         <td>
243                                                                                 &nbsp;
244                                                                                 <input onkeypress="return IsDigit(event);" id="txtRowSpan" type="text" maxlength="3" size="2"
245                                                                                         ></td>
246                                                                         <td>
247                                                                         </td>
248                                                                 </tr>
249                                                                 <tr>
250                                                                         <td nowrap="nowrap">
251                                                                                 <span fcklang="DlgCellCollSpan">Columns Span</span>:</td>
252                                                                         <td>
253                                                                                 &nbsp;
254                                                                                 <input onkeypress="return IsDigit(event);" id="txtCollSpan" type="text" maxlength="2"
255                                                                                         size="2"></td>
256                                                                         <td>
257                                                                         </td>
258                                                                 </tr>
259                                                                 <tr>
260                                                                         <td>
261                                                                                 &nbsp;</td>
262                                                                         <td>
263                                                                                 &nbsp;</td>
264                                                                         <td>
265                                                                                 &nbsp;</td>
266                                                                 </tr>
267                                                                 <tr>
268                                                                         <td nowrap="nowrap">
269                                                                                 <span fcklang="DlgCellBackColor">Background Color</span>:</td>
270                                                                         <td>
271                                                                                 &nbsp;<input id="txtBackColor" type="text" size="8" /></td>
272                                                                         <td>
273                                                                                 &nbsp;
274                                                                                 <input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Back' )"></td>
275                                                                 </tr>
276                                                                 <tr>
277                                                                         <td nowrap="nowrap">
278                                                                                 <span fcklang="DlgCellBorderColor">Border Color</span>:</td>
279                                                                         <td>
280                                                                                 &nbsp;<input id="txtBorderColor" type="text" size="8" /></td>
281                                                                         <td>
282                                                                                 &nbsp;
283                                                                                 <input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Border' )" /></td>
284                                                                 </tr>
285                                                         </table>
286                                                 </td>
287                                         </tr>
288                                 </table>
289                         </td>
290                 </tr>
291         </table>
292 </body>
293 </html>