설명 없음
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

theme_add_welcome_tplfile.htm 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. {include file="public/layout" /}
  2. <body style="background-color: #FFF; overflow: auto;min-width:auto;">
  3. <div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
  4. <div id="append_parent"></div>
  5. <div id="ajaxwaitid"></div>
  6. <div class="page" style="min-width:auto;box-shadow:none;">
  7. <form class="form-horizontal" id="post_form" action="{:url('Index/ajax_add_welcome_tplfile')}" method="post">
  8. <div class="ncap-form-default">
  9. <dl class="row">
  10. <dt class="tit">模板目录</dt>
  11. <dd class="opt" style="width: auto;">
  12. {$tpldirpath}
  13. <span class="err"></span>
  14. <p class="notic"></p>
  15. </dd>
  16. </dl>
  17. <dl class="row">
  18. <dt class="tit">
  19. <label for="url"><em>*</em>文件名称</label>
  20. </dt>
  21. <dd class="opt" style="width: auto;">
  22. welcome_<input type="text" name="filename" value="{$filename}" id="filename" placeholder="请输入模板文件名" tabindex="2" onkeyup="this.value=this.value.replace(/[^\w\-]/g,'');" onpaste="this.value=this.value.replace(/[^\w\-]/g,'')" autocomplete="off">.htm
  23. <span class="err"></span>
  24. <p class="notic">只允许字母、数字、下划线、连接符的任意组合</p>
  25. <p class="red" id="txt_filename"></p>
  26. </dd>
  27. </dl>
  28. <dl class="row">
  29. <dt class="tit">
  30. <label for="theme_title"><em>*</em>主题名称</label>
  31. </dt>
  32. <dd class="opt" style="width: auto;">
  33. <input type="text" name="theme_title" placeholder="" id="theme_title" class="input-txt" autocomplete="off">
  34. <span class="err"></span>
  35. <p class="notic"></p>
  36. </dd>
  37. </dl>
  38. <div class="bot">
  39. <input type="hidden" name="type" value="welcome">
  40. <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn" tabindex="4">确认提交</a>
  41. </div>
  42. </div>
  43. </form>
  44. </div>
  45. <script type="text/javascript">
  46. $(function(){
  47. $('#filename').keyup(function(){
  48. $.ajax({
  49. type: "POST",
  50. url: "{:url('Ajax/new_appoint_tplfile', ['nosubmit'=>1,'_ajax'=>1])}",
  51. data: $('#post_form').serialize(),
  52. dataType: 'json',
  53. success: function (res) {
  54. if(res.code == 1){
  55. $('#txt_filename').html('');
  56. } else {
  57. $('#txt_filename').html(res.msg);
  58. }
  59. }
  60. });
  61. });
  62. });
  63. // 判断输入框是否为空
  64. function checkForm(){
  65. if($('input[name=filename]').val() == ''){
  66. showErrorMsg('文件名称不能为空!');
  67. $('input[name=filename]').focus();
  68. return false;
  69. }
  70. if($('input[name=theme_title]').val() == ''){
  71. showErrorMsg('主题名称不能为空!');
  72. $('input[name=theme_title]').focus();
  73. return false;
  74. }
  75. layer_loading('正在处理');
  76. $.ajax({
  77. type: "POST",
  78. url: "{:url('Index/ajax_add_welcome_tplfile', ['_ajax'=>1])}",
  79. data: $('#post_form').serialize(),
  80. dataType: 'json',
  81. success: function (res) {
  82. if(res.code == 1){
  83. var _parent = parent;
  84. _parent.layer.closeAll();
  85. $('#new_welcome_tplname', window.parent.document).before(res.data.html);
  86. _parent.layer.msg(res.msg, {icon: 1, time: 1000});
  87. return false;
  88. }else{
  89. layer.closeAll();
  90. if (res.data.focus) {
  91. $('#'+res.data.focus).focus();
  92. }
  93. layer.msg(res.msg, {icon: 2});
  94. return false;
  95. }
  96. },
  97. error:function(e){
  98. layer.closeAll();
  99. layer.alert(e.responseText, {icon: 2, title:false});
  100. }
  101. });
  102. }
  103. </script>
  104. {include file="public/footer" /}