diff --git a/src/admin/js/album.js b/src/admin/js/album.js index 7c2eafc4..0d54b2d5 100644 --- a/src/admin/js/album.js +++ b/src/admin/js/album.js @@ -1,7 +1,7 @@ function checkSubmitAlb() { if ($("#gallery .atlas").length > 0) { //这里从gallery中取出图片元素信息 - $("#gallery .atlas").each(function () { + $("#gallery .atlas").each(function() { albums.push({ "img": $(this).find("img").attr("src"), "txt": $(this).find("input").val() diff --git a/src/admin/js/body.js b/src/admin/js/body.js index a148b20d..a254ce43 100644 --- a/src/admin/js/body.js +++ b/src/admin/js/body.js @@ -1,22 +1,3 @@ -$(function () { - $.get("index_testenv.php",function (data) { - if (data !== '') { - $("#body-tips").html(data); - } - }); - $.get("index_body.php?dopost=get_articles",function (data) { - if (data !== '') { - $("#system-word").html(data); - } - }); -}); -function Copyinfo() { - var val = document.getElementById('fz-0'); - window.getSelection().selectAllChildren(val); - document.execCommand("Copy"); - ShowMsg("成功复制环境配置信息"); -} -//Dedebiz info var dedebizInfo; function ViewDedeBIZ() { if (dedebizInfo === false) { @@ -53,7 +34,7 @@ function ViewDedeBIZ() { `); } function LoadServer() { - $.get("index_body.php?dopost=system_info",function (data) { + $.get("index_body.php?dopost=system_info",function(data) { let rsp = JSON.parse(data); if (rsp.code === 200) { if (rsp.result.core.code === 200) { @@ -106,7 +87,7 @@ function LoadServer() { } }); } -Date.prototype.Format = function (fmt) { +Date.prototype.Format = function(fmt) { var o = { "M+" : this.getMonth() + 1, //月份 "d+" : this.getDate(), //日 @@ -122,7 +103,7 @@ Date.prototype.Format = function (fmt) { return fmt; } function LoadStat() { - $.get("index_body.php?dopost=get_statistics",function (data) { + $.get("index_body.php?dopost=get_statistics",function(data) { try { let rsp = JSON.parse(data); if (rsp.code == 200) { @@ -134,7 +115,7 @@ function LoadStat() { $("#today_uv").html(tuv); $("#today_ip").html(tip); $("#today_vv").html(tvv); - $.get("index_body.php?dopost=get_statistics&sdate=-1",function (data) { + $.get("index_body.php?dopost=get_statistics&sdate=-1",function(data) { let rsp = JSON.parse(data); if (rsp.code == 200) { $("#total_pv").html(parseInt(rsp.result.pv) + tpv); @@ -152,7 +133,7 @@ function LoadStat() { d.setDate(d.getDate() - 1); var s = d.Format("yyyy-MM-dd"); s = s.replaceAll("-", ""); - $.get("index_body.php?dopost=get_statistics&sdate=" + s,function (data) { + $.get("index_body.php?dopost=get_statistics&sdate=" + s,function(data) { try { let rsp = JSON.parse(data); if (rsp.code == 200) { @@ -241,11 +222,23 @@ async function LoadStatChart() { }, }); } -$(document).ready(function () { +$(document).ready(function() { + $(function() { + $.get("index_testenv.php",function(data) { + if (data !== '') { + $("#body-tips").html(data); + } + }); + $.get("index_body.php?dopost=get_articles",function(data) { + if (data !== '') { + $("#system-word").html(data); + } + }); + }); LoadServer(); LoadStat(); LoadStatChart(); - setInterval(function () { + setInterval(function() { LoadServer(); - }, 60000) + }, 3000) }); \ No newline at end of file diff --git a/src/admin/js/main.js b/src/admin/js/main.js index 457a31bf..8597c6d5 100644 --- a/src/admin/js/main.js +++ b/src/admin/js/main.js @@ -92,8 +92,8 @@ function InitPage() { var selsource = $Obj('selsource'); var selwriter = $Obj('selwriter'); var colorbt = $Obj('color'); - if (selsource) { selsource.onmousedown = function (e) { SelectSource(e); } } - if (selwriter) { selwriter.onmousedown = function (e) { SelectWriter(e); } } + if (selsource) { selsource.onmousedown = function(e) { SelectSource(e); } } + if (selwriter) { selwriter.onmousedown = function(e) { SelectWriter(e); } } } function $Nav() { if (window.navigator.userAgent.indexOf("MSIE") >= 1) return 'IE'; @@ -399,7 +399,7 @@ function DedeConfirm(content = "", title = "确认提示") { backdrop: 'static', show: true }); - $("#DedeModal" + modalID).on('hidden.bs.modal', function (e) { + $("#DedeModal" + modalID).on('hidden.bs.modal', function(e) { $("#DedeModal" + modalID).remove(); }) }) @@ -439,7 +439,7 @@ function ShowMsg(content, ...args) { backdrop: 'static', show: true }); - $("#GKModal" + modalID).on('hidden.bs.modal', function (e) { + $("#GKModal" + modalID).on('hidden.bs.modal', function(e) { $("#GKModal" + modalID).remove(); }) return modalID; @@ -447,7 +447,7 @@ function ShowMsg(content, ...args) { //隐藏并销毁modal function CloseModal(modalID) { $("#" + modalID).modal('hide'); - $("#" + modalID).on('hidden.bs.modal', function (e) { + $("#" + modalID).on('hidden.bs.modal', function(e) { if ($("#" + modalID).length > 0) { $("#" + modalID).remove(); } @@ -461,7 +461,7 @@ var mdlCropperID = ""; var pubAt = 0; var optCropper = { preview: ".pv", - crop: function (e) { + crop: function(e) { $("#cropWidth").text(Math.round(e.detail.height)); $("#cropHeight").text(Math.round(e.detail.width)); if ($(this).cropper("getCroppedCanvas")) { @@ -472,7 +472,7 @@ var optCropper = { }, aspectRatio: 4 / 3, //拖动截取缩略图后,截取的缩略图更新到imageItems中 - cropend: function (data) { + cropend: function(data) { //这里的id要单独取出来 var dataUrl = $(this).cropper("getCroppedCanvas").toDataURL(); litpicImg = dataUrl; @@ -523,15 +523,15 @@ function uploadImage(litpicImgSrc) { alert("上传缩略图错误"); }); } -$(document).ready(function () { - $("#btnClearAll").click(function (event) { +$(document).ready(function() { + $("#btnClearAll").click(function(event) { litpicImgSrc = ""; litpicImg = ""; $("#picname").val(litpicImg); $("#litPic").attr("src", "/static/web/img/thumbnail.jpg"); }) //添加图片 - $("#iptAddImages").change(function (event) { + $("#iptAddImages").change(function(event) { var files = event.target.files; for (var i = 0, f; f = files[i]; i++) { //如果不是图片忽略 @@ -540,8 +540,8 @@ $(document).ready(function () { } //将图片渲染到浏览器 var reader = new FileReader(); - reader.onload = (function (theFile) { - return function (e) { + reader.onload = (function(theFile) { + return function(e) { litpicImgSrc = e.target.result; if (cfg_uplitpic_cut == 'Y') { SetThumb(litpicImgSrc); @@ -564,7 +564,7 @@ $(document).ready(function () { noClose: false, title: '图片裁剪', }); - setTimeout(function () { + setTimeout(function() { $("#cropImg" + mdlCropperID).cropper(optCropper); }, 500); } @@ -593,10 +593,10 @@ $(document).ready(function () { monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], firstDay: 1 } - }, function (start) { + }, function(start) { $(this).val(start.format("YYYY-MM-DD HH:mm:ss")); }); - $('.datepicker').on('show.daterangepicker', function (ev, picker) { + $('.datepicker').on('show.daterangepicker', function(ev, picker) { if (picker.element.offset().top - $(window).scrollTop() + picker.container.outerHeight() > $(window).height()) { picker.drops = 'up'; } else { diff --git a/src/admin/js/update.js b/src/admin/js/update.js index 25a98274..f02e84cf 100644 --- a/src/admin/js/update.js +++ b/src/admin/js/update.js @@ -15,7 +15,7 @@ function showStepArea(step) { $("#btnStep" + step).show(); } function update() { - $.get("api.php?action=update", function (rs) { + $.get("api.php?action=update", function(rs) { if (rs.code === 0) { $("#_updateMsg").html(rs.msg); if (rs.data.finish === false) { @@ -32,7 +32,7 @@ function update() { }) } function hasNewVersion() { - $.get("api.php?action=has_new_version", function (rs) { + $.get("api.php?action=has_new_version", function(rs) { try { if (rs.code === 0) { if (rs.result.HasNew === true) { @@ -51,24 +51,24 @@ function hasNewVersion() { } }) } -$(document).ready(function () { +$(document).ready(function() { hasNewVersion(); - $("#btnCancel").click(function () { + $("#btnCancel").click(function() { currentStep = 1; $("#_fileList").html(``); }) - $("#btnBackup").click(function () { + $("#btnBackup").click(function() { let alertMsg = dedeAlter("正在备份差异文件", 'info', true); $("#_msgInfo").html(alertMsg); $("#_msgInfo").show(); - $.get("api.php?action=update_backup", function (rs) { + $.get("api.php?action=update_backup", function(rs) { if (rs.code === 0) { alertMsg = dedeAlter(`成功备份差异文件,目录:${rs.data.backupdir}`, 'success'); $("#_msgInfo").html(alertMsg); } }) }) - $("#systemUpdate").click(function () { + $("#systemUpdate").click(function() { if (hasNewVer === false) { currentStep = 5; showStepArea(currentStep); @@ -78,7 +78,7 @@ $(document).ready(function () { $('#mdlUpdate').modal('show'); showStepArea(currentStep); currentStep++; - $.get("api.php?action=get_changed_files", function (rs) { + $.get("api.php?action=get_changed_files", function(rs) { if (rs.code === 0) { let fstr = '