/source/Plug-in/fck/editor/plugins/placeholder/fck_placeholder.html

http://prosporous.googlecode.com/ · HTML · 100 lines · 65 code · 13 blank · 22 comment · 0 complexity · fd16779affa40dd7cb03dcd39fd9ae6b MD5 · raw file

  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. * Placeholder Plugin.
  23. -->
  24. <html>
  25. <head>
  26. <title>Placeholder Properties</title>
  27. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  28. <meta content="noindex, nofollow" name="robots">
  29. <script language="javascript">
  30. var oEditor = window.parent.InnerDialogLoaded() ;
  31. var FCKLang = oEditor.FCKLang ;
  32. var FCKPlaceholders = oEditor.FCKPlaceholders ;
  33. window.onload = function ()
  34. {
  35. // First of all, translate the dialog box texts
  36. oEditor.FCKLanguageManager.TranslatePage( document ) ;
  37. LoadSelected() ;
  38. // Show the "Ok" button.
  39. window.parent.SetOkButton( true ) ;
  40. }
  41. var eSelected = oEditor.FCKSelection.GetSelectedElement() ;
  42. function LoadSelected()
  43. {
  44. if ( !eSelected )
  45. return ;
  46. if ( eSelected.tagName == 'SPAN' && eSelected._fckplaceholder )
  47. document.getElementById('txtName').value = eSelected._fckplaceholder ;
  48. else
  49. eSelected == null ;
  50. }
  51. function Ok()
  52. {
  53. var sValue = document.getElementById('txtName').value ;
  54. if ( eSelected && eSelected._fckplaceholder == sValue )
  55. return true ;
  56. if ( sValue.length == 0 )
  57. {
  58. alert( FCKLang.PlaceholderErrNoName ) ;
  59. return false ;
  60. }
  61. if ( FCKPlaceholders.Exist( sValue ) )
  62. {
  63. alert( FCKLang.PlaceholderErrNameInUse ) ;
  64. return false ;
  65. }
  66. FCKPlaceholders.Add( sValue ) ;
  67. return true ;
  68. }
  69. </script>
  70. </head>
  71. <body scroll="no" style="OVERFLOW: hidden">
  72. <table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
  73. <tr>
  74. <td>
  75. <table cellSpacing="0" cellPadding="0" align="center" border="0">
  76. <tr>
  77. <td>
  78. <span fckLang="PlaceholderDlgName">Placeholder Name</span><br>
  79. <input id="txtName" type="text">
  80. </td>
  81. </tr>
  82. </table>
  83. </td>
  84. </tr>
  85. </table>
  86. </body>
  87. </html>