fck_checkbox.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  2. <!--
  3. * FCKeditor - The text editor for internet
  4. * Copyright (C) 2003-2005 Frederico Caldeira Knabben
  5. *
  6. * Licensed under the terms of the GNU Lesser General Public License:
  7. * http://www.opensource.org/licenses/lgpl-license.php
  8. *
  9. * For further information visit:
  10. * http://www.fckeditor.net/
  11. *
  12. * "Support Open Source software. What about a donation today?"
  13. *
  14. * File Name: fck_checkbox.html
  15. * Checkbox dialog window.
  16. *
  17. * File Authors:
  18. * Frederico Caldeira Knabben (fredck@fckeditor.net)
  19. -->
  20. <html>
  21. <head>
  22. <title>Checkbox Properties</title>
  23. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  24. <meta content="noindex, nofollow" name="robots">
  25. <script src="common/fck_dialog_common.js" type="text/javascript"></script>
  26. <script type="text/javascript">
  27. var oEditor = window.parent.InnerDialogLoaded() ;
  28. // Gets the document DOM
  29. var oDOM = oEditor.FCK.EditorDocument ;
  30. var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
  31. window.onload = function()
  32. {
  33. // First of all, translate the dialog box texts
  34. oEditor.FCKLanguageManager.TranslatePage(document) ;
  35. if ( oActiveEl && oActiveEl.tagName == 'INPUT' && oActiveEl.type == 'checkbox' )
  36. {
  37. GetE('txtName').value = oActiveEl.name ;
  38. GetE('txtValue').value = oEditor.FCKBrowserInfo.IsIE ? oActiveEl.value : GetAttribute( oActiveEl, 'value' ) ;
  39. GetE('txtSelected').checked = oActiveEl.checked ;
  40. }
  41. else
  42. oActiveEl = null ;
  43. window.parent.SetOkButton( true ) ;
  44. }
  45. function Ok()
  46. {
  47. if ( !oActiveEl )
  48. {
  49. oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
  50. oActiveEl.type = 'checkbox' ;
  51. oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
  52. }
  53. if ( GetE('txtName').value.length > 0 )
  54. oActiveEl.name = GetE('txtName').value ;
  55. if ( oEditor.FCKBrowserInfo.IsIE )
  56. oActiveEl.value = GetE('txtValue').value ;
  57. else
  58. SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
  59. var bIsChecked = GetE('txtSelected').checked ;
  60. SetAttribute( oActiveEl, 'checked', bIsChecked ? 'checked' : null ) ; // For Firefox
  61. oActiveEl.checked = bIsChecked ;
  62. return true ;
  63. }
  64. </script>
  65. </head>
  66. <body style="OVERFLOW: hidden" scroll="no">
  67. <table height="100%" width="100%">
  68. <tr>
  69. <td align="center">
  70. <table border="0" cellpadding="0" cellspacing="0" width="80%">
  71. <tr>
  72. <td>
  73. <span fckLang="DlgCheckboxName">Name</span><br>
  74. <input type="text" size="20" id="txtName" style="WIDTH: 100%">
  75. </td>
  76. </tr>
  77. <tr>
  78. <td>
  79. <span fckLang="DlgCheckboxValue">Value</span><br>
  80. <input type="text" size="20" id="txtValue" style="WIDTH: 100%">
  81. </td>
  82. </tr>
  83. <tr>
  84. <td><input type="checkbox" id="txtSelected"><label for="txtSelected" fckLang="DlgCheckboxSelected">Checked</label></td>
  85. </tr>
  86. </table>
  87. </td>
  88. </tr>
  89. </table>
  90. </body>
  91. </html>