1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
\r
3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
\r
4 * Copyright (C) 2003-2007 Frederico Caldeira Knabben
\r
6 * == BEGIN LICENSE ==
\r
8 * Licensed under the terms of any of the following licenses at your
\r
11 * - GNU General Public License Version 2 or later (the "GPL")
\r
12 * http://www.gnu.org/licenses/gpl.html
\r
14 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
\r
15 * http://www.gnu.org/licenses/lgpl.html
\r
17 * - Mozilla Public License Version 1.1 or later (the "MPL")
\r
18 * http://www.mozilla.org/MPL/MPL-1.1.html
\r
22 * Cell properties dialog window.
\r
24 <html xmlns="http://www.w3.org/1999/xhtml">
\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
32 var oEditor = window.parent.InnerDialogLoaded() ;
\r
34 // Gets the document DOM
\r
35 var oDOM = oEditor.FCK.EditorDocument ;
\r
37 // Array of selected Cells
\r
38 var aCells = oEditor.FCKTableHandler.GetSelectedCells() ;
\r
40 window.onload = function()
\r
42 // First of all, translate the dialog box texts
\r
43 oEditor.FCKLanguageManager.TranslatePage( document ) ;
\r
47 window.parent.SetOkButton( true ) ;
\r
48 window.parent.SetAutoSize( true ) ;
\r
51 function SetStartupValue()
\r
53 if ( aCells.length > 0 )
\r
55 var oCell = aCells[0] ;
\r
56 var iWidth = GetAttribute( oCell, 'width' ) ;
\r
58 if ( iWidth.indexOf && iWidth.indexOf( '%' ) >= 0 )
\r
60 iWidth = iWidth.substr( 0, iWidth.length - 1 ) ;
\r
61 GetE('selWidthType').value = 'percent' ;
\r
64 if ( oCell.attributes['noWrap'] != null && oCell.attributes['noWrap'].specified )
\r
65 GetE('selWordWrap').value = !oCell.noWrap ;
\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
79 // Fired when the user press the OK button
\r
82 for( i = 0 ; i < aCells.length ; i++ )
\r
84 if ( GetE('txtWidth').value.length > 0 )
\r
85 aCells[i].width = GetE('txtWidth').value + ( GetE('selWidthType').value == 'percent' ? '%' : '') ;
\r
87 aCells[i].removeAttribute( 'width', 0 ) ;
\r
89 if ( GetE('selWordWrap').value == 'false' )
\r
90 aCells[i].noWrap = true ;
\r
92 aCells[i].removeAttribute( 'noWrap' ) ;
\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
107 function SelectBackColor( color )
\r
109 if ( color && color.length > 0 )
\r
110 GetE('txtBackColor').value = color ;
\r
113 function SelectBorderColor( color )
\r
115 if ( color && color.length > 0 )
\r
116 GetE('txtBorderColor').value = color ;
\r
119 function SelectColor( wich )
\r
121 oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, wich == 'Back' ? SelectBackColor : SelectBorderColor, window ) ;
\r
126 <body scroll="no" style="overflow: hidden">
\r
127 <table cellspacing="0" cellpadding="0" width="100%" border="0" height="100%">
\r
130 <table cellspacing="1" cellpadding="1" width="100%" border="0">
\r
133 <table cellspacing="0" cellpadding="0" border="0">
\r
135 <td nowrap="nowrap">
\r
136 <span fcklang="DlgCellWidth">Width</span>:</td>
\r
138 <input onkeypress="return IsDigit(event);" id="txtWidth" type="text" maxlength="4"
\r
139 size="3" name="txtWidth" /> <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
145 <td nowrap="nowrap">
\r
146 <span fcklang="DlgCellHeight">Height</span>:</td>
\r
148 <input id="txtHeight" type="text" maxlength="4" size="3" name="txtHeight" onkeypress="return IsDigit(event);" /> <span
\r
149 fcklang="DlgCellWidthPx">pixels</span></td>
\r
158 <td nowrap="nowrap">
\r
159 <span fcklang="DlgCellWordWrap">Word Wrap</span>:</td>
\r
161 <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
173 <td nowrap="nowrap">
\r
174 <span fcklang="DlgCellHorAlign">Horizontal Alignment</span>:</td>
\r
176 <select id="selHAlign" name="selAlignment">
\r
177 <option fcklang="DlgCellHorAlignNotSet" value="" selected><Not set></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
184 <td nowrap="nowrap">
\r
185 <span fcklang="DlgCellVerAlign">Vertical Alignment</span>:</td>
\r
187 <select id="selVAlign" name="selAlignment">
\r
188 <option fcklang="DlgCellVerAlignNotSet" value="" selected><Not set></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
198 </td>
\r
200 <table cellspacing="0" cellpadding="0" border="0">
\r
202 <td nowrap="nowrap">
\r
203 <span fcklang="DlgCellRowSpan">Rows Span</span>:</td>
\r
206 <input onkeypress="return IsDigit(event);" id="txtRowSpan" type="text" maxlength="3" size="2"
\r
207 name="txtRows"></td>
\r
212 <td nowrap="nowrap">
\r
213 <span fcklang="DlgCellCollSpan">Columns Span</span>:</td>
\r
216 <input onkeypress="return IsDigit(event);" id="txtCollSpan" type="text" maxlength="2"
\r
217 size="2" name="txtColumns"></td>
\r
230 <td nowrap="nowrap">
\r
231 <span fcklang="DlgCellBackColor">Background Color</span>:</td>
\r
233 <input id="txtBackColor" type="text" size="8" name="txtCellSpacing"></td>
\r
236 <input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Back' )"></td>
\r
239 <td nowrap="nowrap">
\r
240 <span fcklang="DlgCellBorderColor">Border Color</span>:</td>
\r
242 <input id="txtBorderColor" type="text" size="8" name="txtCellPadding" /></td>
\r
245 <input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Border' )" /></td>
\r