HorizontalLineDialog.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="renderer" content="webkit">
  6. <style>
  7. html, body {
  8. padding: 0;
  9. margin: 0;
  10. font-size: 14px;
  11. }
  12. .horizontal-line-editor {
  13. width: 100%;
  14. }
  15. .pup_content{
  16. padding-top: 20px;
  17. padding-left: 20px;
  18. line-height: 24px;
  19. }
  20. .input-horizontal-line-number{
  21. margin-bottom: 10px;
  22. border:1px solid #aaa;
  23. padding:0;
  24. width:300px;
  25. line-height:1.8;
  26. min-height:22px;
  27. outline: none;
  28. }
  29. </style>
  30. <title></title>
  31. </head>
  32. <body>
  33. <div id="HorizontalLineContainer" class="horizontal-line-editor">
  34. <div class="pup_content">
  35. <span class="horizontal-line-editor-title">
  36. 横线行数:
  37. </span>
  38. <span class="horizontal-line-editor-content">
  39. <input type="number" id="HorizontalLineNumber" min="0" max="2000" class="input-horizontal-line-number">
  40. </span>
  41. </div>
  42. </div>
  43. <!--页面中一定要引入internal.js为了能直接使用当前打开dialog的实例变量-->
  44. <!--internal.js默认是放到dialogs目录下的-->
  45. <script type="text/javascript" src="../dialogs/internal.js"></script>
  46. <script src="../kityformula-plugin/kityformula/js/jquery-1.11.0.min.js"></script>
  47. <script>
  48. jQuery( function ($) {
  49. if ( document.body.addEventListener ) {
  50. dialog.onok = function(){
  51. var LatticeNumber = $( "#HorizontalLineNumber").val();
  52. var row = Number(LatticeNumber);
  53. var HorizontalLineHtml = '';
  54. for (var i = 0; i < row; i++) {
  55. HorizontalLineHtml += '<p class="horizontal-line"></p>';
  56. }
  57. HorizontalLineHtml += '<p></p>';
  58. editor.setContent(HorizontalLineHtml,true);
  59. dialog.close();
  60. return false
  61. }
  62. } else {
  63. }
  64. } );
  65. </script>
  66. </body>
  67. </html>