@@ -59,13 +59,10 @@ if (!empty($iseditor)) { | |||
<link rel="stylesheet" href="../../static/web/font/css/font-awesome.min.css"> | |||
<link rel="stylesheet" href="../../static/web/css/bootstrap.min.css"> | |||
<link rel="stylesheet" href="../../static/web/css/admin.css"> | |||
<script src="../js/float.js"></script> | |||
<script src="../../static/web/js/jquery.min.js"></script> | |||
</head> | |||
<body class="body-bg"> | |||
<div class="upload-bg shadow-sm"> | |||
<div id="floater" class="napisdiv"> | |||
<a href="javascript:nullLink();" onclick="document.getElementById('floater').style.display='none';"><img src="../../static/web/img/icon_img.png" id="picview" title="关闭预览"></a> | |||
</div> | |||
<table align="center" class="table icon"> | |||
<tr> | |||
<td colspan="3"> | |||
@@ -139,7 +136,7 @@ if (!empty($iseditor)) { | |||
else $lstyle = ""; | |||
$line = "<tr> | |||
<td> | |||
<a href=\"javascript:;\" onclick=\"ChangeImage('$reurl');\"><img src='$reurl' title='$file'></a> | |||
<a href=\"$reurl\" class=\"toolimg\"><img src='$reurl' title='$file'></a> | |||
<a href=\"javascript:;\" onclick=\"ReturnImg('$reurl');\" $lstyle>$file</a> | |||
</td> | |||
<td>$filesize KB</td> | |||
@@ -154,7 +151,7 @@ if (!empty($iseditor)) { | |||
else $lstyle = ""; | |||
$line = "<tr> | |||
<td> | |||
<a href=\"javascript:;\" onclick=\"ChangeImage('$reurl');\"><img src='$reurl' title='$file'></a> | |||
<a href=\"$reurl\" class=\"toolimg\"><img src='$reurl' title='$file'></a> | |||
<a href=\"javascript:;\" onclick=\"ReturnImg('$reurl');\" $lstyle>$file</a> | |||
</td> | |||
<td>$filesize KB</td> | |||
@@ -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 id='toolimg'><img src='" + this.href + "'><\/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" | |||
}); | |||
}); | |||
}); | |||
</script> | |||
</body> | |||
</html> |
@@ -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 = '<img src="../../static/web/img/loadinglit.gif">'; | |||
(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; | |||
} | |||
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 = '<img src="../../static/web/img/loadinglit.gif">'; | |||
} | |||
newobj.style.display = 'block'; | |||
//提交后还原form的action等参数 | |||
nForm.action = acname; | |||
nForm.dopost.value = 'save'; | |||
nForm.target = ''; | |||
nForm.litpic.disabled = true; | |||
} | |||
}); |
@@ -1,92 +1,3 @@ | |||
var dedebizInfo; | |||
function ViewDedeBIZ() { | |||
if (dedebizInfo === false) { | |||
ShowMsg("启动商业组件失败"); | |||
return; | |||
} | |||
ShowMsg(`<table class="table table-borderless"> | |||
<tr> | |||
<td width="25%"> | |||
<div class="web-info"> | |||
<p>版本号</p> | |||
<span>${dedebizInfo.result.server_version}</span> | |||
</div> | |||
</td> | |||
<td width="25%"> | |||
<div class="web-info"> | |||
<p>服务器系统</p> | |||
<span>${dedebizInfo.result.server_goos}</span> | |||
</div> | |||
</td> | |||
<td width="25%"> | |||
<div class="web-info"> | |||
<p>运行时间</p> | |||
<span>${dedebizInfo.result.server_run_time}</span> | |||
</div> | |||
</td> | |||
<td width="25%"> | |||
<div class="web-info"> | |||
<p>内存占用</p> | |||
<span>${dedebizInfo.result.server_memory_usage}%</span> | |||
</div> | |||
</td> | |||
</tr> | |||
</table>`); | |||
} | |||
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 = `<table class="table table-borderless">`; | |||
if (typeof rsp.result.domain !== "undefined") { | |||
infoStr += `<tr> | |||
<td width="25%"> | |||
<div class="web-info"> | |||
<p>授权域名</p> | |||
<span>${rsp.result.domain}</span> | |||
</div> | |||
</td> | |||
<td width="25%"> | |||
<div class="web-info"> | |||
<p>站点名称</p> | |||
<span>${rsp.result.title}</span> | |||
</div> | |||
</td> | |||
<td width="25%"> | |||
<div class="web-info"> | |||
<p>站点证书</p> | |||
<span><a href="${cfg_biz_dedebizUrl}/auth/?domain=${rsp.result.domain}" target="_blank">查看证书</a></span> | |||
</div> | |||
</td> | |||
<td width="25%"> | |||
<div class="web-info"> | |||
<p>商业组件</p> | |||
<span><a href="javascript:ViewDedeBIZ()">组件状态</a></span> | |||
</div> | |||
</td> | |||
</tr>`; | |||
} | |||
infoStr += "</table>"; | |||
$("#system-info").html(infoStr); | |||
} else { | |||
$("#system-info").html(`<table class="table table-borderless"> | |||
<tr> | |||
<td> | |||
<div class="web-info"> | |||
<p>${rsp.msg}</p> | |||
<span>您已购买了商业版授权,登录DedeBIZ官网会员中心可查看相关授权信息</span> | |||
</div> | |||
</td> | |||
</tr> | |||
</table>`); | |||
} | |||
}); | |||
} | |||
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 = `<table class="table table-borderless">`; | |||
if (typeof rsp.result.domain !== "undefined") { | |||
infoStr += `<tr> | |||
<td width="25%"> | |||
<div class="web-info"> | |||
<p>授权域名</p> | |||
<span>${rsp.result.domain}</span> | |||
</div> | |||
</td> | |||
<td width="25%"> | |||
<div class="web-info"> | |||
<p>站点名称</p> | |||
<span>${rsp.result.title}</span> | |||
</div> | |||
</td> | |||
<td width="25%"> | |||
<div class="web-info"> | |||
<p>授权证书</p> | |||
<span><a href="${cfg_biz_dedebizUrl}/auth/?domain=${rsp.result.domain}" target="_blank">查看证书</a></span> | |||
</div> | |||
</td> | |||
<td width="25%"> | |||
<div class="web-info"> | |||
<p>授权时间</p> | |||
<span>${rsp.result.auth_at}</span> | |||
</div> | |||
</td> | |||
</tr>`; | |||
} | |||
infoStr += "</table>"; | |||
$("#system-info").html(infoStr); | |||
} else { | |||
$("#system-info").html(`<table class="table table-borderless"> | |||
<tr> | |||
<td> | |||
<div class="web-info"> | |||
<p>${rsp.msg}</p> | |||
<span>您已购买了商业版授权,登录DedeBIZ官网会员中心可查看相关授权信息</span> | |||
</div> | |||
</td> | |||
</tr> | |||
</table>`); | |||
} | |||
}); | |||
}); | |||
LoadStat(); | |||
LoadStatChart(); | |||
setInterval(function() { | |||
LoadServer(); | |||
}, 3000) | |||
}); |
@@ -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); |
@@ -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; | |||
} | |||
}); |
@@ -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 = '<img src="../../static/web/img/loadinglit.gif">'; | |||
} | |||
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, | |||
@@ -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 | |||
} | |||
} |
@@ -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, | |||
}); | |||
} | |||
} | |||
$(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); | |||
}); | |||
}); |
@@ -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 += "<div class='mb-3'><label class='mb-0'><input type='checkbox' name='isokcheck" + startNum + "' id='isokcheck" + startNum + "' value='1' "+dsel+" onClick='CheckSelTable(" + startNum + ")'> 显示图片" + startNum + "上传框</label></div>"; | |||
fhtml += "<div id=\"seltb" + startNum + "\" class='form-group' style=\"" + dplay + "\"><label>图片" + startNum + "上传:</label><div class='input-group mb-3'><input type='text' name='imgfile" + startNum + "' class='form-control' placeholder='请选择图片上传或填写图片地址'><div class='input-group-append'><span class='btn btn-success btn-sm btn-send' onClick=\"SelectImage('addcontent.imgfile" + startNum + "', 'big')\">选择</span></div></div><label>图片" + startNum + "简介:</label><textarea name='imgmsg" + startNum + "' class='form-control'></textarea></div>"; | |||
upfield.innerHTML += fhtml; | |||
} | |||
fhtml = ""; | |||
fhtml += "<div class='mb-3'><label class='mb-0'><input type='checkbox' name='isokcheck" + startNum + "' id='isokcheck" + startNum + "' value='1' "+dsel+" onClick='CheckSelTable(" + startNum + ")'> 显示图片" + startNum + "上传框</label></div>"; | |||
fhtml += "<div id=\"seltb" + startNum + "\" class='form-group' style=\"" + dplay + "\"><label>图片" + startNum + "上传:</label><div class='input-group mb-3'><input type='text' name='imgfile" + startNum + "' class='form-control' placeholder='请选择图片上传或填写图片地址'><div class='input-group-append'><span class='btn btn-success btn-sm btn-send' onClick=\"SelectImage('addcontent.imgfile" + startNum + "', 'big')\">选择</span></div></div><label>图片" + startNum + "简介:</label><textarea name='imgmsg" + startNum + "' class='form-control'></textarea></div>"; | |||
upfield.innerHTML += fhtml; | |||
} | |||
} | |||
}); | |||
function CheckSelTable(nnum) { | |||
var cbox = document.getElementById('isokcheck'+nnum); | |||
var seltb = document.getElementById('seltb'+nnum); | |||