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