Browse Source

Update admin.main.js

tags/6.5.6
叙述、别离 3 days ago
parent
commit
a2b4454448
1 changed files with 68 additions and 65 deletions
  1. +68
    -65
      src/static/web/js/admin.main.js

+ 68
- 65
src/static/web/js/admin.main.js View File

@@ -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);


Loading…
Cancel
Save