From 1743105f412d2b0d1b64331e0c56fa1c02170a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=99=E8=BF=B0=E3=80=81=E5=88=AB=E7=A6=BB?= <2449271624@qq.com> Date: Fri, 8 Sep 2023 17:28:36 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=A2=E5=90=91=E5=AF=B9=E8=B1=A1=E4=BC=98?= =?UTF-8?q?=E5=8C=96=EF=BC=8C=E5=9B=BE=E7=89=87=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin/dialog/select_images.php | 32 +++- src/admin/js/album.js | 85 ++++---- src/admin/js/body.js | 148 ++++++-------- src/admin/js/float.js | 94 --------- src/admin/js/global.js | 44 +++-- src/admin/js/main.js | 298 +++++++++-------------------- src/static/web/css/admin.css | 37 ++-- src/static/web/js/style.js | 27 ++- src/static/web/js/user.album.js | 50 ++--- 9 files changed, 293 insertions(+), 522 deletions(-) delete mode 100644 src/admin/js/float.js diff --git a/src/admin/dialog/select_images.php b/src/admin/dialog/select_images.php index 051c3714..7adaeaec 100644 --- a/src/admin/dialog/select_images.php +++ b/src/admin/dialog/select_images.php @@ -59,13 +59,10 @@ if (!empty($iseditor)) { - +
-
- -
@@ -154,7 +151,7 @@ if (!empty($iseditor)) { else $lstyle = ""; $line = " @@ -171,10 +168,6 @@ if (!empty($iseditor)) { function nullLink() { return; } - function ChangeImage(surl) { - document.getElementById('floater').style.display = 'block'; - document.getElementById('picview').src = surl; - } function TNav() { if (window.navigator.userAgent.indexOf("MSIE") >= 1) return 'IE'; else if (window.navigator.userAgent.indexOf("Firefox") >= 1) return 'FF'; @@ -222,6 +215,25 @@ if (!empty($iseditor)) { } window.close(); } + $(function() { + var x = 10; + var y = 20; + $("a.toolimg").mouseover(function(e) { + var toolimg = "
<\/div>"; + $("body").append(toolimg); + $("#toolimg").css({ + "top": (e.pageY + y) + "px", + "left": (e.pageX + x) + "px" + }).show("fast"); + }).mouseout(function() { + $("#toolimg").remove(); + }).mousemove(function(e) { + $("#toolimg").css({ + "top": (e.pageY + y) + "px", + "left": (e.pageX + x) + "px" + }); + }); + }); \ No newline at end of file diff --git a/src/admin/js/album.js b/src/admin/js/album.js index 0d54b2d5..a483dd0b 100644 --- a/src/admin/js/album.js +++ b/src/admin/js/album.js @@ -39,38 +39,55 @@ function delAlbPicOld(picfile, pid) { $Obj('galleryedit').removeChild(tgobj); }); } -function seePicNewAlb(f, imgdid, frname, hpos, acname) { - var newobj = null; - if (f.value == '') return; - vImg = $Obj(imgdid); - picnameObj = document.getElementById('picname'); - nFrame = $Nav() == 'IE' ? eval('document.frames.' + frname) : $Obj(frname); - nForm = f.form; - //修改form的action等参数 - if (nForm.detachEvent) nForm.detachEvent("onsubmit", checkSubmitAlb); - else nForm.removeEventListener("submit", checkSubmitAlb, false); - nForm.action = 'archives_do.php'; - nForm.target = frname; - nForm.dopost.value = 'uploadLitpic'; - nForm.submit(); - picnameObj.value = ''; - newobj = $Obj('uploadwait'); - if (!newobj) { - newobj = document.createElement("div"); - newobj.id = 'uploadwait'; - newobj.style.position = 'absolute'; - newobj.className = 'uploadwait'; - newobj.style.width = 120; - newobj.style.height = 20; - newobj.style.top = hpos; - newobj.style.left = 100; - document.body.appendChild(newobj); - newobj.innerHTML = ''; +(function() { + var nForm = null; + var nFrame = null; + var picnameObj = null; + var vImg = null; + function GetWinPos(w, h) { + var dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screenX; + var dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screenY; + var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; + var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; + var systemZoom = width / window.screen.availWidth; + var left = (width - w) / 2 / systemZoom + dualScreenLeft; + var top = (height - h) / 2 / systemZoom + dualScreenTop; + return { left: left, top: top }; } - newobj.style.display = 'block'; - //提交后还原form的action等参数 - nForm.action = acname; - nForm.dopost.value = 'save'; - nForm.target = ''; - nForm.litpic.disabled = true; -} \ No newline at end of file + function SeePicNew(f, imgdid, frname, hpos, acname) { + var newobj = null; + if (f.value == '') return; + vImg = $Obj(imgdid); + picnameObj = document.getElementById('picname'); + nFrame = $Nav() == 'IE' ? eval('document.frames.' + frname) : $Obj(frname); + nForm = f.form; + //修改form的action等参数 + if (nForm.detachEvent) nForm.detachEvent("onsubmit", checkSubmit); + else nForm.removeEventListener("submit", checkSubmit, false); + nForm.action = 'archives_do.php'; + nForm.target = frname; + nForm.dopost.value = 'uploadLitpic'; + nForm.submit(); + picnameObj.value = ''; + newobj = $Obj('uploadwait'); + if (!newobj) { + newobj = document.createElement("div"); + newobj.id = 'uploadwait'; + newobj.style.position = 'absolute'; + newobj.className = 'uploadwait'; + newobj.style.width = 120; + newobj.style.height = 20; + newobj.style.top = hpos; + newobj.style.left = 100; + newobj.style.display = 'block'; + document.body.appendChild(newobj); + newobj.innerHTML = ''; + } + newobj.style.display = 'block'; + //提交后还原form的action等参数 + nForm.action = acname; + nForm.dopost.value = 'save'; + nForm.target = ''; + nForm.litpic.disabled = true; + } +}); \ No newline at end of file diff --git a/src/admin/js/body.js b/src/admin/js/body.js index a254ce43..e69ef2eb 100644 --- a/src/admin/js/body.js +++ b/src/admin/js/body.js @@ -1,92 +1,3 @@ -var dedebizInfo; -function ViewDedeBIZ() { - if (dedebizInfo === false) { - ShowMsg("启动商业组件失败"); - return; - } - ShowMsg(`
@@ -139,7 +136,7 @@ if (!empty($iseditor)) { else $lstyle = ""; $line = "
- + $file $filesize KB
- + $file $filesize KB
- - - - - - -
-
-

版本号

- ${dedebizInfo.result.server_version} -
-
-
-

服务器系统

- ${dedebizInfo.result.server_goos} -
-
-
-

运行时间

- ${dedebizInfo.result.server_run_time} -
-
-
-

内存占用

- ${dedebizInfo.result.server_memory_usage}% -
-
`); -} -function LoadServer() { - $.get("index_body.php?dopost=system_info",function(data) { - let rsp = JSON.parse(data); - if (rsp.code === 200) { - if (rsp.result.core.code === 200) { - dedebizInfo = JSON.parse(rsp.result.core.data); - } else { - dedebizInfo = false; - } - let infoStr = ``; - if (typeof rsp.result.domain !== "undefined") { - infoStr += ` - - - - - `; - } - infoStr += "
-
-

授权域名

- ${rsp.result.domain} -
-
-
-

站点名称

- ${rsp.result.title} -
-
-
-

站点证书

- 查看证书 -
-
-
-

商业组件

- 组件状态 -
-
"; - $("#system-info").html(infoStr); - } else { - $("#system-info").html(` - - - -
-
-

${rsp.msg}

- 您已购买了商业版授权,登录DedeBIZ官网会员中心可查看相关授权信息 -
-
`); - } - }); -} Date.prototype.Format = function(fmt) { var o = { "M+" : this.getMonth() + 1, //月份 @@ -235,10 +146,61 @@ $(document).ready(function() { } }); }); - LoadServer(); + $(function() { + var dedebizInfo; + $.get("index_body.php?dopost=system_info",function(data) { + let rsp = JSON.parse(data); + if (rsp.code === 200) { + if (rsp.result.core.code === 200) { + dedebizInfo = JSON.parse(rsp.result.core.data); + } else { + dedebizInfo = false; + } + let infoStr = ``; + if (typeof rsp.result.domain !== "undefined") { + infoStr += ` + + + + + `; + } + infoStr += "
+
+

授权域名

+ ${rsp.result.domain} +
+
+
+

站点名称

+ ${rsp.result.title} +
+
+
+

授权证书

+ 查看证书 +
+
+
+

授权时间

+ ${rsp.result.auth_at} +
+
"; + $("#system-info").html(infoStr); + } else { + $("#system-info").html(` + + + +
+
+

${rsp.msg}

+ 您已购买了商业版授权,登录DedeBIZ官网会员中心可查看相关授权信息 +
+
`); + } + }); + }); LoadStat(); LoadStatChart(); - setInterval(function() { - LoadServer(); - }, 3000) }); \ No newline at end of file diff --git a/src/admin/js/float.js b/src/admin/js/float.js deleted file mode 100644 index 3462ff1e..00000000 --- a/src/admin/js/float.js +++ /dev/null @@ -1,94 +0,0 @@ -self.onError=null; -currentX = currentY = 0; -whichIt = null; -lastScrollX = 0; lastScrollY = 0; -NS = (document.layers) ? 1 : 0; -IE = (document.all) ? 1 : 0; -function heartBeat() { - if (IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; } - if (NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; } - if (diffY != lastScrollY) { - percent = .1 * (diffY - lastScrollY); - if (percent > 0) percent = Math.ceil(percent); - else percent = Math.floor(percent); - if (IE) document.all.floater.style.pixelTop += percent; - if (NS) document.floater.top += percent; - lastScrollY = lastScrollY + percent; - } if (diffX != lastScrollX) { - percent = .1 * (diffX - lastScrollX); - if (percent > 0) percent = Math.ceil(percent); - else percent = Math.floor(percent); - if (IE) document.all.floater.style.pixelLeft += percent; - if (NS) document.floater.left += percent; - lastScrollX = lastScrollX + percent; - } -} -function checkFocus(x, y) { - stalkerx = document.floater.pageX; - stalkery = document.floater.pageY; - stalkerwidth = document.floater.clip.width; - stalkerheight = document.floater.clip.height; - if ((x > stalkerx && x < (stalkerx + stalkerwidth)) && (y > stalkery && y < (stalkery + stalkerheight))) return true; - else return false; -} -function grabIt(e) { - if (IE) { - whichIt = event.srcElement; - while (whichIt.id.indexOf("floater") == -1) { - whichIt = whichIt.parentElement; - if (whichIt == null) { return true; } - } - whichIt.style.pixelLeft = whichIt.offsetLeft; - whichIt.style.pixelTop = whichIt.offsetTop; - currentX = (event.clientX + document.body.scrollLeft); - currentY = (event.clientY + document.body.scrollTop); - } else { - window.captureEvents(Event.MOUSEMOVE); - if (checkFocus(e.pageX, e.pageY)) { - whichIt = document.floater; - StalkerTouchedX = e.pageX - document.floater.pageX; - StalkerTouchedY = e.pageY - document.floater.pageY; - } - } return true; -} -function moveIt(e) { - if (whichIt == null) { return false; } - if (IE) { - newX = (event.clientX + document.body.scrollLeft); - newY = (event.clientY + document.body.scrollTop); - distanceX = (newX - currentX); distanceY = (newY - currentY); - currentX = newX; currentY = newY; - whichIt.style.pixelLeft += distanceX; - whichIt.style.pixelTop += distanceY; - if (whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop; - if (whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.body.scrollLeft; - if (whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20; - if (whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5; - event.returnValue = false; - } else { - whichIt.moveTo(e.pageX - StalkerTouchedX, e.pageY - StalkerTouchedY); - if (whichIt.left < 0 + self.pageXOffset) whichIt.left = 0 + self.pageXOffset; - if (whichIt.top < 0 + self.pageYOffset) whichIt.top = 0 + self.pageYOffset; - if ((whichIt.left + whichIt.clip.width) >= (window.innerWidth + self.pageXOffset - 17)) whichIt.left = ((window.innerWidth + self.pageXOffset) - whichIt.clip.width) - 17; - if ((whichIt.top + whichIt.clip.height) >= (window.innerHeight + self.pageYOffset + 50)) whichIt.top = ((window.innerHeight + self.pageYOffset) - whichIt.clip.height) - 17; - return false; - } - return false; -} -function dropIt() { - whichIt = null; - if (NS) window.releaseEvents(Event.MOUSEMOVE); - return true; -} -if (NS) { - window.captureEvents(Event.MOUSEUPEvent.MOUSEDOWN); - window.onmousedown = grabIt; - window.onmousemove = moveIt; - window.onmouseup = dropIt; -} -if (IE) { - document.onmousedown = grabIt; - document.onmousemove = moveIt; - document.onmouseup = dropIt; -} -if (NS || IE) action = window.setInterval("heartBeat()", 1); \ No newline at end of file diff --git a/src/admin/js/global.js b/src/admin/js/global.js index b8cc15f6..6a25726c 100644 --- a/src/admin/js/global.js +++ b/src/admin/js/global.js @@ -1,23 +1,25 @@ -var BROWSER = {}; -var USERAGENT = navigator.userAgent.toLowerCase(); -browserVersion({'firefox':'','chrome':'','opera':'','safari':'','maxthon':'','mozilla':'','webkit':''}); -if (BROWSER.safari) { - BROWSER.firefox = true; -} -BROWSER.opera = BROWSER.opera ? opera.version() : 0; -function browserVersion(types) { - var other = 1; - for (i in types) { - var v = types[i] ? types[i] : i; - if (USERAGENT.indexOf(v) != -1) { - var re = new RegExp(v + '(\\/|\\s)([\\d\\.]+)', 'ig'); - var matches = re.exec(USERAGENT); - var ver = matches != null ? matches[2] : 0; - other = ver !== 0 ? 0 : other; - } else { - var ver = 0; +(function() { + var BROWSER = {}; + var USERAGENT = navigator.userAgent.toLowerCase(); + browserVersion({'firefox':'','chrome':'','opera':'','safari':'','maxthon':'','mozilla':'','webkit':''}); + if (BROWSER.safari) { + BROWSER.firefox = true; + } + BROWSER.opera = BROWSER.opera ? opera.version() : 0; + function browserVersion(types) { + var other = 1; + for (i in types) { + var v = types[i] ? types[i] : i; + if (USERAGENT.indexOf(v) != -1) { + var re = new RegExp(v + '(\\/|\\s)([\\d\\.]+)', 'ig'); + var matches = re.exec(USERAGENT); + var ver = matches != null ? matches[2] : 0; + other = ver !== 0 ? 0 : other; + } else { + var ver = 0; + } + eval('BROWSER.' + i + '= ver'); } - eval('BROWSER.' + i + '= ver'); + BROWSER.other = other; } - BROWSER.other = other; -} \ No newline at end of file +}); \ No newline at end of file diff --git a/src/admin/js/main.js b/src/admin/js/main.js index 8597c6d5..f059aab1 100644 --- a/src/admin/js/main.js +++ b/src/admin/js/main.js @@ -1,60 +1,3 @@ -var fixupPos = false; -var canMove = false; -var leftLeaning = 0; -var nForm = null; -var nFrame = null; -var picnameObj = null; -var vImg = null; -function GetWinPos(w, h) { - var dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screenX; - var dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screenY; - var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; - var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; - var systemZoom = width / window.screen.availWidth; - var left = (width - w) / 2 / systemZoom + dualScreenLeft; - var top = (height - h) / 2 / systemZoom + dualScreenTop; - return { left: left, top: top }; -} -function SeePicNew(f, imgdid, frname, hpos, acname) { - var newobj = null; - if (f.value == '') return; - vImg = $Obj(imgdid); - picnameObj = document.getElementById('picname'); - nFrame = $Nav() == 'IE' ? eval('document.frames.' + frname) : $Obj(frname); - nForm = f.form; - //修改form的action等参数 - if (nForm.detachEvent) nForm.detachEvent("onsubmit", checkSubmit); - else nForm.removeEventListener("submit", checkSubmit, false); - nForm.action = 'archives_do.php'; - nForm.target = frname; - nForm.dopost.value = 'uploadLitpic'; - nForm.submit(); - picnameObj.value = ''; - newobj = $Obj('uploadwait'); - if (!newobj) { - newobj = document.createElement("div"); - newobj.id = 'uploadwait'; - newobj.style.position = 'absolute'; - newobj.className = 'uploadwait'; - newobj.style.width = 120; - newobj.style.height = 20; - newobj.style.top = hpos; - newobj.style.left = 100; - newobj.style.display = 'block'; - document.body.appendChild(newobj); - newobj.innerHTML = ''; - } - newobj.style.display = 'block'; - //提交后还原form的action等参数 - nForm.action = acname; - nForm.dopost.value = 'save'; - nForm.target = ''; - nForm.litpic.disabled = true; -} -function SelectFlash() { - var pos = GetWinPos(800,600); - window.open("./dialog/select_media.php?f=form1.flashurl&noeditor=yes", "popUpFlashWin", "scrollbars=yes,resizable=yes,statebar=no,width=800,height=600,left=" + pos.left + ", top=" + pos.top); -} function SelectMedia(fname) { var pos = GetWinPos(800,600); window.open("./dialog/select_media.php?f=" + fname + "&noeditor=yes", "popUpFlashWin", "scrollbars=yes,resizable=yes,statebar=no,width=800,height=600,left=" + pos.left + ", top=" + pos.top); @@ -84,10 +27,6 @@ function OpenMyWin(surl) { var pos = GetWinPos(800,600); window.open(surl, "popUpMyWin", "scrollbars=yes,resizable=yes,statebar=no,width=800,height=600,left=" + pos.left + ", top=" + pos.top); } -function OpenMyWinCoOne(surl) { - var pos = GetWinPos(800,600); - window.open(surl, "popUpMyWin2", "scrollbars=yes,resizable=yes,statebar=no,width=800,height=600,left=" + pos.left + ", top=" + pos.top); -} function InitPage() { var selsource = $Obj('selsource'); var selwriter = $Obj('selwriter'); @@ -96,8 +35,7 @@ function InitPage() { if (selwriter) { selwriter.onmousedown = function(e) { SelectWriter(e); } } } function $Nav() { - if (window.navigator.userAgent.indexOf("MSIE") >= 1) return 'IE'; - else if (window.navigator.userAgent.indexOf("Firefox") >= 1) return 'FF'; + if (window.navigator.userAgent.indexOf("Firefox") >= 1) return 'FF'; else return "OT"; } function $Obj(objname) { @@ -126,11 +64,11 @@ function ShowHide(objname) { function ShowObj(objname) { var obj = $Obj(objname); if (obj == null) return false; - obj.style.display = ($Nav() == "IE" ? "inline-block" : "table-row"); + obj.style.display = "table-row"; } function ShowObjRow(objname) { var obj = $Obj(objname); - obj.style.display = ($Nav() == "IE" ? "inline-block" : "table-row"); + obj.style.display = "table-row"; } function AddTypeid2() { ShowObjRow('typeid2tr'); @@ -146,36 +84,36 @@ function SeePic(img, f) { function PutSource(str) { var osource = $Obj('source'); if (osource) osource.value = str; - $Obj('mysource').style.display = 'none'; - ChangeFullDiv('hide'); + $Obj("mysource").style.display = "none"; + ChangeFullDiv("hide"); } function PutWriter(str) { - var owriter = $Obj('writer'); + var owriter = $Obj("writer"); if (owriter) owriter.value = str; - $Obj('mywriter').style.display = 'none'; - ChangeFullDiv('hide'); + $Obj("mywriter").style.display = "none"; + ChangeFullDiv("hide"); } function ClearDivCt(objname) { if (!$Obj(objname)) return; - $Obj(objname).innerHTML = ''; - $Obj(objname).style.display = 'none'; + $Obj(objname).innerHTML = ""; + $Obj(objname).style.display = "none"; ChangeFullDiv("hide"); } function ChangeFullDiv(showhide, screenheigt) { - var newobj = $Obj('fullpagediv'); - if (showhide == 'show') { + var newobj = $Obj("fullpagediv"); + if (showhide == "show") { if (!newobj) { newobj = document.createElement("div"); - newobj.id = 'fullpagediv'; - newobj.style.position = 'absolute'; - newobj.className = 'fullpagediv'; - newobj.style.height = document.body.clientHeight + 50 + 'px'; + newobj.id = "fullpagediv"; + newobj.style.position = "absolute"; + newobj.className = "fullpagediv"; + newobj.style.height = document.body.clientHeight + 50 + "px"; document.body.appendChild(newobj); } else { - newobj.style.display = 'block'; + newobj.style.display = "block"; } } else { - if (newobj) newobj.style.display = 'none'; + if (newobj) newobj.style.display = "none"; } } function SelectSource(e) { @@ -186,26 +124,14 @@ function SelectWriter(e) { } function LoadNewDiv(e, surl, oname) { var pxStr = ''; - if ($Nav() == 'IE') { - var posLeft = window.event.clientX - 20; - var posTop = window.event.clientY - 30; - //IE下scrollTop的兼容性问题 - var scrollTop = document.documentElement.scrollTop || window.pageYOffset; - if (typeof (scrollTop) == 'undefined') scrollTop = document.body.scrollTop; - posTop += scrollTop; - } else { - var posLeft = e.pageX - 20; - var posTop = e.pageY - 30; - pxStr = 'px'; - } posLeft = posLeft - 100; var newobj = $Obj(oname); if (!newobj) { newobj = document.createElement("div"); newobj.id = oname; - newobj.style.position = 'absolute'; + newobj.style.position = "absolute"; newobj.className = oname; - newobj.className += ' dlgws'; + newobj.className += " dlgws"; newobj.style.top = posTop + pxStr; newobj.style.left = posLeft + pxStr; document.body.appendChild(newobj); @@ -255,52 +181,6 @@ function ShowUrlTrEdit() { var rurl = $Obj('redirecturl'); if (!jumpTest.checked) rurl.value = ""; } -function CkRemote() { - document.getElementById('picname').value = ''; -} -//复制文档到剪切板 -function copyToClipboard(txt) { - if (txt == null || txt == '') { - alert("没有选择任何文档"); - return; - } - if (window.clipboardData) { - window.clipboardData.clearData(); - window.clipboardData.setData("Text", txt); - } else if (navigator.userAgent.indexOf('Opera') != -1) { - window.location = txt; - } else { - try { - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - } catch (e) { - alert("浏览器已拒绝,请稍后重试"); - } - var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard); - if (!clip) return; - var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable); - if (!trans) return; - trans.addDataFlavor('text/unicode'); - var str = new Object(); - var len = new Object(); - var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); - var copytext = txt; - str.data = copytext; - trans.setTransferData("text/unicode", str, copytext.length * 2); - var clipid = Components.interfaces.nsIClipboard; - if (!clip) return false; - clip.setData(trans, null, clipid.kGlobalClipboard); - } -} -function getSelTxt() { - var g, r; - if (document.all) { - g = document.selection.createRange().text; - } else { - g = document.getSelection(); - } - return g; -} -//文档列表快捷属性弹出 function LoadQuickDiv(e, surl, oname, w, h) { var newobj = $Obj(oname); if (!newobj) { @@ -320,11 +200,9 @@ function LoadQuickDiv(e, surl, oname, w, h) { fetch(surl).then(resp => resp.text()).then((d) => { newobj.innerHTML = d; }); - fixupPos = false; + } -//显示副栏目 function ShowCatMap(e, obj, cid, targetId, oldvalue) { - fixupPos = true; LoadQuickDiv(e, 'archives_do.php?dopost=getCatMap&targetid=' + targetId + '&channelid=' + cid + '&oldvalue=' + oldvalue + '&rnd=' + Math.random(), 'getCatMap', '700px', '500px'); ChangeFullDiv('show'); } @@ -332,7 +210,6 @@ function getSelCat(targetId) { var selBox = document.quicksel.seltypeid; var targetObj = $Obj(targetId); var selvalue = ''; - //副栏目多选 if (targetId == 'typeid2') { var j = 0; for (var i = 0; i < selBox.length; i++) { @@ -344,7 +221,6 @@ function getSelCat(targetId) { } if (targetObj) targetObj.value = selvalue; } else { - //主栏目单选 if (selBox) { for (var i = 0; i < selBox.length; i++) { if (selBox[i].checked) selvalue = selBox[i].value; @@ -454,76 +330,76 @@ function CloseModal(modalID) { }) } //获取缩略图 -var litpicImgSrc = ""; -var litpicImg = ""; -var currentCID = 0; -var mdlCropperID = ""; -var pubAt = 0; -var optCropper = { - preview: ".pv", - crop: function(e) { - $("#cropWidth").text(Math.round(e.detail.height)); - $("#cropHeight").text(Math.round(e.detail.width)); - if ($(this).cropper("getCroppedCanvas")) { +$(function() { + var litpicImgSrc = ""; + var litpicImg = ""; + var currentCID = 0; + var mdlCropperID = ""; + var pubAt = 0; + var optCropper = { + preview: ".pv", + crop: function(e) { + $("#cropWidth").text(Math.round(e.detail.height)); + $("#cropHeight").text(Math.round(e.detail.width)); + if ($(this).cropper("getCroppedCanvas")) { + var dataUrl = $(this).cropper("getCroppedCanvas").toDataURL(); + litpicImg = dataUrl; + $("#litPic").attr("src", litpicImg); + } + }, + aspectRatio: 4 / 3, + //拖动截取缩略图后,截取的缩略图更新到imageItems中 + cropend: function(data) { + //这里的id要单独取出来 var dataUrl = $(this).cropper("getCroppedCanvas").toDataURL(); litpicImg = dataUrl; - $("#litPic").attr("src", litpicImg); + $("#litPic").attr("src", litpicImg); + $("#litpic_b64").val(litpicImg); } - }, - aspectRatio: 4 / 3, - //拖动截取缩略图后,截取的缩略图更新到imageItems中 - cropend: function(data) { - //这里的id要单独取出来 - var dataUrl = $(this).cropper("getCroppedCanvas").toDataURL(); - litpicImg = dataUrl; + } + var cropperAspectRatio = { + 0: 16 / 9, + 1: 4 / 3, + 2: 1 / 1, + 3: 2 / 3, + 4: NaN, + } + function setAspectRatio(ar) { + var opts = optCropper; + opts.aspectRatio = cropperAspectRatio[ar]; + $("#cropImg" + mdlCropperID).cropper('destroy').cropper(opts); + } + function okImage(modalID) { + uploadImage(litpicImg); $("#litPic").attr("src", litpicImg); - $("#litpic_b64").val(litpicImg); + CloseModal('GKModal' + modalID); + } + function useDefault(modalID) { + uploadImage(litpicImgSrc); + $("#litPic").attr("src", litpicImgSrc); + CloseModal('GKModal' + modalID); + } + function uploadImage(litpicImgSrc) { + const formData = new FormData() + formData.append('litpic_b64', litpicImgSrc); + fetch('archives_do.php?dopost=upload_base64_image', { + method: 'POST', + body: formData + }) + .then(r => { + if (r.ok) { + return r.json() + } + throw new Error(errMsg); + }) + .then(d => { + if (d.code == 200) { + $("#picname").val(d.data.image_url); + } + }).catch((error) => { + alert("上传缩略图错误"); + }); } -} -var cropperAspectRatio = { - 0: 16 / 9, - 1: 4 / 3, - 2: 1 / 1, - 3: 2 / 3, - 4: NaN, -} -function setAspectRatio(ar) { - var opts = optCropper; - opts.aspectRatio = cropperAspectRatio[ar]; - $("#cropImg" + mdlCropperID).cropper('destroy').cropper(opts); -} -function okImage(modalID) { - uploadImage(litpicImg); - $("#litPic").attr("src", litpicImg); - CloseModal('GKModal' + modalID); -} -function useDefault(modalID) { - uploadImage(litpicImgSrc); - $("#litPic").attr("src", litpicImgSrc); - CloseModal('GKModal' + modalID); -} -function uploadImage(litpicImgSrc) { - const formData = new FormData() - formData.append('litpic_b64', litpicImgSrc); - fetch('archives_do.php?dopost=upload_base64_image', { - method: 'POST', - body: formData - }) - .then(r => { - if (r.ok) { - return r.json() - } - throw new Error(errMsg); - }) - .then(d => { - if (d.code == 200) { - $("#picname").val(d.data.image_url); - } - }).catch((error) => { - alert("上传缩略图错误"); - }); -} -$(document).ready(function() { $("#btnClearAll").click(function(event) { litpicImgSrc = ""; litpicImg = ""; @@ -568,6 +444,8 @@ $(document).ready(function() { $("#cropImg" + mdlCropperID).cropper(optCropper); }, 500); } +}); +$(document).ready(function() { if ($.fn.daterangepicker) { $('.datepicker').daterangepicker({ "singleDatePicker": true, diff --git a/src/static/web/css/admin.css b/src/static/web/css/admin.css index b7b1ad06..947fb77a 100644 --- a/src/static/web/css/admin.css +++ b/src/static/web/css/admin.css @@ -418,16 +418,6 @@ body.hidemenu .body-right { background:#f5f5f5; border-bottom:1px solid #dee2e6 } -.fullpagediv { - position:absolute; - top:0; - left:0; - width:100%; - height:100%; - background:#f5f5f5; - opacity:.6; - z-index:1999 -} .quicksel { margin-left:10px; margin-top:10px; @@ -465,6 +455,10 @@ body.hidemenu .body-right { border:1px solid #dee2e6; z-index:10001 } +#toolimg { + position:absolute; + display:none +} #uploadfield { float:left } @@ -680,18 +674,17 @@ table,input,select,textarea,.search,.menu-body,.coolbg,.mysource,.mywriter,.pubd } @media (max-width:768px) { .tips { - padding:0 15px - } - .tips-box { - width:100% - } + padding:0 15px +} +.tips-box { + width:100% } -@media (min-width:1200px) { +}@media (min-width:1200px) { .web-info { - text-overflow:ellipsis; - white-space:nowrap - } - .modal-dialog { - max-width:500px - } + text-overflow:ellipsis; + white-space:nowrap +} +.modal-dialog { + max-width:500px +} } \ No newline at end of file diff --git a/src/static/web/js/style.js b/src/static/web/js/style.js index 4750fd9f..a6e79b0f 100644 --- a/src/static/web/js/style.js +++ b/src/static/web/js/style.js @@ -1,16 +1,3 @@ -//返回顶部 -$(function() { - $(window).on('scroll', function() { - var scrolled = $(window).scrollTop(); - if (scrolled > 100) $('#returntop').show(); - if (scrolled < 100) $('#returntop').hide(); - }); - $('#returntop').on('click', function() { - $('html, body').animate({ - scrollTop: '0' - }, 500); - }); -}); //读写cookie函数 function GetCookie(c_name) { if (document.cookie.length > 0) { @@ -191,4 +178,16 @@ function ErrorAddSave(id, title) { ShowMsg(content, { 'footer': footer, }); -} \ No newline at end of file +} +$(function() { + $(window).on('scroll', function() { + var scrolled = $(window).scrollTop(); + if (scrolled > 100) $('#returntop').show(); + if (scrolled < 100) $('#returntop').hide(); + }); + $('#returntop').on('click', function() { + $('html, body').animate({ + scrollTop: '0' + }, 500); + }); +}); \ No newline at end of file diff --git a/src/static/web/js/user.album.js b/src/static/web/js/user.album.js index 71b5869b..cb2227b4 100644 --- a/src/static/web/js/user.album.js +++ b/src/static/web/js/user.album.js @@ -1,29 +1,31 @@ -var startNum = 1; -function MakeUpload(mnum) { - var endNum = 0; - var upfield = document.getElementById("uploadfield"); - var pnumObj = document.getElementById("picnum"); - var fhtml = ""; - var dsel = " checked='checked' "; - var dplay = "display:none"; - if (mnum==0) endNum = startNum + Number(pnumObj.value); - else endNum = mnum; - if (endNum>120) endNum = 120; - for (startNum;startNum < endNum;startNum++) - { - if (startNum==1) { - dsel = " checked='checked' "; - dplay = "block"; - } else { - dsel = " "; - dplay = "display:none"; +(function() { + var startNum = 1; + function MakeUpload(mnum) { + var endNum = 0; + var upfield = document.getElementById("uploadfield"); + var pnumObj = document.getElementById("picnum"); + var fhtml = ""; + var dsel = " checked='checked' "; + var dplay = "display:none"; + if (mnum==0) endNum = startNum + Number(pnumObj.value); + else endNum = mnum; + if (endNum>120) endNum = 120; + for (startNum;startNum < endNum;startNum++) + { + if (startNum==1) { + dsel = " checked='checked' "; + dplay = "block"; + } else { + dsel = " "; + dplay = "display:none"; + } + fhtml = ""; + fhtml += "
"; + fhtml += "
选择
"; + upfield.innerHTML += fhtml; } - fhtml = ""; - fhtml += "
"; - fhtml += "
选择
"; - upfield.innerHTML += fhtml; } -} +}); function CheckSelTable(nnum) { var cbox = document.getElementById('isokcheck'+nnum); var seltb = document.getElementById('seltb'+nnum);