No Description
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.

html_m.htm 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>可视化编辑</title>
  5. <script type="text/javascript">
  6. var eyou_basefile = "{$Request.baseFile}";
  7. var module_name = "{$Think.const.MODULE_NAME}";
  8. var GetUploadify_url = "{:url('Uploadify/upload')}";
  9. var __root_dir__ = "__ROOT_DIR__";
  10. var __lang__ = "{$admin_lang}";
  11. </script>
  12. {load href="__STATIC__/common/js/jquery.min.js" /}
  13. {load href="__PUBLIC__/plugins/Ueditor/ueditor.config.js" /}
  14. {load href="__PUBLIC__/plugins/Ueditor/ueditor.all.min.js" /}
  15. {load href="__PUBLIC__/plugins/Ueditor/lang/zh-cn/zh-cn.js" /}
  16. {load href="__PUBLIC__/plugins/layer-v3.1.0/layer.js" /}
  17. {load href="__STATIC__/admin/js/global.js" /}
  18. <style type="text/css">
  19. .ncap-form-default {
  20. padding: 10px 0;
  21. overflow: hidden;
  22. }
  23. a {
  24. text-decoration: none;
  25. }
  26. a.ncap-btn-big {
  27. font: bold 14px/20px "microsoft yahei", arial;
  28. color: #777;
  29. background-color: #ECF0F1;
  30. text-align: center;
  31. vertical-align: middle;
  32. display: inline-block;
  33. height: 20px;
  34. padding: 7px 19px;
  35. border: solid 1px #BEC3C7;
  36. border-radius: 3px;
  37. cursor: pointer;
  38. }
  39. a.ncap-btn-green {
  40. background-color: #4fc0e8;
  41. color: #FFF;
  42. text-shadow: 0 -1px 0 rgba(0,0,0,0.10);
  43. border-color: #3aa8cf;
  44. }
  45. .ckeditor {
  46. /*height: auto;*/
  47. /*height: 500px;*/
  48. }
  49. .panel-default {
  50. /*height: 510px;*/
  51. }
  52. </style>
  53. </head>
  54. <body>
  55. <div class="panel panel-default">
  56. <div class="span12 ckeditor">
  57. <form class="form-horizontal" id="post_form" onsubmit="return check_submit();">
  58. <div class="control-group">
  59. <textarea id="post_content" name="content" title="">{$field.info.value|default=''}</textarea>
  60. </div>
  61. <div class="control-group ncap-form-default">
  62. <div class="controls">
  63. <input type="hidden" name="id" value="{$field.id|default=''}">
  64. <input type="hidden" name="type" value="{$field.type|default=''}">
  65. <input type="hidden" name="page" value="{$field.page|default=''}">
  66. <input type="hidden" name="v" value="{$v|default='pc'}">
  67. <input type="hidden" name="lang" value="{$field.lang|default='cn'}">
  68. <input type="hidden" name="idcode" value="{$field.idcode|default=''}">
  69. <input type="hidden" name="iframe" value="1">
  70. <a href="JavaScript:void(0);" onclick="check_submit();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
  71. </div>
  72. </div>
  73. </form>
  74. </div>
  75. </div>
  76. </div>
  77. <script type="text/javascript">
  78. var ueditor_toolbars = [[
  79. 'source', '|',
  80. 'bold', 'italic', '|', 'forecolor', 'backcolor'
  81. ]];
  82. var url="{:url('Ueditor/index',array('savepath'=>'allimg'))}";
  83. var ue = UE.getEditor('post_content',{
  84. serverUrl :url,
  85. zIndex: 999,
  86. initialFrameWidth: "100%", //初化宽度
  87. initialFrameHeight: 400, //初化高度
  88. focus: false, //初始化时,是否让编辑器获得焦点true或false
  89. maximumWords: 99999,
  90. removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign',//允许的最大字符数 'fullscreen',
  91. pasteplain:false, //是否默认为纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴
  92. autoHeightEnabled: false,
  93. toolbars: ueditor_toolbars,
  94. initialContent: parent.eyou_getOldHtml()
  95. });
  96. var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  97. function check_submit()
  98. {
  99. if ($('input[name=id]').val() == '' || $('input[name=id]').val() == undefined || $('input[name=type]').val() == '' || $('input[name=page]').val() == '') {
  100. parent.showErrorMsg('缺少系统参数:id、type、page,尝试请求技术支持!');
  101. return false;
  102. }
  103. if(UE.getEditor('post_content').getContent() == ''){
  104. parent.showErrorMsg('内容不能为空!');
  105. return false;
  106. }
  107. parent.eyou_layer_loading('正在处理');
  108. var url = "{:url('api/Uiset/submit', ['_ajax'=>1])}";
  109. $.ajax({
  110. url: url,
  111. type: 'POST',
  112. dataType: 'JSON',
  113. data: $('#post_form').serialize(),
  114. success: function(res){
  115. parent.layer.closeAll();
  116. if (res.code == 1) {
  117. $('#workspace', window.parent.document).attr('src', $('#workspace', window.parent.document).attr('src'));
  118. parent.layer.msg(res.msg, {icon: 1, shade: 0.3, time: 1000});
  119. } else {
  120. parent.eyou_showErrorAlert(res.msg);
  121. }
  122. },
  123. error: function(e){
  124. parent.layer.closeAll();
  125. parent.eyou_showErrorAlert(e.responseText);
  126. }
  127. });
  128. }
  129. </script>
  130. </body>
  131. </html>