国内流行的内容管理系统(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.

113 lines
3.3KB

  1. function checkSubmitAlb() {
  2. if (document.form1.title.value == '') {
  3. ShowMsg("标题不能为空");
  4. return false;
  5. }
  6. if (document.form1.typeid.value == 0) {
  7. ShowMsg("请选择主类别");
  8. return false;
  9. }
  10. document.form1.imagebody.value = $Obj('copyhtml').innerHTML;
  11. if ($("#thumbnails .albCt").length > 0) {
  12. //这里从thumbnails中取出图片元素信息
  13. $("#thumbnails .albCt").each(function () {
  14. albums.push({
  15. "img": $(this).find("img").attr("src"),
  16. "txt": $(this).find("input").val()
  17. })
  18. })
  19. }
  20. $("#albums").val(JSON.stringify(albums));
  21. return true;
  22. }
  23. function testGet() {
  24. LoadTestDiv();
  25. }
  26. function checkMuList(psid, cmid) {
  27. if ($Obj('pagestyle3').checked) {
  28. $Obj('cfgmulist').style.display = 'block';
  29. $Obj('spagelist').style.display = 'none';
  30. } else if ($Obj('pagestyle1').checked) {
  31. $Obj('cfgmulist').style.display = 'none';
  32. $Obj('spagelist').style.display = 'block';
  33. } else {
  34. $Obj('cfgmulist').style.display = 'none';
  35. $Obj('spagelist').style.display = 'none';
  36. }
  37. }
  38. //图片显示与隐藏zip文件选项
  39. function showZipField(formitem, zipid, upid) {
  40. if (formitem.checked) {
  41. $Obj(zipid).style.display = 'block';
  42. $Obj(upid).style.display = 'none';
  43. $Obj('copyhtml').innerHTML = '';
  44. } else {
  45. $Obj(zipid).style.display = 'none';
  46. }
  47. }
  48. //图片显示与隐藏修改框
  49. function showHtmlField(formitem, htmlid, upid) {
  50. if ($Nav() != "IE") {
  51. alert("该方法不适用于非IE浏览器");
  52. return;
  53. }
  54. if (formitem.checked) {
  55. $Obj(htmlid).style.display = 'block';
  56. $Obj(upid).style.display = 'none';
  57. $Obj('formzip').checked = false;
  58. } else {
  59. $Obj(htmlid).style.display = 'none';
  60. $Obj('copyhtml').innerHTML = '';
  61. }
  62. }
  63. function seePicNewAlb(f, imgdid, frname, hpos, acname) {
  64. var newobj = null;
  65. if (f.value == '') return;
  66. vImg = $Obj(imgdid);
  67. picnameObj = document.getElementById('picname');
  68. nFrame = $Nav() == 'IE' ? eval('document.frames.' + frname) : $Obj(frname);
  69. nForm = f.form;
  70. //修改form的action等参数
  71. if (nForm.detachEvent) nForm.detachEvent("onsubmit", checkSubmitAlb);
  72. else nForm.removeEventListener("submit", checkSubmitAlb, false);
  73. nForm.action = 'archives_do.php';
  74. nForm.target = frname;
  75. nForm.dopost.value = 'uploadLitpic';
  76. nForm.submit();
  77. picnameObj.value = '';
  78. newobj = $Obj('uploadwait');
  79. if (!newobj) {
  80. newobj = document.createElement("DIV");
  81. newobj.id = 'uploadwait';
  82. newobj.style.position = 'absolute';
  83. newobj.className = 'uploadwait';
  84. newobj.style.width = 120;
  85. newobj.style.height = 20;
  86. newobj.style.top = hpos;
  87. newobj.style.left = 100;
  88. document.body.appendChild(newobj);
  89. newobj.innerHTML = '<img src="../../static/web/img/loadinglit.gif">';
  90. }
  91. newobj.style.display = 'block';
  92. //提交后还原form的action等参数
  93. nForm.action = acname;
  94. nForm.dopost.value = 'save';
  95. nForm.target = '';
  96. nForm.litpic.disabled = true;
  97. }
  98. //删除已经上传的图片
  99. function delAlbPic(pid) {
  100. var tgobj = $Obj('albCtok' + pid);
  101. fetch('swfupload.php?dopost=del&id=' + pid).then(resp=>resp.text()).then((d)=>{
  102. tgobj.innerHTML = d;
  103. $Obj('thumbnails').removeChild(tgobj);
  104. });
  105. }
  106. //删除已经上传的图片修改时用
  107. function delAlbPicOld(picfile, pid) {
  108. var tgobj = $Obj('albold' + pid);
  109. fetch('swfupload.php?dopost=delold&picfile=' + picfile).then(resp=>resp.text()).then((d)=>{
  110. tgobj.innerHTML = d;
  111. $Obj('thumbnailsEdit').removeChild(tgobj);
  112. });
  113. }