From a2b4454448ccd538dfd6526411e656a2158344ab 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?= <93301500+xushubieli@users.noreply.github.com> Date: Mon, 31 Mar 2025 23:38:51 +0800 Subject: [PATCH] Update admin.main.js --- src/static/web/js/admin.main.js | 133 ++++++++++++++++---------------- 1 file changed, 68 insertions(+), 65 deletions(-) diff --git a/src/static/web/js/admin.main.js b/src/static/web/js/admin.main.js index 0696bbb7..d461331d 100644 --- a/src/static/web/js/admin.main.js +++ b/src/static/web/js/admin.main.js @@ -1,6 +1,3 @@ -function $Obj(objname) { - return document.getElementById(objname); -} function GetWinPos(w, h) { var dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screenX; var dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screenY; @@ -40,9 +37,8 @@ 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 ShowCatMap(e, obj, cid, targetId, oldvalue) { - LoadQuickDiv(e, "archives_do.php?dopost=getCatMap&targetid=" + targetId + "&channelid=" + cid + "&oldvalue=" + oldvalue + "&rnd=" + Math.random(), "getCatMap", "800px", "600px"); - ChangeFullDiv("show"); +function $Obj(objname) { + return document.getElementById(objname); } function InitPage() { var selsource = $Obj("selsource"); @@ -71,65 +67,6 @@ function ColorSel(c, oname) { return true; } } -function LoadQuickDiv(e, surl, oname, w, h) { - var newobj = $Obj(oname); - if (!newobj) { - newobj = document.createElement("div"); - newobj.id = oname; - newobj.style.position = "fixed"; - newobj.className = "pubdlg"; - newobj.style.top = "0"; - newobj.style.left = "0"; - newobj.style.display = "block"; - //newobj.style.transform = "translate(-50%, -50%)"; - document.body.appendChild(newobj); - } - fetch(surl).then(resp => resp.text()).then((d) => { - newobj.innerHTML = d; - }); -} -function LoadNewDiv(e, surl, oname) { - var pxStr = ''; - var posLeft = e.pageX - 20; - var posTop = e.pageY - 30; - pxStr = 'px'; - var newobj = $Obj(oname); - if (!newobj) { - newobj = document.createElement("div"); - newobj.id = oname; - newobj.style.position = 'absolute'; - newobj.className = oname; - newobj.className += ' dlgws'; - newobj.style.top = posTop + pxStr; - newobj.style.left = posLeft + pxStr; - document.body.appendChild(newobj); - } else { - newobj.style.display = "block"; - } - if (newobj.innerHTML.length < 10) { - fetch(surl).then(resp => resp.text()).then((d) => { - newobj.innerHTML = d; - }); - } -} -function ChangeFullDiv(showhide, screenheigt) { - var newobj = $Obj("fullpagediv"); - if (showhide == "show") { - if (!newobj) { - newobj = document.createElement("div"); - newobj.id = "fullpagediv"; - newobj.style.position = "fixed"; - newobj.className = "fullpagediv"; - document.body.appendChild(newobj); - } else { - newobj.style.display = "block"; - } - document.body.style.overflow = "hidden"; - } else { - if (newobj) newobj.style.display = "none"; - document.body.style.overflow = ""; - } -} function ShowColor(e, o) { LoadNewDiv(e, "../theme/system/colornew.htm", "colordlg"); } @@ -195,6 +132,72 @@ function ShowUrlTrEdit() { var rurl = $Obj("redirecturl"); if (!jumpTest.checked) rurl.value = ''; } +function ChangeFullDiv(showhide, screenheigt) { + var newobj = $Obj("fullpagediv"); + if (showhide == "show") { + if (!newobj) { + newobj = document.createElement("div"); + newobj.id = "fullpagediv"; + newobj.style.position = "fixed"; + newobj.className = "fullpagediv"; + //newobj.style.height = document.body.clientHeight + "px"; + document.body.appendChild(newobj); + } else { + newobj.style.display = "block"; + } + document.body.style.overflow = "hidden"; + } else { + if (newobj) newobj.style.display = "none"; + document.body.style.overflow = ""; + } +} +function LoadNewDiv(e, surl, oname) { + var pxStr = ''; + var posLeft = e.pageX - 20; + var posTop = e.pageY - 30; + pxStr = 'px'; + var newobj = $Obj(oname); + if (!newobj) { + newobj = document.createElement("div"); + newobj.id = oname; + newobj.style.position = "fixed"; + newobj.className = oname; + newobj.className += " dlgws"; + newobj.style.top = posTop + pxStr; + newobj.style.left = posLeft + pxStr; + document.body.appendChild(newobj); + } else { + newobj.style.display = "block"; + } + if (newobj.innerHTML.length < 10) { + fetch(surl).then(resp => resp.text()).then((d) => { + newobj.innerHTML = d; + }); + } +} +function LoadQuickDiv(e, surl, oname, w, h) { + var newobj = $Obj(oname); + if (!newobj) { + newobj = document.createElement("div"); + newobj.id = oname; + newobj.style.position = "fixed"; + newobj.className = "pubdlg"; + //newobj.style.width = w; + //newobj.style.height = h + 30; + document.body.appendChild(newobj); + } + newobj.style.top = "0"; + newobj.style.left = "0"; + newobj.style.display = "block"; + //newobj.style.transform = "translate(-50%, -50%)"; + fetch(surl).then(resp => resp.text()).then((d) => { + newobj.innerHTML = d; + }); +} +function ShowCatMap(e, obj, cid, targetId, oldvalue) { + LoadQuickDiv(e, "archives_do.php?dopost=getCatMap&targetid=" + targetId + "&channelid=" + cid + "&oldvalue=" + oldvalue + "&rnd=" + Math.random(), "getCatMap", "700px", "500px"); + ChangeFullDiv("show"); +} function getSelCat(targetId) { var selBox = document.quicksel.seltypeid; var targetObj = $Obj(targetId);