fck_textfield.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. * Text field dialog window.
  23. -->
  24. <html xmlns="http://www.w3.org/1999/xhtml">
  25. <head>
  26. <title></title>
  27. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  28. <meta content="noindex, nofollow" name="robots" />
  29. <script src="common/fck_dialog_common.js" type="text/javascript"></script>
  30. <script type="text/javascript">
  31. var dialog = window.parent ;
  32. var oEditor = dialog.InnerDialogLoaded() ;
  33. // Gets the document DOM
  34. var oDOM = oEditor.FCK.EditorDocument ;
  35. var oActiveEl = dialog.Selection.GetSelectedElement() ;
  36. window.onload = function()
  37. {
  38. // First of all, translate the dialog box texts
  39. oEditor.FCKLanguageManager.TranslatePage(document) ;
  40. if ( oActiveEl && oActiveEl.tagName == 'INPUT' && ( oActiveEl.type == 'text' || oActiveEl.type == 'password' ) )
  41. {
  42. GetE('txtName').value = oActiveEl.name ;
  43. GetE('txtValue').value = oActiveEl.value ;
  44. GetE('txtSize').value = GetAttribute( oActiveEl, 'size' ) ;
  45. GetE('txtMax').value = GetAttribute( oActiveEl, 'maxLength' ) ;
  46. GetE('txtType').value = oActiveEl.type ;
  47. }
  48. else
  49. oActiveEl = null ;
  50. dialog.SetOkButton( true ) ;
  51. dialog.SetAutoSize( true ) ;
  52. SelectField( 'txtName' ) ;
  53. }
  54. function Ok()
  55. {
  56. if ( isNaN( GetE('txtMax').value ) || GetE('txtMax').value < 0 )
  57. {
  58. alert( "Maximum characters must be a positive number." ) ;
  59. GetE('txtMax').focus() ;
  60. return false ;
  61. }
  62. else if( isNaN( GetE('txtSize').value ) || GetE('txtSize').value < 0 )
  63. {
  64. alert( "Width must be a positive number." ) ;
  65. GetE('txtSize').focus() ;
  66. return false ;
  67. }
  68. oEditor.FCKUndo.SaveUndoStep() ;
  69. oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'INPUT', {name: GetE('txtName').value, type: GetE('txtType').value } ) ;
  70. SetAttribute( oActiveEl, 'value' , GetE('txtValue').value ) ;
  71. SetAttribute( oActiveEl, 'size' , GetE('txtSize').value ) ;
  72. SetAttribute( oActiveEl, 'maxlength', GetE('txtMax').value ) ;
  73. return true ;
  74. }
  75. </script>
  76. <style type="text/css">
  77. body, td, input, textarea, select, label { font-family: Arial, Verdana, Geneva, helvetica, sans-serif; font-size: 11px; }
  78. </style>
  79. </head>
  80. <body style="overflow: hidden">
  81. <table width="100%" style="height: 100%">
  82. <tr>
  83. <td align="center">
  84. <table cellspacing="0" cellpadding="0" border="0">
  85. <tr>
  86. <td>
  87. <span fcklang="DlgTextName">Name</span><br />
  88. <input id="txtName" type="text" size="20" />
  89. </td>
  90. <td>
  91. </td>
  92. <td>
  93. <span fcklang="DlgTextValue">Value</span><br />
  94. <input id="txtValue" type="text" size="25" />
  95. </td>
  96. </tr>
  97. <tr>
  98. <td>
  99. <span fcklang="DlgTextCharWidth">Character Width</span><br />
  100. <input id="txtSize" type="text" size="5" />
  101. </td>
  102. <td>
  103. </td>
  104. <td>
  105. <span fcklang="DlgTextMaxChars">Maximum Characters</span><br />
  106. <input id="txtMax" type="text" size="5" />
  107. </td>
  108. </tr>
  109. <tr>
  110. <td>
  111. <span fcklang="DlgTextType">Type</span><br />
  112. <select id="txtType">
  113. <option value="text" selected="selected" fcklang="DlgTextTypeText">Text</option>
  114. <option value="password" fcklang="DlgTextTypePass">Password</option>
  115. </select>
  116. </td>
  117. <td>
  118. &nbsp;</td>
  119. <td>
  120. </td>
  121. </tr>
  122. </table>
  123. </td>
  124. </tr>
  125. </table>
  126. </body>
  127. </html>