国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
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.

144 lines
4.6KB

  1. function checkSubmit()
  2. {
  3. if (document.form1.title.value=='') {
  4. alert("图片标题不能为空");
  5. document.form1.title.focus();
  6. return false;
  7. }
  8. if (document.form1.typeid.value==0) {
  9. alert("所属栏目必须选择");
  10. return false;
  11. }
  12. if (document.form1.typeid.options[document.form1.typeid.selectedIndex].className!='option3')
  13. {
  14. alert("所属栏目必须选择白色背景的项目");
  15. return false;
  16. }
  17. document.form1.imagebody.value = document.getElementById('copyhtml').innerHTML;
  18. document.getElementById('postloader').style.display = 'block';
  19. }
  20. function CheckSelTable(nnum){
  21. var cbox = document.getElementById('isokcheck'+nnum);
  22. var seltb = document.getElementById('seltb'+nnum);
  23. if (!cbox.checked) seltb.style.display = 'none';
  24. else seltb.style.display = 'block';
  25. }
  26. var startNum = 1;
  27. function MakeUpload(mnum)
  28. {
  29. var endNum = 0;
  30. var upfield = document.getElementById("uploadfield");
  31. var pnumObj = document.getElementById("picnum");
  32. var fhtml = "";
  33. var dsel = " checked='checked' ";
  34. var dplay = "display:none";
  35. if (mnum==0) endNum = startNum + Number(pnumObj.value);
  36. else endNum = mnum;
  37. if (endNum>120) endNum = 120;
  38. for (startNum;startNum < endNum;startNum++)
  39. {
  40. if (startNum==1){
  41. dsel = " checked='checked' ";
  42. dplay = "block";
  43. } else {
  44. dsel = " ";
  45. dplay = "display:none";
  46. }
  47. fhtml = '';
  48. fhtml += "<table width='100%'><tr><td><label><input type='checkbox' name='isokcheck"+startNum+"' id='isokcheck"+startNum+"' value='1' "+dsel+" onClick='CheckSelTable("+startNum+")' />显示图片 "+startNum+" 的上传框</label></td></tr></table>";
  49. fhtml += "<table width='100%' border=\"0\" id=\"seltb"+startNum+"\" cellpadding=\"1\" cellspacing=\"1\" bgcolor=\"white\" style=\"margin-bottom:6px;margin-left:10px;"+dplay+"\"><tobdy>";
  50. fhtml += "<tr bgcolor=\"#F7F7F7\">\r\n";
  51. fhtml += "<td height=\"25\" colspan=\"2\"> <strong>图片"+startNum+":</strong></td>";
  52. fhtml += "</tr>";
  53. fhtml += "<tr bgcolor=\"#ffffff\"> ";
  54. fhtml += "<td height=\"25\">  图片地址:";
  55. fhtml += "<input type=\"text\" name='imgfile"+startNum+"' style=\"width:330px\" class=\"intxt\"/> <nobr>填写远程网址</nobr></td>";
  56. fhtml += "<td rowspan=\"2\" align=\"center\"><div id='divpicview"+startNum+"' class='divpre'></div></td>";
  57. fhtml += "</tr>";
  58. fhtml += "<tr bgcolor=\"#ffffff\"> ";
  59. fhtml += "<td height=\"56\" valign=\"top\"> 图片简介:";
  60. fhtml += "<textarea name='imgmsg"+startNum+"' style=\"height:46px;width:330px\"></textarea></td>";
  61. fhtml += "</tr></tobdy></table>\r\n";
  62. upfield.innerHTML += fhtml;
  63. }
  64. }
  65. function TestGet()
  66. {
  67. LoadTestDiv();
  68. }
  69. var vcc = 0;
  70. function LoadTestDiv()
  71. {
  72. var posLeft = 100; var posTop = 100;
  73. var newobj = document.getElementById('_myhtml');
  74. document.getElementById('imagebody').value = document.getElementById('copyhtml').innerHTML;
  75. var dfstr = '粘贴到这里...';
  76. if (document.getElementById('imagebody').value.length <= dfstr.length)
  77. {
  78. alert('您还没有粘贴任何东西在编辑框');
  79. return;
  80. }
  81. if (!newobj){
  82. newobj = document.createElement("DIV");
  83. newobj.id = '_myhtml';
  84. newobj.style.position='absolute';
  85. newobj.className = "dlg2";
  86. newobj.style.top = posTop;
  87. newobj.style.left = posLeft;
  88. document.body.appendChild(newobj);
  89. } else{
  90. newobj.style.display = "block";
  91. }
  92. const formData = new FormData()
  93. formData.append('myhtml', v);
  94. formData.append('vcc', vcc);
  95. fetch('album_testhtml.php', {
  96. method: 'POST',
  97. body: formData
  98. })
  99. .then(r => r.text())
  100. .then(d => {
  101. newobj.innerHTML = d;
  102. vcc++;
  103. })
  104. }
  105. function checkMuList(psid,cmid)
  106. {
  107. if (document.getElementById('pagestyle3').checked)
  108. {
  109. document.getElementById('spagelist').style.display = 'none';
  110. }
  111. else if (document.getElementById('pagestyle1').checked)
  112. {
  113. document.getElementById('spagelist').style.display = 'block';
  114. } else {
  115. document.getElementById('spagelist').style.display = 'none';
  116. }
  117. }
  118. //图片显示与隐藏zip文件选项
  119. function ShowZipField(formitem,zipid,upid)
  120. {
  121. if (formitem.checked){
  122. document.getElementById(zipid).style.display = 'block';
  123. document.getElementById(upid).style.display = 'none';
  124. document.getElementById('formhtml').checked = false;
  125. document.getElementById('copyhtml').innerHTML = '';
  126. } else {
  127. document.getElementById(zipid).style.display = 'none';
  128. }
  129. }
  130. //图片显示与隐藏Html编辑框
  131. function ShowHtmlField(formitem,htmlid,upid)
  132. {
  133. if ($Nav()!="IE"){
  134. alert("该方法不适用于非IE浏览器");
  135. return ;
  136. }
  137. if (formitem.checked){
  138. document.getElementById(htmlid).style.display = 'block';
  139. } else {
  140. document.getElementById(htmlid).style.display = 'none';
  141. document.getElementById('copyhtml').innerHTML = '';
  142. }
  143. }