tpl_sysfile_edite.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <html lang="zh-CN">
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  5. <title><?=$da['filename']?></title>
  6. <script type="text/javascript" src="js/jquery.js"></script>
  7. <script type="text/javascript" src="js/js.js"></script>
  8. <script type="text/javascript" src="js/base64-min.js"></script>
  9. <link rel="stylesheet" type="text/css" href="webmain/css/rock.css"/>
  10. <link rel="shortcut icon" href="favicon.ico" />
  11. <style>
  12. </style>
  13. <script>
  14. var fileext = '<?=$da['fileext']?>';
  15. var filepath = '<?=$da['filepath']?>',lastcont='';
  16. function save(o1){
  17. var cont = get('content').value;
  18. if(lastcont==cont){
  19. js.setmsg('没有修改内容','red');
  20. return;
  21. }
  22. js.setmsg('保存中...');
  23. o1.disabled = true;
  24. $.ajax({
  25. type:'post',
  26. url:'?m=sysfile&a=savefile&d=system&path='+filepath+'',
  27. data:{content:jm.base64encode(cont)},
  28. success:function(bst){
  29. if(bst=='ok'){
  30. lastcont = cont;
  31. o1.disabled = false;
  32. js.setmsg('保存成功', 'green');
  33. loadfile(filepath, 0);
  34. }else{
  35. o1.disabled = false;
  36. js.setmsg(bst, 'red');
  37. }
  38. }
  39. });
  40. }
  41. function initbody(){
  42. var hei = winHb()-50;
  43. $('#lineheihtss').css('height',''+hei+'px');
  44. $('#content').scroll(scrollss);
  45. $('#content').css('height',''+(hei)+'px');
  46. loadfile(filepath, 0);
  47. }
  48. function scrollss(){
  49. get('lineheihtss').scrollTop=get('content').scrollTop;
  50. }
  51. function loadfile(lu,lx){
  52. js.setmsg('加载中...');
  53. $.ajax({
  54. type:'get',
  55. dataType:'json',
  56. url:'?m=sysfile&a=loadfile&d=system&path='+lu+'&lx='+lx+'',
  57. success:function(ret){
  58. js.setmsg();
  59. loadfileshow(ret.content);
  60. if(ret.earr)loadfileshowv(ret.earr);
  61. }
  62. });
  63. }
  64. function loadfileshow(str){
  65. $('#content').val(str);
  66. lastcont = get('content').value;
  67. var cont = str;
  68. var arr = cont.split("\n"),i,s1='';
  69. for(i=0;i<arr.length;i++){
  70. if(i>0)s1+='<br>';
  71. s1+=''+(i+1)+'';
  72. }
  73. $('#lineheiht').html(s1+'<br>&nbsp;');
  74. }
  75. function loadfiles(lu,lx){
  76. var cont = get('content').value;
  77. if(cont != lastcont){
  78. js.confirm('修改了内容,没有保存,是否继续读取旧记录?', function(jg){
  79. if(jg=='yes')loadfile(lu, lx);
  80. });
  81. return;
  82. }else{
  83. loadfile(lu, lx);
  84. }
  85. }
  86. function loadfileshowv(ds){
  87. $('#lishilist a[temp]').remove();
  88. for(var i=0;i<ds.length;i++){
  89. $('#lishilist').append('<a temp="list" style="TEXT-DECORATION:none" onclick="loadfiles(\''+ds[i].path+'\', 1)" class="list-group-item">'+ds[i].optdt+'</a>');
  90. }
  91. }
  92. </script>
  93. <style>
  94. pre span{color:#999999}
  95. pre font{color:blue}
  96. table {
  97. border-spacing: 0;
  98. border-collapse: collapse;
  99. }
  100. </style>
  101. <?php
  102. echo c('color')->getApptheme(true, false, true);
  103. ?>
  104. </head>
  105. <body style="background:white;padding:0px;margin:0px;overflow:hidden">
  106. <table style="width:100%;height:100%" border=0><tr>
  107. <td valign="top" style="background:#e4e4e4;"><div id="lineheihtss" style="width:50px;height:300px;overflow:hidden"><div style="line-height:20px;padding-top:5px;text-align:right;padding-right:3px;font-size:14px" id="lineheiht">1<br>2<br></div></div></td>
  108. <td valign="top" style="width:100%;height:100%;padding:0px">
  109. <div id="contentdiv" style="overflow:hidden;background:#caeccb;display: flex;">
  110. <textarea id="content" style="height:100%;flex:1;border:0px #aaaaaa solid;background:none;line-height:20px;font-size:14px;overflow:auto;padding:5px;margin:0px;outline:none;" spellcheck="false"></textarea></div>
  111. </td>
  112. <td valign="top" align="left">
  113. <div style="width:180px" id="lishilist" class="list-group">
  114. <div class="list-group-item list-group-item-info">修改记录</div>
  115. <a style="TEXT-DECORATION:none" onclick="loadfiles(filepath, 0)" class="list-group-item">当前版本</a>
  116. </div>
  117. </td>
  118. </tr>
  119. <tr>
  120. <td></td>
  121. <td style="height:50px;overflow:hidden">
  122. <div >
  123. <button id="ALTS" onclick="save(this)" class="webbtn">保存</button> <span id="msgview"></span>&nbsp;
  124. 大小:<?=$da['filesize']?>,查找请用Ctrl+F,文件:<?=$rock->jm->base64decode($da['filepath'])?>
  125. </div>
  126. </td>
  127. </tr>
  128. </table>
  129. </body>
  130. </html>
粤ICP备19079148号