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

122 lines
3.6KB

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