PageRenderTime 37ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/boke/Edit_Plus/FCKeditor/editor/dialog/fck_table.html

http://cfbbs.googlecode.com/
HTML | 253 lines | 197 code | 25 blank | 31 comment | 0 complexity | 7beaf702c9f822995683cda4eb876166 MD5 | raw file
Possible License(s): LGPL-2.1
  1. <!--
  2. * FCKeditor - The text editor for internet
  3. * Copyright (C) 2003-2004 Frederico Caldeira Knabben
  4. *
  5. * Licensed under the terms of the GNU Lesser General Public License:
  6. * http://www.opensource.org/licenses/lgpl-license.php
  7. *
  8. * For further information visit:
  9. * http://www.fckeditor.net/
  10. *
  11. * File Name: fck_table.html
  12. * Table dialog window.
  13. *
  14. * Version: 2.0 RC3
  15. * Modified: 2005-02-19 00:38:53
  16. *
  17. * File Authors:
  18. * Frederico Caldeira Knabben (fredck@fckeditor.net)
  19. -->
  20. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  21. <html>
  22. <head>
  23. <title>Table Properties</title>
  24. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  25. <meta name="robots" content="noindex, nofollow" />
  26. <script type="text/javascript">
  27. var oEditor = window.parent.InnerDialogLoaded() ;
  28. // Gets the document DOM
  29. var oDOM = oEditor.FCK.EditorDocument ;
  30. // Gets the table if there is one selected.
  31. var table ;
  32. var e = oEditor.FCKSelection.GetSelectedElement() ;
  33. if ( ! e && document.location.search.substr(1) == 'Parent' )
  34. e = oEditor.FCKSelection.MoveToAncestorNode( 'TABLE' ) ;
  35. if ( e && e.tagName == "TABLE" )
  36. table = e ;
  37. // Fired when the window loading process is finished. It sets the fields with the
  38. // actual values if a table is selected in the editor.
  39. window.onload = function()
  40. {
  41. // First of all, translate the dialog box texts
  42. oEditor.FCKLanguageManager.TranslatePage(document) ;
  43. if (table)
  44. {
  45. document.getElementById('txtRows').value = table.rows.length ;
  46. document.getElementById('txtColumns').value = table.rows[0].cells.length ;
  47. // Gets the value from the Width or the Style attribute
  48. var iWidth = (table.style.width ? table.style.width : table.width ) ;
  49. var iHeight = (table.style.height ? table.style.height : table.height ) ;
  50. if (iWidth.indexOf('%') >= 0) // Percentual = %
  51. {
  52. iWidth = parseInt( iWidth.substr(0,iWidth.length - 1) ) ;
  53. document.getElementById('selWidthType').value = "percent" ;
  54. }
  55. else if (iWidth.indexOf('px') >= 0) // Style Pixel = px
  56. { //
  57. iWidth = iWidth.substr(0,iWidth.length - 2);
  58. document.getElementById('selWidthType').value = "pixels" ;
  59. }
  60. if (iHeight && iHeight.indexOf('px') >= 0) // Style Pixel = px
  61. iHeight = iHeight.substr(0,iHeight.length - 2);
  62. document.getElementById('txtWidth').value = iWidth ;
  63. document.getElementById('txtHeight').value = iHeight ;
  64. document.getElementById('txtBorder').value = table.border ;
  65. document.getElementById('selAlignment').value = table.align ;
  66. document.getElementById('txtCellPadding').value = table.cellPadding ;
  67. document.getElementById('txtCellSpacing').value = table.cellSpacing ;
  68. // document.getElementById('cmbFontStyle').value = table.className ;
  69. if (table.caption) document.getElementById('txtCaption').value = table.caption.innerText ;
  70. document.getElementById('txtRows').disabled = true ;
  71. document.getElementById('txtColumns').disabled = true ;
  72. }
  73. window.parent.SetOkButton( true ) ;
  74. window.parent.SetAutoSize( true ) ;
  75. }
  76. // Fired when the user press the OK button
  77. function Ok()
  78. {
  79. var bExists = ( table != null ) ;
  80. if ( ! bExists )
  81. {
  82. table = document.createElement( "TABLE" ) ;
  83. }
  84. // Removes the Width and Height styles
  85. if ( bExists && table.style.width ) table.style.width = null ; //.removeAttribute("width") ;
  86. if ( bExists && table.style.height ) table.style.height = null ; //.removeAttribute("height") ;
  87. table.width = document.getElementById('txtWidth').value + ( document.getElementById('selWidthType').value == "percent" ? "%" : "") ;
  88. table.height = document.getElementById('txtHeight').value ;
  89. table.border = document.getElementById('txtBorder').value ;
  90. table.align = document.getElementById('selAlignment').value ;
  91. table.cellPadding = document.getElementById('txtCellPadding').value ;
  92. table.cellSpacing = document.getElementById('txtCellSpacing').value ;
  93. // table.className = cmbFontStyle.value ;
  94. if ( document.getElementById('txtCaption').value != '')
  95. {
  96. if (! table.caption) table.createCaption() ;
  97. table.caption.innerText = document.getElementById('txtCaption').value ;
  98. }
  99. // else if ( bExists && table.caption )
  100. // table.deleteCaption() ; // TODO: It causes an IE internal error.
  101. if (! bExists)
  102. {
  103. var iRows = document.getElementById('txtRows').value ;
  104. var iCols = document.getElementById('txtColumns').value ;
  105. for ( var r = 0 ; r < iRows ; r++ )
  106. {
  107. var oRow = table.insertRow(-1) ;
  108. for ( var c = 0 ; c < iCols ; c++ )
  109. {
  110. var oCell = oRow.insertCell(-1) ;
  111. oCell.innerHTML = "&nbsp;" ;
  112. }
  113. }
  114. oEditor.FCK.InsertElement( table ) ;
  115. }
  116. return true ;
  117. }
  118. function IsDigit( e )
  119. {
  120. e = e || event ;
  121. var iCode = ( e.keyCode || e.charCode ) ;
  122. return
  123. (
  124. ( iCode >= 48 && iCode <= 57 ) // Numbers
  125. || (iCode >= 37 && iCode <= 40) // Arrows
  126. || iCode == 8 // Backspace
  127. || iCode == 46 // Delete
  128. ) ;
  129. }
  130. </script>
  131. </head>
  132. <body bottommargin="5" leftmargin="5" topmargin="5" rightmargin="5" scroll="no" style="OVERFLOW: hidden">
  133. <table id="otable" cellSpacing="0" cellPadding="0" width="100%" border="0" height="100%">
  134. <tr>
  135. <td>
  136. <table cellSpacing="1" cellPadding="1" width="100%" border="0">
  137. <tr>
  138. <td valign="top">
  139. <table cellSpacing="0" cellPadding="0" border="0">
  140. <tr>
  141. <td><span fckLang="DlgTableRows">Rows</span>:</td>
  142. <td>&nbsp;<input id="txtRows" type="text" maxLength="3" size="2" value="3" name="txtRows" onkeypress="return IsDigit(event);"></td>
  143. </tr>
  144. <tr>
  145. <td><span fckLang="DlgTableColumns">Columns</span>:</td>
  146. <td>&nbsp;<input id="txtColumns" type="text" maxLength="2" size="2" value="2" name="txtColumns" onkeypress="return IsDigit(event);"></td>
  147. </tr>
  148. <tr>
  149. <td>&nbsp;</td>
  150. <td>&nbsp;</td>
  151. </tr>
  152. <tr>
  153. <td><span fckLang="DlgTableBorder">Border size</span>:</td>
  154. <td>&nbsp;<INPUT id="txtBorder" type="text" maxLength="2" size="2" value="1" name="txtBorder" onkeypress="return IsDigit(event);"></td>
  155. </tr>
  156. <tr>
  157. <td><span fckLang="DlgTableAlign">Alignment</span>:</td>
  158. <td>&nbsp;<select id="selAlignment" name="selAlignment">
  159. <option fckLang="DlgTableAlignNotSet" value="" selected>&lt;Not set&gt;</option>
  160. <option fckLang="DlgTableAlignLeft" value="left">Left</option>
  161. <option fckLang="DlgTableAlignCenter" value="center">Center</option>
  162. <option fckLang="DlgTableAlignRight" value="right">Right</option>
  163. </select></td>
  164. </tr>
  165. </table>
  166. </td>
  167. <td>&nbsp;&nbsp;&nbsp;</td>
  168. <td align="right" valign="top">
  169. <table cellSpacing="0" cellPadding="0" border="0">
  170. <tr>
  171. <td><span fckLang="DlgTableWidth">Width</span>:</td>
  172. <td>&nbsp;<input id="txtWidth" type="text" maxLength="4" size="3" value="200" name="txtWidth" onkeypress="return IsDigit(event);"></td>
  173. <td>&nbsp;<select id="selWidthType" name="selWidthType">
  174. <option fckLang="DlgTableWidthPx" value="pixels" selected>pixels</option>
  175. <option fckLang="DlgTableWidthPc" value="percent">percent</option>
  176. </select></td>
  177. </tr>
  178. <tr>
  179. <td><span fckLang="DlgTableHeight">Height</span>:</td>
  180. <td>&nbsp;<INPUT id="txtHeight" type="text" maxLength="4" size="3" name="txtHeight" onkeypress="return IsDigit(event);"></td>
  181. <td>&nbsp;<span fckLang="DlgTableWidthPx">pixels</span></td>
  182. </tr>
  183. <tr>
  184. <td>&nbsp;</td>
  185. <td>&nbsp;</td>
  186. <td>&nbsp;</td>
  187. </tr>
  188. <tr>
  189. <td nowrap><span fckLang="DlgTableCellSpace">Cell spacing</span>:</td>
  190. <td>&nbsp;<input id="txtCellSpacing" type="text" maxLength="2" size="2" value="1" name="txtCellSpacing"
  191. onkeypress="return IsDigit(event);"></td>
  192. <td>&nbsp;</td>
  193. </tr>
  194. <tr>
  195. <td nowrap><span fckLang="DlgTableCellPad">Cell padding</span>:</td>
  196. <td>&nbsp;<input id="txtCellPadding" type="text" maxLength="2" size="2" value="1" name="txtCellPadding"
  197. onkeypress="return IsDigit(event);"></td>
  198. <td>&nbsp;</td>
  199. </tr>
  200. </table>
  201. </td>
  202. </tr>
  203. </table>
  204. <table cellSpacing="0" cellPadding="0" width="100%" border="0">
  205. <!--
  206. <tr>
  207. <td nowrap>
  208. <span fcklang="DlgClassName">Class Name</span>:</td>
  209. <td>&nbsp;</td>
  210. <td>
  211. <script type="text/javascript">
  212. // var tbstyles = new TBCombo( "FontStyle" , "null" , "", oEditor.config.StyleNames, oEditor.config.StyleValues, 'CheckStyle("cmbFontStyle")');
  213. // document.write(tbstyles.GetHTML());
  214. </script></td>
  215. </tr>
  216. -->
  217. <tr>
  218. <td nowrap><span fckLang="DlgTableCaption">Caption</span>:</td>
  219. <td>&nbsp;</td>
  220. <td width="100%">&nbsp;
  221. <input id="txtCaption" type="text" style="WIDTH: 100%"></td>
  222. </tr>
  223. </table>
  224. </td>
  225. </tr>
  226. </table>
  227. </body>
  228. </html>