functionTabs(e){functiont(e){console.log("hide",e),e.removeClass("js-tab-nav-show"),$(e.data("tab-target")).removeClass("js-tab-show").hide()}functionn(e){console.log("show",e),e.addClass("js-tab-nav-show"),$(e.data("tab-target")).addClass("js-tab-show").show()}varr=$(e);if(r.length){vari=r.find(".js-tab-nav-show");i.length&&$(i.data("tab-target")).addClass("js-tab-show"),r.on("click",".js-tab-nav",function(){vare=$(this);e.hasClass("js-tab-nav-show")||(i=r.find(".js-tab-nav-show").eq(0),t(i),n(e))}),console.log("init tabs @",e)}}functioninitCore(){Gogs.renderMarkdown(),Gogs.renderCodeView()}functionhomepage(){$("#promo-form").submit(function(e){return""===$("#username").val()?(e.preventDefault(),window.location.href="/user/login",!0):void0}),$("#register-button").click(function(e){return""===$("#username").val()?(e.preventDefault(),window.location.href="/user/sign_up",!0):void$("#promo-form").attr("action","/user/sign_up")})}functionsettingsProfile(){$("#user-profile-form").submit(function(e){return$("#username").data("uname")==$("#username").val()||confirm("Username has been changed, do you want to continue?")?void0:(e.preventDefault(),!0)})}functionsettingsSSHKeys(){$("#ssh-add").click(function(){$("#user-ssh-add-form").removeClass("hide")})}functionsettingsDelete(){$("#delete-account-button").click(function(e){returnconfirm("This account is going to deleted, do you want to continue?")?void0:(e.preventDefault(),!0)})}!function(e,t){"object"==typeofmodule&&"object"==typeofmodule.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)thrownewError("jQuery requires a window with a document");returnt(e)}:t(e)}("undefined"!=typeofwindow?window:this,function(e,t){functionn(e){vart=e.length,n=ot.type(e);return"function"===n||ot.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeoft&&t>0&&t-1ine}functionr(e,t,n){if(ot.isFunction(t))returnot.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)returnot.grep(e,function(e){returne===t!==n});if("string"==typeoft){if(pt.test(t))returnot.filter(t,e,n);t=ot.filter(t,e)}returnot.grep(e,function(e){returnot.inArray(e,t)>=0!==n})}functioni(e,t){doe=e[t];while(e&&1!==e.nodeType);returne}functiono(e){vart=wt[e]={};returnot.each(e.match(xt)||[],function(e,n){t[n]=!0}),t}functiona(){mt.addEventListener?(mt.removeEventListener("DOMContentLoaded",s,!1),e.removeEventListener("load",s,!1)):(mt.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}functions(){(mt.addEventListener||"load"===event.type||"complete"===mt.readyState)&&(a(),ot.ready())}functionl(e,t,n){if(void0===n&&1===e.nodeType){varr="data-"+t.replace(kt,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeofn){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:Et.test(n)?ot.parseJSON(n):n}catch(i){}ot.data(e,t,n)}elsen=void0}returnn}functionu(e){vart;for(tine)if(("data"!==t||!ot.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}functionc(e,t,n,r){if(ot.acceptData(e)){vari,o,a=ot.expando,s=e.nodeType,l=s?ot.cache:e,u=s?e[a]:e[a]&&a;if(u&&l[u]&&(r||l[u].data)||void0!==n||"string"!=typeoft)returnu||(u=s?e[a]=G.pop()||ot.guid++:a),l[u]||(l[u]=s?{}:{toJSON:ot.noop}),("object"==typeoft||"function"==typeoft)&&(r?l[u]=ot.extend(l[u],t):l[u].data=ot.extend(l[u].data,t)),o=l[u],r||(o.data||(o.data={}),o=o.data),void0!==n&&(o[ot.camelCase(t)]=n),"string"==typeoft?(i=o[t],null==i&&(i=o[ot.camelCase(t)])):i=o,i}}functiond(e,t,n){if(ot.acceptData(e)){varr,i,o=e.nodeType,a=o?ot.cache:e,s=o?e[ot.expando]:ot.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){ot.isArray(t)?t=t.concat(ot.map(t,ot.camelCase)):tinr?t=[t]:(t=ot.camelCase(t),t=tinr?[t]:t.split(" ")),i=t.length;for(;i--;)deleter[t[i]];if(n?!u(r):!ot.isEmptyObject(r))return}(n||(deletea[s].data,u(a[s])))&&(o?ot.cleanData([e],!0):rt.deleteExpando||a!=a.window?deletea[s]:a[s]=null)}}}functionf(){return!0}functionp(){return!1}functionh(){try{returnmt.activeElement}catch(e){}}functionm(e){vart=Ht.split("|"),n=e.createDocumentFragment();if(n.create
vara=null,a=null;PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]),function(e){e.fn.zclip=function(t){if("object"==typeoft&&!t.length){varn=e.extend({path:"ZeroClipboard.swf",copy:null,beforeCopy:null,afterCopy:null,clickAfter:!0,setHandCursor:!0,setCSSEffects:!0},t);returnthis.each(function(){vart=e(this);if(t.is(":visible")&&("string"==typeofn.copy||e.isFunction(n.copy))){ZeroClipboard.setMoviePath(n.path);varr=newZeroClipboard.Client;e.isFunction(n.copy)&&t.bind("zClip_copy",n.copy),e.isFunction(n.beforeCopy)&&t.bind("zClip_beforeCopy",n.beforeCopy),e.isFunction(n.afterCopy)&&t.bind("zClip_afterCopy",n.afterCopy),r.setHandCursor(n.setHandCursor),r.setCSSEffects(n.setCSSEffects),r.addEventListener("mouseOver",function(e){t.trigger("mouseenter")}),r.addEventListener("mouseOut",function(e){t.trigger("mouseleave")}),r.addEventListener("mouseDown",function(i){t.trigger("mousedown"),r.setText(e.isFunction(n.copy)?t.triggerHandler("zClip_copy"):n.copy),e.isFunction(n.beforeCopy)&&t.trigger("zClip_beforeCopy")}),r.addEventListener("complete",function(r,i){e.isFunction(n.afterCopy)?t.trigger("zClip_afterCopy"):(i.length>500&&(i=i.substr(0,500)+"...\n\n("+(i.length-500)+" characters not shown)"),t.removeClass("hover"),alert("Copied text to clipboard:\n\n "+i)),n.clickAfter&&t.trigger("click")}),r.glue(t[0],t.parent()[0]),e(window).bind("load resize",function(){r.reposition()})}})}return"string"==typeoft?this.each(function(){varn=e(this);t=t.toLowerCase();varr=n.data("zclipId"),i=e("#"+r+".zclip");"remove"==t?(i.remove(),n.removeClass("active hover")):"hide"==t?(i.hide(),n.removeClass("active hover")):"show"==t&&i.show()}):void0}}(jQuery);varZeroClipboard={version:"1.0.7",clients:{},moviePath:"ZeroClipboard.swf",nextId:1,$:function(e){return"string"==typeofe&&(e=document.getElementById(e)),e.addClass||(e.hide=function(){},e.show=function(){this.style.display=""},e.addClass=function(e){this.removeClass(e),this.className+=" "+e},e.removeClass=function(e){for(vart=this.className.split(/\s+/),n=-1,r=0;r<t.length;r++)t[r]==e&&(n=r,r=t.length);returnn>-1&&(t.splice(n,1),this.className=t.join(" ")),this},e.hasClass=function(e){return!!this.className.match(newRegExp("\\s*"+e+"\\s*"))}),e},setMoviePath:function(e){this.moviePath=e},dispatch:function(e,t,n){varr=this.clients[e];r&&r.receiveEvent(t,n)},register:function(e,t){this.clients[e]=t},getDOMObjectPosition:function(e,t){varn={left:0,top:0,width:e.width?e.width:e.offsetWidth,height:e.height?e.height:e.offsetHeight};returne&&e!=t&&(n.left+=e.offsetLeft,n.top+=e.offsetTop),n},Client:function(e){this.handlers={},this.id=ZeroClipboard.nextId++,this.movieId="ZeroClipboardMovie_"+this.id,ZeroClipboard.register(this.id,this),e&&this.glue(e)}};ZeroClipboard.Client.prototype={id:0,ready:!1,movie:null,clipText:"",handCursorEnabled:!0,cssEffects:!0,handlers:null,glue:function(e,t,n){this.domElement=ZeroClipboard.$(e);varr=99;this.domElement.style.zIndex&&(r=parseInt(this.domElement.style.zIndex,10)+1),"string"==typeoft?t=ZeroClipboard.$(t):"undefined"==typeoft&&(t=document.getElementsByTagName("body")[0]);vari=ZeroClipboard.getDOMObjectPosition(this.domElement,t);this.div=document.createElement("div"),this.div.className="zclip",this.div.id="zclip-"+this.movieId,$(this.domElement).data("zclipId","zclip-"+this.movieId);varo=this.div.style;if(o.position="absolute",o.left=""+i.left+"px",o.top=""+i.top+"px",o.width=""+i.width+"px",o.height=""+i.height+"px",o.zIndex=r,"object"==typeofn)for(addedStyleinn)o[addedStyle]=n[addedStyle];t.appendChild(this.div),this.div.innerHTML=this.getHTML(i.width,i.height)},getHTML:function(e,t){varn="",r="id="+this.id+"&width="+e+"&height="+t;if(navigator.userAgent.match(/MSIE/)){vari=location.hr