From 5e7a2b489fa4ef6cd47d465741feaa59d1f4de68 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 26 Mar 2021 11:30:00 +0800 Subject: [PATCH] :arrow_up: fix https://github.com/88250/symphony/issues/46 --- package-lock.json | 6 +++--- package.json | 2 +- src/main/resources/js/common.js | 5 +++-- src/main/resources/js/common.min.js | 2 +- src/main/resources/skins/classic/footer.ftl | 2 +- src/main/resources/skins/mobile/footer.ftl | 2 +- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 53fa14ceb..fe7adc384 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5305,9 +5305,9 @@ "dev": true }, "vditor": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/vditor/-/vditor-3.8.3.tgz", - "integrity": "sha512-XRaQolQNqFQ3RjmGhYCvcdQTaGT1s+RraJMZqA79izne8xtcEtopj97WCm2+ARnN4aoma2u0iEimpTAgzOXHbw==", + "version": "3.8.4", + "resolved": "https://registry.npmjs.org/vditor/-/vditor-3.8.4.tgz", + "integrity": "sha512-tCAxS9gz2JWQW6w2L2gzCCkHXM+btTCI0qkhYGvWDidGmze23LvKmPvr9iwpBad/XhGw66iifD23R1VHEEJxhg==", "requires": { "diff-match-patch": "^1.0.5" } diff --git a/package.json b/package.json index c843f2a0e..baeb991db 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,6 @@ "gulp-uglify": "^3.0.2" }, "dependencies": { - "vditor": "^3.8.3" + "vditor": "^3.8.4" } } diff --git a/src/main/resources/js/common.js b/src/main/resources/js/common.js index a8da04023..58a4afb61 100644 --- a/src/main/resources/js/common.js +++ b/src/main/resources/js/common.js @@ -676,6 +676,7 @@ var Util = { }, lang: Label.langLabel, hint: { + parse: false, emojiTail: '设置常用表情', emoji: Label.emoji, @@ -693,7 +694,7 @@ var Util = { if (result.code === 0) { for (var i = 0; i < result.data.length; i++) { atUsers.push({ - value: '@' + result.data[i].userName, + value: '@' + result.data[i].userName + " ", html: '' + result.data[i].userName, @@ -703,7 +704,7 @@ var Util = { atUsers.push({ html: ' 参与者', - value: '@participants', + value: '@participants ', }) } } else { diff --git a/src/main/resources/js/common.min.js b/src/main/resources/js/common.min.js index c261aa81c..d61ffadd8 100644 --- a/src/main/resources/js/common.min.js +++ b/src/main/resources/js/common.min.js @@ -1 +1 @@ -var Util={LazyLoadImage:function(){function t(e){var t=document.createElement("img");t.src=e.getAttribute("data-src"),t.addEventListener("load",function(){$(e).attr("style")||$(e).attr("class")||$(e).attr("width")||$(e).attr("height")||1!==$(e).closest(".vditor-reset").length||t.naturalHeight>t.naturalWidth&&t.naturalWidth/t.naturalHeight<$(e).closest(".vditor-reset").width()/($(window).height()-40)&&t.naturalHeight>$(window).height()-40&&(e.style.height=$(window).height()-40+"px"),$(e).attr("class")||1!==$(e).closest(".vditor-reset").length||_processPreview($(e)),e.src=t.src,e.style.backgroundImage="none",e.style.backgroundColor="transparent"}),e.removeAttribute("data-src")}if(!("IntersectionObserver"in window))return $("img").each(function(){this.getAttribute("data-src")&&t(this)}),!1;window.imageIntersectionObserver?window.imageIntersectionObserver.disconnect():window.imageIntersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)&&e.target.getAttribute("data-src")&&t(e.target)})}),$("img").each(function(){window.imageIntersectionObserver.observe(this)})},addStyle:function(e,t){if(!document.getElementById(t)){var a=document.createElement("link");a.id=t,a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.setAttribute("href",e),document.getElementsByTagName("head")[0].appendChild(a)}},parseHljs:function(){Vditor.highlightRender({style:"github",enable:!Label.luteAvailable},document)},parseMarkdown:function(){Vditor.mermaidRender(document.body),Vditor.flowchartRender(document.body),Vditor.chartRender(),Vditor.mindmapRender(),Vditor.mathRender(document.body),Vditor.codeRender(document.body,Label.langLabel),Vditor.abcRender(),Vditor.graphvizRender(document.body),Vditor.plantumlRender(document.body);var t=!1;if($(".vditor-reset").each(function(){$(this).find("a").each(function(){var e=$(this).attr("href");e&&".mov"===e.substr(e.length-4).toLowerCase()&&(t=!0)})}),t){function e(){$(".vditor-reset").each(function(){$(this).find("a").each(function(){var e=$(this),t=$(this).attr("href");if(t&&".mov"===t.substr(t.length-4).toLowerCase()){this.style.height="360px",this.style.width="270px",e.removeAttr("href");var a=LivePhotosKit.Player(this);a.photoSrc=Label.staticServePath+"/images/livephoto.png",a.videoSrc=t}})})}"undefined"!=typeof LivePhotosKit?e():$.ajax({method:"GET",url:Label.staticServePath+"/js/lib/livephotoskit.js",dataType:"script",cache:!0}).done(function(){e()})}},prevKey:void 0,clipboard:function(e,t,a){e.click(function(e){t[0].select();try{document.execCommand("copy")?a():console.log("Copy command was unsuccessful")}catch(e){console.log("Oops, unable to copy")}window.getSelection().removeAllRanges()})},closeAlert:function(){var e=$("#alertDialogPanel");e.prev().remove(),e.remove()},alert:function(e){var t;t='
'+('
'+e+"
"),$("body").append(t),$("#alertDialogPanel").css({top:($(window).height()-$("#alertDialogPanel").height())/2+"px",left:($(window).width()-$("#alertDialogPanel").width())/2+"px",outline:"none"}).show().focus()},makeNotificationRead:function(e,a){return $.ajax({url:Label.servePath+"/notifications/make-read/"+e,type:"GET",cache:!1,success:function(e,t){0===e.code&&(Util.setUnreadNotificationCount(!1),$(".notification li").addClass("read"),a&&($(a).prev().remove(),$(a).remove(),0===$(".home-menu .count").length&&$(".module-header:last > span").remove()))}}),!1},_initCommonHotKey:function(){if(!Label.userKeyboardShortcutsStatus||"1"===Label.userKeyboardShortcutsStatus)return!1;function i(e){var t=$(".list > ul > li.focus"),a=0===$(".radio-btn").length?0:48;if(1===t.length){if("top"===e||"bottom"===e)return $(window).scrollTop(t.offset().top-a),!1;($(window).height()+$(window).scrollTop()t.offset().top)&&("down"===e?$(window).scrollTop(t.offset().top-($(window).height()-t.outerHeight())):$(window).scrollTop(t.offset().top-a))}}0===$("#articleTitle").length&&$(document).bind("keydown","c",function(e){return Util.prevKey||(window.location=Label.servePath+"/post?type=0"),!1}),$(document).bind("keyup","g",function(){return Util.prevKey="g",setTimeout(function(){Util.prevKey=void 0},1e3),!1}).bind("keyup","s",function(){return $("#search").focus(),!1}).bind("keyup","t",function(){return void 0===Util.prevKey&&Util.goTop(),!1}).bind("keyup","n",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath+"/notifications"),!1}).bind("keyup","h",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath+"/hot"),!1}).bind("keyup","i",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath),!1}).bind("keyup","r",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath+"/recent"),!1}).bind("keyup","p",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath+"/perfect"),!1}).bind("keyup","Shift+/",function(e){return window.open(Label.servePath+"/about"),!1}).bind("keyup","j",function(e){var t=".content .list:last > ul > ";1===$("#comments").length&&(t="#comments .list > ul > ");var a=$(t+"li.focus");return 0===a.length?$(t+"li:first").addClass("focus"):1===a.next().length&&(a.next().addClass("focus"),a.removeClass("focus")),i("down"),!1}).bind("keyup","k",function(e){var t=".content .list:last > ul > ";1===$("#comments").length&&(t="#comments .list > ul > ");var a=$(t+"li.focus");return 0===a.length?$(t+"li:last").addClass("focus"):1===a.prev().length&&(a.prev().addClass("focus"),a.removeClass("focus")),i("up"),!1}).bind("keyup","f",function(e){var t=".content .list:last > ul > ";return 1===$("#comments").length&&(t="#comments .list > ul > "),$(t+"li.focus").removeClass("focus"),$(t+"li:first").addClass("focus"),i("top"),!1}).bind("keyup","l",function(e){if(Util.prevKey)return!1;var t=".content .list:last > ul > ";return 1===$("#comments").length&&(t="#comments .list > ul > "),$(t+"li.focus").removeClass("focus"),$(t+"li:last").addClass("focus"),i("bottom"),!1}).bind("keyup","o",function(e){if(1===$("#comments").length)return!1;var t=$(".content .list:last > ul > li.focus > h2 > a").attr("href");return(t=(t=t||$(".content .list:last > ul > li.focus .fn-flex-1 > h2 > a").attr("href"))||$(".content .list:last > ul > li.focus h2.fn-flex-1 > a").attr("href"))&&(window.location=t),!1}).bind("keyup","return",function(e){if(1===$("#comments").length)return!1;var t=$(".content .list:last > ul > li.focus > h2 > a").attr("href");return(t=(t=t||$(".content .list:last > ul > li.focus .fn-flex-1 > h2 > a").attr("href"))||$(".content .list:last > ul > li.focus h2.fn-flex-1 > a").attr("href"))&&(window.location=t),!1})},notifyMsg:function(t){if(!("Notification"in window))return!1;function a(e){var t=new Notification(Label.visionLabel,{body:Label.desktopNotificationTemplateLabel.replace("${count}",e),icon:Label.staticServePath+"/images/faviconH.png"});t.onclick=t.onerror=function(){window.location=Label.servePath+"/notifications"}}"granted"===Notification.permission?a(t):"denied"!==Notification.permission&&Notification.requestPermission(function(e){"granted"===e&&a(t)})},processClipBoard:function(e,i){if(""===e.getData("text/html")&&2===e.items.length)return"";var t=!1,a=toMarkdown(e.getData("text/html"),{converters:[{filter:"img",replacement:function(e,t){if(1===t.attributes.length)return"";var a={url:t.src};return $.ajax({url:Label.servePath+"/fetch-upload",type:"POST",data:JSON.stringify(a),cache:!1,success:function(e,t){if(0===e.code){var a=i.getValue();a=a.replace(e.originalURL,e.url),i.setValue(a)}}}),"![]("+t.src+")"}},{filter:["pre","code"],replacement:function(e){return 1With ♥ from '}},[{source:function(e,a){i.search(e,{hitsPerPage:20},function(e,t){e?a([]):a(t.hits,t)})},displayKey:"name",templates:{suggestion:function(e){return e._highlightResult.articleTitle.value}}}]).on("autocomplete:selected",function(e,t,a){window.open(Label.servePath+"/article/"+t.oId)}).bind("keyup","esc",function(){$(this).blur()})},newVditor:function(e){Label.emoji||$.ajax({url:Label.servePath+"/users/emotions",type:"GET",cache:!0,async:!1,success:function(e){Label.emoji={},e.data.forEach(function(e){var t=Object.keys(e)[0];Label.emoji[t]=e[t]})}});var t={outline:e.outline||{enable:!1},after:e.after||void 0,typewriterMode:e.typewriterMode||!1,cache:{enable:e.cache||!1},input:e.input,preview:{delay:500,mode:e.preview.mode,url:Label.servePath+"/markdown",parse:function(e){"none"!==e.style.display&&Util.LazyLoadImage()},hljs:{enable:!Label.luteAvailable}},upload:{max:Label.fileMaxSize,url:Label.servePath+"/upload",linkToImgUrl:Label.servePath+"/fetch-upload",filename:function(e){return e.replace(/\?|\\|\/|:|\||<|>|\*|\[|\]|\s+/g,"-")},accept:".zip,.rar,.7z,.tar,.gzip,.bz2,.jar,.jpg,.jpeg,.png,.gif,.webp,.webm,.bmp,.mp3,.mp4,.wav,.mov,.weba,.mkv"},placeholder:e.placeholder,height:e.height,counter:{enable:!!e.counter,max:e.counter},resize:{enable:e.resize.enable,position:e.resize.position},lang:Label.langLabel,hint:{emojiTail:'设置常用表情',emoji:Label.emoji,extend:[{key:"@",hint:function(a){var i=[];return $.ajax({url:Label.servePath+"/users/names",type:"POST",async:!1,data:JSON.stringify({name:a}),success:function(e){if(0===e.code){for(var t=0;t'+e.data[t].userName});""===a&&i.push({html:' 参与者',value:"@participants"})}else alert(e.msg)}}),i}}]},esc:e.esc,ctrlEnter:e.ctrlEnter};return $(window).width()<768?(t.toolbar=["emoji","link","upload","edit-mode",{name:"more",toolbar:["insert-after","fullscreen","preview","info","help"]}],t.resize.enable=!1):e.toolbar&&(t.toolbar=e.toolbar),new Vditor(e.id,t)},setUnreadNotificationCount:function(o){$.ajax({url:Label.servePath+"/notifications/unread/count",type:"GET",cache:!1,success:function(e,t){function a(e){var t="",a='';return 0'+Label.notificationCommentedLabel+' '+e.unreadCommentedNotificationCnt+""+a.replace("${markReadType}","commented")+""),0'+Label.notificationReplyLabel+' '+e.unreadReplyNotificationCnt+""+a.replace("${markReadType}","reply")+""),0'+Label.notificationAtLabel+' '+e.unreadAtNotificationCnt+""+a.replace("${markReadType}","at")+""),0'+Label.notificationFollowingLabel+' '+e.unreadFollowingNotificationCnt+""+a.replace("${markReadType}","following")+""),0'+Label.pointLabel+' '+e.unreadPointNotificationCnt+""),0'+Label.sameCityLabel+' '+e.unreadBroadcastNotificationCnt+""),0'+Label.systemLabel+' '+e.unreadSysAnnounceNotificationCnt+""),0'+Label.newFollowerLabel+' '+e.unreadNewFollowerNotificationCnt+""),t}var i=e.unreadNotificationCnt;if($.ua.set(navigator.userAgent),$.ua.device.type&&"mobile"===$.ua.device.type){if(0
    '+n+"
