@@ -7,8 +7,6 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
function checkSubmitAlb() { | function checkSubmitAlb() { | ||||
if (document.form1.title.value == '') { | if (document.form1.title.value == '') { | ||||
ShowMsg("档案标题不能为空"); | ShowMsg("档案标题不能为空"); | ||||
@@ -19,9 +17,8 @@ function checkSubmitAlb() { | |||||
return false; | return false; | ||||
} | } | ||||
document.form1.imagebody.value = $Obj('copyhtml').innerHTML; | document.form1.imagebody.value = $Obj('copyhtml').innerHTML; | ||||
if ($("#thumbnails .albCt").length > 0) { | if ($("#thumbnails .albCt").length > 0) { | ||||
// 这里从thumbnails中取出图片元素信息 | |||||
//这里从thumbnails中取出图片元素信息 | |||||
$("#thumbnails .albCt").each(function () { | $("#thumbnails .albCt").each(function () { | ||||
albums.push({ | albums.push({ | ||||
"img": $(this).find("img").attr("src"), | "img": $(this).find("img").attr("src"), | ||||
@@ -29,16 +26,12 @@ function checkSubmitAlb() { | |||||
}) | }) | ||||
}) | }) | ||||
} | } | ||||
$("#albums").val(JSON.stringify(albums)); | $("#albums").val(JSON.stringify(albums)); | ||||
return true; | return true; | ||||
} | } | ||||
function testGet() { | function testGet() { | ||||
LoadTestDiv(); | LoadTestDiv(); | ||||
} | } | ||||
function checkMuList(psid, cmid) { | function checkMuList(psid, cmid) { | ||||
if ($Obj('pagestyle3').checked) { | if ($Obj('pagestyle3').checked) { | ||||
$Obj('cfgmulist').style.display = 'block'; | $Obj('cfgmulist').style.display = 'block'; | ||||
@@ -51,21 +44,16 @@ function checkMuList(psid, cmid) { | |||||
$Obj('spagelist').style.display = 'none'; | $Obj('spagelist').style.display = 'none'; | ||||
} | } | ||||
} | } | ||||
//图集,显示与隐藏zip文件选项 | //图集,显示与隐藏zip文件选项 | ||||
function showZipField(formitem, zipid, upid) { | function showZipField(formitem, zipid, upid) { | ||||
if (formitem.checked) { | if (formitem.checked) { | ||||
$Obj(zipid).style.display = 'block'; | $Obj(zipid).style.display = 'block'; | ||||
$Obj(upid).style.display = 'none'; | $Obj(upid).style.display = 'none'; | ||||
//$Obj('handfield').style.display = 'none'; | |||||
// $Obj('formhtml').checked = false; | |||||
$Obj('copyhtml').innerHTML = ''; | $Obj('copyhtml').innerHTML = ''; | ||||
} else { | } else { | ||||
$Obj(zipid).style.display = 'none'; | $Obj(zipid).style.display = 'none'; | ||||
//$Obj('handfield').style.display = 'block'; | |||||
} | } | ||||
} | } | ||||
//图集,显示与隐藏Html编辑框 | //图集,显示与隐藏Html编辑框 | ||||
function showHtmlField(formitem, htmlid, upid) { | function showHtmlField(formitem, htmlid, upid) { | ||||
if ($Nav() != "IE") { | if ($Nav() != "IE") { | ||||
@@ -75,15 +63,12 @@ function showHtmlField(formitem, htmlid, upid) { | |||||
if (formitem.checked) { | if (formitem.checked) { | ||||
$Obj(htmlid).style.display = 'block'; | $Obj(htmlid).style.display = 'block'; | ||||
$Obj(upid).style.display = 'none'; | $Obj(upid).style.display = 'none'; | ||||
//$Obj('handfield').style.display = 'none'; | |||||
$Obj('formzip').checked = false; | $Obj('formzip').checked = false; | ||||
} else { | } else { | ||||
$Obj(htmlid).style.display = 'none'; | $Obj(htmlid).style.display = 'none'; | ||||
//$Obj('handfield').style.display = 'block'; | |||||
$Obj('copyhtml').innerHTML = ''; | $Obj('copyhtml').innerHTML = ''; | ||||
} | } | ||||
} | } | ||||
function seePicNewAlb(f, imgdid, frname, hpos, acname) { | function seePicNewAlb(f, imgdid, frname, hpos, acname) { | ||||
var newobj = null; | var newobj = null; | ||||
if (f.value == '') return; | if (f.value == '') return; | ||||
@@ -98,7 +83,6 @@ function seePicNewAlb(f, imgdid, frname, hpos, acname) { | |||||
nForm.target = frname; | nForm.target = frname; | ||||
nForm.dopost.value = 'uploadLitpic'; | nForm.dopost.value = 'uploadLitpic'; | ||||
nForm.submit(); | nForm.submit(); | ||||
picnameObj.value = ''; | picnameObj.value = ''; | ||||
newobj = $Obj('uploadwait'); | newobj = $Obj('uploadwait'); | ||||
if (!newobj) { | if (!newobj) { | ||||
@@ -119,11 +103,7 @@ function seePicNewAlb(f, imgdid, frname, hpos, acname) { | |||||
nForm.dopost.value = 'save'; | nForm.dopost.value = 'save'; | ||||
nForm.target = ''; | nForm.target = ''; | ||||
nForm.litpic.disabled = true; | nForm.litpic.disabled = true; | ||||
//nForm.litpic = null; | |||||
//if(nForm.attachEvent) nForm.attachEvent("onsubmit", checkSubmit); | |||||
//else nForm.addEventListener("submit", checkSubmit, true); | |||||
} | } | ||||
//删除已经上传的图片 | //删除已经上传的图片 | ||||
function delAlbPic(pid) { | function delAlbPic(pid) { | ||||
var tgobj = $Obj('albCtok' + pid); | var tgobj = $Obj('albCtok' + pid); | ||||
@@ -132,8 +112,7 @@ function delAlbPic(pid) { | |||||
$Obj('thumbnails').removeChild(tgobj); | $Obj('thumbnails').removeChild(tgobj); | ||||
}); | }); | ||||
} | } | ||||
//删除已经上传的图片(编辑时用) | |||||
//删除已经上传的图片,编辑时用 | |||||
function delAlbPicOld(picfile, pid) { | function delAlbPicOld(picfile, pid) { | ||||
var tgobj = $Obj('albold' + pid); | var tgobj = $Obj('albold' + pid); | ||||
fetch('swfupload.php?dopost=delold&picfile=' + picfile).then(resp=>resp.text()).then((d)=>{ | fetch('swfupload.php?dopost=delold&picfile=' + picfile).then(resp=>resp.text()).then((d)=>{ | ||||
@@ -9,7 +9,6 @@ | |||||
}).blur(function(){ | }).blur(function(){ | ||||
$(this).removeClass("txt_s"); | $(this).removeClass("txt_s"); | ||||
}); | }); | ||||
//表格折叠 | //表格折叠 | ||||
$(".tform").find("tbody tr th[_show]").each(function(i){ | $(".tform").find("tbody tr th[_show]").each(function(i){ | ||||
//加入折叠提示 | //加入折叠提示 | ||||
@@ -33,14 +32,12 @@ | |||||
$(this).removeClass("mouseon"); | $(this).removeClass("mouseon"); | ||||
}).click(); | }).click(); | ||||
}); | }); | ||||
//列表行高亮 | //列表行高亮 | ||||
$("table[_dlist*='light']").children("tbody").children("tr").mouseover(function(){ | $("table[_dlist*='light']").children("tbody").children("tr").mouseover(function(){ | ||||
if($(this).attr("_nolight")!="yes")$(this).addClass("t_on"); | if($(this).attr("_nolight")!="yes")$(this).addClass("t_on"); | ||||
}).mouseout(function(){ | }).mouseout(function(){ | ||||
$(this).removeClass("t_on"); | $(this).removeClass("t_on"); | ||||
}); | }); | ||||
//列表行整行选择 | //列表行整行选择 | ||||
$("table[_dlist*='check']").each(function(){ | $("table[_dlist*='check']").each(function(){ | ||||
//处理行点击 | //处理行点击 | ||||
@@ -57,7 +54,6 @@ | |||||
} | } | ||||
}); | }); | ||||
//处理checkbox点击 | //处理checkbox点击 | ||||
$(this).find("td input[type='checkbox']").click(function(){ | $(this).find("td input[type='checkbox']").click(function(){ | ||||
tr = $(this).parent("td").parent("tr"); | tr = $(this).parent("td").parent("tr"); | ||||
@@ -69,7 +65,6 @@ | |||||
tr.addClass("t_sl"); | tr.addClass("t_sl"); | ||||
} | } | ||||
}); | }); | ||||
//排除链接及按钮点击 | //排除链接及按钮点击 | ||||
$(this).find("tbody tr td a,tbody tr td button,tbody tr td table").click(function(){ | $(this).find("tbody tr td a,tbody tr td button,tbody tr td table").click(function(){ | ||||
tr = $(this).parent("td").parent("tr"); | tr = $(this).parent("td").parent("tr"); | ||||
@@ -84,19 +79,14 @@ | |||||
}); | }); | ||||
}); | }); | ||||
//高亮初始化 | //高亮初始化 | ||||
setChecklight(); | setChecklight(); | ||||
//全选按钮 | //全选按钮 | ||||
$("button[_click='allSelect']").click(function(){ | $("button[_click='allSelect']").click(function(){ | ||||
ckbox = $(this).parent("td").parent("tr").parent("tbody").find("td input[type='checkbox']"); | ckbox = $(this).parent("td").parent("tr").parent("tbody").find("td input[type='checkbox']"); | ||||
ckbox.attr("checked","checked"); | ckbox.attr("checked","checked"); | ||||
setChecklight(); | setChecklight(); | ||||
}); | }); | ||||
//反选按钮 | //反选按钮 | ||||
$("button[_click='unSelect']").click(function(){ | $("button[_click='unSelect']").click(function(){ | ||||
ckbox = $(this).parent("td").parent("tr").parent("tbody").find("td input[type='checkbox']"); | ckbox = $(this).parent("td").parent("tr").parent("tbody").find("td input[type='checkbox']"); | ||||
@@ -106,7 +96,6 @@ | |||||
setChecklight(); | setChecklight(); | ||||
}); | }); | ||||
//自定义提交 | //自定义提交 | ||||
$("button[_submit]").click(function(){ | $("button[_submit]").click(function(){ | ||||
url = $(this).attr("_submit"); | url = $(this).attr("_submit"); | ||||
@@ -117,11 +106,8 @@ | |||||
} | } | ||||
$(this).parents("form").attr("action",url).submit(); | $(this).parents("form").attr("action",url).submit(); | ||||
}); | }); | ||||
}); | }); | ||||
/*高亮初始化*/ | |||||
//高亮初始化 | |||||
function setChecklight(){ | function setChecklight(){ | ||||
$(".tlist[_dlist*='check']").find("tbody tr td input[type='checkbox']").each(function(i){ | $(".tlist[_dlist*='check']").find("tbody tr td input[type='checkbox']").each(function(i){ | ||||
tr = $(this).parent("td").parent("tr"); | tr = $(this).parent("td").parent("tr"); | ||||
@@ -132,8 +118,7 @@ | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
/*栏目跳转*/ | |||||
//栏目跳转 | |||||
function AC(mid){ | function AC(mid){ | ||||
f = $(window.parent.document); | f = $(window.parent.document); | ||||
mlink = f.find("a[id='"+mid+"']"); | mlink = f.find("a[id='"+mid+"']"); | ||||
@@ -155,5 +140,4 @@ | |||||
} | } | ||||
} | } | ||||
} | |||||
} |
@@ -1,3 +1,3 @@ | |||||
function CheckSubmit(){ | function CheckSubmit(){ | ||||
return true; | return true; | ||||
} | |||||
} |
@@ -6,17 +6,14 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
var MenuWidth = 120; | var MenuWidth = 120; | ||||
var ItemHeight = 16; | var ItemHeight = 16; | ||||
var ItemNumber = 0; | var ItemNumber = 0; | ||||
function curNav() { | function curNav() { | ||||
if (window.navigator.userAgent.indexOf("MSIE") >= 1) return 'IE'; | if (window.navigator.userAgent.indexOf("MSIE") >= 1) return 'IE'; | ||||
else if (window.navigator.userAgent.indexOf("Firefox") >= 1) return 'FF'; | else if (window.navigator.userAgent.indexOf("Firefox") >= 1) return 'FF'; | ||||
else return 'OT'; | else return 'OT'; | ||||
} | } | ||||
function insertHtm(op, code, isStart) { | function insertHtm(op, code, isStart) { | ||||
if (curNav() == 'IE') { | if (curNav() == 'IE') { | ||||
op.insertAdjacentHTML(isStart ? "beforeEnd" : "afterEnd", code); | op.insertAdjacentHTML(isStart ? "beforeEnd" : "afterEnd", code); | ||||
@@ -28,49 +25,34 @@ function insertHtm(op, code, isStart) { | |||||
else op.appendChild(fragment); | else op.appendChild(fragment); | ||||
} | } | ||||
} | } | ||||
ContextMenu.WebFX_PopUp = null; | ContextMenu.WebFX_PopUp = null; | ||||
ContextMenu.WbFX_PopUpcss = null; | ContextMenu.WbFX_PopUpcss = null; | ||||
ContextMenu.intializeContextMenu = function () { | ContextMenu.intializeContextMenu = function () { | ||||
insertHtm(document.body, '<iframe src="#" scrolling="no" class="WebFX-ContextMenu" marginwidth="0" marginheight="0" frameborder="0" style="position:absolute;display:none;z-index:50000000;" id="WebFX_PopUp"></iframe>', true); | insertHtm(document.body, '<iframe src="#" scrolling="no" class="WebFX-ContextMenu" marginwidth="0" marginheight="0" frameborder="0" style="position:absolute;display:none;z-index:50000000;" id="WebFX_PopUp"></iframe>', true); | ||||
if (curNav() == 'IE') WebFX_PopUp = document.frames['WebFX_PopUp']; | if (curNav() == 'IE') WebFX_PopUp = document.frames['WebFX_PopUp']; | ||||
else WebFX_PopUp = document.getElementById('WebFX_PopUp'); | else WebFX_PopUp = document.getElementById('WebFX_PopUp'); | ||||
WebFX_PopUpcss = document.getElementById('WebFX_PopUp'); | WebFX_PopUpcss = document.getElementById('WebFX_PopUp'); | ||||
WebFX_PopUpcss.onfocus = function () { WebFX_PopUpcss.style.display = "inline" }; | WebFX_PopUpcss.onfocus = function () { WebFX_PopUpcss.style.display = "inline" }; | ||||
WebFX_PopUpcss.onblur = function () { WebFX_PopUpcss.style.display = "none" }; | WebFX_PopUpcss.onblur = function () { WebFX_PopUpcss.style.display = "none" }; | ||||
if (curNav() == 'IE') document.body.attachEvent("onmousedown", function () { WebFX_PopUpcss.style.display = "none" }); | if (curNav() == 'IE') document.body.attachEvent("onmousedown", function () { WebFX_PopUpcss.style.display = "none" }); | ||||
else document.addEventListener("onblur", function () { WebFX_PopUpcss.style.display = "none" }, false); | else document.addEventListener("onblur", function () { WebFX_PopUpcss.style.display = "none" }, false); | ||||
if (curNav() == 'IE') document.attachEvent("onblur", function () { WebFX_PopUpcss.style.display = "none" }); | if (curNav() == 'IE') document.attachEvent("onblur", function () { WebFX_PopUpcss.style.display = "none" }); | ||||
else document.addEventListener("onblur", function () { WebFX_PopUpcss.style.display = "none" }, false); | else document.addEventListener("onblur", function () { WebFX_PopUpcss.style.display = "none" }, false); | ||||
} | } | ||||
function ContextSeperator() { } | function ContextSeperator() { } | ||||
function ContextMenu() { } | function ContextMenu() { } | ||||
ContextMenu.showPopup = function (x, y) { | ContextMenu.showPopup = function (x, y) { | ||||
WebFX_PopUpcss.style.display = "block" | WebFX_PopUpcss.style.display = "block" | ||||
} | } | ||||
ContextMenu.display = function (evt, popupoptions) { | ContextMenu.display = function (evt, popupoptions) { | ||||
var eobj, x, y; | var eobj, x, y; | ||||
eobj = evt ? evt : (window.event ? window.event : null); | eobj = evt ? evt : (window.event ? window.event : null); | ||||
if (curNav() == 'IE') { | if (curNav() == 'IE') { | ||||
x = eobj.x; y = eobj.y | x = eobj.x; y = eobj.y | ||||
} else { | } else { | ||||
x = eobj.pageX; y = eobj.pageY; | x = eobj.pageX; y = eobj.pageY; | ||||
} | } | ||||
ContextMenu.populatePopup(popupoptions, window) | ContextMenu.populatePopup(popupoptions, window) | ||||
ContextMenu.showPopup(x, y); | ContextMenu.showPopup(x, y); | ||||
ContextMenu.fixSize(); | ContextMenu.fixSize(); | ||||
@@ -78,57 +60,32 @@ ContextMenu.display = function (evt, popupoptions) { | |||||
eobj.cancelBubble = true; | eobj.cancelBubble = true; | ||||
eobj.returnValue = false; | eobj.returnValue = false; | ||||
} | } | ||||
//TODO | //TODO | ||||
ContextMenu.getScrollTop = function () { | ContextMenu.getScrollTop = function () { | ||||
return document.body.scrollTop; | return document.body.scrollTop; | ||||
//window.pageXOffset and window.pageYOffset for moz | |||||
} | } | ||||
ContextMenu.getScrollLeft = function () { | ContextMenu.getScrollLeft = function () { | ||||
return document.body.scrollLeft; | return document.body.scrollLeft; | ||||
} | } | ||||
ContextMenu.fixPos = function (x, y) { | ContextMenu.fixPos = function (x, y) { | ||||
/*var docheight,docwidth,dh,dw; | |||||
if(!x) { x=0; y=0; } | |||||
docheight = document.body.clientHeight; | |||||
docwidth = document.body.clientWidth; | |||||
dh = (WebFX_PopUpcss.offsetHeight+y) - docheight; | |||||
dw = (WebFX_PopUpcss.offsetWidth+x) - docwidth; | |||||
if(dw>0){ | |||||
WebFX_PopUpcss.style.left = (x - dw) + ContextMenu.getScrollLeft() + "px"; | |||||
}else { | |||||
WebFX_PopUpcss.style.left = x + ContextMenu.getScrollLeft(); | |||||
} if(dh>0) { | |||||
WebFX_PopUpcss.style.top = (y - dh) + ContextMenu.getScrollTop() + "px" | |||||
}else{ | |||||
WebFX_PopUpcss.style.top = y + ContextMenu.getScrollTop(); }*/ | |||||
WebFX_PopUpcss.style.top = y + "px"; | WebFX_PopUpcss.style.top = y + "px"; | ||||
WebFX_PopUpcss.style.left = x + "px"; | WebFX_PopUpcss.style.left = x + "px"; | ||||
} | } | ||||
ContextMenu.fixSize = function () { | ContextMenu.fixSize = function () { | ||||
WebFX_PopUpcss.style.height = (ItemHeight * ItemNember + 20) + "px"; | WebFX_PopUpcss.style.height = (ItemHeight * ItemNember + 20) + "px"; | ||||
WebFX_PopUpcss.style.width = MenuWidth + "px"; | WebFX_PopUpcss.style.width = MenuWidth + "px"; | ||||
ItemNember = 0; | ItemNember = 0; | ||||
} | } | ||||
ContextMenu.populatePopup = function (arr, win) { | ContextMenu.populatePopup = function (arr, win) { | ||||
var alen, i, tmpobj, doc, height, htmstr; | var alen, i, tmpobj, doc, height, htmstr; | ||||
alen = arr.length; | alen = arr.length; | ||||
ItemNember = alen; | ItemNember = alen; | ||||
if (curNav() == 'IE') doc = WebFX_PopUp.document; | if (curNav() == 'IE') doc = WebFX_PopUp.document; | ||||
else doc = WebFX_PopUp.contentWindow.document; | else doc = WebFX_PopUp.contentWindow.document; | ||||
doc.body.innerHTML = ''; | doc.body.innerHTML = ''; | ||||
//if (doc.getElementsByTagName("LINK").length == 0){ | |||||
doc.open(); | doc.open(); | ||||
doc.write('<html><head><link rel="StyleSheet" href="js/contextmenu.css"></head><body></body></html>'); | doc.write('<html><head><link rel="StyleSheet" href="js/contextmenu.css"></head><body></body></html>'); | ||||
doc.close(); | doc.close(); | ||||
//} | |||||
for (i = 0; i < alen; i++) { | for (i = 0; i < alen; i++) { | ||||
if (arr[i].constructor == ContextItem) { | if (arr[i].constructor == ContextItem) { | ||||
tmpobj = doc.createElement("DIV"); | tmpobj = doc.createElement("DIV"); | ||||
@@ -149,7 +106,6 @@ ContextMenu.populatePopup = function (arr, win) { | |||||
if (typeof (f) == "function") { f(); } | if (typeof (f) == "function") { f(); } | ||||
}; | }; | ||||
})(arr[i].action); | })(arr[i].action); | ||||
tmpobj.onmouseover = function () { this.className = "WebFX-ContextMenu-Over" } | tmpobj.onmouseover = function () { this.className = "WebFX-ContextMenu-Over" } | ||||
tmpobj.onmouseout = function () { this.className = "WebFX-ContextMenu-Item" } | tmpobj.onmouseout = function () { this.className = "WebFX-ContextMenu-Item" } | ||||
} | } | ||||
@@ -161,7 +117,6 @@ ContextMenu.populatePopup = function (arr, win) { | |||||
doc.body.className = "WebFX-ContextMenu-Body"; | doc.body.className = "WebFX-ContextMenu-Body"; | ||||
doc.body.onselectstart = function () { return false; } | doc.body.onselectstart = function () { return false; } | ||||
} | } | ||||
function ContextItem(str, fnc, disabled) { | function ContextItem(str, fnc, disabled) { | ||||
this.text = str; | this.text = str; | ||||
this.action = fnc; | this.action = fnc; | ||||
@@ -1,62 +1 @@ | |||||
.WebFX-ContextMenu { | |||||
border:0; | |||||
width:10px | |||||
} | |||||
.WebFX-ContextMenu-Body { | |||||
background-color:#EEFFEC; | |||||
background-image:url(../../static/web/img/mmenubg.gif); | |||||
margin:0; | |||||
padding:1px; | |||||
border:1px solid #E0E7C9 | |||||
} | |||||
.WebFX-ContextMenu-Separator { | |||||
font-size:0pt; | |||||
border:1px dotted #E0E7C9; | |||||
height:1px; | |||||
overflow:hidden; | |||||
margin:3px 1px 3px 1px | |||||
} | |||||
.WebFX-ContextMenu-Item { | |||||
cursor:default; | |||||
font:menu; | |||||
font-size:12px; | |||||
color:black !important; | |||||
width:100%; | |||||
padding:2px 20px 2px 16px | |||||
} | |||||
.WebFX-ContextMenu-Over { | |||||
cursor:default; | |||||
background-color:highlight; | |||||
font:menu; | |||||
font-size:12px; | |||||
width:100%; | |||||
padding:2px 20px 2px 16px; | |||||
color:highlighttext | |||||
} | |||||
.WebFX-ContextMenu-Disabled { | |||||
cursor:default; | |||||
font:menu; | |||||
width:100%; | |||||
padding:2px 20px 2px 16px; | |||||
color:graytext | |||||
} | |||||
.WebFX-ContextMenu-Disabled-Over { | |||||
cursor:default; | |||||
background-color:highlight; | |||||
font:menu; | |||||
width:100%; | |||||
padding:2px 20px 2px 16px; | |||||
color:graytext | |||||
} | |||||
.WebFX-ContextMenu-Disabled-Over .WebFX-ContextMenu-DisabledContainer { | |||||
display:block; | |||||
width:100%; | |||||
vertical-align:center | |||||
} | |||||
.WebFX-ContextMenu-Disabled .WebFX-ContextMenu-DisabledContainer { | |||||
display:block; | |||||
background:GrayText; | |||||
filter:chroma(color=#010101) dropshadow(color=ButtonHighlight,offx=1,offy=1); | |||||
width:100%; | |||||
vertical-align:center | |||||
} | |||||
.WebFX-ContextMenu{border:0;width:10px}.WebFX-ContextMenu-Body{background-color:#EEFFEC;background-image:url(../../static/web/img/mmenubg.gif);margin:0;padding:1px;border:1px solid #E0E7C9}.WebFX-ContextMenu-Separator{font-size:0pt;border:1px dotted #E0E7C9;height:1px;overflow:hidden;margin:3px 1px 3px 1px}.WebFX-ContextMenu-Item{cursor:default;font:menu;font-size:12px;color:black !important;width:100%;padding:2px 20px 2px 16px}.WebFX-ContextMenu-Over{cursor:default;background-color:highlight;font:menu;font-size:12px;width:100%;padding:2px 20px 2px 16px;color:highlighttext}.WebFX-ContextMenu-Disabled{cursor:default;font:menu;width:100%;padding:2px 20px 2px 16px;color:graytext}.WebFX-ContextMenu-Disabled-Over{cursor:default;background-color:highlight;font:menu;width:100%;padding:2px 20px 2px 16px;color:graytext}.WebFX-ContextMenu-Disabled-Over .WebFX-ContextMenu-DisabledContainer{display:block;width:100%;vertical-align:center}.WebFX-ContextMenu-Disabled .WebFX-ContextMenu-DisabledContainer{display:block;background:GrayText;filter:chroma(color=#010101) dropshadow(color=ButtonHighlight,offx=1,offy=1);width:100%;vertical-align:center} |
@@ -49,8 +49,6 @@ function AlertMsg(title, id) { | |||||
var msgObj = document.createElement("div") | var msgObj = document.createElement("div") | ||||
msgObj.setAttribute("id", "msgdiv"); | msgObj.setAttribute("id", "msgdiv"); | ||||
msgObj.style.position = "absolute"; | msgObj.style.position = "absolute"; | ||||
//msgObj.style.top = (screen.availHeight - msgh) / 4 + "px"; | |||||
//msgObj.style.left = (screen.availWidth - msgw) / 2 + "px"; | |||||
msgObj.style.top = "100px"; | msgObj.style.top = "100px"; | ||||
msgObj.style.left = "100px"; | msgObj.style.left = "100px"; | ||||
msgObj.style.width = msgw + "px"; | msgObj.style.width = msgw + "px"; | ||||
@@ -6,8 +6,6 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
function showHide2(objname) { | function showHide2(objname) { | ||||
var obj = $Obj(objname); | var obj = $Obj(objname); | ||||
if (obj.style.display != 'block') { obj.style.display = 'block' } | if (obj.style.display != 'block') { obj.style.display = 'block' } | ||||
@@ -32,7 +32,6 @@ function heartBeat() { | |||||
} | } | ||||
} | } | ||||
function checkFocus(x, y) { | function checkFocus(x, y) { | ||||
stalkerx = document.floater.pageX; | stalkerx = document.floater.pageX; | ||||
stalkery = document.floater.pageY; | stalkery = document.floater.pageY; | ||||
@@ -41,7 +40,6 @@ function checkFocus(x, y) { | |||||
if ((x > stalkerx && x < (stalkerx + stalkerwidth)) && (y > stalkery && y < (stalkery + stalkerheight))) return true; | if ((x > stalkerx && x < (stalkerx + stalkerwidth)) && (y > stalkery && y < (stalkery + stalkerheight))) return true; | ||||
else return false; | else return false; | ||||
} | } | ||||
function grabIt(e) { | function grabIt(e) { | ||||
if (IE) { | if (IE) { | ||||
whichIt = event.srcElement; | whichIt = event.srcElement; | ||||
@@ -62,9 +60,7 @@ function grabIt(e) { | |||||
} | } | ||||
} return true; | } return true; | ||||
} | } | ||||
function moveIt(e) { | function moveIt(e) { | ||||
if (whichIt == null) { return false; } | if (whichIt == null) { return false; } | ||||
if (IE) { | if (IE) { | ||||
newX = (event.clientX + document.body.scrollLeft); | newX = (event.clientX + document.body.scrollLeft); | ||||
@@ -88,7 +84,6 @@ function moveIt(e) { | |||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
function dropIt() { | function dropIt() { | ||||
whichIt = null; | whichIt = null; | ||||
if (NS) window.releaseEvents(Event.MOUSEMOVE); | if (NS) window.releaseEvents(Event.MOUSEMOVE); | ||||
@@ -3,29 +3,20 @@ var thespeed = 5; | |||||
var navIE = document.all && navigator.userAgent.indexOf("Firefox") == -1; | var navIE = document.all && navigator.userAgent.indexOf("Firefox") == -1; | ||||
var myspeed = 0; | var myspeed = 0; | ||||
$(function () { | $(function () { | ||||
//左侧菜单开关 | //左侧菜单开关 | ||||
LeftMenuToggle(); | LeftMenuToggle(); | ||||
//全部功能开关 | //全部功能开关 | ||||
AllMenuToggle(); | AllMenuToggle(); | ||||
//取消菜单链接虚线 | //取消菜单链接虚线 | ||||
$(".head").find("a").click(function () { $(this).blur() }); | $(".head").find("a").click(function () { $(this).blur() }); | ||||
$(".menu").find("a").click(function () { $(this).blur() }); | $(".menu").find("a").click(function () { $(this).blur() }); | ||||
}).keydown(function (event) {//快捷键 | }).keydown(function (event) {//快捷键 | ||||
if (event.keyCode == 116) { | if (event.keyCode == 116) { | ||||
//url = $("#main").attr("src"); | |||||
//main.location.href = url; | |||||
//return false; | |||||
} | } | ||||
if (event.keyCode == 27) { | if (event.keyCode == 27) { | ||||
$("#qucikmenu").slideToggle("fast") | $("#qucikmenu").slideToggle("fast") | ||||
} | } | ||||
}); | }); | ||||
function LeftMenuToggle() {//左侧菜单开关 | function LeftMenuToggle() {//左侧菜单开关 | ||||
$("#togglemenu").click(function () { | $("#togglemenu").click(function () { | ||||
if ($("body").attr("class") == "showmenu") { | if ($("body").attr("class") == "showmenu") { | ||||
@@ -37,19 +28,14 @@ function LeftMenuToggle() {//左侧菜单开关 | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
function AllMenuToggle() {//全部功能开关 | function AllMenuToggle() {//全部功能开关 | ||||
mask = $(".pagemask,.iframemask,.allmenu"); | mask = $(".pagemask,.iframemask,.allmenu"); | ||||
$("#allmenu").click(function () { | $("#allmenu").click(function () { | ||||
mask.show(); | mask.show(); | ||||
}); | }); | ||||
//mask.mousedown(function(){alert("123");}); | |||||
mask.click(function () { mask.hide(); }); | mask.click(function () { mask.hide(); }); | ||||
} | } | ||||
function AC(act) { | function AC(act) { | ||||
//alert(act); | |||||
mlink = $("a[id='" + act + "']"); | mlink = $("a[id='" + act + "']"); | ||||
if (mlink.size() > 0) { | if (mlink.size() > 0) { | ||||
box = mlink.parents("div[id^='menu_']"); | box = mlink.parents("div[id^='menu_']"); | ||||
@@ -69,59 +55,14 @@ function AC(act) { | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/********************* | /********************* | ||||
* 滚动按钮设置 | * 滚动按钮设置 | ||||
*********************/ | *********************/ | ||||
function scrollwindow() { | function scrollwindow() { | ||||
parent.frames['menu'].scrollBy(0, myspeed); | parent.frames['menu'].scrollBy(0, myspeed); | ||||
} | } | ||||
function initializeIT() { | function initializeIT() { | ||||
if (myspeed != 0) { | if (myspeed != 0) { | ||||
scrollwindow(); | scrollwindow(); | ||||
} | } | ||||
} | |||||
//滚动插件 | |||||
/* | |||||
(function($){ | |||||
$.fn.extend({ | |||||
Scroll:function(opt,callback){ | |||||
//参数初始化 | |||||
if(!opt) var opt={}; | |||||
var _this=this.eq(0).find("ul:first"); | |||||
var lineH=_this.find("li:first").height(), //获取行高 | |||||
line=opt.line?parseInt(opt.line,10):parseInt(this.height()/lineH,10), //每次滚动的行数,默认为一屏,即父容器高度 | |||||
speed=opt.speed?parseInt(opt.speed,10):500, //卷动速度,数值越大,速度越慢(毫秒) | |||||
timer=opt.timer?parseInt(opt.timer,10):3000; //滚动的时间间隔(毫秒) | |||||
if(line==0) line=1; | |||||
var upHeight=0-line*lineH; | |||||
//滚动函数 | |||||
scrollUp=function(){ | |||||
_this.animate({ | |||||
marginTop:upHeight | |||||
},speed,function(){ | |||||
for(i=1;i<=line;i++){ | |||||
_this.find("li:first").appendTo(_this); | |||||
} | |||||
_this.css({marginTop:0}); | |||||
}); | |||||
} | |||||
//鼠标事件绑定 | |||||
var timerID; | |||||
timerID=setInterval("scrollUp()",timer); | |||||
_this.mouseover(function(){ | |||||
clearInterval(timerID); | |||||
}).mouseout(function(){ | |||||
timerID=setInterval("scrollUp()",timer); | |||||
}); | |||||
} | |||||
}) | |||||
})(jQuery); | |||||
*/ | |||||
} |
@@ -20,4 +20,4 @@ function browserVersion(types) { | |||||
eval('BROWSER.' + i + '= ver'); | eval('BROWSER.' + i + '= ver'); | ||||
} | } | ||||
BROWSER.other = other; | BROWSER.other = other; | ||||
} | |||||
} |
@@ -6,10 +6,8 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
var ie = document.all != null; | var ie = document.all != null; | ||||
var moz = !ie && document.getElementById != null && document.layers == null; | var moz = !ie && document.getElementById != null && document.layers == null; | ||||
/* | /* | ||||
* Extends the event object with srcElement, cancelBubble, returnValue, | * Extends the event object with srcElement, cancelBubble, returnValue, | ||||
* fromElement and toElement | * fromElement and toElement | ||||
@@ -18,17 +16,14 @@ function extendEventObject() { | |||||
Event.prototype.__defineSetter__("returnValue", function (b) { | Event.prototype.__defineSetter__("returnValue", function (b) { | ||||
if (!b) this.preventDefault(); | if (!b) this.preventDefault(); | ||||
}); | }); | ||||
Event.prototype.__defineSetter__("cancelBubble", function (b) { | Event.prototype.__defineSetter__("cancelBubble", function (b) { | ||||
if (b) this.stopPropagation(); | if (b) this.stopPropagation(); | ||||
}); | }); | ||||
Event.prototype.__defineGetter__("srcElement", function () { | Event.prototype.__defineGetter__("srcElement", function () { | ||||
var node = this.target; | var node = this.target; | ||||
while (node.nodeType != 1) node = node.parentNode; | while (node.nodeType != 1) node = node.parentNode; | ||||
return node; | return node; | ||||
}); | }); | ||||
Event.prototype.__defineGetter__("fromElement", function () { | Event.prototype.__defineGetter__("fromElement", function () { | ||||
var node; | var node; | ||||
if (this.type == "mouseover") | if (this.type == "mouseover") | ||||
@@ -39,7 +34,6 @@ function extendEventObject() { | |||||
while (node.nodeType != 1) node = node.parentNode; | while (node.nodeType != 1) node = node.parentNode; | ||||
return node; | return node; | ||||
}); | }); | ||||
Event.prototype.__defineGetter__("toElement", function () { | Event.prototype.__defineGetter__("toElement", function () { | ||||
var node; | var node; | ||||
if (this.type == "mouseout") | if (this.type == "mouseout") | ||||
@@ -50,7 +44,6 @@ function extendEventObject() { | |||||
while (node.nodeType != 1) node = node.parentNode; | while (node.nodeType != 1) node = node.parentNode; | ||||
return node; | return node; | ||||
}); | }); | ||||
Event.prototype.__defineGetter__("offsetX", function () { | Event.prototype.__defineGetter__("offsetX", function () { | ||||
return this.layerX; | return this.layerX; | ||||
}); | }); | ||||
@@ -58,7 +51,6 @@ function extendEventObject() { | |||||
return this.layerY; | return this.layerY; | ||||
}); | }); | ||||
} | } | ||||
/* | /* | ||||
* Emulates element.attachEvent as well as detachEvent | * Emulates element.attachEvent as well as detachEvent | ||||
*/ | */ | ||||
@@ -72,7 +64,6 @@ function emulateAttachEvent() { | |||||
}; | }; | ||||
this.addEventListener(shortTypeName, fHandler._ieEmuEventHandler, false); | this.addEventListener(shortTypeName, fHandler._ieEmuEventHandler, false); | ||||
}; | }; | ||||
HTMLDocument.prototype.detachEvent = | HTMLDocument.prototype.detachEvent = | ||||
HTMLElement.prototype.detachEvent = function (sType, fHandler) { | HTMLElement.prototype.detachEvent = function (sType, fHandler) { | ||||
var shortTypeName = sType.replace(/on/, ""); | var shortTypeName = sType.replace(/on/, ""); | ||||
@@ -82,7 +73,6 @@ function emulateAttachEvent() { | |||||
this.removeEventListener(shortTypeName, fHandler, true); | this.removeEventListener(shortTypeName, fHandler, true); | ||||
}; | }; | ||||
} | } | ||||
/* | /* | ||||
* This function binds the event object passed along in an | * This function binds the event object passed along in an | ||||
* event to window.event | * event to window.event | ||||
@@ -94,12 +84,10 @@ function emulateEventHandlers(eventNames) { | |||||
}, true); // using capture | }, true); // using capture | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
* Simple emulation of document.all | * Simple emulation of document.all | ||||
* this one is far from complete. Be cautious | * this one is far from complete. Be cautious | ||||
*/ | */ | ||||
function emulateAllModel() { | function emulateAllModel() { | ||||
var allGetter = function () { | var allGetter = function () { | ||||
var a = this.getElementsByTagName("*"); | var a = this.getElementsByTagName("*"); | ||||
@@ -112,13 +100,11 @@ function emulateAllModel() { | |||||
HTMLDocument.prototype.__defineGetter__("all", allGetter); | HTMLDocument.prototype.__defineGetter__("all", allGetter); | ||||
HTMLElement.prototype.__defineGetter__("all", allGetter); | HTMLElement.prototype.__defineGetter__("all", allGetter); | ||||
} | } | ||||
function extendElementModel() { | function extendElementModel() { | ||||
HTMLElement.prototype.__defineGetter__("parentElement", function () { | HTMLElement.prototype.__defineGetter__("parentElement", function () { | ||||
if (this.parentNode == this.ownerDocument) return null; | if (this.parentNode == this.ownerDocument) return null; | ||||
return this.parentNode; | return this.parentNode; | ||||
}); | }); | ||||
HTMLElement.prototype.__defineGetter__("children", function () { | HTMLElement.prototype.__defineGetter__("children", function () { | ||||
var tmp = []; | var tmp = []; | ||||
var j = 0; | var j = 0; | ||||
@@ -138,28 +124,20 @@ function extendElementModel() { | |||||
} | } | ||||
return tmp; | return tmp; | ||||
}); | }); | ||||
HTMLElement.prototype.contains = function (oEl) { | HTMLElement.prototype.contains = function (oEl) { | ||||
if (oEl == this) return true; | if (oEl == this) return true; | ||||
if (oEl == null) return false; | if (oEl == null) return false; | ||||
return this.contains(oEl.parentNode); | return this.contains(oEl.parentNode); | ||||
}; | }; | ||||
} | } | ||||
/* | /* | ||||
document.defaultView.getComputedStyle(el1,<BR>null).getPropertyValue('top'); | document.defaultView.getComputedStyle(el1,<BR>null).getPropertyValue('top'); | ||||
*/ | */ | ||||
function emulateCurrentStyle(properties) { | function emulateCurrentStyle(properties) { | ||||
HTMLElement.prototype.__defineGetter__("currentStyle", function () { | HTMLElement.prototype.__defineGetter__("currentStyle", function () { | ||||
var cs = {}; | var cs = {}; | ||||
var el = this; | var el = this; | ||||
for (var i = 0; i < properties.length; i++) { | for (var i = 0; i < properties.length; i++) { | ||||
//cs.__defineGetter__(properties[i], function () { | |||||
// window.status = "i: " + i ; | |||||
// return document.defaultView.getComputedStyle(el, null).getPropertyValue(properties[i]); | |||||
//}); | |||||
cs.__defineGetter__(properties[i], encapsulateObjects(el, properties[i])); | cs.__defineGetter__(properties[i], encapsulateObjects(el, properties[i])); | ||||
} | } | ||||
return cs; | return cs; | ||||
@@ -171,9 +149,7 @@ function encapsulateObjects(el, sProperty) { | |||||
return document.defaultView.getComputedStyle(el, null).getPropertyValue(sProperty); | return document.defaultView.getComputedStyle(el, null).getPropertyValue(sProperty); | ||||
}; | }; | ||||
} | } | ||||
function emulateHTMLModel() { | function emulateHTMLModel() { | ||||
// This function is used to generate a html string for the text properties/methods | // This function is used to generate a html string for the text properties/methods | ||||
// It replaces '\n' with "<BR"> as well as fixes consecutive white spaces | // It replaces '\n' with "<BR"> as well as fixes consecutive white spaces | ||||
// It also repalaces some special characters | // It also repalaces some special characters | ||||
@@ -183,32 +159,27 @@ function emulateHTMLModel() { | |||||
s = s.replace(/\s\s/, " "); | s = s.replace(/\s\s/, " "); | ||||
return s.replace(/\s/g, " "); | return s.replace(/\s/g, " "); | ||||
} | } | ||||
HTMLElement.prototype.insertAdjacentHTML = function (sWhere, sHTML) { | HTMLElement.prototype.insertAdjacentHTML = function (sWhere, sHTML) { | ||||
var df; // : DocumentFragment | var df; // : DocumentFragment | ||||
var r = this.ownerDocument.createRange(); | var r = this.ownerDocument.createRange(); | ||||
switch (String(sWhere).toLowerCase()) { | switch (String(sWhere).toLowerCase()) { | ||||
case "beforebegin": | case "beforebegin": | ||||
r.setStartBefore(this); | r.setStartBefore(this); | ||||
df = r.createContextualFragment(sHTML); | df = r.createContextualFragment(sHTML); | ||||
this.parentNode.insertBefore(df, this); | this.parentNode.insertBefore(df, this); | ||||
break; | break; | ||||
case "afterbegin": | case "afterbegin": | ||||
r.selectNodeContents(this); | r.selectNodeContents(this); | ||||
r.collapse(true); | r.collapse(true); | ||||
df = r.createContextualFragment(sHTML); | df = r.createContextualFragment(sHTML); | ||||
this.insertBefore(df, this.firstChild); | this.insertBefore(df, this.firstChild); | ||||
break; | break; | ||||
case "beforeend": | case "beforeend": | ||||
r.selectNodeContents(this); | r.selectNodeContents(this); | ||||
r.collapse(false); | r.collapse(false); | ||||
df = r.createContextualFragment(sHTML); | df = r.createContextualFragment(sHTML); | ||||
this.appendChild(df); | this.appendChild(df); | ||||
break; | break; | ||||
case "afterend": | case "afterend": | ||||
r.setStartAfter(this); | r.setStartAfter(this); | ||||
df = r.createContextualFragment(sHTML); | df = r.createContextualFragment(sHTML); | ||||
@@ -216,7 +187,6 @@ function emulateHTMLModel() { | |||||
break; | break; | ||||
} | } | ||||
}; | }; | ||||
HTMLElement.prototype.__defineSetter__("outerHTML", function (sHTML) { | HTMLElement.prototype.__defineSetter__("outerHTML", function (sHTML) { | ||||
var r = this.ownerDocument.createRange(); | var r = this.ownerDocument.createRange(); | ||||
r.setStartBefore(this); | r.setStartBefore(this); | ||||
@@ -225,7 +195,6 @@ function emulateHTMLModel() { | |||||
return sHTML; | return sHTML; | ||||
}); | }); | ||||
HTMLElement.prototype.__defineGetter__("canHaveChildren", function () { | HTMLElement.prototype.__defineGetter__("canHaveChildren", function () { | ||||
switch (this.tagName) { | switch (this.tagName) { | ||||
case "AREA": | case "AREA": | ||||
@@ -245,7 +214,6 @@ function emulateHTMLModel() { | |||||
} | } | ||||
return true; | return true; | ||||
}); | }); | ||||
HTMLElement.prototype.__defineGetter__("outerHTML", function () { | HTMLElement.prototype.__defineGetter__("outerHTML", function () { | ||||
var attr, attrs = this.attributes; | var attr, attrs = this.attributes; | ||||
var str = "<" + this.tagName; | var str = "<" + this.tagName; | ||||
@@ -259,28 +227,22 @@ function emulateHTMLModel() { | |||||
return str + ">" + this.innerHTML + "</" + this.tagName + ">"; | return str + ">" + this.innerHTML + "</" + this.tagName + ">"; | ||||
}); | }); | ||||
HTMLElement.prototype.__defineSetter__("innerText", function (sText) { | HTMLElement.prototype.__defineSetter__("innerText", function (sText) { | ||||
this.innerHTML = convertTextToHTML(sText); | this.innerHTML = convertTextToHTML(sText); | ||||
return sText; | return sText; | ||||
}); | }); | ||||
var tmpGet; | var tmpGet; | ||||
HTMLElement.prototype.__defineGetter__("innerText", tmpGet = function () { | HTMLElement.prototype.__defineGetter__("innerText", tmpGet = function () { | ||||
var r = this.ownerDocument.createRange(); | var r = this.ownerDocument.createRange(); | ||||
r.selectNodeContents(this); | r.selectNodeContents(this); | ||||
return r.toString(); | return r.toString(); | ||||
}); | }); | ||||
HTMLElement.prototype.__defineSetter__("outerText", function (sText) { | HTMLElement.prototype.__defineSetter__("outerText", function (sText) { | ||||
this.outerHTML = convertTextToHTML(sText); | this.outerHTML = convertTextToHTML(sText); | ||||
return sText; | return sText; | ||||
}); | }); | ||||
HTMLElement.prototype.__defineGetter__("outerText", tmpGet); | HTMLElement.prototype.__defineGetter__("outerText", tmpGet); | ||||
HTMLElement.prototype.insertAdjacentText = function (sWhere, sText) { | HTMLElement.prototype.insertAdjacentText = function (sWhere, sText) { | ||||
this.insertAdjacentHTML(sWhere, convertTextToHTML(sText)); | this.insertAdjacentHTML(sWhere, convertTextToHTML(sText)); | ||||
}; | }; | ||||
} | } |
@@ -7,7 +7,6 @@ function selAll() | |||||
else celements[i].checked = false; | else celements[i].checked = false; | ||||
} | } | ||||
} | } | ||||
function noselAll() | function noselAll() | ||||
{ | { | ||||
var celements = document.getElementsByName('aids[]'); | var celements = document.getElementsByName('aids[]'); | ||||
@@ -19,58 +18,52 @@ function noselAll() | |||||
} | } | ||||
} | } | ||||
} | } | ||||
function delkey() | function delkey() | ||||
{ | |||||
if(window.confirm("您确实要删除选定的关键字吗")) | |||||
{ | { | ||||
if(window.confirm("您确实要删除选定的关键字么?")) | |||||
{ | |||||
document.form3.dopost.value = 'del'; | |||||
document.form3.submit(); | |||||
} | |||||
document.form3.dopost.value = 'del'; | |||||
document.form3.submit(); | |||||
} | } | ||||
} | |||||
function diskey() | function diskey() | ||||
{ | |||||
if(window.confirm("您确实要禁用选定的关键字吗")) | |||||
{ | { | ||||
if(window.confirm("您确实要禁用选定的关键字么?")) | |||||
{ | |||||
document.form3.dopost.value = 'dis'; | |||||
document.form3.submit(); | |||||
} | |||||
document.form3.dopost.value = 'dis'; | |||||
document.form3.submit(); | |||||
} | } | ||||
} | |||||
function enakey() | function enakey() | ||||
{ | |||||
if(window.confirm("您确实要启用选定的关键字吗")) | |||||
{ | { | ||||
if(window.confirm("您确实要启用选定的关键字么?")) | |||||
{ | |||||
document.form3.dopost.value = 'ena'; | |||||
document.form3.submit(); | |||||
} | |||||
document.form3.dopost.value = 'ena'; | |||||
document.form3.submit(); | |||||
} | } | ||||
} | |||||
function urlkey() | function urlkey() | ||||
{ | |||||
if(window.confirm("您确实要更新选定的关键字的网址吗")) | |||||
{ | { | ||||
if(window.confirm("您确实要更新选定的关键字的网址么?")) | |||||
{ | |||||
document.form3.dopost.value = 'url'; | |||||
document.form3.submit(); | |||||
} | |||||
document.form3.dopost.value = 'url'; | |||||
document.form3.submit(); | |||||
} | } | ||||
} | |||||
function rankey() | function rankey() | ||||
{ | |||||
if(window.confirm("您确实要改变选定的关键字的频率吗")) | |||||
{ | { | ||||
if(window.confirm("您确实要改变选定的关键字的频率么?")) | |||||
{ | |||||
document.form3.dopost.value = 'ran'; | |||||
document.form3.submit(); | |||||
} | |||||
document.form3.dopost.value = 'ran'; | |||||
document.form3.submit(); | |||||
} | } | ||||
// 批量删除搜多关键字 | |||||
} | |||||
//批量删除搜多关键字 | |||||
function delall() | function delall() | ||||
{ | |||||
if(window.confirm("您确实要删除选定的关键字吗")) | |||||
{ | { | ||||
if(window.confirm("您确实要删除选定的关键字么?")) | |||||
{ | |||||
document.form3.dopost.value = 'delall'; | |||||
document.form3.submit(); | |||||
} | |||||
document.form3.dopost.value = 'delall'; | |||||
document.form3.submit(); | |||||
} | } | ||||
} |
@@ -1,4 +1,3 @@ | |||||
function showHide(objname) | function showHide(objname) | ||||
{ | { | ||||
//只对主菜单设置cookie | //只对主菜单设置cookie | ||||
@@ -12,7 +11,7 @@ function showHide(objname) | |||||
obj.style.display = 'block'; | obj.style.display = 'block'; | ||||
return true; | return true; | ||||
} | } | ||||
//正常设置cookie | |||||
//正常设置cookie | |||||
var ckstr = getCookie('menuitems'); | var ckstr = getCookie('menuitems'); | ||||
var ckstrs = null; | var ckstrs = null; | ||||
var okstr =''; | var okstr =''; | ||||
@@ -75,14 +74,9 @@ function setCookie(c_name,value,expiredays) | |||||
var totalitem = 12; | var totalitem = 12; | ||||
function CheckOpenMenu() | function CheckOpenMenu() | ||||
{ | { | ||||
//setCookie('menuitems',''); | |||||
var ckstr = getCookie('menuitems'); | var ckstr = getCookie('menuitems'); | ||||
var curitem = ''; | var curitem = ''; | ||||
var curobj = null; | var curobj = null; | ||||
//cross_obj = document.getElementById("staticbuttons"); | |||||
//setInterval("initializeIT()",20); | |||||
if(ckstr==null) | if(ckstr==null) | ||||
{ | { | ||||
ckstr='1_1,2_1,3_1'; | ckstr='1_1,2_1,3_1'; | ||||
@@ -103,7 +97,6 @@ function CheckOpenMenu() | |||||
} | } | ||||
} | } | ||||
} | } | ||||
var curitem = 1; | var curitem = 1; | ||||
function ShowMainMenu(n) | function ShowMainMenu(n) | ||||
{ | { | ||||
@@ -132,6 +125,4 @@ function ShowMainMenu(n) | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
// bindClick(); | |||||
} | |||||
} |
@@ -113,7 +113,6 @@ function getCheckboxItem() | |||||
} | } | ||||
return allSel; | return allSel; | ||||
} | } | ||||
//获得选中其中一个的id | //获得选中其中一个的id | ||||
function getOneItem() | function getOneItem() | ||||
{ | { | ||||
@@ -129,7 +128,6 @@ function getOneItem() | |||||
} | } | ||||
return allSel; | return allSel; | ||||
} | } | ||||
function selAll() | function selAll() | ||||
{ | { | ||||
if (typeof document.form2.arcID.length === "undefined") { | if (typeof document.form2.arcID.length === "undefined") { | ||||
@@ -6,90 +6,65 @@ var nForm = null; | |||||
var nFrame = null; | var nFrame = null; | ||||
var picnameObj = null; | var picnameObj = null; | ||||
var vImg = null; | var vImg = null; | ||||
function $Nav() { | function $Nav() { | ||||
if (window.navigator.userAgent.indexOf("MSIE") >= 1) return 'IE'; | if (window.navigator.userAgent.indexOf("MSIE") >= 1) return 'IE'; | ||||
else if (window.navigator.userAgent.indexOf("Firefox") >= 1) return 'FF'; | else if (window.navigator.userAgent.indexOf("Firefox") >= 1) return 'FF'; | ||||
else return "OT"; | else return "OT"; | ||||
} | } | ||||
function $Obj(objname) { | function $Obj(objname) { | ||||
return document.getElementById(objname); | return document.getElementById(objname); | ||||
} | } | ||||
//旧的颜色选择框(已经过期) | |||||
/* | |||||
function ShowColor() | |||||
{ | |||||
var fcolor=showModalDialog("../../static/web/img/color.htm?ok",false,"dialogWidth:106px;dialogHeight:110px;status:0;dialogTop:"+(+120)+";dialogLeft:"+(+120)); | |||||
if(fcolor!=null && fcolor!="undefined") document.form1.color.value = fcolor; | |||||
} | |||||
*/ | |||||
function ColorSel(c, oname) { | function ColorSel(c, oname) { | ||||
var tobj = $Obj(oname); | var tobj = $Obj(oname); | ||||
if (!tobj) tobj = eval('document.form1.' + oname); | if (!tobj) tobj = eval('document.form1.' + oname); | ||||
if (!tobj) { | if (!tobj) { | ||||
$Obj('colordlg').style.display = 'none'; | $Obj('colordlg').style.display = 'none'; | ||||
return false; | return false; | ||||
} | |||||
else { | |||||
} else { | |||||
tobj.value = c; | tobj.value = c; | ||||
$Obj('colordlg').style.display = 'none'; | $Obj('colordlg').style.display = 'none'; | ||||
return true; | return true; | ||||
} | } | ||||
} | } | ||||
function ShowColor(e, o) { | function ShowColor(e, o) { | ||||
LoadNewDiv(e, '../../static/web/img/colornew.htm', 'colordlg'); | LoadNewDiv(e, '../../static/web/img/colornew.htm', 'colordlg'); | ||||
} | } | ||||
function ShowHide(objname) { | function ShowHide(objname) { | ||||
var obj = $Obj(objname); | var obj = $Obj(objname); | ||||
if (obj.style.display != "none") obj.style.display = "none"; | if (obj.style.display != "none") obj.style.display = "none"; | ||||
else obj.style.display = "inline-block"; | else obj.style.display = "inline-block"; | ||||
} | } | ||||
function ShowHideT(objname) { | function ShowHideT(objname) { | ||||
var obj = $Obj(objname); | var obj = $Obj(objname); | ||||
if (obj.style.display != "none") obj.style.display = "none"; | if (obj.style.display != "none") obj.style.display = "none"; | ||||
else obj.style.display = ($Nav() == "IE" ? "inline-block" : "table"); | else obj.style.display = ($Nav() == "IE" ? "inline-block" : "table"); | ||||
} | } | ||||
function ShowObj(objname) { | function ShowObj(objname) { | ||||
var obj = $Obj(objname); | var obj = $Obj(objname); | ||||
if (obj == null) return false; | if (obj == null) return false; | ||||
obj.style.display = ($Nav() == "IE" ? "inline-block" : "table"); | obj.style.display = ($Nav() == "IE" ? "inline-block" : "table"); | ||||
} | } | ||||
function ShowObjRow(objname) { | function ShowObjRow(objname) { | ||||
var obj = $Obj(objname); | var obj = $Obj(objname); | ||||
obj.style.display = ($Nav() == "IE" ? "inline-block" : "table-row"); | obj.style.display = ($Nav() == "IE" ? "inline-block" : "table-row"); | ||||
} | } | ||||
function AddTypeid2() { | function AddTypeid2() { | ||||
ShowObjRow('typeid2tr'); | ShowObjRow('typeid2tr'); | ||||
//$Obj('typeid2ct').innerHTML = $Obj('typeidct').innerHTML.replace('typeid','typeid2'); | |||||
} | } | ||||
function HideObj(objname) { | function HideObj(objname) { | ||||
var obj = $Obj(objname); | var obj = $Obj(objname); | ||||
if (obj == null) return false; | if (obj == null) return false; | ||||
obj.style.display = "none"; | obj.style.display = "none"; | ||||
} | } | ||||
function ShowItem1() { | function ShowItem1() { | ||||
ShowObj('needset'); ShowObj('head1'); HideObj('head2'); HideObj('adset'); ShowObj('votehead'); | ShowObj('needset'); ShowObj('head1'); HideObj('head2'); HideObj('adset'); ShowObj('votehead'); | ||||
} | } | ||||
function ShowItem2() { | function ShowItem2() { | ||||
ShowObj('head2'); ShowObj('adset'); HideObj('voteset'); HideObj('head1'); HideObj('needset'); HideObj('votehead'); | ShowObj('head2'); ShowObj('adset'); HideObj('voteset'); HideObj('head1'); HideObj('needset'); HideObj('votehead'); | ||||
} | } | ||||
function SeePic(img, f) { | function SeePic(img, f) { | ||||
if (f.value != '') img.src = f.value; | if (f.value != '') img.src = f.value; | ||||
} | } | ||||
function SeePicNew(f, imgdid, frname, hpos, acname) { | function SeePicNew(f, imgdid, frname, hpos, acname) { | ||||
var newobj = null; | var newobj = null; | ||||
if (f.value == '') return; | if (f.value == '') return; | ||||
@@ -104,7 +79,6 @@ function SeePicNew(f, imgdid, frname, hpos, acname) { | |||||
nForm.target = frname; | nForm.target = frname; | ||||
nForm.dopost.value = 'uploadLitpic'; | nForm.dopost.value = 'uploadLitpic'; | ||||
nForm.submit(); | nForm.submit(); | ||||
picnameObj.value = ''; | picnameObj.value = ''; | ||||
newobj = $Obj('uploadwait'); | newobj = $Obj('uploadwait'); | ||||
if (!newobj) { | if (!newobj) { | ||||
@@ -126,29 +100,22 @@ function SeePicNew(f, imgdid, frname, hpos, acname) { | |||||
nForm.dopost.value = 'save'; | nForm.dopost.value = 'save'; | ||||
nForm.target = ''; | nForm.target = ''; | ||||
nForm.litpic.disabled = true; | nForm.litpic.disabled = true; | ||||
//nForm.litpic = null; | |||||
//if(nForm.attachEvent) nForm.attachEvent("onsubmit", checkSubmit); | |||||
//else nForm.addEventListener("submit", checkSubmit, true); | |||||
} | } | ||||
function SelectFlash() { | function SelectFlash() { | ||||
if ($Nav() == 'IE') { var posLeft = window.event.clientX - 300; var posTop = window.event.clientY; } | if ($Nav() == 'IE') { var posLeft = window.event.clientX - 300; var posTop = window.event.clientY; } | ||||
else { var posLeft = 100; var posTop = 100; } | else { var posLeft = 100; var posTop = 100; } | ||||
window.open("./dialog/select_media.php?f=form1.flashurl", "popUpFlashWin", "scrollbars=yes,resizable=yes,statebar=no,width=500,height=350,left=" + posLeft + ", top=" + posTop); | window.open("./dialog/select_media.php?f=form1.flashurl", "popUpFlashWin", "scrollbars=yes,resizable=yes,statebar=no,width=500,height=350,left=" + posLeft + ", top=" + posTop); | ||||
} | } | ||||
function SelectMedia(fname) { | function SelectMedia(fname) { | ||||
if ($Nav() == 'IE') { var posLeft = window.event.clientX - 200; var posTop = window.event.clientY; } | if ($Nav() == 'IE') { var posLeft = window.event.clientX - 200; var posTop = window.event.clientY; } | ||||
else { var posLeft = 100; var posTop = 100; } | else { var posLeft = 100; var posTop = 100; } | ||||
window.open("./dialog/select_media.php?f=" + fname, "popUpFlashWin", "scrollbars=yes,resizable=yes,statebar=no,width=500,height=350,left=" + posLeft + ", top=" + posTop); | window.open("./dialog/select_media.php?f=" + fname, "popUpFlashWin", "scrollbars=yes,resizable=yes,statebar=no,width=500,height=350,left=" + posLeft + ", top=" + posTop); | ||||
} | } | ||||
function SelectSoft(fname) { | function SelectSoft(fname) { | ||||
if ($Nav() == 'IE') { var posLeft = window.event.clientX - 200; var posTop = window.event.clientY - 50; } | if ($Nav() == 'IE') { var posLeft = window.event.clientX - 200; var posTop = window.event.clientY - 50; } | ||||
else { var posLeft = 100; var posTop = 100; } | else { var posLeft = 100; var posTop = 100; } | ||||
window.open("./dialog/select_soft.php?f=" + fname, "popUpImagesWin", "scrollbars=yes,resizable=yes,statebar=no,width=600,height=400,left=" + posLeft + ", top=" + posTop); | window.open("./dialog/select_soft.php?f=" + fname, "popUpImagesWin", "scrollbars=yes,resizable=yes,statebar=no,width=600,height=400,left=" + posLeft + ", top=" + posTop); | ||||
} | } | ||||
function SelectImage(fname, stype, imgsel) { | function SelectImage(fname, stype, imgsel) { | ||||
if ($Nav() == 'IE') { var posLeft = window.event.clientX - 100; var posTop = window.event.clientY; } | if ($Nav() == 'IE') { var posLeft = window.event.clientX - 100; var posTop = window.event.clientY; } | ||||
else { var posLeft = 100; var posTop = 100; } | else { var posLeft = 100; var posTop = 100; } | ||||
@@ -157,7 +124,6 @@ function SelectImage(fname, stype, imgsel) { | |||||
if (!stype) stype = ''; | if (!stype) stype = ''; | ||||
window.open("./dialog/select_images.php?f=" + fname + "&noeditor=yes&imgstick=" + stype + imgsel, "popUpImagesWin", "scrollbars=yes,resizable=yes,statebar=no,width=650,height=400,left=" + posLeft + ", top=" + posTop); | window.open("./dialog/select_images.php?f=" + fname + "&noeditor=yes&imgstick=" + stype + imgsel, "popUpImagesWin", "scrollbars=yes,resizable=yes,statebar=no,width=650,height=400,left=" + posLeft + ", top=" + posTop); | ||||
} | } | ||||
function imageCut(fname) { | function imageCut(fname) { | ||||
if ($Nav() == 'IE') { var posLeft = window.event.clientX - 100; var posTop = window.event.clientY; } | if ($Nav() == 'IE') { var posLeft = window.event.clientX - 100; var posTop = window.event.clientY; } | ||||
else { var posLeft = 100; var posTop = 100; } | else { var posLeft = 100; var posTop = 100; } | ||||
@@ -169,7 +135,6 @@ function imageCut(fname) { | |||||
} | } | ||||
window.open("imagecut.php?f=" + fname + "&file=" + file, "popUpImagesWin", "scrollbars=yes,resizable=yes,statebar=no,width=800,height=600,left=" + posLeft + ", top=" + posTop); | window.open("imagecut.php?f=" + fname + "&file=" + file, "popUpImagesWin", "scrollbars=yes,resizable=yes,statebar=no,width=800,height=600,left=" + posLeft + ", top=" + posTop); | ||||
} | } | ||||
function SelectImageN(fname, stype, vname) { | function SelectImageN(fname, stype, vname) { | ||||
if ($Nav() == 'IE') { var posLeft = window.event.clientX - 100; var posTop = window.event.clientY; } | if ($Nav() == 'IE') { var posLeft = window.event.clientX - 100; var posTop = window.event.clientY; } | ||||
else { var posLeft = 100; var posTop = 100; } | else { var posLeft = 100; var posTop = 100; } | ||||
@@ -177,13 +142,11 @@ function SelectImageN(fname, stype, vname) { | |||||
if (!stype) stype = ''; | if (!stype) stype = ''; | ||||
window.open("./dialog/select_images.php?f=" + fname + "&imgstick=" + stype + "&v=" + vname, "popUpImagesWin", "scrollbars=yes,resizable=yes,statebar=no,width=600,height=400,left=" + posLeft + ", top=" + posTop); | window.open("./dialog/select_images.php?f=" + fname + "&imgstick=" + stype + "&v=" + vname, "popUpImagesWin", "scrollbars=yes,resizable=yes,statebar=no,width=600,height=400,left=" + posLeft + ", top=" + posTop); | ||||
} | } | ||||
function SelectKeywords(f) { | function SelectKeywords(f) { | ||||
if ($Nav() == 'IE') { var posLeft = window.event.clientX - 350; var posTop = window.event.clientY - 200; } | if ($Nav() == 'IE') { var posLeft = window.event.clientX - 350; var posTop = window.event.clientY - 200; } | ||||
else { var posLeft = 100; var posTop = 100; } | else { var posLeft = 100; var posTop = 100; } | ||||
window.open("article_keywords_select.php?f=" + f, "popUpkwWin", "scrollbars=yes,resizable=yes,statebar=no,width=600,height=450,left=" + posLeft + ", top=" + posTop); | window.open("article_keywords_select.php?f=" + f, "popUpkwWin", "scrollbars=yes,resizable=yes,statebar=no,width=600,height=450,left=" + posLeft + ", top=" + posTop); | ||||
} | } | ||||
function InitPage() { | function InitPage() { | ||||
var selsource = $Obj('selsource'); | var selsource = $Obj('selsource'); | ||||
var selwriter = $Obj('selwriter'); | var selwriter = $Obj('selwriter'); | ||||
@@ -193,30 +156,25 @@ function InitPage() { | |||||
if (selwriter) { selwriter.onmousedown = function (e) { SelectWriter(e); } } | if (selwriter) { selwriter.onmousedown = function (e) { SelectWriter(e); } } | ||||
if (titlechange) { titlechange.onchange = function (e) { TestHasTitle(e); } } | if (titlechange) { titlechange.onchange = function (e) { TestHasTitle(e); } } | ||||
} | } | ||||
function OpenMyWin(surl) { | function OpenMyWin(surl) { | ||||
window.open(surl, "popUpMyWin", "scrollbars=yes,resizable=yes,statebar=no,width=500,height=350,left=200, top=100"); | window.open(surl, "popUpMyWin", "scrollbars=yes,resizable=yes,statebar=no,width=500,height=350,left=200, top=100"); | ||||
} | } | ||||
function OpenMyWinCoOne(surl) { | function OpenMyWinCoOne(surl) { | ||||
window.open(surl, "popUpMyWin2", "scrollbars=yes,resizable=yes,statebar=no,width=800,height=450,left=100,top=50"); | window.open(surl, "popUpMyWin2", "scrollbars=yes,resizable=yes,statebar=no,width=800,height=450,left=100,top=50"); | ||||
} | } | ||||
function PutSource(str) { | function PutSource(str) { | ||||
var osource = $Obj('source'); | var osource = $Obj('source'); | ||||
if (osource) osource.value = str; | if (osource) osource.value = str; | ||||
$Obj('mysource').style.display = 'none'; | $Obj('mysource').style.display = 'none'; | ||||
ChangeFullDiv('hide'); | ChangeFullDiv('hide'); | ||||
} | } | ||||
function PutWriter(str) { | function PutWriter(str) { | ||||
var owriter = $Obj('writer'); | var owriter = $Obj('writer'); | ||||
if (owriter) owriter.value = str; | if (owriter) owriter.value = str; | ||||
$Obj('mywriter').style.display = 'none'; | $Obj('mywriter').style.display = 'none'; | ||||
ChangeFullDiv('hide'); | ChangeFullDiv('hide'); | ||||
} | } | ||||
// 增加选择投票内容 | |||||
//增加选择投票内容 | |||||
function PutVote(str) { | function PutVote(str) { | ||||
var ovote = $Obj('voteid'); | var ovote = $Obj('voteid'); | ||||
if (ovote) { | if (ovote) { | ||||
@@ -228,14 +186,12 @@ function PutVote(str) { | |||||
} | } | ||||
} | } | ||||
function ClearDivCt(objname) { | function ClearDivCt(objname) { | ||||
if (!$Obj(objname)) return; | if (!$Obj(objname)) return; | ||||
$Obj(objname).innerHTML = ''; | $Obj(objname).innerHTML = ''; | ||||
$Obj(objname).style.display = 'none'; | $Obj(objname).style.display = 'none'; | ||||
ChangeFullDiv("hide"); | ChangeFullDiv("hide"); | ||||
} | } | ||||
function ChangeFullDiv(showhide, screenheigt) { | function ChangeFullDiv(showhide, screenheigt) { | ||||
var newobj = $Obj('fullpagediv'); | var newobj = $Obj('fullpagediv'); | ||||
if (showhide == 'show') { | if (showhide == 'show') { | ||||
@@ -246,26 +202,19 @@ function ChangeFullDiv(showhide, screenheigt) { | |||||
newobj.className = 'fullpagediv'; | newobj.className = 'fullpagediv'; | ||||
newobj.style.height = document.body.clientHeight + 50 + 'px'; | newobj.style.height = document.body.clientHeight + 50 + 'px'; | ||||
document.body.appendChild(newobj); | document.body.appendChild(newobj); | ||||
} | |||||
else { | |||||
} else { | |||||
newobj.style.display = 'block'; | newobj.style.display = 'block'; | ||||
} | } | ||||
} | |||||
else { | |||||
} else { | |||||
if (newobj) newobj.style.display = 'none'; | if (newobj) newobj.style.display = 'none'; | ||||
} | } | ||||
} | } | ||||
function SelectSource(e) { | function SelectSource(e) { | ||||
LoadNewDiv(e, 'article_select_sw.php?t=source&k=8&rnd=' + Math.random(), 'mysource'); | LoadNewDiv(e, 'article_select_sw.php?t=source&k=8&rnd=' + Math.random(), 'mysource'); | ||||
//ChangeFullDiv('show'); | |||||
} | } | ||||
function SelectWriter(e) { | function SelectWriter(e) { | ||||
LoadNewDiv(e, 'article_select_sw.php?t=writer&k=8&rnd=' + Math.random(), 'mywriter'); | LoadNewDiv(e, 'article_select_sw.php?t=writer&k=8&rnd=' + Math.random(), 'mywriter'); | ||||
//ChangeFullDiv('show'); | |||||
} | } | ||||
function LoadNewDiv(e, surl, oname) { | function LoadNewDiv(e, surl, oname) { | ||||
var pxStr = ''; | var pxStr = ''; | ||||
if ($Nav() == 'IE') { | if ($Nav() == 'IE') { | ||||
@@ -275,9 +224,7 @@ function LoadNewDiv(e, surl, oname) { | |||||
var scrollTop = document.documentElement.scrollTop || window.pageYOffset; | var scrollTop = document.documentElement.scrollTop || window.pageYOffset; | ||||
if (typeof (scrollTop) == 'undefined') scrollTop = document.body.scrollTop; | if (typeof (scrollTop) == 'undefined') scrollTop = document.body.scrollTop; | ||||
posTop += scrollTop; | posTop += scrollTop; | ||||
} | |||||
else { | |||||
} else { | |||||
var posLeft = e.pageX - 20; | var posLeft = e.pageX - 20; | ||||
var posTop = e.pageY - 30; | var posTop = e.pageY - 30; | ||||
pxStr = 'px'; | pxStr = 'px'; | ||||
@@ -293,19 +240,16 @@ function LoadNewDiv(e, surl, oname) { | |||||
newobj.style.top = posTop + pxStr; | newobj.style.top = posTop + pxStr; | ||||
newobj.style.left = posLeft + pxStr; | newobj.style.left = posLeft + pxStr; | ||||
document.body.appendChild(newobj); | document.body.appendChild(newobj); | ||||
} | |||||
else { | |||||
} else { | |||||
newobj.style.display = "block"; | newobj.style.display = "block"; | ||||
} | } | ||||
if (newobj.innerHTML.length < 10) { | if (newobj.innerHTML.length < 10) { | ||||
fetch(surl).then(resp=>resp.text()).then((d)=>{newobj.innerHTML = d}); | fetch(surl).then(resp=>resp.text()).then((d)=>{newobj.innerHTML = d}); | ||||
} | } | ||||
} | } | ||||
function TestHasTitle(e) { | function TestHasTitle(e) { | ||||
LoadNewDiv2(e, 'article_test_title.php?t=' + $Obj('title').value, 'mytitle', "dlgTesttitle"); | LoadNewDiv2(e, 'article_test_title.php?t=' + $Obj('title').value, 'mytitle', "dlgTesttitle"); | ||||
} | } | ||||
function LoadNewDiv2(e, surl, oname, dlgcls) { | function LoadNewDiv2(e, surl, oname, dlgcls) { | ||||
var posLeft = 300; | var posLeft = 300; | ||||
var posTop = 50; | var posTop = 50; | ||||
@@ -329,7 +273,6 @@ function LoadNewDiv2(e, surl, oname, dlgcls) { | |||||
jQuery(newobj).css('top', '50px').css('left', '300px'); | jQuery(newobj).css('top', '50px').css('left', '300px'); | ||||
DedeXHTTP = null; | DedeXHTTP = null; | ||||
} | } | ||||
function ShowUrlTr() { | function ShowUrlTr() { | ||||
var jumpTest = $Obj('flagsj'); | var jumpTest = $Obj('flagsj'); | ||||
var jtr = $Obj('redirecturltr'); | var jtr = $Obj('redirecturltr'); | ||||
@@ -340,31 +283,26 @@ function ShowUrlTr() { | |||||
jtr.style.display = "none"; | jtr.style.display = "none"; | ||||
} | } | ||||
} | } | ||||
function ShowUrlTrEdit() { | function ShowUrlTrEdit() { | ||||
ShowUrlTr(); | ShowUrlTr(); | ||||
var jumpTest = $Obj('isjump'); | var jumpTest = $Obj('isjump'); | ||||
var rurl = $Obj('redirecturl'); | var rurl = $Obj('redirecturl'); | ||||
if (!jumpTest.checked) rurl.value = ""; | if (!jumpTest.checked) rurl.value = ""; | ||||
} | } | ||||
function CkRemote() { | function CkRemote() { | ||||
document.getElementById('picname').value = ''; | document.getElementById('picname').value = ''; | ||||
} | } | ||||
//载入指定宽高的AJAX窗体 | //载入指定宽高的AJAX窗体 | ||||
function LoadQuickDiv(e, surl, oname, w, h) { | function LoadQuickDiv(e, surl, oname, w, h) { | ||||
if ($Nav() == 'IE') { | if ($Nav() == 'IE') { | ||||
if (window.event) { | if (window.event) { | ||||
var posLeft = window.event.clientX - 20; | var posLeft = window.event.clientX - 20; | ||||
var posTop = window.event.clientY - 30; | var posTop = window.event.clientY - 30; | ||||
} | |||||
else { | |||||
} else { | |||||
var posLeft = e.clientX - 20; | var posLeft = e.clientX - 20; | ||||
var posTop = e.clientY + 30; | var posTop = e.clientY + 30; | ||||
} | } | ||||
} | |||||
else { | |||||
} else { | |||||
var posLeft = e.pageX - 20; | var posLeft = e.pageX - 20; | ||||
var posTop = e.pageY - 30; | var posTop = e.pageY - 30; | ||||
} | } | ||||
@@ -396,11 +334,9 @@ function LoadQuickDiv(e, surl, oname, w, h) { | |||||
}); | }); | ||||
fixupPos = false; | fixupPos = false; | ||||
} | } | ||||
function MyGetScrollTop() { | function MyGetScrollTop() { | ||||
return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; | return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; | ||||
} | } | ||||
//通用事件获取接口 | //通用事件获取接口 | ||||
function getEvent() { | function getEvent() { | ||||
if ($Nav() == 'IE') return window.event; | if ($Nav() == 'IE') return window.event; | ||||
@@ -417,7 +353,6 @@ function getEvent() { | |||||
} | } | ||||
return null; | return null; | ||||
} | } | ||||
//模拟ondrop事件相关代码 | //模拟ondrop事件相关代码 | ||||
/*---------------------------- | /*---------------------------- | ||||
leftLeaning = 300; | leftLeaning = 300; | ||||
@@ -429,11 +364,9 @@ newobj.onmousedown = DropStop; | |||||
function DropStart() { | function DropStart() { | ||||
this.style.cursor = 'move'; | this.style.cursor = 'move'; | ||||
} | } | ||||
function DropStop() { | function DropStop() { | ||||
this.style.cursor = 'default'; | this.style.cursor = 'default'; | ||||
} | } | ||||
function DropMove() { | function DropMove() { | ||||
if (this.style.cursor != 'move') return; | if (this.style.cursor != 'move') return; | ||||
var event = getEvent(); | var event = getEvent(); | ||||
@@ -441,15 +374,13 @@ function DropMove() { | |||||
var posLeft = event.clientX - 20; | var posLeft = event.clientX - 20; | ||||
var posTop = event.clientY - 30; | var posTop = event.clientY - 30; | ||||
posTop += document.body.scrollTop; | posTop += document.body.scrollTop; | ||||
} | |||||
else { | |||||
} else { | |||||
var posLeft = event.pageX - 20; | var posLeft = event.pageX - 20; | ||||
var posTop = event.pageY - 30; | var posTop = event.pageY - 30; | ||||
} | } | ||||
this.style.top = posTop; | this.style.top = posTop; | ||||
this.style.left = posLeft - leftLeaning; | this.style.left = posLeft - leftLeaning; | ||||
} | } | ||||
//对指定的元素绑定move事件 | //对指定的元素绑定move事件 | ||||
/*----------------------------- | /*----------------------------- | ||||
onmousemove="DropMoveHand('divname', 225);" | onmousemove="DropMoveHand('divname', 225);" | ||||
@@ -471,15 +402,13 @@ function DropMoveHand(objid, mleftLeaning) { | |||||
var posLeft = event.clientX - 20; | var posLeft = event.clientX - 20; | ||||
var posTop = event.clientY - 20; | var posTop = event.clientY - 20; | ||||
posTop += window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop; | posTop += window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop; | ||||
} | |||||
else { | |||||
} else { | |||||
var posLeft = event.pageX - 20; | var posLeft = event.pageX - 20; | ||||
var posTop = event.pageY - 20; | var posTop = event.pageY - 20; | ||||
} | } | ||||
obj.style.top = posTop + "px"; | obj.style.top = posTop + "px"; | ||||
obj.style.left = posLeft - mleftLeaning + "px"; | obj.style.left = posLeft - mleftLeaning + "px"; | ||||
} | } | ||||
//复制内容到剪切板 | //复制内容到剪切板 | ||||
function copyToClipboard(txt) { | function copyToClipboard(txt) { | ||||
if (txt == null || txt == '') { | if (txt == null || txt == '') { | ||||
@@ -489,11 +418,9 @@ function copyToClipboard(txt) { | |||||
if (window.clipboardData) { | if (window.clipboardData) { | ||||
window.clipboardData.clearData(); | window.clipboardData.clearData(); | ||||
window.clipboardData.setData("Text", txt); | window.clipboardData.setData("Text", txt); | ||||
} | |||||
else if (navigator.userAgent.indexOf('Opera') != -1) { | |||||
} else if (navigator.userAgent.indexOf('Opera') != -1) { | |||||
window.location = txt; | window.location = txt; | ||||
} | |||||
else { | |||||
} else { | |||||
try { | try { | ||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); | netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); | ||||
} catch (e) { | } catch (e) { | ||||
@@ -501,10 +428,8 @@ function copyToClipboard(txt) { | |||||
} | } | ||||
var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard); | var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard); | ||||
if (!clip) return; | if (!clip) return; | ||||
var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable); | var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable); | ||||
if (!trans) return; | if (!trans) return; | ||||
trans.addDataFlavor('text/unicode'); | trans.addDataFlavor('text/unicode'); | ||||
var str = new Object(); | var str = new Object(); | ||||
var len = new Object(); | var len = new Object(); | ||||
@@ -517,7 +442,6 @@ function copyToClipboard(txt) { | |||||
clip.setData(trans, null, clipid.kGlobalClipboard); | clip.setData(trans, null, clipid.kGlobalClipboard); | ||||
} | } | ||||
} | } | ||||
function getSelTxt() { | function getSelTxt() { | ||||
var g, r; | var g, r; | ||||
if (document.all) { | if (document.all) { | ||||
@@ -527,14 +451,12 @@ function getSelTxt() { | |||||
} | } | ||||
return g; | return g; | ||||
} | } | ||||
//显示栏目Map地图 | //显示栏目Map地图 | ||||
function ShowCatMap(e, obj, cid, targetId, oldvalue) { | function ShowCatMap(e, obj, cid, targetId, oldvalue) { | ||||
fixupPos = true; | fixupPos = true; | ||||
LoadQuickDiv(e, 'archives_do.php?dopost=getCatMap&targetid=' + targetId + '&channelid=' + cid + '&oldvalue=' + oldvalue + '&rnd=' + Math.random(), 'getCatMap', '700px', '500px'); | LoadQuickDiv(e, 'archives_do.php?dopost=getCatMap&targetid=' + targetId + '&channelid=' + cid + '&oldvalue=' + oldvalue + '&rnd=' + Math.random(), 'getCatMap', '700px', '500px'); | ||||
ChangeFullDiv('show'); | ChangeFullDiv('show'); | ||||
} | } | ||||
function getSelCat(targetId) { | function getSelCat(targetId) { | ||||
var selBox = document.quicksel.seltypeid; | var selBox = document.quicksel.seltypeid; | ||||
var targetObj = $Obj(targetId); | var targetObj = $Obj(targetId); | ||||
@@ -572,53 +494,34 @@ function getSelCat(targetId) { | |||||
HideObj("getCatMap"); | HideObj("getCatMap"); | ||||
ChangeFullDiv("hide"); | ChangeFullDiv("hide"); | ||||
} | } | ||||
function getElementLeft(element) { | function getElementLeft(element) { | ||||
var actualLeft = element.offsetLeft; | var actualLeft = element.offsetLeft; | ||||
var current = element.offsetParent; | var current = element.offsetParent; | ||||
while (current !== null) { | while (current !== null) { | ||||
actualLeft += current.offsetLeft; | actualLeft += current.offsetLeft; | ||||
current = current.offsetParent; | current = current.offsetParent; | ||||
} | } | ||||
return actualLeft; | return actualLeft; | ||||
} | } | ||||
function getElementTop(element) { | function getElementTop(element) { | ||||
var actualTop = element.offsetTop; | var actualTop = element.offsetTop; | ||||
var current = element.offsetParent; | var current = element.offsetParent; | ||||
while (current !== null) { | while (current !== null) { | ||||
actualTop += current.offsetTop; | actualTop += current.offsetTop; | ||||
current = current.offsetParent; | current = current.offsetParent; | ||||
} | } | ||||
return actualTop; | return actualTop; | ||||
} | } | ||||
// Copyright 2020 The MuEMS Authors. All rights reserved. | |||||
// license that can be found in the LICENSE file. | |||||
// -----msgbox------------------------------------- | |||||
// 生成一个随机ID | |||||
//Copyright 2020 The MuEMS Authors. All rights reserved. | |||||
//license that can be found in the LICENSE file. | |||||
//-----msgbox------------------------------------- | |||||
//生成一个随机ID | |||||
function guid() { | function guid() { | ||||
function S4() { | function S4() { | ||||
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); | return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); | ||||
} | } | ||||
return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); | return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); | ||||
} | } | ||||
// 显示对话框,动态创建modal并显示,退出自动销毁窗体 | |||||
// args是以下结构体 | |||||
/* | |||||
args = { | |||||
title : "", // 标题,默认是MuEMS | |||||
footer : "", // 底部按钮,可以自定义按钮 | |||||
noClose : false, // 是否显示右上角关闭按钮,默认显示 | |||||
} | |||||
*/ | |||||
// 函数会返回一个modalID,通过这个ID可自已定义一些方法 | // 函数会返回一个modalID,通过这个ID可自已定义一些方法 | ||||
// 这里用到了一个展开语法 | // 这里用到了一个展开语法 | ||||
// https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax | // https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax | ||||
@@ -628,7 +531,6 @@ function ShowMsg(content, ...args) { | |||||
modalID = guid(); | modalID = guid(); | ||||
var footer = `<button type="button" class="btn btn-primary" onClick="CloseModal(\'GKModal${modalID}\')">Ok</button>`; | var footer = `<button type="button" class="btn btn-primary" onClick="CloseModal(\'GKModal${modalID}\')">Ok</button>`; | ||||
var noClose = false; | var noClose = false; | ||||
if (args.length == 1) { | if (args.length == 1) { | ||||
// 存在args参数 | // 存在args参数 | ||||
if (typeof args[0].title !== 'undefined' && args[0].title != "") { | if (typeof args[0].title !== 'undefined' && args[0].title != "") { | ||||
@@ -641,10 +543,8 @@ function ShowMsg(content, ...args) { | |||||
noClose = true; | noClose = true; | ||||
} | } | ||||
} | } | ||||
footer = footer.replaceAll("~modalID~", modalID); | footer = footer.replaceAll("~modalID~", modalID); | ||||
content = content.replaceAll("~modalID~", modalID); | content = content.replaceAll("~modalID~", modalID); | ||||
var modal = `<div id="GKModal${modalID}" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="GKModalLabel${modalID}" aria-hidden="true"> | var modal = `<div id="GKModal${modalID}" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="GKModalLabel${modalID}" aria-hidden="true"> | ||||
<div class="modal-dialog" role="document"> | <div class="modal-dialog" role="document"> | ||||
<div class="modal-content"><div class="modal-header"> | <div class="modal-content"><div class="modal-header"> | ||||
@@ -665,8 +565,7 @@ function ShowMsg(content, ...args) { | |||||
}) | }) | ||||
return modalID; | return modalID; | ||||
} | } | ||||
// 隐藏并销毁modal | |||||
//隐藏并销毁modal | |||||
function CloseModal(modalID) { | function CloseModal(modalID) { | ||||
$("#" + modalID).modal('hide'); | $("#" + modalID).modal('hide'); | ||||
$("#" + modalID).on('hidden.bs.modal', function (e) { | $("#" + modalID).on('hidden.bs.modal', function (e) { | ||||
@@ -675,8 +574,7 @@ function CloseModal(modalID) { | |||||
} | } | ||||
}) | }) | ||||
} | } | ||||
// 获取缩略图 | |||||
//获取缩略图 | |||||
var litpicImgSrc = ""; | var litpicImgSrc = ""; | ||||
var litpicImg = ""; | var litpicImg = ""; | ||||
var currentCID = 0; | var currentCID = 0; | ||||
@@ -693,17 +591,15 @@ var optCropper = { | |||||
$("#litPic").attr("src", litpicImg); | $("#litPic").attr("src", litpicImg); | ||||
}, | }, | ||||
aspectRatio: 4 / 3, | aspectRatio: 4 / 3, | ||||
// 拖动截取缩略图后,截取的缩略图更新到imageItems中 | |||||
//拖动截取缩略图后,截取的缩略图更新到imageItems中 | |||||
cropend: function (data) { | cropend: function (data) { | ||||
// 这里的ID要单独取出来 | |||||
var dataUrl = $(this).cropper("getCroppedCanvas") | |||||
.toDataURL(); | |||||
//这里的ID要单独取出来 | |||||
var dataUrl = $(this).cropper("getCroppedCanvas").toDataURL(); | |||||
litpicImg = dataUrl; | litpicImg = dataUrl; | ||||
$("#litPic").attr("src", litpicImg); | $("#litPic").attr("src", litpicImg); | ||||
$("#litpic_b64").val(litpicImg); | $("#litpic_b64").val(litpicImg); | ||||
} | } | ||||
} | } | ||||
var cropperAspectRatio = { | var cropperAspectRatio = { | ||||
0: 16 / 9, | 0: 16 / 9, | ||||
1: 4 / 3, | 1: 4 / 3, | ||||
@@ -711,25 +607,21 @@ var cropperAspectRatio = { | |||||
3: 2 / 3, | 3: 2 / 3, | ||||
4: NaN, | 4: NaN, | ||||
} | } | ||||
function setAspectRatio(ar) { | function setAspectRatio(ar) { | ||||
var opts = optCropper; | var opts = optCropper; | ||||
opts.aspectRatio = cropperAspectRatio[ar]; | opts.aspectRatio = cropperAspectRatio[ar]; | ||||
$("#cropImg" + mdlCropperID).cropper('destroy').cropper(opts); | $("#cropImg" + mdlCropperID).cropper('destroy').cropper(opts); | ||||
} | } | ||||
function okImage(modalID) { | function okImage(modalID) { | ||||
uploadImage(litpicImg); | uploadImage(litpicImg); | ||||
$("#litPic").attr("src", litpicImg); | $("#litPic").attr("src", litpicImg); | ||||
CloseModal('GKModal' + modalID); | CloseModal('GKModal' + modalID); | ||||
} | } | ||||
function useDefault(modalID) { | function useDefault(modalID) { | ||||
uploadImage(litpicImgSrc); | uploadImage(litpicImgSrc); | ||||
$("#litPic").attr("src", litpicImgSrc); | $("#litPic").attr("src", litpicImgSrc); | ||||
CloseModal('GKModal' + modalID); | CloseModal('GKModal' + modalID); | ||||
} | } | ||||
function uploadImage(litpicImgSrc) { | function uploadImage(litpicImgSrc) { | ||||
const formData = new FormData() | const formData = new FormData() | ||||
formData.append('litpic_b64', litpicImgSrc); | formData.append('litpic_b64', litpicImgSrc); | ||||
@@ -751,26 +643,22 @@ function uploadImage(litpicImgSrc) { | |||||
alert("上传缩略图错误"); | alert("上传缩略图错误"); | ||||
}); | }); | ||||
} | } | ||||
$(document).ready(function () { | $(document).ready(function () { | ||||
$("#btnClearAll").click(function (event) { | $("#btnClearAll").click(function (event) { | ||||
litpicImgSrc = ""; | litpicImgSrc = ""; | ||||
litpicImg = ""; | litpicImg = ""; | ||||
$("#picname").val(litpicImg); | $("#picname").val(litpicImg); | ||||
$("#litPic").attr("src", "../../static/web/img/defaultpic.jpg"); | $("#litPic").attr("src", "../../static/web/img/defaultpic.jpg"); | ||||
}) | }) | ||||
// 添加图片 | |||||
//添加图片 | |||||
$("#iptAddImages").change(function (event) { | $("#iptAddImages").change(function (event) { | ||||
var files = event.target.files; | var files = event.target.files; | ||||
for (var i = 0, f; f = files[i]; i++) { | for (var i = 0, f; f = files[i]; i++) { | ||||
// 如果不是图片忽略 | |||||
//如果不是图片忽略 | |||||
if (!f.type.match('image.*')) { | if (!f.type.match('image.*')) { | ||||
continue; | continue; | ||||
} | } | ||||
// 将图片渲染到浏览器 | |||||
//将图片渲染到浏览器 | |||||
var reader = new FileReader(); | var reader = new FileReader(); | ||||
reader.onload = (function (theFile) { | reader.onload = (function (theFile) { | ||||
return function (e) { | return function (e) { | ||||
@@ -787,8 +675,7 @@ $(document).ready(function () { | |||||
} | } | ||||
$("#iptAddImages").val(""); | $("#iptAddImages").val(""); | ||||
}); | }); | ||||
// 截取缩略图 | |||||
//截取缩略图 | |||||
function SetThumb(srcURL) { | function SetThumb(srcURL) { | ||||
var footer = | var footer = | ||||
"<p><a href='javascript:useDefault(\"~modalID~\");' class='btn btn-success'>使用原图</a> <a href='javascript:okImage(\"~modalID~\")' class='btn btn-success'>确定</a></p>"; | "<p><a href='javascript:useDefault(\"~modalID~\");' class='btn btn-success'>使用原图</a> <a href='javascript:okImage(\"~modalID~\")' class='btn btn-success'>确定</a></p>"; | ||||
@@ -810,12 +697,10 @@ $(document).ready(function () { | |||||
noClose: false, | noClose: false, | ||||
title: 'DedeBIZ缩略图裁剪', | title: 'DedeBIZ缩略图裁剪', | ||||
}); | }); | ||||
setTimeout(function () { | setTimeout(function () { | ||||
$("#cropImg" + mdlCropperID).cropper(optCropper); | $("#cropImg" + mdlCropperID).cropper(optCropper); | ||||
}, 500); | }, 500); | ||||
} | } | ||||
if ($.fn.daterangepicker) { | if ($.fn.daterangepicker) { | ||||
$('.datepicker').daterangepicker({ | $('.datepicker').daterangepicker({ | ||||
"singleDatePicker": true, | "singleDatePicker": true, | ||||
@@ -854,7 +739,4 @@ $(document).ready(function () { | |||||
picker.move(); | picker.move(); | ||||
}) | }) | ||||
} | } | ||||
}) | }) |
@@ -8,13 +8,11 @@ if(moz) { | |||||
extendElementModel(); | extendElementModel(); | ||||
emulateAttachEvent(); | emulateAttachEvent(); | ||||
} | } | ||||
function delArc(mid){ | function delArc(mid){ | ||||
var qstr=getCheckboxItem(); | var qstr=getCheckboxItem(); | ||||
if(mid==0) mid = getOneItem(); | if(mid==0) mid = getOneItem(); | ||||
location="member_do.php?id="+qstr+"&dopost=delmembers"; | location="member_do.php?id="+qstr+"&dopost=delmembers"; | ||||
} | } | ||||
//获得选中文件的文件名 | //获得选中文件的文件名 | ||||
function getCheckboxItem() | function getCheckboxItem() | ||||
{ | { | ||||
@@ -32,7 +30,6 @@ function getCheckboxItem() | |||||
} | } | ||||
return allSel; | return allSel; | ||||
} | } | ||||
//获得选中其中一个的id | //获得选中其中一个的id | ||||
function getOneItem() | function getOneItem() | ||||
{ | { | ||||
@@ -42,13 +39,12 @@ function getOneItem() | |||||
{ | { | ||||
if(document.form2.mid[i].checked) | if(document.form2.mid[i].checked) | ||||
{ | { | ||||
allSel = document.form2.mid[i].value; | |||||
break; | |||||
allSel = document.form2.mid[i].value; | |||||
break; | |||||
} | } | ||||
} | } | ||||
return allSel; | return allSel; | ||||
} | } | ||||
function selAll() | function selAll() | ||||
{ | { | ||||
for(i=0;i<document.form2.mid.length;i++) | for(i=0;i<document.form2.mid.length;i++) | ||||
@@ -15,9 +15,7 @@ function selNext(oj, v) | |||||
aOption.value = '0'; | aOption.value = '0'; | ||||
oj.options.add(aOption); | oj.options.add(aOption); | ||||
return; | return; | ||||
} | |||||
else | |||||
{ | |||||
} else { | |||||
aOption = document.createElement('OPTION'); | aOption = document.createElement('OPTION'); | ||||
aOption.text = '具体地区'; | aOption.text = '具体地区'; | ||||
aOption.value = '0'; | aOption.value = '0'; | ||||
@@ -38,7 +36,6 @@ function ChangeSon() | |||||
{ | { | ||||
//由于支持3级联动,所以这里需要对自己改变进行重构 | //由于支持3级联动,所以这里需要对自己改变进行重构 | ||||
var emname = this.name.replace('_son', ''); | var emname = this.name.replace('_son', ''); | ||||
//alert(emname); | |||||
if( document.getElementById(emname+'_sec') ) | if( document.getElementById(emname+'_sec') ) | ||||
{ | { | ||||
var oj = document.getElementById(emname + '_sec'); | var oj = document.getElementById(emname + '_sec'); | ||||
@@ -55,7 +52,6 @@ function ChangeSon() | |||||
var selarr = eval('em_'+emname+'s'); | var selarr = eval('em_'+emname+'s'); | ||||
var selv = parseInt(v); | var selv = parseInt(v); | ||||
var maxv = parseInt(v) + 0.5; | var maxv = parseInt(v) + 0.5; | ||||
//alert(maxv); | |||||
i = 0; | i = 0; | ||||
while(newobj && newobj.length > 0) oj.remove(0); | while(newobj && newobj.length > 0) oj.remove(0); | ||||
clear(oj); | clear(oj); | ||||
@@ -154,7 +150,6 @@ function MakeTopSelect(emname, selvalue) | |||||
selObj.className = "form-control"; | selObj.className = "form-control"; | ||||
selObj.onchange = selNextSon; | selObj.onchange = selNextSon; | ||||
var selarr = eval('em_'+emname+'s'); | var selarr = eval('em_'+emname+'s'); | ||||
//alert(selarr[1002.2]); | |||||
var topvalue = 0; | var topvalue = 0; | ||||
var sonvalue = 0; | var sonvalue = 0; | ||||
var secvalue = 0; | var secvalue = 0; | ||||
@@ -162,7 +157,6 @@ function MakeTopSelect(emname, selvalue) | |||||
aOption.text = '请选择..'; | aOption.text = '请选择..'; | ||||
aOption.value = 0; | aOption.value = 0; | ||||
selObj.options.add(aOption); | selObj.options.add(aOption); | ||||
//alert(selvalue); | |||||
if(selvalue % 500 == 0 ) | if(selvalue % 500 == 0 ) | ||||
{ | { | ||||
topvalue = selvalue; | topvalue = selvalue; | ||||
@@ -197,7 +191,6 @@ function MakeTopSelect(emname, selvalue) | |||||
} | } | ||||
document.getElementById('span_'+emname).appendChild(selObj); | document.getElementById('span_'+emname).appendChild(selObj); | ||||
//如果子类存在值,创建子类 | //如果子类存在值,创建子类 | ||||
//if(sonvalue > 0 || topvalue > 0) { | |||||
selObj = document.createElement("select"); | selObj = document.createElement("select"); | ||||
selObj.name = emname + '_son'; | selObj.name = emname + '_son'; | ||||
selObj.id = emname + '_son'; | selObj.id = emname + '_son'; | ||||
@@ -245,7 +238,6 @@ function MakeTopSelect(emname, selvalue) | |||||
selObj.options.add(aOption); | selObj.options.add(aOption); | ||||
var selv = sonvalue; | var selv = sonvalue; | ||||
var maxv = parseInt(sonvalue) + 0.5; | var maxv = parseInt(sonvalue) + 0.5; | ||||
//alert(maxv); | |||||
i = 0; | i = 0; | ||||
for(i = selv + 0.001; i < maxv; i = FloatAdd(i, 0.001)) | for(i = selv + 0.001; i < maxv; i = FloatAdd(i, 0.001)) | ||||
{ | { | ||||
@@ -1,37 +1,29 @@ | |||||
function checkSubmit() | function checkSubmit() | ||||
{ | { | ||||
if(document.form1.title.value=='') { | if(document.form1.title.value=='') { | ||||
alert("图集标题不能为空"); | alert("图集标题不能为空"); | ||||
document.form1.title.focus(); | document.form1.title.focus(); | ||||
return false; | return false; | ||||
} | } | ||||
if(document.form1.typeid.value==0) { | if(document.form1.typeid.value==0) { | ||||
alert("隶属栏目必须选择"); | alert("隶属栏目必须选择"); | ||||
return false; | return false; | ||||
} | } | ||||
if(document.form1.typeid.options[document.form1.typeid.selectedIndex].className!='option3') | if(document.form1.typeid.options[document.form1.typeid.selectedIndex].className!='option3') | ||||
{ | { | ||||
alert("隶属栏目必须选择白色背景的项目"); | alert("隶属栏目必须选择白色背景的项目"); | ||||
return false; | return false; | ||||
} | } | ||||
document.form1.imagebody.value = document.getElementById('copyhtml').innerHTML; | document.form1.imagebody.value = document.getElementById('copyhtml').innerHTML; | ||||
document.getElementById('postloader').style.display = 'block'; | document.getElementById('postloader').style.display = 'block'; | ||||
} | } | ||||
function CheckSelTable(nnum){ | function CheckSelTable(nnum){ | ||||
var cbox = document.getElementById('isokcheck'+nnum); | var cbox = document.getElementById('isokcheck'+nnum); | ||||
var seltb = document.getElementById('seltb'+nnum); | var seltb = document.getElementById('seltb'+nnum); | ||||
if(!cbox.checked) seltb.style.display = 'none'; | if(!cbox.checked) seltb.style.display = 'none'; | ||||
else seltb.style.display = 'block'; | else seltb.style.display = 'block'; | ||||
} | } | ||||
var startNum = 1; | var startNum = 1; | ||||
function MakeUpload(mnum) | function MakeUpload(mnum) | ||||
{ | { | ||||
@@ -41,20 +33,15 @@ function MakeUpload(mnum) | |||||
var fhtml = ""; | var fhtml = ""; | ||||
var dsel = " checked='checked' "; | var dsel = " checked='checked' "; | ||||
var dplay = "display:none"; | var dplay = "display:none"; | ||||
if(mnum==0) endNum = startNum + Number(pnumObj.value); | if(mnum==0) endNum = startNum + Number(pnumObj.value); | ||||
else endNum = mnum; | else endNum = mnum; | ||||
if(endNum>120) endNum = 120; | if(endNum>120) endNum = 120; | ||||
//document.getElementById('handfield').style.display = 'block'; | |||||
for(startNum;startNum < endNum;startNum++) | for(startNum;startNum < endNum;startNum++) | ||||
{ | { | ||||
if(startNum==1){ | if(startNum==1){ | ||||
dsel = " checked='checked' "; | dsel = " checked='checked' "; | ||||
dplay = "block"; | dplay = "block"; | ||||
}else | |||||
{ | |||||
} else { | |||||
dsel = " "; | dsel = " "; | ||||
dplay = "display:none"; | dplay = "display:none"; | ||||
} | } | ||||
@@ -76,12 +63,10 @@ function MakeUpload(mnum) | |||||
upfield.innerHTML += fhtml; | upfield.innerHTML += fhtml; | ||||
} | } | ||||
} | } | ||||
function TestGet() | function TestGet() | ||||
{ | { | ||||
LoadTestDiv(); | LoadTestDiv(); | ||||
} | } | ||||
var vcc = 0; | var vcc = 0; | ||||
function LoadTestDiv() | function LoadTestDiv() | ||||
{ | { | ||||
@@ -91,7 +76,7 @@ function LoadTestDiv() | |||||
var dfstr = '粘贴到这里...'; | var dfstr = '粘贴到这里...'; | ||||
if(document.getElementById('imagebody').value.length <= dfstr.length) | if(document.getElementById('imagebody').value.length <= dfstr.length) | ||||
{ | { | ||||
alert('您还没有粘贴任何东西都编辑框哦'); | |||||
alert('您还没有粘贴任何东西在编辑框'); | |||||
return; | return; | ||||
} | } | ||||
if(!newobj){ | if(!newobj){ | ||||
@@ -102,11 +87,9 @@ function LoadTestDiv() | |||||
newobj.style.top = posTop; | newobj.style.top = posTop; | ||||
newobj.style.left = posLeft; | newobj.style.left = posLeft; | ||||
document.body.appendChild(newobj); | document.body.appendChild(newobj); | ||||
} | |||||
else{ | |||||
} else{ | |||||
newobj.style.display = "block"; | newobj.style.display = "block"; | ||||
} | } | ||||
const formData = new FormData() | const formData = new FormData() | ||||
formData.append('myhtml', v); | formData.append('myhtml', v); | ||||
formData.append('vcc', vcc); | formData.append('vcc', vcc); | ||||
@@ -120,7 +103,6 @@ function LoadTestDiv() | |||||
vcc++; | vcc++; | ||||
}) | }) | ||||
} | } | ||||
function checkMuList(psid,cmid) | function checkMuList(psid,cmid) | ||||
{ | { | ||||
if(document.getElementById('pagestyle3').checked) | if(document.getElementById('pagestyle3').checked) | ||||
@@ -130,29 +112,22 @@ function checkMuList(psid,cmid) | |||||
else if(document.getElementById('pagestyle1').checked) | else if(document.getElementById('pagestyle1').checked) | ||||
{ | { | ||||
document.getElementById('spagelist').style.display = 'block'; | document.getElementById('spagelist').style.display = 'block'; | ||||
} | |||||
else | |||||
{ | |||||
} else { | |||||
document.getElementById('spagelist').style.display = 'none'; | document.getElementById('spagelist').style.display = 'none'; | ||||
} | } | ||||
} | } | ||||
//图集,显示与隐藏zip文件选项 | //图集,显示与隐藏zip文件选项 | ||||
function ShowZipField(formitem,zipid,upid) | function ShowZipField(formitem,zipid,upid) | ||||
{ | { | ||||
if(formitem.checked){ | if(formitem.checked){ | ||||
document.getElementById(zipid).style.display = 'block'; | document.getElementById(zipid).style.display = 'block'; | ||||
document.getElementById(upid).style.display = 'none'; | document.getElementById(upid).style.display = 'none'; | ||||
//document.getElementById('handfield').style.display = 'none'; | |||||
document.getElementById('formhtml').checked = false; | document.getElementById('formhtml').checked = false; | ||||
document.getElementById('copyhtml').innerHTML = ''; | document.getElementById('copyhtml').innerHTML = ''; | ||||
}else | |||||
{ | |||||
} else { | |||||
document.getElementById(zipid).style.display = 'none'; | document.getElementById(zipid).style.display = 'none'; | ||||
//document.getElementById('handfield').style.display = 'block'; | |||||
} | } | ||||
} | } | ||||
//图集,显示与隐藏Html编辑框 | //图集,显示与隐藏Html编辑框 | ||||
function ShowHtmlField(formitem,htmlid,upid) | function ShowHtmlField(formitem,htmlid,upid) | ||||
{ | { | ||||
@@ -162,13 +137,8 @@ function ShowHtmlField(formitem,htmlid,upid) | |||||
} | } | ||||
if(formitem.checked){ | if(formitem.checked){ | ||||
document.getElementById(htmlid).style.display = 'block'; | document.getElementById(htmlid).style.display = 'block'; | ||||
//document.getElementById(upid).style.display = 'none'; | |||||
//document.getElementById('handfield').style.display = 'none'; | |||||
//document.getElementById('formzip').checked = false; | |||||
}else | |||||
{ | |||||
} else { | |||||
document.getElementById(htmlid).style.display = 'none'; | document.getElementById(htmlid).style.display = 'none'; | ||||
//document.getElementById('handfield').style.display = 'block'; | |||||
document.getElementById('copyhtml').innerHTML = ''; | document.getElementById('copyhtml').innerHTML = ''; | ||||
} | } | ||||
} | |||||
} |
@@ -1,11 +1,9 @@ | |||||
/* Copyright 2020 The DedeBIZ.COM Authors. All rights reserved. | /* Copyright 2020 The DedeBIZ.COM Authors. All rights reserved. | ||||
license that can be found in the LICENSE file. */ | license that can be found in the LICENSE file. */ | ||||
// 滚动到页面顶部 | // 滚动到页面顶部 | ||||
function gotop() { | function gotop() { | ||||
$('html, body').animate({ scrollTop: 0 }, 'slow'); | $('html, body').animate({ scrollTop: 0 }, 'slow'); | ||||
} | } | ||||
//读写cookie函数 | //读写cookie函数 | ||||
function GetCookie(c_name) { | function GetCookie(c_name) { | ||||
if (document.cookie.length > 0) { | if (document.cookie.length > 0) { | ||||
@@ -21,44 +19,30 @@ function GetCookie(c_name) { | |||||
} | } | ||||
return null | return null | ||||
} | } | ||||
function SetCookie(c_name, value, expiredays) { | function SetCookie(c_name, value, expiredays) { | ||||
var exdate = new Date(); | var exdate = new Date(); | ||||
exdate.setDate(exdate.getDate() + expiredays); | exdate.setDate(exdate.getDate() + expiredays); | ||||
document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()); //使设置的有效时间正确。增加toGMTString() | document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()); //使设置的有效时间正确。增加toGMTString() | ||||
} | } | ||||
//------------------------------------------------------------------------------------------- | //------------------------------------------------------------------------------------------- | ||||
// 全局消息提示框 | // 全局消息提示框 | ||||
//------------------------------------------------------------------------------------------- | //------------------------------------------------------------------------------------------- | ||||
// 生成一个随机ID | |||||
//生成一个随机ID | |||||
function guid() { | function guid() { | ||||
function S4() { | function S4() { | ||||
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); | return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); | ||||
} | } | ||||
return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); | return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); | ||||
} | } | ||||
// 显示对话框,动态创建modal并显示,退出自动销毁窗体 | |||||
// args是以下结构体 | |||||
/* | |||||
args = { | |||||
title : "", // 标题,默认是MuEMS | |||||
footer : "", // 底部按钮,可以自定义按钮 | |||||
noClose : false, // 是否显示右上角关闭按钮,默认显示 | |||||
} | |||||
*/ | |||||
// 函数会返回一个modalID,通过这个ID可自已定义一些方法 | |||||
// 这里用到了一个展开语法 | |||||
// https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax | |||||
//函数会返回一个modalID,通过这个ID可自已定义一些方法 | |||||
//这里用到了一个展开语法 | |||||
//https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax | |||||
function ShowMsg(content, ...args) { | function ShowMsg(content, ...args) { | ||||
title = "系统提示"; | title = "系统提示"; | ||||
if (typeof content == "undefined") content = ""; | if (typeof content == "undefined") content = ""; | ||||
modalID = guid(); | modalID = guid(); | ||||
var footer = `<button type="button" class="btn btn-outline-success" onClick="CloseModal(\'DedeModal${modalID}\')">确定</button>`; | var footer = `<button type="button" class="btn btn-outline-success" onClick="CloseModal(\'DedeModal${modalID}\')">确定</button>`; | ||||
var noClose = false; | var noClose = false; | ||||
if (args.length == 1) { | if (args.length == 1) { | ||||
// 存在args参数 | // 存在args参数 | ||||
if (typeof args[0].title !== 'undefined' && args[0].title != "") { | if (typeof args[0].title !== 'undefined' && args[0].title != "") { | ||||
@@ -71,13 +55,11 @@ function ShowMsg(content, ...args) { | |||||
noClose = true; | noClose = true; | ||||
} | } | ||||
} | } | ||||
String.prototype.replaceAll = function (s1, s2) { | String.prototype.replaceAll = function (s1, s2) { | ||||
return this.replace(new RegExp(s1, "gm"), s2); | return this.replace(new RegExp(s1, "gm"), s2); | ||||
} | } | ||||
footer = footer.replaceAll("~modalID~", modalID); | footer = footer.replaceAll("~modalID~", modalID); | ||||
content = content.replaceAll("~modalID~", modalID); | content = content.replaceAll("~modalID~", modalID); | ||||
var modal = `<div id="DedeModal${modalID}" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="DedeModalLabel${modalID}" aria-hidden="true"> | var modal = `<div id="DedeModal${modalID}" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="DedeModalLabel${modalID}" aria-hidden="true"> | ||||
<div class="modal-dialog modal-dialog-centered" role="document"> | <div class="modal-dialog modal-dialog-centered" role="document"> | ||||
<div class="modal-content"><div class="modal-header"> | <div class="modal-content"><div class="modal-header"> | ||||
@@ -98,8 +80,7 @@ function ShowMsg(content, ...args) { | |||||
}) | }) | ||||
return modalID; | return modalID; | ||||
} | } | ||||
// 隐藏并销毁modal | |||||
//隐藏并销毁modal | |||||
function CloseModal(modalID) { | function CloseModal(modalID) { | ||||
$("#" + modalID).modal('hide'); | $("#" + modalID).modal('hide'); | ||||
$("#" + modalID).on('hidden.bs.modal', function (e) { | $("#" + modalID).on('hidden.bs.modal', function (e) { | ||||
@@ -108,8 +89,7 @@ function CloseModal(modalID) { | |||||
} | } | ||||
}) | }) | ||||
} | } | ||||
// 在某个元素内显示alert信息 | |||||
//在某个元素内显示alert信息 | |||||
function ShowAlert(ele, content, type, showtime = 3000) { | function ShowAlert(ele, content, type, showtime = 3000) { | ||||
let msg = `<div class="alert alert-${type}" role="alert"> | let msg = `<div class="alert alert-${type}" role="alert"> | ||||
${content} | ${content} | ||||
@@ -120,7 +100,6 @@ function ShowAlert(ele, content, type, showtime = 3000) { | |||||
$(ele).html(""); | $(ele).html(""); | ||||
}, showtime); | }, showtime); | ||||
} | } | ||||
//------------------------------------------------------------------------------------------- | //------------------------------------------------------------------------------------------- | ||||
// 纠错扩展 | // 纠错扩展 | ||||
//------------------------------------------------------------------------------------------- | //------------------------------------------------------------------------------------------- | ||||
@@ -154,8 +133,7 @@ function ErrAddSaveDo(modalID) { | |||||
$("#btnSubmit").removeAttr("disabled"); | $("#btnSubmit").removeAttr("disabled"); | ||||
}); | }); | ||||
} | } | ||||
// 错误提示 | |||||
//错误提示 | |||||
function ErrorAddSave(id, title) { | function ErrorAddSave(id, title) { | ||||
let content = ` | let content = ` | ||||
<input type="hidden" value="${id}" class="form-control" id="iptID"> | <input type="hidden" value="${id}" class="form-control" id="iptID"> | ||||
@@ -194,13 +172,9 @@ function ErrorAddSave(id, title) { | |||||
'footer': footer, | 'footer': footer, | ||||
}); | }); | ||||
} | } | ||||
// 页面加载触发 | // 页面加载触发 | ||||
$(document).ready(function () { | $(document).ready(function () { | ||||
window.onscroll = function () { scrollFunction() }; | window.onscroll = function () { scrollFunction() }; | ||||
function scrollFunction() { | function scrollFunction() { | ||||
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { | if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { | ||||
$("#btnScrollTop").show(); | $("#btnScrollTop").show(); | ||||
@@ -208,5 +182,4 @@ $(document).ready(function () { | |||||
$("#btnScrollTop").hide(); | $("#btnScrollTop").hide(); | ||||
} | } | ||||
} | } | ||||
}); | }); |