!function(e,n){var o=window.jQuery||{},t=n,i=window.document,r=n;e.loginBox=e.loginBox?e.loginBox:{},o===window.jQuery?($selectorAll=function(e){var n=[];return o(e).each(function(e,o){n.push(o)}),n},function(e){return o(e).get(0)},t=!0):$selectorAll=function(e){return document.querySelectorAll(e)},o.LOGIN=o.LOGIN||{},o.LOGIN.isInit=!0,e.loginBox.scope=o.LOGIN;var a=function(e){var n=window.frames.passport_iframe;n&&(n=n.window,o.LOGIN.w=n),n||(n=o.LOGIN.w),n&&n.checkPollingTimer&&setTimeout(function(){n.checkPollingTimer(e)},500)},s=function(e){var n=document.cookie;return n&&function(){var o,t={};n=n.split("; ");for(var i=0,r=n.length;i0&&(o[0]===e&&(t.key=o[0],t.value=o[1],t.status=!0),"key"in t)));i++);return"key"in t&&t}()},l=function(e,n,o){var t,i,r=s(e);r&&!0===r.status&&(t=r.key+"="+r.value+";",i=new Date,i.setTime(i.getTime()-1e3),t=t+"expires="+i.toGMTString()+";",n&&(t=t+"domain="+n+";"),o&&(t=t+"path="+o+";"),document.cookie=t)},c=function(){s("c-login-auto").status&&l("c-login-auto",".csdn.net","/"),delete o.LOGIN.options.pvSource},d=function(){var e=i.head,n=e.firstElementChild||e.firstChild,o=document.createElement("style");o.innerText=".login-box{position: fixed;display: none;left: 50%;top: 50%;z-index: 10000;-webkit-transform: translate(-50%, -50%);-ms-transform: translate(-50%, -50%);-o-transform: translate(-50%, -50%);-moz-transform: translate(-50%, -50%);transform: translate(-50%, -50%);background-color: #fff;}.login-mark{position: fixed;top: 0;left: 0;z-index: 9999;background-color: rgba(0, 0, 0, 0.5);width: 100%;height: 100%;display: none;}",e.insertBefore(o,n)},u=function(e){e&&e.pvSource&&(o.LOGIN.options.pvSource=e.pvSource,o.LOGIN.options.isClosedMaskArea=e.isClosedMaskArea,o.LOGIN.options.isClosedBtn=e.isClosedBtn,p(o.LOGIN.options)),o.LOGIN.docDom&&(i.body.appendChild(o.LOGIN.oMark),i.body.appendChild(o.LOGIN.docDom),o.LOGIN.appendBox.isCreate=!0)},f=function(e){var n,t,a,s=e.domain,l=e.from,c=e.append,d=e.isClosedBtn,u=e.isClosedMaskArea,f=e.service,p=e.isRedirect,m=e.loginService,L=e.isIframe,I=e.iframeName,N=e.frameWidth,O=e.frameHeight,G=document.createElement("div");return G.className="login-mark",i.domain=s||"csdn.net",l&&(m=m+"?from="+l,f&&(m=m+"&service="+f),a=m,e.pvSource&&(m=m+"&"+e.pvSource)),r=document.createDocumentFragment(),n='',t=document.createElement("div"),t.id=c.replace(/[#\.]/,""),t.className="login-box",o.LOGIN.appendBox=t,o.LOGIN.markDom=G,o.LOGIN.recordLoginService=a,o.LOGIN.loginService=m,o.LOGIN.isClosedMaskArea=u,L&&(o.LOGIN.appendBox.innerHTML=n,o.LOGIN.iframeName=I,o.LOGIN.iframeDom=o.LOGIN.appendBox.firstElementChild||o.LOGIN.appendBox.firstChild),d&&(cssStyle="display: inline-block; color: #999; font-size: 22px; cursor: pointer; position:absolute; top:2%; right:5%;-moz-user-select:none; -webkit-user-select:none; user-select:none;",closeBtn=document.createElement("span"),closeBtn.style=cssStyle,closeBtn.innerHTML="×",t.appendChild(closeBtn),o.LOGIN.closeBtn=closeBtn),r&&(r.appendChild(t),o.LOGIN.oMark=G,o.LOGIN.docDom=r),o.LOGIN.isRedirect=p,!0},p=e.loginBox.login=function(t){t=t||{};var i={domain:t.domain||"csdn.net",isRedirect:t.isRedirect||!document.createElement("iframe").sandbox,iframeName:t.iframeName||"passport_iframe",isIframe:t.isIframe===n||t.isIframe,frameWidth:t.frameWidth,frameHeight:t.frameHeight,append:t.append||"#passport-box",isClosedBtn:void 0==t.isClosedBtn||!!t.isClosedBtn,isClosedMaskArea:void 0==t.isClosedMaskArea||!!t.isClosedMaskArea,from:t.from,service:t.service,loginService:t.loginService,initRun:t.initRun||null,before:t.before||null,after:t.after||null,finished:t.finished||null};if(t.pvSource&&(i.pvSource=t.pvSource),t.isClosedMaskArea&&(i.isClosedMaskArea=t.isClosedMaskArea),!i.loginService)throw new Error("login 处理 control错误!");return o.LOGIN.options=i,o.LOGIN.runStatus=!0,i.isIframe&&function(){i.initRun&&(o.LOGIN.runStatus=i.initRun()),o.LOGIN.runStatus&&(o.LOGIN.runStatus=f(i))}(),e.loginBox},m=function(e){return o.LOGIN.runStatus=o.LOGIN.options[e]?o.LOGIN.options[e]():o.LOGIN.runStatus,o.LOGIN.runStatus},L=function(e,n,o){window.addEventListener?function(){e.addEventListener(n,o,!1)}():function(){e.attachEvent("on"+n,o)}()},I=function(e,n){var t;if(t="all"===e?"none":"block","start"===e&&(t="block"),!o.LOGIN.options.pvSource&&"block"===t){var i;o.LOGIN.loginService!==o.LOGIN.recordLoginService&&(i=o.LOGIN.appendBox.getElementsByTagName("iframe"),i[0].src=o.LOGIN.recordLoginService,o.LOGIN.loginService=o.LOGIN.recordLoginService)}return o.LOGIN.appendBox&&(o.LOGIN.markDom.style.display=t,o.LOGIN.appendBox.style.display=t,o.LOGIN.appendBox.status="block"===t||(o.LOGIN.runStatus=!0,!1)),o.LOGIN.appendBox.status&&n&&n(),t&&a(o.LOGIN.appendBox.status),o.LOGIN},N=function(){var e=function(e){var n=window.event||e;if(o.LOGIN.appendBox.status)return I(o.LOGIN.isClosedMaskArea?"all":"no-close"),n.cancelBubble?n.cancelBubble=!0:n.stopPropagation(),!1};o.LOGIN.oMark&&!o.LOGIN.oMark.isClick&&(L(o.LOGIN.oMark,"click",e),o.LOGIN.oMark.isClick=!0),o.LOGIN.closeBtn&&o.LOGIN.oMark.isClick&&!o.LOGIN.closeBtn.isCloseClick&&(L(o.LOGIN.closeBtn,"click",e),o.LOGIN.closeBtn.isCloseClick=!0)},O=function(){o.LOGIN.loginBtn=$selectorAll("[data-bind-login=true]");var e=function(e){var t=window.event||e,r="true"===this.getAttribute("data-bind-login"),a=this.href;if(!o.LOGIN.runStatus&&r)return console.error("开启loginbox失败!"),!1;!1===o.LOGIN.isRedirect?!0===r&&(o.LOGIN.options.isIframe&&(c(),!o.LOGIN.appendBox.isCreate&&u(),m("before")&&I(n,function(){m("after")}),N()),t.returnValue?t.returnValue=!1:t.preventDefault()):a||(i.location.href=o.LOGIN.options.loginService)},t=0;if(!o.LOGIN.loginBtn||o.LOGIN.loginBtn.length<=0)return!1;for(;o.LOGIN.loginBtn[t];)!function(n){var t=o.LOGIN.loginBtn[n];L(t,"click",e)}(t),t++},G=function(e){var n={domain:"csdn.net",isIframe:!0,frameWidth:410,frameHeight:427,append:"#passportbox",from:window.location.href,isClosedBtn:!1,loginService:"https://passport.csdn.net/account/login"};for(var o in e)n[o]=e[o];p(n)};e.loginBox.close=function(){return o.LOGIN.appendBox.status&&I("all"),e.loginBox},e.loginBox.show=function(n){return!o.LOGIN.appendBox.isCreate&&u(n),o.LOGIN.appendBox.status||(I("start"),N()),e.loginBox};var g,v=(e.loginBox.support=function(){return o.LOGIN.isRedirect},function(){var n=e&&e.loginBox&&e.loginBox.loginBoxParams;return n||console.warn("login-box has no loginBoxParams"),n||{}}),B=function(){if(d(),O(),o.LOGIN.isInit){var e=v();G(e)}},h=function(e){var n=!1,o=function(){n||(n=!0,e&&e())},t=function(){try{i.documentElement.doScroll("left")}catch(e){return void setTimeout(t,50)}o()};t(),i.onreadystatechange=function(){"complete"===i.readyState&&(i.onreadystatechange=null,o())}},k=function(e){document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(function(){e&&e()},0):(g=function(){document.removeEventListener("DOMContentLoaded",g,!1),e()},document.addEventListener("DOMContentLoaded",g,!1)):document.attachEvent&&h(e)};_ready=function(){t&&o(function(){B()})||k(B)},_ready()}(window.csdn=window.csdn||{},void 0);