HorizontalLineDialog.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 += '<div class="composition-column en" style="display:block"></div>';
  56. }
  57. editor.setContent(HorizontalLineHtml,true);
  58. dialog.close();
  59. return false
  60. }
  61. } else {
  62. }
  63. } );
  64. </script>
  65. </body>
  66. </html>