"),$("#aNotifications").click(function(){$("#notificationsPanel").slideToggle()})}else window.localStorage.hadNotificate="false",$("#aNotifications").removeClass("msg").addClass("no-msg").text(i).attr("href",Label.servePath+"/notifications");return!1}if(0
    '+n+"
"),$("#aNotifications").click(function(){$("#notificationsPanel").show()}),$("body").click(function(e){"aNotifications"!==e.target.id&&"notificationsPanel"!==$(e.target).closest(".module").attr("id")&&$("#notificationsPanel").hide()})}else window.localStorage.hadNotificate="false",$("#notificationsPanel").remove(),$("#aNotifications").removeClass("msg").addClass("no-msg tooltipped tooltipped-w").text(i).attr("href",Label.servePath+"/notifications")}})},follow:function(a,i,n,o){if(!Label.isLoggedIn)return Util.needLogin(),!1;if($(a).hasClass("disabled"))return!1;var e={followingId:i};$(a).addClass("disabled"),$.ajax({url:Label.servePath+"/follow/"+n,type:"POST",cache:!1,data:JSON.stringify(e),success:function(e,t){0===e.code&&($(a).removeClass("disabled"),void 0!==o?"article"===n||"tag"===n?$(a).html(' '+(o+1)).attr("onclick","Util.unfollow(this, '"+i+"', '"+n+"', "+(o+1)+")").attr("aria-label",Label.uncollectLabel).addClass("ft-red"):"article-watch"===n&&$(a).html(' '+(o+1)).attr("onclick","Util.unfollow(this, '"+i+"', '"+n+"', "+(o+1)+")").attr("aria-label",Label.unfollowLabel).addClass("ft-red"):$(a).attr("onclick","Util.unfollow(this, '"+i+"', '"+n+"')").text("article"===n?Label.uncollectLabel:Label.unfollowLabel))},complete:function(){$(a).removeClass("disabled")}})},unfollow:function(a,i,n,o){if($(a).hasClass("disabled"))return!1;var e={followingId:i};$(a).addClass("disabled"),$.ajax({url:Label.servePath+"/unfollow/"+n,type:"POST",cache:!1,data:JSON.stringify(e),success:function(e,t){0===e.code&&(void 0!==o?"article"===n||"tag"===n?$(a).removeClass("ft-red").html(' '+(o-1)).attr("onclick","Util.follow(this, '"+i+"', '"+n+"',"+(o-1)+")").attr("aria-label",Label.collectLabel):"article-watch"===n&&$(a).removeClass("ft-red").html(' '+(o-1)).attr("onclick","Util.follow(this, '"+i+"', '"+n+"',"+(o-1)+")").attr("aria-label",Label.followLabel):$(a).attr("onclick","Util.follow(this, '"+i+"', '"+n+"')").text("article"===n?Label.collectLabel:Label.followLabel))},complete:function(){$(a).removeClass("disabled")}})},goTop:function(){$("html, body").animate({scrollTop:0},800)},goLogin:function(){if(-1===location.href.indexOf("/login")){var e=location.href;0===location.search.indexOf("?goto")&&(e=location.href.replace(location.search,"")),window.location.href=Label.servePath+"/login?goto="+encodeURIComponent(e)}},needLogin:function(){Util.goLogin()},goRegister:function(){if(-1===location.href.indexOf("/register")){var e=location.href;0===location.search.indexOf("?goto")&&(e=location.href.replace(location.search,"")),window.location.href=Label.servePath+"/register?goto="+encodeURIComponent(e)}},_kill:function(){"IE"===$.ua.browser.name&&parseInt($.ua.browser.version)<10&&$.ajax({url:Label.servePath+"/kill-browser",type:"GET",cache:!1,success:function(e,t){$("body").append(e),$("#killBrowser").dialog({modal:!0,hideFooter:!0,height:345,width:600}),$("#killBrowser").dialog("open")}})},_initActivity:function(){var e=$(".person-info"),t=e.data("percent"),a=0,i=0,n=0;t<=25?a=parseInt(t/.25):t<=75?(a=100,i=parseInt((t-25)/2/.25)):t<=100&&(i=a=100,n=parseInt((t-75)/.25)),e.find(".bottom").css({width:a+"%",left:(100-a)/2+"%"}),e.find(".top-left").css({width:parseInt(n/2)+"%",left:0}),e.find(".top-right").css({width:parseInt(n/2)+"%",right:0}),e.find(".left").css({height:i+"%",top:100-i+"%"}),e.find(".right").css({height:i+"%",top:100-i+"%"})},_initBreezemoon:function(t,e,a){0!==t.length&&(e.keypress(function(e){13===e.keyCode&&t.click()}),t.click(function(){a?"disabled"!==t.attr("disabled")&&(t.attr("disabled","disabled").css("opacity","0.3"),$.ajax({url:Label.servePath+"/breezemoon",type:"POST",cache:!1,headers:{csrfToken:$(this).data("csrf")},data:JSON.stringify({breezemoonContent:e.val()}),success:function(e){0===e.code?window.location.reload():Util.alert(e.msg)},complete:function(){t.css("opacity",1).removeAttr("disabled")}})):Util.goLogin()}))},init:function(e){if(this._kill(),this._initNav(),this._initActivity(),1===$(".pagination select").length&&$(".pagination select").change(function(){var e=$(this).data("url")+"?p="+$(this).val();$(this).data("param")&&(e+="&"+$(this).data("param")),window.location.href=e}),$(".nav input.search").focus(function(){$(".nav .tags").css("visibility","hidden")}).blur(function(){$(".nav .tags").css("visibility","visible")}),$(window).scroll(function(){20<$(window).scrollTop()&&0===$(".radio-btn").length?$(".go-top").show():$(".go-top").hide()}),Util.parseMarkdown(),Util.parseHljs(),e&&(window.localStorage.hadNotificate||(window.localStorage.hadNotificate="false"),Util.setUnreadNotificationCount(!0)),$(window).keyup(function(e){27===e.keyCode&&Util.closeAlert()}),this._initBreezemoon($("#breezemoonPostBtn"),$("#breezemoonInput"),e),this._initCommonHotKey(),e)return!1;$("body").click(function(e){0===$(e.target).closest(".nav .form").length&&$(".nav .form").hide()})},initUserChannel:function(e){var t=new ReconnectingWebSocket(e);t.reconnectInterval=1e4,t.onopen=function(){setInterval(function(){t.send("-hb-")},3e5)},t.onmessage=function(e){switch(JSON.parse(e.data).command){case"refreshNotification":Util.setUnreadNotificationCount(!0)}},t.onclose=function(){t.close()},t.onerror=function(e){console.log("ERROR",e)}},_initNav:function(){var e=location.href;$(".user-nav > a").each(function(){0===e.indexOf($(this).attr("href"))?$(this).addClass("current"):"/register"===location.pathname?$(".user-nav a:last").addClass("current"):"/login"===location.pathname?$(".user-nav a:first").addClass("current"):0!==e.indexOf(Label.servePath+"/settings")&&0!==e.indexOf($("#aPersonListPanel").data("url"))||$("#aPersonListPanel").addClass("current")}),$(".nav .avatar-small").parent().click(function(){$("#personListPanel").show()}),$("body").click(function(e){"aPersonListPanel"!==$(e.target).closest("a").attr("id")&&"personListPanel"!==$(e.target).closest(".module").attr("id")&&$("#personListPanel").hide()}),1===$(".nav-tabs a:last").length&&0<$(".nav-tabs a:last")[0].offsetTop&&$(".nav-tabs").mouseover(function(){$(".user-nav").hide()}).mouseout(function(){$(".user-nav").show()})},logout:function(){window.localStorage&&(window.localStorage.clear(),window.localStorage.hadNotificate="false"),window.location.href=Label.servePath+"/logout?goto="+Label.servePath},startsWith:function(e,t){return e.match("^"+t)==t},mouseClickEffects:function(){var r=0;jQuery(document).ready(function(o){o("html").click(function(e){var t,a=18;10==++r?t=o("").text("OωO"):20===r?t=o("").text("(๑•́ ∀ •̀๑)"):30===r?t=o("").text("(๑•́ ₃ •̀๑)"):40===r?t=o("").text("(๑•̀_•́๑)"):50===r?t=o("").text("( ̄へ ̄)"):60===r?t=o("").text("(╯°口°)╯(┴—┴"):70===r?t=o("").text("૮( ᵒ̌皿ᵒ̌ )ა"):80===r?t=o("").text("╮(。>口<。)╭"):90===r?t=o("").text("( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃"):100<=r&&r<=105?t=o("").text("(ꐦ°᷄д°᷅)"):(t=o(''),a=Math.round(14*Math.random()+6));var i=e.pageX,n=e.pageY;t.css({"z-index":9999,top:n-20,left:i,position:"absolute",color:"#E94F06","font-size":a,"-moz-user-select":"none","-webkit-user-select":"none","-ms-user-select":"none"}),o("body").append(t),t.animate({top:n-180,opacity:0},1500,function(){t.remove()})})})}},Validate={goValidate:function(e){for(var t="
    ",a=0;a"+e.data[a].msg+"");return"
      "===t?(e.target.html(""),e.target.removeClass("error"),!0):(e.target.html(t+"
    "),e.target.addClass("error"),!1)},validate:function(e){var t=!0,a="";switch(a="editor"===e.type?e.target.getValue():"imgSrc"===e.type?e.target.attr("src"):"imgStyle"===e.type?e.target.data("imageurl"):e.target.val().toString().replace(/(^\s*)|(\s*$)/g,""),e.type){case"email":/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(e.target.val())||(t=!1);break;case"password":!(e.target.val().length<6||16=(e.min?e.min:0)}return t}},Label={},pngMagic=[137,80,78,71,13,10,26,10],jpeg_jfif=[74,70,73,70],jpeg_exif=[69,120,105,102],jpegMagic=[255,216,255,224],gifMagic0=[71,73,70,56,55,97],getGifMagic1=[71,73,70,56,57,97],wavMagic1=[82,73,70,70],wavMagic2=[87,65,86,69];function arraycopy(e,t,a,n,o){for(i=0;isuccess(): Unable to detect window audio context, cannot continue.")}var o=n.getWindowAudioContextMethod();Audio.recorderObj=new SoundRecorder(o,2048,a,i),Audio.recorderObj.init(e),Audio.recorderObj.recorder.onaudioprocess=function(e){if(Audio.recorderObj.isRecording()){var t=e.inputBuffer.getChannelData(0),a=e.inputBuffer.getChannelData(1);Audio.recorderObj.cloneChannelData(t,a)}},Audio.availabel=!0,r&&r()}},function(e){console.log("getUserMedia->failure(): ERROR: Microphone access request failed!");switch(e.name){case"PermissionDeniedError":Label.recordDeniedLabel;break;case"DevicesNotFoundError":Label.recordDeviceNotFoundLabel;break;default:"ERROR: The following unexpected error occurred while attempting to connect to your microphone: "+e.name}})):console.log("ERROR: getUserMedia not supported by browser.")},handleStartRecording:function(){Audio.recorderObj.startRecordingNewWavFile()},handleStopRecording:function(){Audio.recorderObj.stopRecording(),Audio.wavFileBlob=Audio.recorderObj.buildWavFileBlob()}}; \ No newline at end of file +var Util={LazyLoadImage:function(){function t(e){var t=document.createElement("img");t.src=e.getAttribute("data-src"),t.addEventListener("load",function(){$(e).attr("style")||$(e).attr("class")||$(e).attr("width")||$(e).attr("height")||1!==$(e).closest(".vditor-reset").length||t.naturalHeight>t.naturalWidth&&t.naturalWidth/t.naturalHeight<$(e).closest(".vditor-reset").width()/($(window).height()-40)&&t.naturalHeight>$(window).height()-40&&(e.style.height=$(window).height()-40+"px"),$(e).attr("class")||1!==$(e).closest(".vditor-reset").length||_processPreview($(e)),e.src=t.src,e.style.backgroundImage="none",e.style.backgroundColor="transparent"}),e.removeAttribute("data-src")}if(!("IntersectionObserver"in window))return $("img").each(function(){this.getAttribute("data-src")&&t(this)}),!1;window.imageIntersectionObserver?window.imageIntersectionObserver.disconnect():window.imageIntersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)&&e.target.getAttribute("data-src")&&t(e.target)})}),$("img").each(function(){window.imageIntersectionObserver.observe(this)})},addStyle:function(e,t){if(!document.getElementById(t)){var a=document.createElement("link");a.id=t,a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.setAttribute("href",e),document.getElementsByTagName("head")[0].appendChild(a)}},parseHljs:function(){Vditor.highlightRender({style:"github",enable:!Label.luteAvailable},document)},parseMarkdown:function(){Vditor.mermaidRender(document.body),Vditor.flowchartRender(document.body),Vditor.chartRender(),Vditor.mindmapRender(),Vditor.mathRender(document.body),Vditor.codeRender(document.body,Label.langLabel),Vditor.abcRender(),Vditor.graphvizRender(document.body),Vditor.plantumlRender(document.body);var t=!1;if($(".vditor-reset").each(function(){$(this).find("a").each(function(){var e=$(this).attr("href");e&&".mov"===e.substr(e.length-4).toLowerCase()&&(t=!0)})}),t){function e(){$(".vditor-reset").each(function(){$(this).find("a").each(function(){var e=$(this),t=$(this).attr("href");if(t&&".mov"===t.substr(t.length-4).toLowerCase()){this.style.height="360px",this.style.width="270px",e.removeAttr("href");var a=LivePhotosKit.Player(this);a.photoSrc=Label.staticServePath+"/images/livephoto.png",a.videoSrc=t}})})}"undefined"!=typeof LivePhotosKit?e():$.ajax({method:"GET",url:Label.staticServePath+"/js/lib/livephotoskit.js",dataType:"script",cache:!0}).done(function(){e()})}},prevKey:void 0,clipboard:function(e,t,a){e.click(function(e){t[0].select();try{document.execCommand("copy")?a():console.log("Copy command was unsuccessful")}catch(e){console.log("Oops, unable to copy")}window.getSelection().removeAllRanges()})},closeAlert:function(){var e=$("#alertDialogPanel");e.prev().remove(),e.remove()},alert:function(e){var t;t='
    '+('
    '+e+"
    "),$("body").append(t),$("#alertDialogPanel").css({top:($(window).height()-$("#alertDialogPanel").height())/2+"px",left:($(window).width()-$("#alertDialogPanel").width())/2+"px",outline:"none"}).show().focus()},makeNotificationRead:function(e,a){return $.ajax({url:Label.servePath+"/notifications/make-read/"+e,type:"GET",cache:!1,success:function(e,t){0===e.code&&(Util.setUnreadNotificationCount(!1),$(".notification li").addClass("read"),a&&($(a).prev().remove(),$(a).remove(),0===$(".home-menu .count").length&&$(".module-header:last > span").remove()))}}),!1},_initCommonHotKey:function(){if(!Label.userKeyboardShortcutsStatus||"1"===Label.userKeyboardShortcutsStatus)return!1;function i(e){var t=$(".list > ul > li.focus"),a=0===$(".radio-btn").length?0:48;if(1===t.length){if("top"===e||"bottom"===e)return $(window).scrollTop(t.offset().top-a),!1;($(window).height()+$(window).scrollTop()t.offset().top)&&("down"===e?$(window).scrollTop(t.offset().top-($(window).height()-t.outerHeight())):$(window).scrollTop(t.offset().top-a))}}0===$("#articleTitle").length&&$(document).bind("keydown","c",function(e){return Util.prevKey||(window.location=Label.servePath+"/post?type=0"),!1}),$(document).bind("keyup","g",function(){return Util.prevKey="g",setTimeout(function(){Util.prevKey=void 0},1e3),!1}).bind("keyup","s",function(){return $("#search").focus(),!1}).bind("keyup","t",function(){return void 0===Util.prevKey&&Util.goTop(),!1}).bind("keyup","n",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath+"/notifications"),!1}).bind("keyup","h",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath+"/hot"),!1}).bind("keyup","i",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath),!1}).bind("keyup","r",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath+"/recent"),!1}).bind("keyup","p",function(e){return"g"===Util.prevKey&&(window.location=Label.servePath+"/perfect"),!1}).bind("keyup","Shift+/",function(e){return window.open(Label.servePath+"/about"),!1}).bind("keyup","j",function(e){var t=".content .list:last > ul > ";1===$("#comments").length&&(t="#comments .list > ul > ");var a=$(t+"li.focus");return 0===a.length?$(t+"li:first").addClass("focus"):1===a.next().length&&(a.next().addClass("focus"),a.removeClass("focus")),i("down"),!1}).bind("keyup","k",function(e){var t=".content .list:last > ul > ";1===$("#comments").length&&(t="#comments .list > ul > ");var a=$(t+"li.focus");return 0===a.length?$(t+"li:last").addClass("focus"):1===a.prev().length&&(a.prev().addClass("focus"),a.removeClass("focus")),i("up"),!1}).bind("keyup","f",function(e){var t=".content .list:last > ul > ";return 1===$("#comments").length&&(t="#comments .list > ul > "),$(t+"li.focus").removeClass("focus"),$(t+"li:first").addClass("focus"),i("top"),!1}).bind("keyup","l",function(e){if(Util.prevKey)return!1;var t=".content .list:last > ul > ";return 1===$("#comments").length&&(t="#comments .list > ul > "),$(t+"li.focus").removeClass("focus"),$(t+"li:last").addClass("focus"),i("bottom"),!1}).bind("keyup","o",function(e){if(1===$("#comments").length)return!1;var t=$(".content .list:last > ul > li.focus > h2 > a").attr("href");return(t=(t=t||$(".content .list:last > ul > li.focus .fn-flex-1 > h2 > a").attr("href"))||$(".content .list:last > ul > li.focus h2.fn-flex-1 > a").attr("href"))&&(window.location=t),!1}).bind("keyup","return",function(e){if(1===$("#comments").length)return!1;var t=$(".content .list:last > ul > li.focus > h2 > a").attr("href");return(t=(t=t||$(".content .list:last > ul > li.focus .fn-flex-1 > h2 > a").attr("href"))||$(".content .list:last > ul > li.focus h2.fn-flex-1 > a").attr("href"))&&(window.location=t),!1})},notifyMsg:function(t){if(!("Notification"in window))return!1;function a(e){var t=new Notification(Label.visionLabel,{body:Label.desktopNotificationTemplateLabel.replace("${count}",e),icon:Label.staticServePath+"/images/faviconH.png"});t.onclick=t.onerror=function(){window.location=Label.servePath+"/notifications"}}"granted"===Notification.permission?a(t):"denied"!==Notification.permission&&Notification.requestPermission(function(e){"granted"===e&&a(t)})},processClipBoard:function(e,i){if(""===e.getData("text/html")&&2===e.items.length)return"";var t=!1,a=toMarkdown(e.getData("text/html"),{converters:[{filter:"img",replacement:function(e,t){if(1===t.attributes.length)return"";var a={url:t.src};return $.ajax({url:Label.servePath+"/fetch-upload",type:"POST",data:JSON.stringify(a),cache:!1,success:function(e,t){if(0===e.code){var a=i.getValue();a=a.replace(e.originalURL,e.url),i.setValue(a)}}}),"![]("+t.src+")"}},{filter:["pre","code"],replacement:function(e){return 1With ♥ from '}},[{source:function(e,a){i.search(e,{hitsPerPage:20},function(e,t){e?a([]):a(t.hits,t)})},displayKey:"name",templates:{suggestion:function(e){return e._highlightResult.articleTitle.value}}}]).on("autocomplete:selected",function(e,t,a){window.open(Label.servePath+"/article/"+t.oId)}).bind("keyup","esc",function(){$(this).blur()})},newVditor:function(e){Label.emoji||$.ajax({url:Label.servePath+"/users/emotions",type:"GET",cache:!0,async:!1,success:function(e){Label.emoji={},e.data.forEach(function(e){var t=Object.keys(e)[0];Label.emoji[t]=e[t]})}});var t={outline:e.outline||{enable:!1},after:e.after||void 0,typewriterMode:e.typewriterMode||!1,cache:{enable:e.cache||!1},input:e.input,preview:{delay:500,mode:e.preview.mode,url:Label.servePath+"/markdown",parse:function(e){"none"!==e.style.display&&Util.LazyLoadImage()},hljs:{enable:!Label.luteAvailable}},upload:{max:Label.fileMaxSize,url:Label.servePath+"/upload",linkToImgUrl:Label.servePath+"/fetch-upload",filename:function(e){return e.replace(/\?|\\|\/|:|\||<|>|\*|\[|\]|\s+/g,"-")},accept:".zip,.rar,.7z,.tar,.gzip,.bz2,.jar,.jpg,.jpeg,.png,.gif,.webp,.webm,.bmp,.mp3,.mp4,.wav,.mov,.weba,.mkv"},placeholder:e.placeholder,height:e.height,counter:{enable:!!e.counter,max:e.counter},resize:{enable:e.resize.enable,position:e.resize.position},lang:Label.langLabel,hint:{parse:!1,emojiTail:'设置常用表情',emoji:Label.emoji,extend:[{key:"@",hint:function(a){var i=[];return $.ajax({url:Label.servePath+"/users/names",type:"POST",async:!1,data:JSON.stringify({name:a}),success:function(e){if(0===e.code){for(var t=0;t'+e.data[t].userName});""===a&&i.push({html:' 参与者',value:"@participants "})}else alert(e.msg)}}),i}}]},esc:e.esc,ctrlEnter:e.ctrlEnter};return $(window).width()<768?(t.toolbar=["emoji","link","upload","edit-mode",{name:"more",toolbar:["insert-after","fullscreen","preview","info","help"]}],t.resize.enable=!1):e.toolbar&&(t.toolbar=e.toolbar),new Vditor(e.id,t)},setUnreadNotificationCount:function(o){$.ajax({url:Label.servePath+"/notifications/unread/count",type:"GET",cache:!1,success:function(e,t){function a(e){var t="",a='';return 0'+Label.notificationCommentedLabel+' '+e.unreadCommentedNotificationCnt+""+a.replace("${markReadType}","commented")+""),0'+Label.notificationReplyLabel+' '+e.unreadReplyNotificationCnt+""+a.replace("${markReadType}","reply")+""),0'+Label.notificationAtLabel+' '+e.unreadAtNotificationCnt+""+a.replace("${markReadType}","at")+""),0'+Label.notificationFollowingLabel+' '+e.unreadFollowingNotificationCnt+""+a.replace("${markReadType}","following")+""),0'+Label.pointLabel+' '+e.unreadPointNotificationCnt+""),0'+Label.sameCityLabel+' '+e.unreadBroadcastNotificationCnt+""),0'+Label.systemLabel+' '+e.unreadSysAnnounceNotificationCnt+""),0'+Label.newFollowerLabel+' '+e.unreadNewFollowerNotificationCnt+""),t}var i=e.unreadNotificationCnt;if($.ua.set(navigator.userAgent),$.ua.device.type&&"mobile"===$.ua.device.type){if(0
      '+n+"
    "),$("#aNotifications").click(function(){$("#notificationsPanel").slideToggle()})}else window.localStorage.hadNotificate="false",$("#aNotifications").removeClass("msg").addClass("no-msg").text(i).attr("href",Label.servePath+"/notifications");return!1}if(0
      '+n+"
    "),$("#aNotifications").click(function(){$("#notificationsPanel").show()}),$("body").click(function(e){"aNotifications"!==e.target.id&&"notificationsPanel"!==$(e.target).closest(".module").attr("id")&&$("#notificationsPanel").hide()})}else window.localStorage.hadNotificate="false",$("#notificationsPanel").remove(),$("#aNotifications").removeClass("msg").addClass("no-msg tooltipped tooltipped-w").text(i).attr("href",Label.servePath+"/notifications")}})},follow:function(a,i,n,o){if(!Label.isLoggedIn)return Util.needLogin(),!1;if($(a).hasClass("disabled"))return!1;var e={followingId:i};$(a).addClass("disabled"),$.ajax({url:Label.servePath+"/follow/"+n,type:"POST",cache:!1,data:JSON.stringify(e),success:function(e,t){0===e.code&&($(a).removeClass("disabled"),void 0!==o?"article"===n||"tag"===n?$(a).html(' '+(o+1)).attr("onclick","Util.unfollow(this, '"+i+"', '"+n+"', "+(o+1)+")").attr("aria-label",Label.uncollectLabel).addClass("ft-red"):"article-watch"===n&&$(a).html(' '+(o+1)).attr("onclick","Util.unfollow(this, '"+i+"', '"+n+"', "+(o+1)+")").attr("aria-label",Label.unfollowLabel).addClass("ft-red"):$(a).attr("onclick","Util.unfollow(this, '"+i+"', '"+n+"')").text("article"===n?Label.uncollectLabel:Label.unfollowLabel))},complete:function(){$(a).removeClass("disabled")}})},unfollow:function(a,i,n,o){if($(a).hasClass("disabled"))return!1;var e={followingId:i};$(a).addClass("disabled"),$.ajax({url:Label.servePath+"/unfollow/"+n,type:"POST",cache:!1,data:JSON.stringify(e),success:function(e,t){0===e.code&&(void 0!==o?"article"===n||"tag"===n?$(a).removeClass("ft-red").html(' '+(o-1)).attr("onclick","Util.follow(this, '"+i+"', '"+n+"',"+(o-1)+")").attr("aria-label",Label.collectLabel):"article-watch"===n&&$(a).removeClass("ft-red").html(' '+(o-1)).attr("onclick","Util.follow(this, '"+i+"', '"+n+"',"+(o-1)+")").attr("aria-label",Label.followLabel):$(a).attr("onclick","Util.follow(this, '"+i+"', '"+n+"')").text("article"===n?Label.collectLabel:Label.followLabel))},complete:function(){$(a).removeClass("disabled")}})},goTop:function(){$("html, body").animate({scrollTop:0},800)},goLogin:function(){if(-1===location.href.indexOf("/login")){var e=location.href;0===location.search.indexOf("?goto")&&(e=location.href.replace(location.search,"")),window.location.href=Label.servePath+"/login?goto="+encodeURIComponent(e)}},needLogin:function(){Util.goLogin()},goRegister:function(){if(-1===location.href.indexOf("/register")){var e=location.href;0===location.search.indexOf("?goto")&&(e=location.href.replace(location.search,"")),window.location.href=Label.servePath+"/register?goto="+encodeURIComponent(e)}},_kill:function(){"IE"===$.ua.browser.name&&parseInt($.ua.browser.version)<10&&$.ajax({url:Label.servePath+"/kill-browser",type:"GET",cache:!1,success:function(e,t){$("body").append(e),$("#killBrowser").dialog({modal:!0,hideFooter:!0,height:345,width:600}),$("#killBrowser").dialog("open")}})},_initActivity:function(){var e=$(".person-info"),t=e.data("percent"),a=0,i=0,n=0;t<=25?a=parseInt(t/.25):t<=75?(a=100,i=parseInt((t-25)/2/.25)):t<=100&&(i=a=100,n=parseInt((t-75)/.25)),e.find(".bottom").css({width:a+"%",left:(100-a)/2+"%"}),e.find(".top-left").css({width:parseInt(n/2)+"%",left:0}),e.find(".top-right").css({width:parseInt(n/2)+"%",right:0}),e.find(".left").css({height:i+"%",top:100-i+"%"}),e.find(".right").css({height:i+"%",top:100-i+"%"})},_initBreezemoon:function(t,e,a){0!==t.length&&(e.keypress(function(e){13===e.keyCode&&t.click()}),t.click(function(){a?"disabled"!==t.attr("disabled")&&(t.attr("disabled","disabled").css("opacity","0.3"),$.ajax({url:Label.servePath+"/breezemoon",type:"POST",cache:!1,headers:{csrfToken:$(this).data("csrf")},data:JSON.stringify({breezemoonContent:e.val()}),success:function(e){0===e.code?window.location.reload():Util.alert(e.msg)},complete:function(){t.css("opacity",1).removeAttr("disabled")}})):Util.goLogin()}))},init:function(e){if(this._kill(),this._initNav(),this._initActivity(),1===$(".pagination select").length&&$(".pagination select").change(function(){var e=$(this).data("url")+"?p="+$(this).val();$(this).data("param")&&(e+="&"+$(this).data("param")),window.location.href=e}),$(".nav input.search").focus(function(){$(".nav .tags").css("visibility","hidden")}).blur(function(){$(".nav .tags").css("visibility","visible")}),$(window).scroll(function(){20<$(window).scrollTop()&&0===$(".radio-btn").length?$(".go-top").show():$(".go-top").hide()}),Util.parseMarkdown(),Util.parseHljs(),e&&(window.localStorage.hadNotificate||(window.localStorage.hadNotificate="false"),Util.setUnreadNotificationCount(!0)),$(window).keyup(function(e){27===e.keyCode&&Util.closeAlert()}),this._initBreezemoon($("#breezemoonPostBtn"),$("#breezemoonInput"),e),this._initCommonHotKey(),e)return!1;$("body").click(function(e){0===$(e.target).closest(".nav .form").length&&$(".nav .form").hide()})},initUserChannel:function(e){var t=new ReconnectingWebSocket(e);t.reconnectInterval=1e4,t.onopen=function(){setInterval(function(){t.send("-hb-")},3e5)},t.onmessage=function(e){switch(JSON.parse(e.data).command){case"refreshNotification":Util.setUnreadNotificationCount(!0)}},t.onclose=function(){t.close()},t.onerror=function(e){console.log("ERROR",e)}},_initNav:function(){var e=location.href;$(".user-nav > a").each(function(){0===e.indexOf($(this).attr("href"))?$(this).addClass("current"):"/register"===location.pathname?$(".user-nav a:last").addClass("current"):"/login"===location.pathname?$(".user-nav a:first").addClass("current"):0!==e.indexOf(Label.servePath+"/settings")&&0!==e.indexOf($("#aPersonListPanel").data("url"))||$("#aPersonListPanel").addClass("current")}),$(".nav .avatar-small").parent().click(function(){$("#personListPanel").show()}),$("body").click(function(e){"aPersonListPanel"!==$(e.target).closest("a").attr("id")&&"personListPanel"!==$(e.target).closest(".module").attr("id")&&$("#personListPanel").hide()}),1===$(".nav-tabs a:last").length&&0<$(".nav-tabs a:last")[0].offsetTop&&$(".nav-tabs").mouseover(function(){$(".user-nav").hide()}).mouseout(function(){$(".user-nav").show()})},logout:function(){window.localStorage&&(window.localStorage.clear(),window.localStorage.hadNotificate="false"),window.location.href=Label.servePath+"/logout?goto="+Label.servePath},startsWith:function(e,t){return e.match("^"+t)==t},mouseClickEffects:function(){var r=0;jQuery(document).ready(function(o){o("html").click(function(e){var t,a=18;10==++r?t=o("").text("OωO"):20===r?t=o("").text("(๑•́ ∀ •̀๑)"):30===r?t=o("").text("(๑•́ ₃ •̀๑)"):40===r?t=o("").text("(๑•̀_•́๑)"):50===r?t=o("").text("( ̄へ ̄)"):60===r?t=o("").text("(╯°口°)╯(┴—┴"):70===r?t=o("").text("૮( ᵒ̌皿ᵒ̌ )ა"):80===r?t=o("").text("╮(。>口<。)╭"):90===r?t=o("").text("( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃"):100<=r&&r<=105?t=o("").text("(ꐦ°᷄д°᷅)"):(t=o(''),a=Math.round(14*Math.random()+6));var i=e.pageX,n=e.pageY;t.css({"z-index":9999,top:n-20,left:i,position:"absolute",color:"#E94F06","font-size":a,"-moz-user-select":"none","-webkit-user-select":"none","-ms-user-select":"none"}),o("body").append(t),t.animate({top:n-180,opacity:0},1500,function(){t.remove()})})})}},Validate={goValidate:function(e){for(var t="
      ",a=0;a"+e.data[a].msg+"");return"
        "===t?(e.target.html(""),e.target.removeClass("error"),!0):(e.target.html(t+"
      "),e.target.addClass("error"),!1)},validate:function(e){var t=!0,a="";switch(a="editor"===e.type?e.target.getValue():"imgSrc"===e.type?e.target.attr("src"):"imgStyle"===e.type?e.target.data("imageurl"):e.target.val().toString().replace(/(^\s*)|(\s*$)/g,""),e.type){case"email":/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(e.target.val())||(t=!1);break;case"password":!(e.target.val().length<6||16=(e.min?e.min:0)}return t}},Label={},pngMagic=[137,80,78,71,13,10,26,10],jpeg_jfif=[74,70,73,70],jpeg_exif=[69,120,105,102],jpegMagic=[255,216,255,224],gifMagic0=[71,73,70,56,55,97],getGifMagic1=[71,73,70,56,57,97],wavMagic1=[82,73,70,70],wavMagic2=[87,65,86,69];function arraycopy(e,t,a,n,o){for(i=0;isuccess(): Unable to detect window audio context, cannot continue.")}var o=n.getWindowAudioContextMethod();Audio.recorderObj=new SoundRecorder(o,2048,a,i),Audio.recorderObj.init(e),Audio.recorderObj.recorder.onaudioprocess=function(e){if(Audio.recorderObj.isRecording()){var t=e.inputBuffer.getChannelData(0),a=e.inputBuffer.getChannelData(1);Audio.recorderObj.cloneChannelData(t,a)}},Audio.availabel=!0,r&&r()}},function(e){console.log("getUserMedia->failure(): ERROR: Microphone access request failed!");switch(e.name){case"PermissionDeniedError":Label.recordDeniedLabel;break;case"DevicesNotFoundError":Label.recordDeviceNotFoundLabel;break;default:"ERROR: The following unexpected error occurred while attempting to connect to your microphone: "+e.name}})):console.log("ERROR: getUserMedia not supported by browser.")},handleStartRecording:function(){Audio.recorderObj.startRecordingNewWavFile()},handleStopRecording:function(){Audio.recorderObj.stopRecording(),Audio.wavFileBlob=Audio.recorderObj.buildWavFileBlob()}}; \ No newline at end of file diff --git a/src/main/resources/skins/classic/footer.ftl b/src/main/resources/skins/classic/footer.ftl index 0620444e7..2310a5a6d 100644 --- a/src/main/resources/skins/classic/footer.ftl +++ b/src/main/resources/skins/classic/footer.ftl @@ -56,7 +56,7 @@ - + - +