You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
395 KiB
14 lines
395 KiB
9 years ago
|
(function(){null==window.GitHub&&(window.GitHub={})}).call(this),function(){top!==window&&(alert("For security reasons, framing is not allowed."),top.location.replace(document.location))}.call(this),function(e){e.fn.caret=function(e){return"undefined"==typeof e?this[0].selectionStart:(this[0].focus(),this[0].setSelectionRange(e,e))},e.fn.caretSelection=function(e,t){return"undefined"==typeof e&&"undefined"==typeof t?[this[0].selectionStart,this[0].selectionEnd]:(this[0].focus(),this[0].setSelectionRange(e,t))}}(jQuery),function(){$(document).on("ajaxSuccess",".js-ajax-pagination",function(e,t,n,r){return this.replaceWith.apply(this,$.parseHTML(r))})}.call(this),function(){var e,t,n;t=require("github/failbot").reportError,e=function(e){return Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.name="DataRemoteError",this.message=e},e.prototype=new Error,e.prototype.constructor=e,n=function(){return $("#ajax-error-message").show(function(){return $(this).addClass("visible")})},$(document).on("ajaxError","[data-remote]",function(r,i,s,o){var a,c,u,l,d,h;if(this===r.target&&"abort"!==o&&"canceled"!==o){if(c="."+this.className.split(" ").sort().join("."),a=new e(o+" ("+i.status+") from "+c),t(a,{dataRemote:{target:$(this).inspect(),method:null!=(u=this.getAttribute("method"))?u:"GET",url:null!=(l=null!=(d=this.href)?d:this.action)?l:window.location.href,dataType:null!=(h=this.getAttribute("data-type"))?h:"intelligent guess"}}),/<html/.test(i.responseText))throw n(),r.stopImmediatePropagation(),a;return setTimeout(function(){if(!r.isDefaultPrevented())throw n(),a},0)}}),$(document).on("ajaxSend","[data-remote]",function(){return $("#ajax-error-message").hide().removeClass("visible")}),$(document).on("click",".js-ajax-error-dismiss",function(){return $("#ajax-error-message").hide().removeClass("visible"),!1})}.call(this),function(){$(document).on("ajaxSend","[data-remote]",function(e){return this!==e.target||e.isDefaultPrevented()?void 0:$(this).addClass("loading")}),$(document).on("ajaxComplete","[data-remote]",function(e){return this===e.target?$(this).removeClass("loading"):void 0})}.call(this),function(){var e,t,n,r,i,s={}.hasOwnProperty,o=[].slice;n=function(e){return console&&console.log?console.log(e):void 0},i=function(e){return console&&console.warn?console.warn(e):void 0},t=function(e,t){var n,r,i;if(e.length!==t.length)return!1;for(n=r=0,i=e.length;i>=0?i>r:r>i;n=i>=0?++r:--r)if(e[n]!==t[n])return!1;return!0},e={host:"collector.githubapp.com",type:"page_view",dimensions:{},measures:{},context:{},actor:{},image:new Image,performance:{},expectedPerformanceTimingKeys:["connectEnd","connectStart","domComplete","domContentLoadedEventEnd","domContentLoadedEventStart","domInteractive","domLoading","domainLookupEnd","domainLookupStart","fetchStart","loadEventEnd","loadEventStart","navigationStart","redirectEnd","redirectStart","requestStart","responseEnd","responseStart","secureConnectionStart","unloadEventEnd","unloadEventStart"],recordPageView:function(){return this.applyMetaTags(),null==this.app?!1:null==this.host?(i("Host not set, you are doing something wrong"),!1):(this.image.src=this._src(),this._clearPerformance(),!0)},setHost:function(e){return this.host=e},setApp:function(e){return this.app=e},setDimensions:function(e){return this.dimensions=e},addDimensions:function(e){var t,n,r;null==this.dimensions&&(this.dimensions={}),n=[];for(t in e)s.call(e,t)&&(r=e[t],n.push(this.dimensions[t]=r));return n},setMeasures:function(e){return this.measures=e},setMeasures:function(e){return this.measures=e},addMeasures:function(e){var t,n,r;null==this.measures&&(this.measures={}),n=[];for(t in e)s.call(e,t)&&(r=e[t],n.push(this.measures[t]=r));return n},setContext:function(e){return this.context=e},addContext:function(e){var t,n,r;null==this.context&&(this.context={}),n=[];for(t in e)s.call(e,t)&&(r=e[t],n.push(this.context[t]=r));return n},setActor:function(e){return this.actor=e},push:function(e){return this.applyCall(e)},enablePerformance:function(){return
|
||
|
},n=function(e){var t,n,i;for(n=0,i=r.length;i>n;n++)if(t=r[n],t.type===e)return t},h=function(e){var t,n,r,i,s,o;for(r=!0,i=0,n=(e+"").split("").reverse(),s=0,o=n.length;o>s;s++)t=n[s],t=parseInt(t,10),(r=!r)&&(t*=2),t>9&&(t-=9),i+=t;return i%10===0},d=function(e){var t;return null!=e.prop("selectionStart")&&e.prop("selectionStart")!==e.prop("selectionEnd")?!0:("undefined"!=typeof document&&null!==document&&null!=(t=document.selection)&&"function"==typeof t.createRange?t.createRange().text:void 0)?!0:!1},f=function(t){return setTimeout(function(){var n,r;return n=e(t.currentTarget),r=n.val(),r=e.payment.formatCardNumber(r),n.val(r)})},a=function(n){var r,i,s,o,a,c,u;return s=String.fromCharCode(n.which),!/^\d+$/.test(s)||(r=e(n.currentTarget),u=r.val(),i=t(u+s),o=(u.replace(/\D/g,"")+s).length,c=16,i&&(c=i.length[i.length.length-1]),o>=c||null!=r.prop("selectionStart")&&r.prop("selectionStart")!==u.length)?void 0:(a=i&&"amex"===i.type?/^(\d{4}|\d{4}\s\d{6})$/:/(?:^|\s)(\d{4})$/,a.test(u)?(n.preventDefault(),r.val(u+" "+s)):a.test(u+s)?(n.preventDefault(),r.val(u+s+" ")):void 0)},s=function(t){var n,r;return n=e(t.currentTarget),r=n.val(),t.meta||8!==t.which||null!=n.prop("selectionStart")&&n.prop("selectionStart")!==r.length?void 0:/\d\s$/.test(r)?(t.preventDefault(),n.val(r.replace(/\d\s$/,""))):/\s\d?$/.test(r)?(t.preventDefault(),n.val(r.replace(/\s\d?$/,""))):void 0},c=function(t){var n,r,i;return r=String.fromCharCode(t.which),/^\d+$/.test(r)?(n=e(t.currentTarget),i=n.val()+r,/^\d$/.test(i)&&"0"!==i&&"1"!==i?(t.preventDefault(),n.val("0"+i+" / ")):/^\d\d$/.test(i)?(t.preventDefault(),n.val(""+i+" / ")):void 0):void 0},u=function(t){var n,r,i;return r=String.fromCharCode(t.which),/^\d+$/.test(r)?(n=e(t.currentTarget),i=n.val(),/^\d\d$/.test(i)?n.val(""+i+" / "):void 0):void 0},l=function(t){var n,r,i;return r=String.fromCharCode(t.which),"/"===r?(n=e(t.currentTarget),i=n.val(),/^\d$/.test(i)&&"0"!==i?n.val("0"+i+" / "):void 0):void 0},o=function(t){var n,r;if(!t.meta&&(n=e(t.currentTarget),r=n.val(),8===t.which&&(null==n.prop("selectionStart")||n.prop("selectionStart")===r.length)))return/\d(\s|\/)+$/.test(r)?(t.preventDefault(),n.val(r.replace(/\d(\s|\/)*$/,""))):/\s\/\s?\d?$/.test(r)?(t.preventDefault(),n.val(r.replace(/\s\/\s?\d?$/,""))):void 0},v=function(e){var t;return e.metaKey||e.ctrlKey?!0:32===e.which?!1:0===e.which?!0:e.which<33?!0:(t=String.fromCharCode(e.which),!!/[\d\s]/.test(t))},p=function(n){var r,i,s,o;return r=e(n.currentTarget),s=String.fromCharCode(n.which),/^\d+$/.test(s)&&!d(r)?(o=(r.val()+s).replace(/\D/g,""),i=t(o),i?o.length<=i.length[i.length.length-1]:o.length<=16):void 0},g=function(t){var n,r,i;return n=e(t.currentTarget),r=String.fromCharCode(t.which),/^\d+$/.test(r)&&!d(n)?(i=n.val()+r,i=i.replace(/\D/g,""),i.length>6?!1:void 0):void 0},m=function(t){var n,r,i;return n=e(t.currentTarget),r=String.fromCharCode(t.which),/^\d+$/.test(r)?(i=n.val()+r,i.length<=4):void 0},b=function(t){var n,i,s,o,a;return n=e(t.currentTarget),a=n.val(),o=e.payment.cardType(a)||"unknown",n.hasClass(o)?void 0:(i=function(){var e,t,n;for(n=[],e=0,t=r.length;t>e;e++)s=r[e],n.push(s.type);return n}(),n.removeClass("unknown"),n.removeClass(i.join(" ")),n.addClass(o),n.toggleClass("identified","unknown"!==o),n.trigger("payment.cardType",o))},e.payment.fn.formatCardCVC=function(){return this.payment("restrictNumeric"),this.on("keypress",m),this},e.payment.fn.formatCardExpiry=function(){return this.payment("restrictNumeric"),this.on("keypress",g),this.on("keypress",c),this.on("keypress",l),this.on("keypress",u),this.on("keydown",o),this},e.payment.fn.formatCardNumber=function(){return this.payment("restrictNumeric"),this.on("keypress",p),this.on("keypress",a),this.on("keydown",s),this.on("keyup",b),this.on("paste",f),this},e.payment.fn.restrictNumeric=function(){return this.on("keypress",v),this},e.payment.fn.cardExpiryVal=function(){return e.payment.cardExpiryVal(e(this).val())},e.payment.cardExpiryVal=function(e){var t,n,r,i;return e=e.replace(/\s/g,""),i=e.split("/",2),t=i[0],r=i[1],2===(null!=r?r.length:void
|
||
|
case"e":n[1]=t.y2;break;case"w":n[1]=t.y2;break;case"n":n[0]=t.x2;break;case"s":n[0]=t.x2}de.setCurrent(n),fe.update()}}function d(e){var t=e;return pe.watchKeys(),function(e){de.moveOffset([e[0]-t[0],e[1]-t[1]]),t=e,fe.update()}}function h(e){switch(e){case"n":return"sw";case"s":return"nw";case"e":return"nw";case"w":return"ne";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne"}}function f(e){return function(t){return I.disabled?!1:"move"!==e||I.allowMove?(P=o(B),re=!0,u(e,a(t)),t.stopPropagation(),t.preventDefault(),!1):!1}}function m(e,t,n){var r=e.width(),i=e.height();r>t&&t>0&&(r=t,i=t/e.width()*e.height()),i>n&&n>0&&(i=n,r=n/e.height()*e.width()),te=e.width()/r,ne=e.height()/i,e.width(r).height(i)}function p(e){return{x:e.x*te,y:e.y*ne,x2:e.x2*te,y2:e.y2*ne,w:e.w*te,h:e.h*ne}}function g(e){var t=de.getFixed();t.w>I.minSelect[0]&&t.h>I.minSelect[1]?(fe.enableHandles(),fe.done()):fe.release(),me.setCursor(I.allowSelect?"crosshair":"default")}function v(e){if(I.disabled)return!1;if(!I.allowSelect)return!1;re=!0,P=o(B),fe.disableHandles(),me.setCursor("crosshair");var t=a(e);return de.setPressed(t),fe.update(),me.activateHandlers(b,g,"touch"===e.type.substring(0,5)),pe.watchKeys(),e.stopPropagation(),e.preventDefault(),!1}function b(e){de.setCurrent(e),fe.update()}function y(){var t=e("<div></div>").addClass(i("tracker"));return R&&t.css({opacity:0,backgroundColor:"white"}),t}function $(e){Y.removeClass().addClass(i("holder")).addClass(e)}function j(e,t){function n(){window.setTimeout(b,d)}var r=e[0]/te,i=e[1]/ne,s=e[2]/te,o=e[3]/ne;if(!ie){var a=de.flipCoords(r,i,s,o),c=de.getFixed(),u=[c.x,c.y,c.x2,c.y2],l=u,d=I.animationDelay,h=a[0]-u[0],f=a[1]-u[1],m=a[2]-u[2],p=a[3]-u[3],g=0,v=I.swingSpeed;r=l[0],i=l[1],s=l[2],o=l[3],fe.animMode(!0);var b=function(){return function(){g+=(100-g)/v,l[0]=Math.round(r+g/100*h),l[1]=Math.round(i+g/100*f),l[2]=Math.round(s+g/100*m),l[3]=Math.round(o+g/100*p),g>=99.8&&(g=100),100>g?(x(l),n()):(fe.done(),fe.animMode(!1),"function"==typeof t&&t.call(ge))}}();n()}}function w(e){x([e[0]/te,e[1]/ne,e[2]/te,e[3]/ne]),I.onSelect.call(ge,p(de.getFixed())),fe.enableHandles()}function x(e){de.setPressed([e[0],e[1]]),de.setCurrent([e[2],e[3]]),fe.update()}function k(){return p(de.getFixed())}function C(){return de.getFixed()}function S(e){c(e),D()}function L(){I.disabled=!0,fe.disableHandles(),fe.setCursor("default"),me.setCursor("default")}function A(){I.disabled=!1,D()}function T(){fe.done(),me.activateHandlers(null,null)}function q(){Y.remove(),O.show(),O.css("visibility","visible"),e(t).removeData("Jcrop")}function _(e,t){fe.release(),L();var n=new Image;n.onload=function(){var r=n.width,i=n.height,s=I.boxWidth,o=I.boxHeight;B.width(r).height(i),B.attr("src",e),V.attr("src",e),m(B,s,o),U=B.width(),W=B.height(),V.width(U).height(W),ae.width(U+2*oe).height(W+2*oe),Y.width(U).height(W),he.resize(U,W),A(),"function"==typeof t&&t.call(ge)},n.src=e}function E(e,t,n){var r=t||I.bgColor;I.bgFade&&s()&&I.fadeTime&&!n?e.animate({backgroundColor:r},{queue:!1,duration:I.fadeTime}):e.css("backgroundColor",r)}function D(e){I.allowResize?e?fe.enableOnly():fe.enableHandles():fe.disableHandles(),me.setCursor(I.allowSelect?"crosshair":"default"),fe.setCursor(I.allowMove?"move":"default"),I.hasOwnProperty("trueSize")&&(te=I.trueSize[0]/U,ne=I.trueSize[1]/W),I.hasOwnProperty("setSelect")&&(w(I.setSelect),fe.done(),delete I.setSelect),he.refresh(),I.bgColor!=ce&&(E(I.shade?he.getShades():Y,I.shade?I.shadeColor||I.bgColor:I.bgColor),ce=I.bgColor),ue!=I.bgOpacity&&(ue=I.bgOpacity,I.shade?he.refresh():fe.setBgOpacity(ue)),X=I.maxSize[0]||0,Q=I.maxSize[1]||0,Z=I.minSize[0]||0,ee=I.minSize[1]||0,I.hasOwnProperty("outerImage")&&(B.attr("src",I.outerImage),delete I.outerImage),fe.refresh()}var P,I=e.extend({},e.Jcrop.defaults),M=navigator.userAgent.toLowerCase(),R=/msie/.test(M),H=/msie [1-6]\./.test(M);"object"!=typeof t&&(t=e(t)[0]),"object"!=typeof n&&(n={}),c(n);var N={border:"none",visibility:"visible",margin:0,padding:0,position:"absolute",top:0,left:0},O=e(t),F=!0;if("IMG"==t.tagName){i
|
||
|
t||void 0}function q(e,t,n){"none"==t&&(t="");var r=[],i=De(e);e="__utma"==e?6:2;for(var s=0;s<i[me];s++){var o=(""+i[s])[X](".");o[me]>=e&&r[oe]({hash:o[0],R:i[s],O:o})}return 0==r[me]?void 0:1==r[me]?r[0]:_(t,r)||_(n,r)||_(null,r)||r[0]}function _(e,t){var n,r;null==e?n=r=1:(n=R(e),r=R(o(e,".")?e[$e](1):"."+e));for(var i=0;i<t[me];i++)if(t[i][ae]==n||t[i][ae]==r)return t[i]}function E(e){e=e.get(jn);var t=D(e,0);return"_ga=1."+d(t+"."+e)}function D(e,t){for(var n=new Date,r=Te[je],i=r.plugins||[],n=[e,r.userAgent,n.getTimezoneOffset(),n.getYear(),n.getDate(),n.getHours(),n.getMinutes()+t],r=0;r<i[me];++r)n[oe](i[r].description);return R(n[xe]("."))}function P(e,t){if(t==qe[Q][ee])return!1;for(var n=0;n<e[me];n++)if(e[n]instanceof RegExp){if(e[n][ce](t))return!0}else if(0<=t[de](e[n]))return!0;return!1}function I(){var e=Te.gaGlobal=Te.gaGlobal||{};return e.hid=e.hid||Ke()}function M(e){return 0<=e[de](".")||0<=e[de](":")}function R(e){var t,n=1,r=0;if(e)for(n=0,t=e[me]-1;t>=0;t--)r=e.charCodeAt(t),n=(n<<6&268435455)+r+(r<<14),r=266338304&n,n=0!=r?n^r>>21:n;return n}var H=encodeURIComponent,N=window,O=setTimeout,F=Math,z="replace",B="data",U="match",W="send",Y="port",V="createElement",G="setAttribute",K="getTime",J="host",X="split",Q="location",Z="hasOwnProperty",ee="hostname",te="search",ne="protocol",re="href",ie="action",se="apply",oe="push",ae="hash",ce="test",ue="slice",le="cookie",de="indexOf",he="defaultValue",fe="name",me="length",pe="prototype",ge="clientWidth",ve="target",be="call",ye="clientHeight",$e="substring",je="navigator",we="parentNode",xe="join",ke="toLowerCase",Ce=new function(){var e=[];this.set=function(t){e[t]=!0},this.M=function(){for(var t=[],n=0;n<e[me];n++)e[n]&&(t[F.floor(n/6)]=t[F.floor(n/6)]^1<<n%6);for(n=0;n<t[me];n++)t[n]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".charAt(t[n]||0);return t[xe]("")+"~"}},Se=function(e,t,r,i){try{e.addEventListener?e.addEventListener(t,r,!!i):e.attachEvent&&e.attachEvent("on"+t,r)}catch(s){n(27)}},Le=function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent&&e.detachEvent("on"+t,n)},Ae=function(){this.keys=[],this.w={},this.m={}};Ae[pe].set=function(e,t,n){this.keys[oe](e),n?this.m[":"+e]=t:this.w[":"+e]=t},Ae[pe].get=function(e){return this.m[Z](":"+e)?this.m[":"+e]:this.w[":"+e]},Ae[pe].map=function(e){for(var t=0;t<this.keys[me];t++){var n=this.keys[t],r=this.get(n);r&&e(n,r)}};var Te=N,qe=document,_e=function(e){var t=Te._gaUserPrefs;if(t&&t.ioo&&t.ioo()||e&&!0===Te["ga-disable-"+e])return!0;try{var n=Te.external;if(n&&n._gaUserPrefs&&"oo"==n._gaUserPrefs)return!0}catch(r){}return!1},Ee=function(e){O(e,100)},De=function(e){var t=[],n=qe[le][X](";");e=new RegExp("^\\s*"+e+"=\\s*(.*?)\\s*$");for(var r=0;r<n[me];r++){var i=n[r][U](e);i&&t[oe](i[1])}return t},Pe=function(e,t,r,i,s,o){if(s=_e(s)?!1:Me[ce](qe[Q][ee])||"/"==r&&Ie[ce](i)?!1:!0,!s)return!1;if(t&&1200<t[me]&&(t=t[$e](0,1200),n(24)),r=e+"="+t+"; path="+r+"; ",o&&(r+="expires="+new Date((new Date)[K]()+o).toGMTString()+"; "),i&&"none"!=i&&(r+="domain="+i+";"),i=qe[le],qe.cookie=r,!(i=i!=qe[le]))e:{for(e=De(e),i=0;i<e[me];i++)if(t==e[i]){i=!0;break e}i=!1}return i},Ie=new RegExp(/^(www\.)?google(\.com?)?(\.[a-z]{2})?$/),Me=new RegExp(/(^|\.)doubleclick\.net$/i),Re=function(){for(var e=Te[je].userAgent+(qe[le]?qe[le]:"")+(qe.referrer?qe.referrer:""),t=e[me],n=Te.history[me];n>0;)e+=n--^t++;return R(e)},He=function(){return m()+"//www.google-analytics.com"},Ne=function(e){t(this,"len"),this.message=e+"-8192"},Oe=function(e){t(this,"ff2post"),this.message=e+"-2036"},Fe=function(e,t,n,r){if(n=n||l,r&&(r=n,Te[je].sendBeacon&&Te[je].sendBeacon(e,t)?(r(),r=!0):r=!1),!r)if(2036>=t[me])ze(e,t,n);else{if(!(8192>=t[me]))throw new Ne(t[me]);if(0<=Te[je].userAgent[de]("Firefox")&&![].reduce)throw new Oe(t[me]);Ue(e,t,n)||Be(e,t,n)||We(t,n)||n()}},ze=function(e,t,n){var r=u(e+"?"+t);r.onload=r.onerror=function(){r.onload=null,r.onerror=null,n()}},Be=function(e,t,n){var r;return(r=Te.XDomainRequest)?(r=new r,r.open("POST",e),r.onerror=function(){n()},r.onload=n,r[W](
|
||
|
return function(t,r){return 1===e.length?n(e[0],t):t()}}(this))},t=0,window.addEventListener("scroll",function(e){t=e.timeStamp||(new Date).getTime()},!0),n=function(n,r){var i;return n===window&&t<(new Date).getTime()-500?void setImmediate(r):(i=e(function(){return n.removeEventListener("scroll",i,!1),r()},500),n.addEventListener("scroll",i,!1),void i())}}.call(this),function(){$(document).on("ajaxSuccess",".js-notice-dismiss",function(){return $(this).closest(".js-notice").fadeOut()}),$(document).on("click",".js-notice-dismiss-action",function(){return $(this).closest(".js-notice").find(".js-notice-dismiss").submit()})}.call(this),function(){$.observeLast=function(e,t){var n,r;null==t&&(t="last"),n=r=function(){$(e).removeClass(t).last().addClass(t)},$.observe(e,{add:n,remove:r})}}.call(this),function(){$(document).on("click",".js-permalink-shortcut",function(){return window.location=this.href+window.location.hash,!1})}.call(this),function(){$(document).on("pjax:start",function(e){var t;(t=e.relatedTarget)&&($(t).addClass("pjax-active"),$(t).parents(".js-pjax-active").addClass("pjax-active"))}),$(document).on("pjax:end",function(e){$(".pjax-active").removeClass("pjax-active")})}.call(this),function(){var e;e=document.referrer,$(document).on("pjax:start",function(){return e=$.pjax.state.url}),$(document).on("click",".js-pjax-back",function(t){1!==t.which||t.metaKey||t.ctrlKey||history.length>1&&this.href===e&&(history.back(),t.preventDefault())})}.call(this),function(){$(document).on("pjax:click",function(){return window.onbeforeunload?!1:void 0})}.call(this),function(){var e;e=function(){var e,t;return t=function(){var t,n,r;for(r=[],t=0,n=arguments.length;n>t;t++)e=arguments[t],r.push(e.split("/",3).join("/"));return r}.apply(this,arguments),t[0]===t[1]},$(document).on("pjax:click","#js-repo-pjax-container a[href]",function(){var t;return t=$(this).prop("pathname"),e(t,location.pathname)?void 0:!1}),$(document).on("pjax:click",".js-comment-body",function(e){return"files"!==e.target.pathname.split("/")[3]})}.call(this),function(){var e,t;$.support.pjax&&(t={},$(e=function(){return t[document.location.pathname]=$("head [data-pjax-transient]")}),$(document).on("pjax:beforeReplace",function(e,n){var r,i,s,o;for(i=s=0,o=n.length;o>s;i=++s)r=n[i],r&&("pjax-head"===r.id?(t[document.location.pathname]=$(r).children(),n[i]=null):"js-flash-container"===r.id&&($("#js-flash-container").replaceWith(r),n[i]=null))}),$(document).on("pjax:end",function(){var e,n,r;return e=t[document.location.pathname],e?($("head [data-pjax-transient]").remove(),r=$(e).not("title, script, link[rel='stylesheet']"),n=$(e).filter("link[rel='stylesheet']"),$(document.head).append(r.attr("data-pjax-transient",!0)),$(document.head).append(n)):void 0}))}.call(this),function(){var e,t;$.support.pjax&&(t=function(e){return null!=e.getAttribute("data-pjax-preserve-scroll")?!1:0},e=function(e){var t,n,r;return t=$(e),n=t.add(t.parents("[data-pjax]")).map(function(){var e;return e=this.getAttribute("data-pjax"),null!=e&&"true"!==e?e:void 0}),(r=n[0])?document.querySelector(r):$(e).closest("[data-pjax-container]")[0]},$(document).on("click","[data-pjax] a, a[data-pjax]",function(n){var r,i;return i=this,null==i.getAttribute("data-skip-pjax")&&null==i.getAttribute("data-remote")&&(r=e(i))?$.pjax.click(n,{container:r,scrollTo:t(i)}):void 0}),$(document).on("submit","form[data-pjax]",function(n){var r,i;return i=this,(r=e(i))?$.pjax.submit(n,{container:r,scrollTo:t(i)}):void 0}))}.call(this),function(){var e;$.support.pjax&&(e=document.querySelector("meta[name=pjax-timeout]"))&&($.pjax.defaults.timeout=parseInt(e.content))}.call(this),function(){var e,t,n,r,i,s,o,a;o=require("github/stats")["default"],$.support.pjax&&(t=null,i="last_pjax_request",s="pjax_start",r="pjax_end",n=function(e){var n,r;(r=null!=(n=e.relatedTarget)?n.href:void 0)&&(window.performance.mark(s),t=r)},a=function(){setImmediate(function(){var n,a,c;if(window.performance.getEntriesByName(s).length&&(window.performance.mark(r),window.performance.measure(i,s,r),a=window.performance.getEntriesByNam
|
||
|
r=n.fuzzyFilterSortList(t,{limit:5}),Promise.resolve([n,r])},normalizeMatch:f},auditLogCountry:{match:/(^|\s)((\-?country:)([a-z0-9\-\+_]*))$/i,replace:"$1$3$value ",search:function(e,t){var n,r;return n=$(e).find("ul.country-suggestions"),r=n.fuzzyFilterSortList(t,{limit:5}),Promise.resolve([n,r])},normalizeMatch:f},emoji:{match:/(^|\s)(:([a-z0-9\-\+_]*))$/i,replace:"$1$value ",getValue:function(e){return o.emoji&&e.getAttribute("data-raw-value")||e.getAttribute("data-value")},search:function(e,t){var n,r;return n=$(e).find("ul.emoji-suggestions"),t=" "+t.toLowerCase().replace(/_/g," "),r=n.fuzzyFilterSortList(t,{limit:5,text:s,score:i}),Promise.resolve([n,r])}},hashed:{match:/(^|\s)(\#([a-z0-9\-_\/]*))$/i,replace:"$1#$value ",search:function(e,t){var r,i,s,o;return r=$(e).find("ul.hashed-suggestions"),i=/^\d+$/.test(t)?(s=new RegExp("\\b"+t),function(e){return h(e,s)}):l(t).score,o=r.fuzzyFilterSortList(t,{limit:5,text:n,score:i}),Promise.resolve([r,o])}}},r=function(e){return e.replace(/`{3,}[^`]*\n(.+)?\n`{3,}/g,"")},t=function(e){var t,n;return(null!=(t=e.match(/`{3,}/g))?t.length:void 0)%2?!0:(null!=(n=r(e).match(/`/g))?n.length:void 0)%2?!0:void 0},e.prototype.teardown=function(){this.deactivate(),$(this.textarea).off(".suggester"),$(this.textarea.form).off(".suggester"),$(this.suggester).off(".suggester"),this.onSuggestionsLoaded=function(){return null}},e.prototype.onPaste=function(){this.deactivate(),this.justPasted=!0},e.prototype.onInput=function(){return this.justPasted?void(this.justPasted=!1):this.checkQuery()?!1:void 0},e.prototype.onNavigationKeyDown=function(e){switch(e.hotkey){case"tab":return this.onNavigationOpen(e),!1;case"esc":return this.deactivate(),e.stopImmediatePropagation(),!1}},e.prototype.onNavigationOpen=function(e){var t,n,r;r=null!=this.currentSearch.type.getValue?this.currentSearch.type.getValue(e.target):e.target.getAttribute("data-value"),n=this.textarea.value.substring(0,this.currentSearch.endIndex),t=this.textarea.value.substring(this.currentSearch.endIndex),n=n.replace(this.currentSearch.type.match,this.currentSearch.type.replace.replace("$value",r)),this.textarea.value=n+t,this.deactivate(),this.textarea.focus(),this.textarea.selectionStart=n.length,this.textarea.selectionEnd=n.length},e.prototype.checkQuery=function(){var e,t;if(t=this.searchQuery()){if(t.query===(null!=(e=this.currentSearch)?e.query:void 0))return;return this.currentSearch=t,this.search(t.type,t.query).then(function(e){return function(n){return n?e.activate(t.startIndex):e.deactivate()}}(this)),this.currentSearch.query}this.currentSearch=null,this.deactivate()},e.prototype.activate=function(e){$(this.suggester).css($(this.textarea).textFieldSelectionPosition(e+1)),this.suggester.classList.contains("active")||(this.suggester.classList.add("active"),this.textarea.classList.add("js-navigation-enable"),$(this.suggester).navigation("push"),$(this.suggester).navigation("focus"))},e.prototype.deactivate=function(){this.suggester.classList.contains("active")&&(this.suggester.classList.remove("active"),$(this.suggester).find(".suggestions").hide(),this.textarea.classList.remove("js-navigation-enable"),$(this.suggester).navigation("pop"))},e.prototype.search=function(e,t){return e.search(this.fragment,t).then(function(e){return function(t){var n,r,i;return n=t[0],i=t[1],i>0?(r=n[0].cloneNode(!0),e.suggester.innerHTML="",e.suggester.appendChild(r),$(r).show(),$(e.suggester).navigation("focus"),!0):!1}}(this))},e.prototype.searchQuery=function(){var e,n,r,i,s,o,a;if(i=this.textarea.selectionEnd,o=this.textarea.value.substring(0,i),!t(o)){s=this.types;for(r in s)if(a=s[r],e=o.match(a.match))return n=null!=a.normalizeMatch?a.normalizeMatch(a,i,e):this.normalizeMatch(a,i,e)}},e.prototype.normalizeMatch=function(e,t,n){var r,i,s,o;return o=n[2],i=n[3],s=t-o.length,r=t,{type:e,text:o,query:i,startIndex:s,endIndex:r}},e.prototype.loadSuggestions=function(){var e,t;if(!this.fragment.hasChildNodes()&&(t=this.suggester.getAttribute("data-url"),null!=t))return e=null!=a[t]?a[t]:a[t]=c(t),e.then(function(e){return function(t){return
|
||
|
if(null!=(null!=(a=e.clipboardData)?a.items:void 0)){for(c=e.clipboardData.items,i=0,o=c.length;o>i&&(s=c[i],!(r=f(s.type)));i++);if(r)return t=s.getAsFile(),t.name=r,n([t],this),e.preventDefault()}},w=function(e){return e.target.classList.contains("js-manual-file-chooser")?(e.target.files?n(e.target.files,this):E(this,"is-bad-browser"),e.target.value=""):void 0},a=0,$.observe(".js-document-dropzone",{add:function(){return document.body.addEventListener("dragenter",C),document.body.addEventListener("dragover",C),document.body.addEventListener("dragleave",j),this.addEventListener("drop",L)},remove:function(){return document.body.removeEventListener("dragenter",C),document.body.removeEventListener("dragover",C),document.body.removeEventListener("dragleave",j),this.removeEventListener("drop",L)}}),$.observe(".js-uploadable-container",{add:function(){return 0===a++&&(document.addEventListener("drop",k),document.addEventListener("dragover",x)),this.addEventListener("dragenter",C),this.addEventListener("dragover",C),this.addEventListener("dragleave",S),this.addEventListener("drop",L),this.addEventListener("paste",A),this.addEventListener("change",w)},remove:function(){return 0===--a&&(document.removeEventListener("drop",k),document.removeEventListener("dragover",x)),this.removeEventListener("dragenter",C),this.removeEventListener("dragover",C),this.removeEventListener("dragleave",S),this.removeEventListener("drop",L),this.removeEventListener("paste",A),this.removeEventListener("change",w)}}),("undefined"==typeof FormData||null===FormData)&&document.documentElement.classList.add("no-dnd-uploads")}.call(this),function(){var e,t,n;t=require("delegated-events"),t.on("click",".js-release-remove-file",function(){var e;return e=this.closest(".js-release-file"),e.classList.add("delete"),e.querySelector("input.destroy").value="true"}),t.on("click",".js-release-undo-remove-file",function(){var e;return e=this.closest(".js-release-file"),e.classList.remove("delete"),e.querySelector("input.destroy").value=""}),n=function(e){return e.closest("form").querySelector("#release_id").value},e=[],t.on("release:saved",".js-release-form",function(){var t,n,r,i,s,o;for(setImmediate(function(){var t,n,r;for(t=0,n=e.length;n>t;t++)(r=e[t])();return e.length=0}),o=0,s=this.querySelectorAll(".js-releases-field .js-release-file"),r=0,i=s.length;i>r;r++)t=s[r],t.classList.contains("delete")?t.remove():t.classList.contains("js-template")||o++;return n=this.querySelector(".js-releases-field"),n.classList.toggle("not-populated",!o),n.classList.toggle("is-populated",o)}),t.on("upload:setup",".js-upload-release-file",function(t){var r,i,s,o,a;return a=t.detail,s=a.policyRequest,o=a.preprocess,i=this,r=function(){var e,t,r;return s.body.append("release_id",n(i)),r=document.querySelectorAll(".js-releases-field .js-release-file.delete .id"),r.length?(t=function(){var t,n,i;for(i=[],t=0,n=r.length;n>t;t++)e=r[t],i.push(e.value);return i}(),s.body.append("deletion_candidates",t.join(","))):void 0},n(i)?r():(o.push(new Promise(function(t){return e.push(t)}).then(r)),1===e.length?$("button.js-save-draft").click():void 0)}),t.on("upload:start",".js-upload-release-file",function(e){var t,n,r,i,s,o,a;if(i=e.detail.policy,this.querySelector(".js-upload-meter").classList.remove("hidden"),o=i.asset.replaced_asset){for(s=document.querySelectorAll(".js-releases-field .js-release-file .id"),a=[],n=0,r=s.length;r>n;n++)t=s[n],Number(t.value)===o?a.push(t.closest(".js-release-file").remove()):a.push(void 0);return a}}),t.on("upload:complete",".js-upload-release-file",function(e){var t,n,r,i,s,o,a,c,u,l;for(l=e.detail,a=l.policy,n=document.querySelector(".js-releases-field"),u=n.querySelector(".js-template").cloneNode(!0),u.classList.remove("template","js-template"),u.querySelector("input.id").value=a.asset.id||l.result.id,o=a.asset.name||a.asset.href.split("/").pop(),c=u.querySelectorAll(".filename"),i=0,s=c.length;s>i;i++)t=c[i],"INPUT"===t.tagName?t.value=o:t.textContent=o;return r="",a.asset.size&&(r="("+(a.asset.size/1048576).toFixed(2)+" MB)"),u.querySelector(".filesize")
|
||
|
this.spaceMap=r.spacemap,this.userBlocks=r.blocks,this.commits=function(){var t,n,i,s;for(i=r.dates,s=[],c=t=0,n=i.length;n>t;c=++t)o=i[c],s.push(new e(c,o));return s}(),this.users={},d=r.users,a=0,l=d.length;l>a;a++)h=d[a],this.users[h.name]=h;return this.chrome=new i(this,this.ctx,this.width,this.height,this.focus,this.commits,this.userBlocks,this.users),this.graph=new s(this,this.ctx,this.width,this.height,this.focus,this.commits,this.users,this.spaceMap,this.userBlocks,this.nethash),this.mouseDriver=new n(this.container,this.chrome,this.graph),this.keyDriver=new t(this.chrome,this.graph),this.stopLoader(),this.graph.drawBackground(),this.chrome.draw(),this.graph.requestInitialChunk()}},r.prototype.initError=function(){return this.stopLoader(),this.ctx.clearRect(0,0,this.width,this.height),this.startLoader("Graph could not be drawn due to a network problem.")},r}(),e=function(){function e(e,t){this.time=e,this.date=new Date(t),this.requested=null,this.populated=null}return e.prototype.populate=function(e,t,n){return this.user=t,this.author=e.author,this.date=new Date(e.date.replace(" ","T")),this.gravatar=e.gravatar,this.id=e.id,this.login=e.login,this.message=e.message,this.space=e.space,this.time=e.time,this.parents=this.populateParents(e.parents,n),this.requested=!0,this.populated=new Date},e.prototype.populateParents=function(e,t){var n,r,i;return i=function(){var i,s,o;for(o=[],i=0,s=e.length;s>i;i++)n=e[i],r=t[n[1]],r.id=n[0],r.space=n[2],o.push(r);return o}()},e}(),i=function(){function e(e,t,n,r,i,s,o,a){this.network=e,this.ctx=t,this.width=n,this.height=r,this.focus=i,this.commits=s,this.userBlocks=o,this.users=a,this.namesWidth=120,this.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],this.userBgColors=["#fff","#f7f7f7"],this.headerColor="#f7f7f7",this.dividerColor="#ddd",this.headerHeight=40,this.dateRowHeight=30,this.graphTopOffset=10+this.headerHeight+this.dateRowHeight,this.nameLineHeight=24,this.offsetX=this.namesWidth+(this.width-this.namesWidth)/2-this.focus*this.nameLineHeight,this.offsetY=0,this.contentHeight=this.calcContentHeight(),this.graphMidpoint=this.namesWidth+(this.width-this.namesWidth)/2,this.activeUser=null}return e.prototype.moveX=function(e){return this.offsetX+=e,this.offsetX>this.graphMidpoint?this.offsetX=this.graphMidpoint:this.offsetX<this.graphMidpoint-this.commits.length*this.nameLineHeight?this.offsetX=this.graphMidpoint-this.commits.length*this.nameLineHeight:void 0},e.prototype.moveY=function(e){return this.offsetY+=e,this.offsetY>0||this.contentHeight<this.height-this.graphTopOffset?this.offsetY=0:this.offsetY<-this.contentHeight+this.height/2?this.offsetY=-this.contentHeight+this.height/2:void 0},e.prototype.calcContentHeight=function(){var e,t,n,r,i;for(t=0,i=this.userBlocks,n=0,r=i.length;r>n;n++)e=i[n],t+=e.count;return t*this.nameLineHeight},e.prototype.hover=function(e,t){var n,r,i,s;for(s=this.userBlocks,r=0,i=s.length;i>r;r++)if(n=s[r],e>0&&e<this.namesWidth&&t>this.graphTopOffset+this.offsetY+n.start*this.nameLineHeight&&t<this.graphTopOffset+this.offsetY+(n.start+n.count)*this.nameLineHeight)return this.users[n.name];return null},e.prototype.draw=function(){return this.drawTimeline(this.ctx),this.drawUsers(this.ctx)},e.prototype.drawTimeline=function(e){var t,n,r,i,s,o,a,c,u,l,d,h,f;for(e.fillStyle=this.headerColor,e.fillRect(0,0,this.width,this.headerHeight),e.fillStyle=this.dividerColor,e.fillRect(0,this.headerHeight-1,this.width,1),u=parseInt((0-this.offsetX)/this.nameLineHeight),0>u&&(u=0),c=u+parseInt(this.width/(this.nameLineHeight-1)),c>this.commits.length&&(c=this.commits.length),e.save(),e.translate(this.offsetX,0),a=null,o=null,s=i=h=u,f=c;f>=h?f>i:i>f;s=f>=h?++i:--i)t=this.commits[s],l=this.months[t.date.getMonth()],l!==a&&(e.font="bold 12px 'Helvetica Neue', Arial, sans-serif",e.fillStyle="#555",d=this.ctx.measureText(l).width,e.fillText(l,s*this.nameLineHeight-d/2,this.headerHeight/2+4),a=l),r=t.date.getDate(),r!==o&&(e.font="12px 'Helvetica Neue', Arial, sans-serif",e.fillStyle="#555",n=this.ctx.measureText(r).width,e.
|
||
|
}).attr("d",function(e,t){return 0===t?m(e):m.y(function(e){return E(e.value)})(e)}),u=S.selectAll("g.dots").data(v).enter().append("g").attr("class",function(e,t){return 0===t?"dots totals":"dots uniques"}),u.each(function(e,t){var n;return n=d3.select(this),1===t&&(_=E),n.selectAll("circle").data(function(e,t){return e}).enter().append("circle").attr("cx",function(e){return T(e.key)}).attr("cy",function(e){return _(e.value)}).attr("r",4)}),D.scale(E).orient("right"),S.append("g").attr("class","y axis unique").attr("transform","translate("+s+", 0)").call(D),S.append("rect").attr("class","overlay").attr("width",s).attr("height",t).on("mousemove",y).on("mouseout",function(e){return setTimeout(o.hide,500)})}},$(document).on("graph:load","#js-visitors-graph",function(t,n){var r;return r=e("views","unique visitors"),$.observe("#js-visitors-graph .js-graph",{remove:r.hide}),i.apply(this,[t,n,r])}),$(document).on("graph:load","#js-clones-graph",function(t,n){var r;return r=e("clones","unique cloners"),$.observe("#js-clones-graph .js-graph",{remove:r.hide}),i.apply(this,[t,n,r])})}.call(this),function(){var e;e=function(){var e,t;t=$(this),e=t.find(":selected"),e.attr("data-already-member")?($(".js-account-membership-form").addClass("is-member"),$(".js-account-membership-form").removeClass("is-not-member")):($(".js-account-membership-form").removeClass("is-member"),$(".js-account-membership-form").addClass("is-not-member"))},$.observe(".js-account-membership",e),$(document).on("change",".js-account-membership",e)}.call(this),function(){var e,t,n,r,i,s,o,a,c,u;n=require("github/fetch").fetchPoll,c=null,o=300,a=[".",".","."],s=0,t=function(){return $(".js-audit-log-export-button").removeClass("disabled")},e=function(){return $(".js-audit-log-export-button").addClass("disabled")},i=function(){var t,n;return t=$(".js-audit-log-export-status"),t.data("oldText",t.text()),n=function(){var e;return e=a.slice(0,s).join(""),t.text("Exporting"+e),s>=3?s=0:s+=1},c=setInterval(n,o),e()},u=function(){var e;return t(),e=$(".js-audit-log-export-status"),e.text(e.data("oldText")),clearInterval(c),s=0},r=function(){return u(),$("#ajax-error-message").show(function(){return this.classList.add("visible")})},$(document).on("ajaxSend",".js-audit-log-export",i),$(document).on("ajaxError",".js-audit-log-export",r),$(document).on("ajaxSuccess",".js-audit-log-export",function(e,t,i,s){var o,a;return a=this,o=function(){return u(),window.location=s.export_url},n(s.job_url).then(o,r)}),$(document).on("navigation:open",".audit-search-form .js-suggester",function(e){return $(this).closest("form").submit()})}.call(this),function(){var e,t;$(document).on("submit",".js-find-coupon-form",function(e){var t,n;return t=e.target.action,n=$("#code").val(),window.location=t+"/"+encodeURIComponent(n),e.stopPropagation(),e.preventDefault()}),$(document).on("click",".js-choose-account",function(t){return $(".js-plan-row, .js-choose-plan").removeClass("selected"),$(".js-plan").val(""),$(".js-billing-section").addClass("has-removed-contents"),e($(this).closest(".js-account-row")),t.stopPropagation(),t.preventDefault()}),$(document).on("click",".js-choose-plan",function(e){return t($(this).closest(".js-plan-row")),e.stopPropagation(),e.preventDefault()}),$.observe(".js-plan-row.selected",{add:function(){return $(this).closest("form").find(".js-redeem-button").prop("disabled",$(this).hasClass("free-plan"))}}),e=function(e){var n,r,i,s;if(e.length)return i=e.attr("data-login"),s=e.attr("data-plan"),$(".js-account-row, .js-choose-account").removeClass("selected"),e.addClass("selected"),e.find(".js-choose-account").addClass("selected"),$(".js-account").val(i),$(".js-plan-section").removeClass("is-hidden"),$(".js-billing-plans").addClass("is-hidden"),r=$(".js-plans-for-"+i),r.removeClass("is-hidden"),n=$(".js-plan-row",r),t(1===n.length?n:$("[data-name='"+s+"']",r))},t=function(e){var t,n,r,i,s;if(e.length)return i=e.attr("data-name"),n=parseInt(e.attr("data-cost"),10),s=e.closest(".js-billing-plans"),r="true"===s.attr("data-has-billing"),t=s.attr("data-login"),$(".js-plan-row
|
||
|
for(a=0,s=o.querySelectorAll(".js-repo-access-team-select-option"),t=0,i=s.length;i>t;t++)n=s[t],r=n.classList,e===n.getAttribute("data-team-id")&&(r.add("has-access"),r.remove("selected")),r.contains("has-access")||a++;if(0===a)return o.closest(".js-repo-access-group").classList.add("no-form")}},n=function(e){var t,n;return(n=document.querySelector(".js-repo-access-team-select"))?(null!=(t=n.querySelector("[data-team-id='"+e+"']"))&&t.classList.remove("has-access"),n.closest(".js-repo-access-group").classList.remove("no-form")):void 0},$(document).on("autocomplete:autocompleted:changed",".js-add-repo-access-field",function(){return $(this).data("autocompleted")?this.form.querySelector(".js-add-new-collab").disabled=!1:i()}),$(document).on("selectmenu:selected",".js-repo-access-team-select",function(){var e,t;return e=this.querySelector(".js-repo-access-team-select-option.selected").getAttribute("data-team-id"),t=this.closest(".js-repo-access-group").querySelector(".js-add-repo-access-field"),t.value=e,$(t.form).submit()}),$(document).on("ajaxSend",".js-add-repo-access-form",function(){r()}),$(document).on("ajaxSuccess",".js-add-repo-access-form",function(n,r,o,a){var c,u,l,d;return u=this.closest(".js-repo-access-group"),c=this.querySelector(".js-add-repo-access-field"),l=u.querySelector(".js-repo-access-list"),d=c.value,c.value="",a.error?s(a.error,u):(i(),l.insertAdjacentHTML("beforeend",a.html),e(u),"teams"===u.id?t(d):void 0)}),$(document).on("ajaxSuccess",".js-remove-repo-access-form",function(){var t,i;return r(),t=this.closest(".js-repo-access-entry"),i=this.closest(".js-repo-access-group"),"teams"===i.id&&n(t.getAttribute("data-team-id")),t.remove(),e(i)}),$(document).on("ajaxError",".js-remove-repo-access-form",function(){return s(this.getAttribute("data-error-message"),this.closest(".js-repo-access-group")),!1})}.call(this),function(){var e,t;e=require("github/fetch").fetchText,$(document).on("change",".js-default-branch",function(){var e,t;return t=document.querySelector(".js-default-branch-confirmation"),e=document.querySelector(".js-change-default-branch-button"),e.disabled=this.value===t.getAttribute("data-original-value"),t.value=this.value}),$(document).on("change",".js-repo-features-form input[type=checkbox]",function(){var e;return e=this.closest(".js-repo-option").querySelector(".js-status-indicator"),e.classList.remove("status-indicator-success","status-indicator-failed"),e.classList.add("status-indicator-loading")}),$(document).on("ajaxSuccess",".js-repo-features-form",function(e,t,n,r){var i,s,o,a;for(a=this.querySelectorAll(".status-indicator-loading"),s=0,o=a.length;o>s;s++)i=a[s],i.classList.remove("status-indicator-loading"),i.classList.add("status-indicator-success");return/^\s*</.test(r)?$(document.querySelector(".js-repo-nav")).replaceWith(r):void 0}),$(document).on("ajaxError",".js-repo-features-form",function(){var e,t,n,r,i,s;for(i=this.querySelectorAll(".status-indicator-loading"),s=[],n=0,r=i.length;r>n;n++)t=i[n],t.classList.remove("status-indicator-loading"),t.classList.add("status-indicator-failed"),e=t.closest(".js-repo-option").querySelector("input[type=checkbox]"),s.push(e.checked=!e.checked);return s}),$(document).on("change",".js-protect-branch",function(){var e,t,n,r,i,s,o,a,c,u;for(a=this.closest(".js-protected-branch-settings"),e=this.checked,c=a.querySelectorAll(".js-protected-branch-options"),n=0,s=c.length;s>n;n++)t=c[n],t.classList.toggle("active",e);for(u=a.querySelectorAll(".js-protected-branch-option"),i=0,o=u.length;o>i;i++)r=u[i],e?r.removeAttribute("disabled"):r.setAttribute("disabled","disabled")}),$(document).on("change",".js-required-status-toggle",function(){var e;e=this.closest(".js-protected-branch-settings").querySelector(".js-required-statuses"),e.classList.toggle("hidden",!this.checked)}),$(document).on("change",".js-required-status-checkbox",function(){var e;e=this.closest(".js-protected-branches-item"),e.querySelector(".js-required-status-badge").classList.toggle("hidden",!this.checked)}),$(document).on("change",".js-allowed-branch-pushers-toggle",functi
|
||
|
(i=s.match(/\/issues#issue\/(\d+)\/comment\/(\d+)$/))?(t=i[0],r=i[1],n=i[2],window.location=s.replace(/\/?#issue\/.+/,"/"+r+"#issuecomment-"+n)):void 0})}.call(this),function(){var e;$.observe(".js-issues-list-check:checked",{add:function(){return $(this).closest(".js-issue-row").addClass("selected")},remove:function(){return $(this).closest(".js-issue-row").removeClass("selected")}}),$(document).on("navigation:keydown",".js-issue-row",function(t){return"x"===t.hotkey?(e(this),!1):void 0}),$("#js-issues-search").focus(function(e){return this.value=this.value}),e=function(e){var t;(t=$(e).find(".js-issues-list-check")[0])&&(t.checked=!t.checked,$(t).trigger("change"))}}.call(this),function(){var e,t,n,r,i;e=require("github/fetch").fetchText,$(document).on("selectmenu:selected",".js-issue-sidebar-form",function(e){var t,r,i,s,o;return r=e.target,r.hasAttribute("data-assignee-value")&&(i=r.closest(".js-menu-content"),t=i.querySelector(".js-assignee-field"),t.value=r.getAttribute("data-assignee-value"),t.disabled=!1),o=function(e){return function(){return e.matches("form")?$(e).submit():n(e)}}(this),s=r.closest(".js-select-menu").hasAttribute("data-multiple"),s?($(this).off(".deferredSubmit"),$(this).one("menu:deactivate.deferredSubmit",o)):o()}),i=function(e,t){var n;e.replaceWith.apply(e,$.parseHTML(t)),n=document.querySelector(".js-discussion-sidebar-item .js-assignee-field"),n&&n.value&&(n.disabled=!1)},$(document).on("ajaxSuccess",".js-discussion-sidebar-item",function(e,t,n,r){var s;s=e.target.classList,s.contains("js-issue-sidebar-form")&&i(this,r)}),$(document).on("click","div.js-issue-sidebar-form .js-issue-assign-self",function(e){var t;t=this.closest(".js-issue-sidebar-form"),n(t,{name:this.name,value:this.value}),e.preventDefault()}),n=function(t,n){var s;s=r(t),n&&s.push(n),s.push({name:"authenticity_token",value:t.closest("form").elements.authenticity_token.value}),e(t.getAttribute("data-url"),{method:"post",body:$.param(s),headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}).then(function(e){return i(t.closest(".js-discussion-sidebar-item"),e)})},r=function(e){var n,r,i,s,o,a;for(n=e.closest("form"),o=$(n).serializeArray(),a=[],r=0,i=o.length;i>r;r++)s=o[r],$.contains(e,t(n,s))&&a.push(s);return a},t=function(e,t){var n,r,i,s;for(s=e.elements,r=0,i=s.length;i>r;r++)if(n=s[r],n.name===t.name&&n.value===t.value)return n}}.call(this),function(){var e,t,n;n=require("github/fetch"),e=n.fetchJSON,t=n.fetchPoll,$(document).on("change",".js-issues-list-check",function(){$("#js-issues-toolbar").toggleClass("triage-mode",$(".js-issues-list-check:checked").length>0)}),$(document).on("change",".js-issues-list-check",function(){var e;e=$(".js-issues-list-check:checked"),$("#js-issues-toolbar .js-issues-toolbar-triage .js-select-menu").data("contents-data",e).addClass("js-load-contents")}),$(document).on("selectmenu:selected",".js-issues-toolbar-triage .js-navigation-item",function(){var e,t,n,r,i,s;n=$(this).closest(".js-menu-container").hasClass("js-label-select-menu"),e=$(this).closest("form"),i=$(this).hasClass("selected"),r=$(this).attr("data-name"),s=$(this).attr("data-value"),t=n?$("<input>",{type:"hidden",name:r+"["+s+"]",value:i?"1":"0"}):$("<input>",{type:"hidden",name:r,value:i?s:""}),setImmediate(function(e){return function(){return $(e).menu("deactivate")}}(this)),e.find(".js-issues-triage-fields").append(t),e.addClass("will-submit")}),$(document).on("menu:deactivate",".js-issues-toolbar-triage .js-menu-container",function(n){var r,i;(r=this.querySelector("form.will-submit"))&&(this.classList.add("is-loading"),i=e(r.getAttribute("action"),{method:r.getAttribute("method"),body:$.param($(r).serializeArray()),headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}),i.then(function(e){return function(n){var r,i,s;return s=t(n.job.url,{headers:{accept:"application/json"}}),r=function(){return $(e).menu("deactivate"),location.reload()},i=function(){return e.classList.add("has-error")},s.then(r,i)}}(this)),r.classList.remove("will-submit"),n.preventDefault())})}.call(this
|
||
|
return $(this).removeClass("is-importing")}),$(document).on("ajaxSuccess",".js-ldap-group-adder",function(e,t,n,r){return $(this).closest(".js-ldap-import-groups-container").removeClass("is-empty").find(".js-ldap-imported-groups").prepend($(r)),this.reset(),$(this).find(".js-team-ldap-group-field").focus(),this.querySelector(".js-ldap-group-adder-button").disabled=!0,$(".js-import-form-actions").removeClass("hidden")}),$(document).on("submit",".js-team-remove-group",function(e){this.closest(".js-team").classList.add("is-removing"),document.querySelector(".js-team-ldap-group-field").focus()}),$(document).on("ajaxSuccess",".js-team-remove-group",function(){this.closest(".js-team").remove(),document.querySelector(".js-team:not(.is-removing)")||(document.querySelector(".js-ldap-import-groups-container").classList.add("is-empty"),document.querySelector(".js-import-form-actions").classList.add("hidden"))}),$(document).on("ajaxError",".js-team-remove-group",function(){this.closest(".js-team").classList.remove("is-removing")}),$(document).on("click",".js-edit-team",function(e){return $(this).closest(".js-team").hasClass("is-removing")?!1:(e.preventDefault(),$(this).closest(".js-team").addClass("is-editing"),$(this).closest(".js-team").find(".js-team-name-field").focus())}),$(document).on("click",".js-save-button",function(){return $(this).hasClass("disabled")?!1:$(this).closest(".js-team").addClass("is-sending")}),$(document).on("click",".js-cancel-team-edit",function(e){var t,n;return e.preventDefault(),n=$(this).closest(".js-team").removeClass("is-editing"),t=n.find(".js-team-form").removeClass("is-exists"),t.find(".js-slug").text(t.find(".js-slug").attr("data-original-slug")),t[0].reset()}),$(document).on("ajaxSuccess",".js-team-form:not(.is-checking)",function(e,t,n,r){return t.nameCheck?void 0:$(this).closest(".js-team").removeClass("is-editing").replaceWith($(r))}),$(document).on("ajaxSuccess",".js-team-form.is-checking",function(e,t,n,r){var i,s;return i=$(this).removeClass("is-checking"),"function"==typeof(s=i.find(".js-team-name-field")).removeData&&s.removeData("autocheck-xhr"),r.error?(i.find(".js-save-button").addClass("disabled"),"exists"===r.error?(i.addClass("is-exists"),i.find(".js-slug").html(r.slug)):void 0):(i.find(".js-slug").html(r.slug),i.find(".js-save-button").removeClass("disabled"))}),$(document).on("ajaxError",".js-team-form",function(e,t,n,r){return t.nameCheck&&"abort"===t.statusText?!1:void 0}),$.observe(".js-team-name-field",function(){$(this).on("throttled:input",function(){var e,t,n,r;return t=$(this),e=t.closest(".js-team-form"),null!=(n=t.data("autocheck-xhr"))&&n.abort(),e.removeClass("is-exists").addClass("is-checking"),e.find(".js-save-button").addClass("disabled"),r=$.ajax({url:t.attr("data-check-url"),type:"GET",context:this,data:{name:this.value}}),r.nameCheck=!0,t.data("autocheck-xhr",r)})})}.call(this),function(){$(document).on("click",".js-show-own-teams",function(){var e,t,n,r;return e=$(".js-team-search-field"),r=e.val(),n=$(this).attr("data-me"),-1===r.indexOf("@"+n)&&(t=r?" ":"",e.val(""+r+t+"@"+n),e.focus(),e.trigger("throttled:input")),!1})}.call(this),function(){var e,t;t=require("github/fetch").fetchText,e=function(e){var n,r,i;r=e.value.trim(),n=e.form,n.classList.add("is-sending"),n.classList.remove("is-name-check-fail"),n.classList.remove("is-name-check-success"),i=new URL(e.getAttribute("data-check-url"),window.location.origin).toString(),i+=-1===i.indexOf("?")?"?":"&",i+="name="+encodeURIComponent(r),t(i).then(function(t){var i,s,o,a,c;return n.classList.remove("is-sending"),n.querySelector(".js-team-name-errors").innerHTML=t||"",o=null!=(a=e.getAttribute("data-original"))?a.trim():void 0,s=o&&r===o,i=!!n.querySelector(".js-error"),c=(i||!r)&&!s,n.querySelector(".js-create-team-button").disabled=c,n.classList.toggle("is-name-check-fail",i),n.classList.toggle("is-name-check-success",!i&&r)})},$.observe(".js-new-team",function(){$(this).on("throttled:input",function(){return e(this)})}),$.observe(".js-new-org-team",function(){var t;t=this.querySelector(".js-new-team"),t.val
|
||
|
$.observe(".js-email-global-unsubscribe-form",function(){this.querySelector(".js-email-global-unsubscribe-submit").disabled=!0}),$(document).on("change",".js-email-global-unsubscribe-form",function(){var e,t;return e=function(){var e,n,r,i;for(r=this.querySelectorAll(".js-email-global-unsubscribe"),i=[],e=0,n=r.length;n>e;e++)t=r[e],t.checked&&i.push(t);return i}.call(this),this.querySelector(".js-email-global-unsubscribe-submit").disabled=e[0].defaultChecked}),$(document).on("ajaxSend",".js-remove-key",function(e){return $(this).addClass("disabled").find("span").text("Deleting\u2026")}),$(document).on("ajaxError",".js-remove-key",function(e){return $(this).removeClass("disabled").find("span").text("Error. Try again.")}),$(document).on("ajaxSuccess",".js-remove-key",function(e){return $(this).parents("li").remove(),0===$(".js-ssh-keys-box li").length?$(".js-no-ssh-keys").show():void 0}),$(document).on("ajaxSuccess",".js-leave-collaborated-repo",function(e){var t,n;t=e.target.getAttribute("data-repo-id"),n=document.querySelector(".js-collab-repo[data-repo-id='"+t+"']"),n.remove(),$.facebox.close()}),$(document).on("ajaxSuccess",".js-newsletter-unsubscribe-form",function(){var e,t,n,r,i;for(r=document.querySelectorAll(".js-newsletter-unsubscribe-message"),i=[],t=0,n=r.length;n>t;t++)e=r[t],i.push(e.classList.toggle("hidden"));return i}),$(document).on("click",".js-show-new-ssh-key-form",function(){return $(".js-new-ssh-key-box").toggle().find(".js-ssh-key-title").focus(),!1}),$(document).on("ajaxSuccess",".js-revoke-access-form",function(){var e,t,n;e=this.getAttribute("data-id"),n=this.getAttribute("data-type-name"),t=document.querySelector(".js-revoke-item[data-type='"+n+"'][data-id='"+e+"']"),$.facebox.close(),t.remove(),t.classList.contains("new-token")&&document.querySelector(".js-flash-new-token").remove()}),$(document).on("click",".js-delete-oauth-application-image",function(){var e,t,n;return e=$(this).closest(".js-uploadable-container"),e.removeClass("has-uploaded-logo"),t=e.find("img.js-image-field"),n=e.find("input.js-oauth-application-logo-id"),t.attr("src",""),n.val(""),!1}),$(document).on("click",".js-new-callback",function(e){var t,n;return e.preventDefault(),t=$(e.currentTarget).closest(".js-callback-urls"),n=t.find(".js-callback-url").first().clone(),n.removeClass("is-default-callback"),n.find("input").val(""),t.addClass("has-many"),$(e.currentTarget).before(n)}),$(document).on("click",".js-delete-callback",function(e){var t,n;return e.preventDefault(),t=$(e.currentTarget).closest(".js-callback-urls"),$(e.currentTarget).closest(".js-callback-url").remove(),n=t.find(".js-callback-url"),n.length<=1?t.removeClass("has-many"):void 0}),$(document).on("click",".js-oauth-application-whitelist .js-deny-this-request",function(e){return $(e.currentTarget).siblings("#state").val("denied"),$(e.currentTarget).closest(".js-org-application-access-form").submit()}),$(document).on("ajaxSuccess",".js-org-application-access-form",function(e,t,n,r){return window.location.reload()}),$(document).on("click",".js-user-rename-warning-continue",function(){var e,t,n,r,i;for(r=document.querySelectorAll(".js-user-rename-warning, .js-user-rename-form"),i=[],t=0,n=r.length;n>t;t++)e=r[t],i.push(e.classList.toggle("hidden"));return i}),$(document).on("change",".js-checkbox-scope",function(){var e,t,n,r,i,s;for(r=this.closest(".js-check-scope-container"),i=r.querySelectorAll(".js-checkbox-scope"),s=[],t=0,n=i.length;n>t;t++)e=i[t],e!==this?(e.checked=this.checked,s.push(e.disabled=this.checked)):s.push(void 0);return s})}.call(this),function(){var e,t,n,r,i,s,o,a,c,u,l,d,h,f=[].slice;r=require("github/feature-detection")["default"],i=require("github/fetch").fetchJSON,l=function(){var e;return e=1<=arguments.length?f.call(arguments,0):[],new Promise(function(t,n){return u2f.register.apply(u2f,f.call(e).concat([function(e){var r;return null!=e.errorCode&&0!==e.errorCode?(r=new Error("Device registration failed"),r.code=e.errorCode,n(r)):t(e)}]))})},(t=document.querySelector(".js-u2f-box"))&&(t.classList.toggle("available",r.u2f),s=function
|