test_Box.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!--<!DOCTYPE html>-->
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <script src="../../lib/jquery/jquery-3.2.1.min.js"></script>
  6. <link rel="stylesheet" href="../../lib/bootstrap/css/bootstrap.min.css">
  7. <script src="../../lib/bootstrap/bootstrap.min.js"></script>
  8. <script src="../../public/web/PerfectLoad.js"></script>
  9. </head>
  10. <body>
  11. <button id = "btnA">按钮A</button>
  12. <button id = "btnB">按钮B</button>
  13. <button id = "btnC">按钮C</button>
  14. <button id = "btnD">按钮D</button>
  15. <script>
  16. !function loadHintBox(){
  17. $("body").append('<div id = "hintBox_container"></div>');
  18. $("#hintBox_container").load("../../public/scHintBox.html");
  19. }();
  20. $(document).ready(function(){
  21. function cbYes() {alert('你点击了yes按键');};
  22. function cbNo() {alert('你点击了no按键');}
  23. $("#btnA").click(function(){
  24. let s = hintBox.font('5');
  25. hintBox.infoBox('系统提示', `该行已被第 ${s} 行引用,不允许删除!`, 1);
  26. });
  27. $("#btnB").click(function(){
  28. hintBox.infoBox('操作确认', '确定要删除当前节点吗?', 2, cbYes, cbNo);
  29. });
  30. $("#btnC").click(function(){
  31. hintBox.infoBox('多分支选择', '三个按钮是否继续?', 3, cbYes, cbNo, ['你','我','他']);
  32. });
  33. $("#btnD").click(function(){
  34. hintBox.valueBox('请输入新名称222:', '我的模板1xxxx', function () {
  35. let newName = hintBox.value;
  36. if (newName == '') {
  37. hintBox.error('名称不能为空!');
  38. return false;
  39. };
  40. if (newName == '111') {
  41. hintBox.error(`“${newName}” 已存在,请重新输入!`);
  42. return false;
  43. };
  44. });
  45. });
  46. });
  47. </script>
  48. </body>
  49. </html>