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

141 lines
4.1KB

  1. /**
  2. * 图集
  3. *
  4. * @version $Id: album.js 1 22:28 2010年7月20日Z tianya $
  5. * @package DedeBIZ.Administrator
  6. * @copyright Copyright (c) 2021, 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('handfield').style.display = 'none';
  53. // $Obj('formhtml').checked = false;
  54. $Obj('copyhtml').innerHTML = '';
  55. } else {
  56. $Obj(zipid).style.display = 'none';
  57. //$Obj('handfield').style.display = 'block';
  58. }
  59. }
  60. //图集,显示与隐藏Html编辑框
  61. function showHtmlField(formitem, htmlid, upid) {
  62. if ($Nav() != "IE") {
  63. alert("该方法不适用于非IE浏览器");
  64. return;
  65. }
  66. if (formitem.checked) {
  67. $Obj(htmlid).style.display = 'block';
  68. $Obj(upid).style.display = 'none';
  69. //$Obj('handfield').style.display = 'none';
  70. $Obj('formzip').checked = false;
  71. } else {
  72. $Obj(htmlid).style.display = 'none';
  73. //$Obj('handfield').style.display = 'block';
  74. $Obj('copyhtml').innerHTML = '';
  75. }
  76. }
  77. function seePicNewAlb(f, imgdid, frname, hpos, acname) {
  78. var newobj = null;
  79. if (f.value == '') return;
  80. vImg = $Obj(imgdid);
  81. picnameObj = document.getElementById('picname');
  82. nFrame = $Nav() == 'IE' ? eval('document.frames.' + frname) : $Obj(frname);
  83. nForm = f.form;
  84. //修改form的action等参数
  85. if (nForm.detachEvent) nForm.detachEvent("onsubmit", checkSubmitAlb);
  86. else nForm.removeEventListener("submit", checkSubmitAlb, false);
  87. nForm.action = 'archives_do.php';
  88. nForm.target = frname;
  89. nForm.dopost.value = 'uploadLitpic';
  90. nForm.submit();
  91. picnameObj.value = '';
  92. newobj = $Obj('uploadwait');
  93. if (!newobj) {
  94. newobj = document.createElement("DIV");
  95. newobj.id = 'uploadwait';
  96. newobj.style.position = 'absolute';
  97. newobj.className = 'uploadwait';
  98. newobj.style.width = 120;
  99. newobj.style.height = 20;
  100. newobj.style.top = hpos;
  101. newobj.style.left = 100;
  102. document.body.appendChild(newobj);
  103. newobj.innerHTML = '<img src="images/loadinglit.gif" width="16" height="16" alit="" />上传中...';
  104. }
  105. newobj.style.display = 'block';
  106. //提交后还原form的action等参数
  107. nForm.action = acname;
  108. nForm.dopost.value = 'save';
  109. nForm.target = '';
  110. nForm.litpic.disabled = true;
  111. //nForm.litpic = null;
  112. //if(nForm.attachEvent) nForm.attachEvent("onsubmit", checkSubmit);
  113. //else nForm.addEventListener("submit", checkSubmit, true);
  114. }
  115. //删除已经上传的图片
  116. function delAlbPic(pid) {
  117. var tgobj = $Obj('albCtok' + pid);
  118. var myajax = new DedeAjax(tgobj);
  119. myajax.SendGet2('swfupload.php?dopost=del&id=' + pid);
  120. $Obj('thumbnails').removeChild(tgobj);
  121. }
  122. //删除已经上传的图片(编辑时用)
  123. function delAlbPicOld(picfile, pid) {
  124. var tgobj = $Obj('albold' + pid);
  125. var myajax = new DedeAjax(tgobj);
  126. myajax.SendGet2('swfupload.php?dopost=delold&picfile=' + picfile);
  127. $Obj('thumbnailsEdit').removeChild(tgobj);
  128. }