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

album.js 2.4KB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. function checkSubmitAlb() {
  2. if ($("#gallery .atlas").length > 0) {
  3. //这里从gallery中取出图片元素信息
  4. $("#gallery .atlas").each(function () {
  5. albums.push({
  6. "img": $(this).find("img").attr("src"),
  7. "txt": $(this).find("input").val()
  8. })
  9. })
  10. }
  11. $("#albums").val(JSON.stringify(albums));
  12. return true;
  13. }
  14. function seePicNewAlb(f, imgdid, frname, hpos, acname) {
  15. var newobj = null;
  16. if (f.value == '') return;
  17. vImg = $Obj(imgdid);
  18. picnameObj = document.getElementById('picname');
  19. nFrame = $Nav() == 'IE' ? eval('document.frames.' + frname) : $Obj(frname);
  20. nForm = f.form;
  21. //修改form的action等参数
  22. if (nForm.detachEvent) nForm.detachEvent("onsubmit", checkSubmitAlb);
  23. else nForm.removeEventListener("submit", checkSubmitAlb, false);
  24. nForm.action = 'archives_do.php';
  25. nForm.target = frname;
  26. nForm.dopost.value = 'uploadLitpic';
  27. nForm.submit();
  28. picnameObj.value = '';
  29. newobj = $Obj('uploadwait');
  30. if (!newobj) {
  31. newobj = document.createElement("div");
  32. newobj.id = 'uploadwait';
  33. newobj.style.position = 'absolute';
  34. newobj.className = 'uploadwait';
  35. newobj.style.width = 120;
  36. newobj.style.height = 20;
  37. newobj.style.top = hpos;
  38. newobj.style.left = 100;
  39. document.body.appendChild(newobj);
  40. newobj.innerHTML = '<img src="../../static/web/img/loadinglit.gif">';
  41. }
  42. newobj.style.display = 'block';
  43. //提交后还原form的action等参数
  44. nForm.action = acname;
  45. nForm.dopost.value = 'save';
  46. nForm.target = '';
  47. nForm.litpic.disabled = true;
  48. }
  49. function checkMuList(psid, cmid) {
  50. if ($Obj('pagestyle3').checked) {
  51. $Obj('cfgmulist').style.display = 'table-row';
  52. $Obj('spagelist').style.display = 'none';
  53. } else if ($Obj('pagestyle1').checked) {
  54. $Obj('cfgmulist').style.display = 'none';
  55. $Obj('spagelist').style.display = 'table-row';
  56. } else {
  57. $Obj('cfgmulist').style.display = 'none';
  58. $Obj('spagelist').style.display = 'none';
  59. }
  60. }
  61. //删除已经上传的图片
  62. function delAlbPic(pid) {
  63. var tgobj = $Obj('atlasok' + pid);
  64. fetch('swfupload.php?dopost=del&id=' + pid).then(resp=>resp.text()).then((d)=>{
  65. tgobj.innerHTML = d;
  66. $Obj('gallery').removeChild(tgobj);
  67. });
  68. }
  69. //删除已经上传的图片修改时用
  70. function delAlbPicOld(picfile, pid) {
  71. var tgobj = $Obj('albold' + pid);
  72. fetch('swfupload.php?dopost=delold&picfile=' + picfile).then(resp=>resp.text()).then((d)=>{
  73. tgobj.innerHTML = d;
  74. $Obj('galleryedit').removeChild(tgobj);
  75. });
  76. }