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