From 4ef468bd32ac7c8c2d6876a83ea6d51f4643ef50 Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Wed, 10 Sep 2014 13:08:32 -0700 Subject: [PATCH] Added messages show/hide toggles --- client/build/build.js | 2 +- client/css/style.css | 7 +++++++ client/index.html | 33 +++++++++++++++++++++++++++++++++ client/js/shout.js | 23 ++++++++++++++++++++--- package.json | 2 +- 5 files changed, 62 insertions(+), 5 deletions(-) diff --git a/client/build/build.js b/client/build/build.js index 4b6567ab..9b0141aa 100644 --- a/client/build/build.js +++ b/client/build/build.js @@ -5,4 +5,4 @@ g.events={};for(e in j){for(c=0,d=j[e].length;c=0;while(d.length=0){c=Math.floor(b)}else{c=Math.ceil(b)}}return c}function tb(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function ub(a,c,d){return _b(b([a,11,31+c-d]),c,d).week}function vb(a){return wb(a)?366:365}function wb(a){return a%4===0&&a%100!==0||a%400===0}function xb(a){var b;if(a._a&&a._pf.overflow===-2){b=a._a[i]<0||a._a[i]>11?i:a._a[j]<1||a._a[j]>tb(a._a[h],a._a[i])?j:a._a[k]<0||a._a[k]>23?k:a._a[l]<0||a._a[l]>59?l:a._a[m]<0||a._a[m]>59?m:a._a[n]<0||a._a[n]>999?n:-1;if(a._pf._overflowDayOfYear&&(bj)){b=j}a._pf.overflow=b}}function yb(a){if(a._isValid==null){a._isValid=!isNaN(a._d.getTime())&&a._pf.overflow<0&&!a._pf.empty&&!a._pf.invalidMonth&&!a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated;if(a._strict){a._isValid=a._isValid&&a._pf.charsLeftOver===0&&a._pf.unusedTokens.length===0}}return a._isValid}function zb(a){return a?a.toLowerCase().replace("_","-"):a}function Ab(a,c){return c._isUTC?b(a).zone(c._offset||0):b(a).local()}hb(eb.prototype,{set:function(a){var b,c;for(c in a){b=a[c];if(typeof b==="function"){this[c]=b}else{this["_"+c]=b}}},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(a){return this._months[a.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var c,d,e;if(!this._monthsParse){this._monthsParse=[]}for(c=0;c<12;c++){if(!this._monthsParse[c]){d=b.utc([2e3,c]);e="^"+this.months(d,"")+"|^"+this.monthsShort(d,"");this._monthsParse[c]=new RegExp(e.replace(".",""),"i")}if(this._monthsParse[c].test(a)){return c}}},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var c,d,e;if(!this._weekdaysParse){this._weekdaysParse=[]}for(c=0;c<7;c++){if(!this._weekdaysParse[c]){d=b([2e3,1]).day(c);e="^"+this.weekdays(d,"")+"|^"+this.weekdaysShort(d,"")+"|^"+this.weekdaysMin(d,"");this._weekdaysParse[c]=new RegExp(e.replace(".",""),"i")}if(this._weekdaysParse[c].test(a)){return c}}},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];if(!b&&this._longDateFormat[a.toUpperCase()]){b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)});this._longDateFormat[a]=b}return b},isPM:function(a){return(a+"").toLowerCase().charAt(0)==="p"},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){if(a>11){return c?"pm":"PM"}else{return c?"am":"AM"}},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendar[a];return typeof c==="function"?c.apply(b):c},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return typeof e==="function"?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[a>0?"future":"past"];return typeof c==="function"?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return _b(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}});function Bb(a,b){b.abbr=a;if(!o[a]){o[a]=new eb}o[a].set(b);return o[a]}function Cb(a){delete o[a]}function Db(a){var c=0,d,e,f,g,h=function(a){if(!o[a]&&q){try{require("./lang/"+a)}catch(b){}}return o[a]};if(!a){return b.fn._lang}if(!mb(a)){e=h(a);if(e){return e}a=[a]}while(c0){e=h(g.slice(0,d).join("-"));if(e){return e}if(f&&f.length>=d&&ob(g,f,true)>=d-1){break}d--}c++}return b.fn._lang}function Eb(a){if(a.match(/\[[\s\S]/)){return a.replace(/^\[|\]$/g,"")}return a.replace(/\\/g,"")}function Fb(a){var b=a.match(u),c,d;for(c=0,d=b.length;c=0&&v.test(a)){a=a.replace(v,d);v.lastIndex=0;c-=1}return a}function Ib(a,b){var c,d=b._strict;switch(a){case"Q":return G;case"DDDD":return I;case"YYYY":case"GGGG":case"gggg":return d?J:y;case"Y":case"G":case"g":return L;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return d?K:z;case"S":if(d){return G}case"SS":if(d){return H}case"SSS":if(d){return I}case"DDD":return x;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return B;case"a":case"A":return Db(b._l)._meridiemParse;case"X":return E;case"Z":case"ZZ":return C;case"T":return D;case"SSSS":return A;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return d?H:w;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return w;case"Do":return F;default:c=new RegExp(Rb(Qb(a.replace("\\","")),"i"));return c}}function Jb(a){a=a||"";var b=a.match(C)||[],c=b[b.length-1]||[],d=(c+"").match(Q)||["-",0,0],e=+(d[1]*60)+sb(d[2]);return d[0]==="+"?-e:e}function Kb(a,c,d){var e,f=d._a;switch(a){case"Q":if(c!=null){f[i]=(sb(c)-1)*3}break;case"M":case"MM":if(c!=null){f[i]=sb(c)-1}break;case"MMM":case"MMMM":e=Db(d._l).monthsParse(c);if(e!=null){f[i]=e}else{d._pf.invalidMonth=c}break;case"D":case"DD":if(c!=null){f[j]=sb(c)}break;case"Do":if(c!=null){f[j]=sb(parseInt(c,10))}break;case"DDD":case"DDDD":if(c!=null){d._dayOfYear=sb(c)}break;case"YY":f[h]=b.parseTwoDigitYear(c);break;case"YYYY":case"YYYYY":case"YYYYYY":f[h]=sb(c);break;case"a":case"A":d._isPm=Db(d._l).isPM(c);break;case"H":case"HH":case"h":case"hh":f[k]=sb(c);break;case"m":case"mm":f[l]=sb(c);break;case"s":case"ss":f[m]=sb(c);break;case"S":case"SS":case"SSS":case"SSSS":f[n]=sb(("0."+c)*1e3);break;case"X":d._d=new Date(parseFloat(c)*1e3);break;case"Z":case"ZZ":d._useUTC=true;d._tzm=Jb(c);break;case"dd":case"ddd":case"dddd":e=Db(d._l).weekdaysParse(c);if(e!=null){d._w=d._w||{};d._w["d"]=e}else{d._pf.invalidWeekday=c}break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":a=a.substr(0,1);case"gggg":case"GGGG":case"GGGGG":a=a.substr(0,2);if(c){d._w=d._w||{};d._w[a]=sb(c)}break;case"gg":case"GG":d._w=d._w||{};d._w[a]=b.parseTwoDigitYear(c)}}function Lb(a){var c,d,e,f,g,i,j,k;c=a._w;if(c.GG!=null||c.W!=null||c.E!=null){g=1;i=4;d=_(c.GG,a._a[h],_b(b(),1,4).year);e=_(c.W,1);f=_(c.E,1)}else{k=Db(a._l);g=k._week.dow;i=k._week.doy;d=_(c.gg,a._a[h],_b(b(),g,i).year);e=_(c.w,1);if(c.d!=null){f=c.d;if(fvb(f)){a._pf._overflowDayOfYear=true}c=Xb(f,0,a._dayOfYear);a._a[i]=c.getUTCMonth();a._a[j]=c.getUTCDate()}for(b=0;b<3&&a._a[b]==null;++b){a._a[b]=d[b]=e[b]}for(;b<7;b++){a._a[b]=d[b]=a._a[b]==null?b===2?1:0:a._a[b]}a._d=(a._useUTC?Xb:Wb).apply(null,d);if(a._tzm!=null){a._d.setUTCMinutes(a._d.getUTCMinutes()+a._tzm)}}function Nb(a){var b;if(a._d){return}b=qb(a._i);a._a=[b.year,b.month,b.day,b.hour,b.minute,b.second,b.millisecond];Mb(a)}function Ob(a){var b=new Date;if(a._useUTC){return[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]}else{return[b.getFullYear(),b.getMonth(),b.getDate()]}}function Pb(a){if(a._f===b.ISO_8601){Tb(a);return}a._a=[];a._pf.empty=true;var c=Db(a._l),d=""+a._i,e,f,g,h,i,j=d.length,l=0;g=Hb(a._f,c).match(u)||[];for(e=0;e0){a._pf.unusedInput.push(i)}d=d.slice(d.indexOf(f)+f.length);l+=f.length}if(Z[h]){if(f){a._pf.empty=false}else{a._pf.unusedTokens.push(h)}Kb(h,f,a)}else if(a._strict&&!f){a._pf.unusedTokens.push(h)}}a._pf.charsLeftOver=j-l;if(d.length>0){a._pf.unusedInput.push(d)}if(a._isPm&&a._a[k]<12){a._a[k]+=12}if(a._isPm===false&&a._a[k]===12){a._a[k]=0}Mb(a);xb(a)}function Qb(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e})}function Rb(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Sb(a){var b,c,d,e,f;if(a._f.length===0){a._pf.invalidFormat=true;a._d=new Date(NaN);return}for(e=0;e0;j[4]=c;return Zb.apply({},j)}function _b(a,c,d){var e=d-c,f=d-a.day(),g;if(f>e){f-=7}if(fd?7:0)-(f0?a:a-1,dayOfYear:h>0?h:vb(a-1)+h}}function bc(c){var d=c._i,e=c._f;if(d===null||e===a&&d===""){return b.invalid({nullInput:true})}if(typeof d==="string"){c._i=d=Db().preparse(d)}if(b.isMoment(d)){c=ib(d);c._d=new Date(+d._d)}else if(e){if(mb(e)){Sb(c)}else{Pb(c)}}else{Vb(c)}return new fb(c)}b=function(b,c,d,e){var f;if(typeof d==="boolean"){e=d;d=a}f={};f._isAMomentObject=true;f._i=b;f._f=c;f._l=d;f._strict=e;f._isUTC=false;f._pf=ab();return bc(f)};b.suppressDeprecationWarnings=false;b.createFromInputFallback=bb("moment construction falls back to js Date. This is "+"discouraged and will be removed in upcoming major "+"release. Please refer to "+"https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i)});function cc(a,c){var d,e;if(c.length===1&&mb(c[0])){c=c[0]}if(!c.length){return b()}d=c[0];for(e=1;e=0;--g){rb($[g])}b.normalizeUnits=function(a){return pb(a)};b.invalid=function(a){var c=b.utc(NaN);if(a!=null){hb(c._pf,a)}else{c._pf.userInvalidated=true}return c};b.parseZone=function(){return b.apply(null,arguments).parseZone()};b.parseTwoDigitYear=function(a){return sb(a)+(sb(a)>68?1900:2e3)};hb(b.fn=fb.prototype,{clone:function(){return b(this)},valueOf:function(){return+this._d+(this._offset||0)*6e4},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().lang("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=b(this).utc();if(00}return false},parsingFlags:function(){return hb({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(){return this.zone(0)},local:function(){this.zone(0);this._isUTC=false;return this},format:function(a){var c=Gb(this,a||b.defaultFormat);return this.lang().postformat(c)},add:function(a,c){var d;if(typeof a==="string"&&typeof c==="string"){d=b.duration(isNaN(+c)?+a:+c,isNaN(+c)?c:a)}else if(typeof a==="string"){d=b.duration(+c,a)}else{d=b.duration(a,c)}lb(this,d,1);return this},subtract:function(a,c){var d;if(typeof a==="string"&&typeof c==="string"){d=b.duration(isNaN(+c)?+a:+c,isNaN(+c)?c:a)}else if(typeof a==="string"){d=b.duration(+c,a)}else{d=b.duration(a,c)}lb(this,d,-1);return this},diff:function(a,c,d){var e=Ab(a,this),f=(this.zone()-e.zone())*6e4,g,h;c=pb(c);if(c==="year"||c==="month"){g=(this.daysInMonth()+e.daysInMonth())*432e5;h=(this.year()-e.year())*12+(this.month()-e.month());h+=(this-b(this).startOf("month")-(e-b(e).startOf("month")))/g;h-=(this.zone()-b(this).startOf("month").zone()-(e.zone()-b(e).startOf("month").zone()))*6e4/g;if(c==="year"){h=h/12}}else{g=this-e;h=c==="second"?g/1e3:c==="minute"?g/6e4:c==="hour"?g/36e5:c==="day"?(g-f)/864e5:c==="week"?(g-f)/6048e5:g}return d?h:jb(h)},from:function(a,c){return b.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!c)},fromNow:function(a){return this.from(b(),a)},calendar:function(a){var c=a||b(),d=Ab(c,this).startOf("day"),e=this.diff(d,"days",true),f=e<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse";return this.format(this.lang().calendar(f,this))},isLeapYear:function(){return wb(this.year())},isDST:function(){return this.zone()+b(a).startOf(c)},isBefore:function(a,c){c=typeof c!=="undefined"?c:"millisecond";return+this.clone().startOf(c)<+b(a).startOf(c)},isSame:function(a,b){b=b||"ms";return+this.clone().startOf(b)===+Ab(a,this).startOf(b)},min:bb("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(a){a=b.apply(null,arguments);return athis?this:a}),zone:function(a,c){var d=this._offset||0;if(a!=null){if(typeof a==="string"){a=Jb(a)}if(Math.abs(a)<16){a=a*60}this._offset=a;this._isUTC=true;if(d!==a){if(!c||this._changeInProgress){lb(this,b.duration(d-a,"m"),1,false)}else if(!this._changeInProgress){this._changeInProgress=true;b.updateOffset(this,true);this._changeInProgress=null}}}else{return this._isUTC?d:this._d.getTimezoneOffset()}return this},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){if(this._tzm){this.zone(this._tzm)}else if(typeof this._i==="string"){this.zone(this._i)}return this},hasAlignedHourOffset:function(a){if(!a){a=0}else{a=b(a).zone()}return(this.zone()-a)%60===0},daysInMonth:function(){return tb(this.year(),this.month())},dayOfYear:function(a){var c=f((b(this).startOf("day")-b(this).startOf("year"))/864e5)+1;return a==null?c:this.add("d",a-c)},quarter:function(a){return a==null?Math.ceil((this.month()+1)/3):this.month((a-1)*3+this.month()%3)},weekYear:function(a){var b=_b(this,this.lang()._week.dow,this.lang()._week.doy).year;return a==null?b:this.add("y",a-b)},isoWeekYear:function(a){var b=_b(this,1,4).year;return a==null?b:this.add("y",a-b)},week:function(a){var b=this.lang().week(this);return a==null?b:this.add("d",(a-b)*7)},isoWeek:function(a){var b=_b(this,1,4).week;return a==null?b:this.add("d",(a-b)*7)},weekday:function(a){var b=(this.day()+7-this.lang()._week.dow)%7;return a==null?b:this.add("d",a-b)},isoWeekday:function(a){return a==null?this.day()||7:this.day(this.day()%7?a:a-7)},isoWeeksInYear:function(){return ub(this.year(),1,4)},weeksInYear:function(){var a=this._lang._week;return ub(this.year(),a.dow,a.doy)},get:function(a){a=pb(a);return this[a]()},set:function(a,b){a=pb(a);if(typeof this[a]==="function"){this[a](b)}return this},lang:function(b){if(b===a){return this._lang}else{this._lang=Db(b);return this}}});function dc(a,b){var c;if(typeof b==="string"){b=a.lang().monthsParse(b);if(typeof b!=="number"){return a}}c=Math.min(a.date(),tb(a.year(),b));a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c);return a}function ec(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function fc(a,b,c){if(b==="Month"){return dc(a,c)}else{return a._d["set"+(a._isUTC?"UTC":"")+b](c)}}function gc(a,c){return function(d){if(d!=null){fc(this,a,d);b.updateOffset(this,c);return this}else{return ec(this,a)}}}b.fn.millisecond=b.fn.milliseconds=gc("Milliseconds",false);b.fn.second=b.fn.seconds=gc("Seconds",false);b.fn.minute=b.fn.minutes=gc("Minutes",false);b.fn.hour=b.fn.hours=gc("Hours",true);b.fn.date=gc("Date",true);b.fn.dates=bb("dates accessor is deprecated. Use date instead.",gc("Date",true));b.fn.year=gc("FullYear",true);b.fn.years=bb("years accessor is deprecated. Use year instead.",gc("FullYear",true));b.fn.days=b.fn.day;b.fn.months=b.fn.month;b.fn.weeks=b.fn.week;b.fn.isoWeeks=b.fn.isoWeek;b.fn.quarters=b.fn.quarter;b.fn.toJSON=b.fn.toISOString;hb(b.duration.fn=gb.prototype,{_bubble:function(){var a=this._milliseconds,b=this._days,c=this._months,d=this._data,e,f,g,h;d.milliseconds=a%1e3;e=jb(a/1e3);d.seconds=e%60;f=jb(e/60);d.minutes=f%60;g=jb(f/60);d.hours=g%24;b+=jb(g/24);d.days=b%30;c+=jb(b/30);d.months=c%12;h=jb(c/12);d.years=h},weeks:function(){return jb(this.days()/7)},valueOf:function(){return this._milliseconds+this._days*864e5+this._months%12*2592e6+sb(this._months/12)*31536e6},humanize:function(a){var b=+this,c=$b(b,!a,this.lang());if(a){c=this.lang().pastFuture(b,c)}return this.lang().postformat(c)},add:function(a,c){var d=b.duration(a,c);this._milliseconds+=d._milliseconds;this._days+=d._days;this._months+=d._months;this._bubble();return this},subtract:function(a,c){var d=b.duration(a,c);this._milliseconds-=d._milliseconds;this._days-=d._days;this._months-=d._months;this._bubble();return this},get:function(a){a=pb(a);return this[a.toLowerCase()+"s"]()},as:function(a){a=pb(a);return this["as"+a.charAt(0).toUpperCase()+a.slice(1)+"s"]()},lang:b.fn.lang,toIsoString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),f=Math.abs(this.seconds()+this.milliseconds()/1e3);if(!this.asSeconds()){return"P0D"}return(this.asSeconds()<0?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":"")}});function hc(a){b.duration.fn[a]=function(){return this._data[a]}}function ic(a,c){b.duration.fn["as"+a]=function(){return+this/c}}for(g in S){if(S.hasOwnProperty(g)){ic(g,S[g]);hc(g.toLowerCase())}}ic("Weeks",6048e5);b.duration.fn.asMonths=function(){return(+this-this.years()*31536e6)/2592e6+this.years()*12};b.lang("en",{ordinal:function(a){var b=a%10,c=sb(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th";return a+c}});function jc(a){if(typeof ender!=="undefined"){return}e=d.moment;if(a){d.moment=bb("Accessing Moment through the global scope is "+"deprecated, and will be removed in an upcoming "+"release.",b)}else{d.moment=b}}if(q){module.exports=b}else if(typeof define==="function"&&define.amd){define("moment",function(a,c,f){if(f.config&&f.config()&&f.config().noGlobal===true){d.moment=e}return b});jc(true)}else{jc()}}).call(this);!function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.io=a():"undefined"!=typeof global?global.io=a():"undefined"!=typeof self&&(self.io=a())}(function(){var a,b,c;return function d(a,b,c){function e(g,h){if(!b[g]){if(!a[g]){var i=typeof require=="function"&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=b[g]={exports:{}};a[g][0].call(j.exports,function(b){var c=a[g][1][b];return e(c?c:b)},j,j.exports,d,a,b,c)}return b[g].exports}var f=typeof require=="function"&&require;for(var g=0;g0&&!this.encoding){var a=this.packetBuffer.shift();this.packet(a)}};m.prototype.cleanup=function(){var a;while(a=this.subs.shift())a.destroy();this.packetBuffer=[];this.encoding=false;this.decoder.destroy()};m.prototype.close=m.prototype.disconnect=function(){this.skipReconnect=true;this.engine.close()};m.prototype.onclose=function(a){l("close");this.cleanup();this.readyState="closed";this.emit("close",a);if(this._reconnection&&!this.skipReconnect){this.reconnect()}};m.prototype.reconnect=function(){if(this.reconnecting)return this;var a=this;this.attempts++;if(this.attempts>this._reconnectionAttempts){l("reconnect failed");this.emitAll("reconnect_failed");this.reconnecting=false}else{var b=this.attempts*this.reconnectionDelay();b=Math.min(b,this.reconnectionDelayMax());l("will wait %dms before reconnect attempt",b);this.reconnecting=true;var c=setTimeout(function(){l("attempting reconnect");a.emitAll("reconnect_attempt",a.attempts);a.emitAll("reconnecting",a.attempts);a.open(function(b){if(b){l("reconnect attempt error");a.reconnecting=false;a.reconnect();a.emitAll("reconnect_error",b.data)}else{l("reconnect success");a.onreconnect()}})},b);this.subs.push({destroy:function(){clearTimeout(c)}})}};m.prototype.onreconnect=function(){var a=this.attempts;this.attempts=0;this.reconnecting=false;this.emitAll("reconnect",a)}},{"./on":4,"./socket":5,"./url":6,"component-bind":7,"component-emitter":8,debug:9,"engine.io-client":11,"object-component":37,"socket.io-parser":40}],4:[function(a,b,c){b.exports=d;function d(a,b,c){a.on(b,c);return{destroy:function(){a.removeListener(b,c)}}}},{}],5:[function(a,b,c){var d=a("socket.io-parser");var e=a("component-emitter");var f=a("to-array");var g=a("./on");var h=a("component-bind");var i=a("debug")("socket.io-client:socket");var j=a("has-binary-data");var k=a("indexof");b.exports=c=n;var l={connect:1,connect_error:1,connect_timeout:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1};var m=e.prototype.emit;function n(a,b){this.io=a;this.nsp=b;this.json=this;this.ids=0;this.acks={};this.open();this.receiveBuffer=[];this.sendBuffer=[];this.connected=false;this.disconnected=true;this.subEvents()}e(n.prototype);n.prototype.subEvents=function(){var a=this.io;this.subs=[g(a,"open",h(this,"onopen")),g(a,"packet",h(this,"onpacket")),g(a,"close",h(this,"onclose"))] };n.prototype.open=n.prototype.connect=function(){if(this.connected)return this;this.io.open();if("open"==this.io.readyState)this.onopen();return this};n.prototype.send=function(){var a=f(arguments);a.unshift("message");this.emit.apply(this,a);return this};n.prototype.emit=function(a){if(l.hasOwnProperty(a)){m.apply(this,arguments);return this}var b=f(arguments);var c=d.EVENT;if(j(b)){c=d.BINARY_EVENT}var e={type:c,data:b};if("function"==typeof b[b.length-1]){i("emitting packet with ack id %d",this.ids);this.acks[this.ids]=b.pop();e.id=this.ids++}if(this.connected){this.packet(e)}else{this.sendBuffer.push(e)}return this};n.prototype.packet=function(a){a.nsp=this.nsp;this.io.packet(a)};n.prototype.onopen=function(){i("transport is open - connecting");if("/"!=this.nsp){this.packet({type:d.CONNECT})}};n.prototype.onclose=function(a){i("close (%s)",a);this.connected=false;this.disconnected=true;this.emit("disconnect",a)};n.prototype.onpacket=function(a){if(a.nsp!=this.nsp)return;switch(a.type){case d.CONNECT:this.onconnect();break;case d.EVENT:this.onevent(a);break;case d.BINARY_EVENT:this.onevent(a);break;case d.ACK:this.onack(a);break;case d.BINARY_ACK:this.onack(a);break;case d.DISCONNECT:this.ondisconnect();break;case d.ERROR:this.emit("error",a.data);break}};n.prototype.onevent=function(a){var b=a.data||[];i("emitting event %j",b);if(null!=a.id){i("attaching ack callback to event");b.push(this.ack(a.id))}if(this.connected){m.apply(this,b)}else{this.receiveBuffer.push(b)}};n.prototype.ack=function(a){var b=this;var c=false;return function(){if(c)return;c=true;var e=f(arguments);i("sending ack %j",e);var g=j(e)?d.BINARY_ACK:d.ACK;b.packet({type:g,id:a,data:e})}};n.prototype.onack=function(a){i("calling ack %s with %j",a.id,a.data);var b=this.acks[a.id];b.apply(this,a.data);delete this.acks[a.id]};n.prototype.onconnect=function(){this.connected=true;this.disconnected=false;this.emit("connect");this.emitBuffered()};n.prototype.emitBuffered=function(){var a;for(a=0;a=d)return(a/d).toFixed(1)+"h";if(a>=c)return(a/c).toFixed(1)+"m";if(a>=b)return(a/b|0)+"s";return a+"ms"};d.enabled=function(a){for(var b=0,c=d.skips.length;b';i=document.createElement(b)}catch(a){i=document.createElement("iframe");i.name=c.iframeId;i.src="javascript:0"}i.id=c.iframeId;c.form.appendChild(i);c.iframe=i}k();a=a.replace(h,"\\\n");this.area.value=a.replace(g,"\\n");try{this.form.submit()}catch(l){}if(this.iframe.attachEvent){this.iframe.onreadystatechange=function(){if(c.iframe.readyState=="complete"){j()}}}else{this.iframe.onload=j}}},{"./polling":18,"component-inherit":21}],17:[function(a,b,c){var d=typeof self!=="undefined"?self:typeof window!=="undefined"?window:{};var e=a("xmlhttprequest");var f=a("./polling");var g=a("component-emitter");var h=a("component-inherit");var i=a("debug")("engine.io-client:polling-xhr");b.exports=k;b.exports.Request=l;function j(){}function k(a){f.call(this,a);if(d.location){var b="https:"==location.protocol;var c=location.port;if(!c){c=b?443:80}this.xd=a.hostname!=d.location.hostname||c!=a.port}}h(k,f);k.prototype.supportsBinary=true;k.prototype.request=function(a){a=a||{};a.uri=this.uri();a.xd=this.xd;a.agent=this.agent||false;a.supportsBinary=this.supportsBinary;return new l(a)};k.prototype.doWrite=function(a,b){var c=typeof a!=="string"&&a!==undefined;var d=this.request({method:"POST",data:a,isBinary:c});var e=this;d.on("success",b);d.on("error",function(a){e.onError("xhr post error",a)});this.sendXhr=d};k.prototype.doPoll=function(){i("xhr poll");var a=this.request();var b=this;a.on("data",function(a){b.onData(a)});a.on("error",function(a){b.onError("xhr poll error",a)});this.pollXhr=a};function l(a){this.method=a.method||"GET";this.uri=a.uri;this.xd=!!a.xd;this.async=false!==a.async;this.data=undefined!=a.data?a.data:null;this.agent=a.agent;this.create(a.isBinary,a.supportsBinary)}g(l.prototype);l.prototype.create=function(a,b){var c=this.xhr=new e({agent:this.agent,xdomain:this.xd});var f=this;try{i("xhr open %s: %s",this.method,this.uri);c.open(this.method,this.uri,this.async);if(b){c.responseType="arraybuffer"}if("POST"==this.method){try{if(a){c.setRequestHeader("Content-type","application/octet-stream")}else{c.setRequestHeader("Content-type","text/plain;charset=UTF-8")}}catch(g){}}if("withCredentials"in c){c.withCredentials=true}c.onreadystatechange=function(){var a;try{if(4!=c.readyState)return;if(200==c.status||1223==c.status){var d=c.getResponseHeader("Content-Type");if(d==="application/octet-stream"){a=c.response}else{if(!b){a=c.responseText}else{a="ok"}}}else{setTimeout(function(){f.onError(c.status)},0)}}catch(e){f.onError(e)}if(null!=a){f.onData(a)}};i("xhr data %s",this.data);c.send(this.data)}catch(g){setTimeout(function(){f.onError(g)},0);return}if(d.document){this.index=l.requestsCount++;l.requests[this.index]=this}};l.prototype.onSuccess=function(){this.emit("success");this.cleanup()};l.prototype.onData=function(a){this.emit("data",a);this.onSuccess()};l.prototype.onError=function(a){this.emit("error",a);this.cleanup()};l.prototype.cleanup=function(){if("undefined"==typeof this.xhr||null===this.xhr){return}this.xhr.onreadystatechange=j;try{this.xhr.abort()}catch(a){}if(d.document){delete l.requests[this.index]}this.xhr=null};l.prototype.abort=function(){this.cleanup()};if(d.document){l.requestsCount=0;l.requests={};if(d.attachEvent){d.attachEvent("onunload",m)}else if(d.addEventListener){d.addEventListener("beforeunload",m)}}function m(){for(var a in l.requests){if(l.requests.hasOwnProperty(a)){l.requests[a].abort()}}}},{"./polling":18,"component-emitter":8,"component-inherit":21,debug:9,xmlhttprequest:20}],18:[function(a,b,c){var d=a("../transport");var e=a("parseqs");var f=a("engine.io-parser");var g=a("component-inherit");var h=a("debug")("engine.io-client:polling");b.exports=j;var i=function(){var b=a("xmlhttprequest");var c=new b({agent:this.agent,xdomain:false});return null!=c.responseType}();function j(a){var b=a&&a.forceBase64;if(!i||b){this.supportsBinary=false}d.call(this,a)}g(j,d);j.prototype.name="polling";j.prototype.doOpen=function(){this.poll()};j.prototype.pause=function(a){var b=0;var c=this;this.readyState="pausing";function d(){h("paused");c.readyState="paused";a()}if(this.polling||!this.writable){var e=0;if(this.polling){h("we are currently polling - waiting to pause");e++;this.once("pollComplete",function(){h("pre-pause polling complete");--e||d()})}if(!this.writable){h("we are currently writing - waiting to pause");e++;this.once("drain",function(){h("pre-pause writing complete");--e||d()})}}else{d()}};j.prototype.poll=function(){h("polling");this.polling=true;this.doPoll();this.emit("poll")};j.prototype.onData=function(a){var b=this;h("polling got data %s",a);var c=function(a,c,d){if("opening"==b.readyState){b.onOpen()}if("close"==a.type){b.onClose();return false}b.onPacket(a)};f.decodePayload(a,this.socket.binaryType,c);if("closed"!=this.readyState){this.polling=false;this.emit("pollComplete");if("open"==this.readyState){this.poll()}else{h('ignoring poll - transport state "%s"',this.readyState)}}};j.prototype.doClose=function(){var a=this;function b(){h("writing close packet");a.write([{type:"close"}])}if("open"==this.readyState){h("transport open - closing");b()}else{h("transport not open - deferring close");this.once("open",b)}};j.prototype.write=function(a){var b=this;this.writable=false;var c=function(){b.writable=true;b.emit("drain")};var b=this;f.encodePayload(a,this.supportsBinary,function(a){b.doWrite(a,c)})};j.prototype.uri=function(){var a=this.query||{};var b=this.secure?"https":"http";var c="";if(false!==this.timestampRequests){a[this.timestampParam]=+new Date+"-"+d.timestamps++}if(!this.supportsBinary&&!a.sid){a.b64=1}a=e.encode(a);if(this.port&&("https"==b&&this.port!=443||"http"==b&&this.port!=80)){c=":"+this.port}if(a.length){a="?"+a}return b+"://"+this.hostname+c+this.path+a}},{"../transport":14,"component-inherit":21,debug:9,"engine.io-parser":22,parseqs:30,xmlhttprequest:20}],19:[function(a,b,c){var d=a("../transport");var e=a("engine.io-parser");var f=a("parseqs");var g=a("component-inherit");var h=a("debug")("engine.io-client:websocket");var i=a("ws");b.exports=j;function j(a){var b=a&&a.forceBase64;if(b){this.supportsBinary=false}d.call(this,a)}g(j,d);j.prototype.name="websocket";j.prototype.supportsBinary=true;j.prototype.doOpen=function(){if(!this.check()){return}var a=this;var b=this.uri();var c=void 0;var d={agent:this.agent};this.ws=new i(b,c,d);if(this.ws.binaryType===undefined){this.supportsBinary=false}this.ws.binaryType="arraybuffer";this.addEventListeners()};j.prototype.addEventListeners=function(){var a=this;this.ws.onopen=function(){a.onOpen()};this.ws.onclose=function(){a.onClose()};this.ws.onmessage=function(b){a.onData(b.data)};this.ws.onerror=function(b){a.onError("websocket error",b)}};if("undefined"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)){j.prototype.onData=function(a){var b=this;setTimeout(function(){d.prototype.onData.call(b,a)},0)}}j.prototype.write=function(a){var b=this;this.writable=false;for(var c=0,d=a.length;c1){return{type:l[d],data:a.substring(1)}}else{return{type:l[d]}}}var e=new Uint8Array(a);var d=e[0];var g=f(a,1);if(n&&b==="blob"){g=new n([g])}return{type:l[d],data:g}};c.decodeBase64Packet=function(a,b){var c=l[a.charAt(0)];if(!d.ArrayBuffer){return{type:c,data:{base64:true,data:a.substr(1)}}}var e=g.decode(a.substr(1));if(b==="blob"&&n){e=new n([e])}return{type:c,data:e}};c.encodePayload=function(a,b,d){if(typeof b=="function"){d=b;b=null}if(b){if(n&&!j){return c.encodePayloadAsBlob(a,d)}return c.encodePayloadAsArrayBuffer(a,d)}if(!a.length){return d("0:")}function e(a){return a.length+":"+a}function f(a,d){c.encodePacket(a,b,function(a){d(null,e(a))})}r(a,f,function(a,b){return d(b.join(""))})};function r(a,b,c){var d=new Array(a.length);var e=h(a.length,c);var f=function(a,c,e){b(c,function(b,c){d[a]=c;e(b,d)})};for(var g=0;g0){var h=new Uint8Array(e);var i=h[0]===0;var j="";for(var k=1;;k++){if(h[k]==255)break;j+=h[k]}e=f(e,2+j.length);j=parseInt(j);var l=f(e,0,j);if(i){try{l=String.fromCharCode.apply(null,new Uint8Array(l))}catch(m){var n=new Uint8Array(l);l="";for(var k=0;kd){c=d}if(b>=d||b>=c||d===0){return new ArrayBuffer(0)}var e=new Uint8Array(a);var f=new Uint8Array(c-b);for(var g=b,h=0;g>2];f+=a[(c[d]&3)<<4|c[d+1]>>4];f+=a[(c[d+1]&15)<<2|c[d+2]>>6];f+=a[c[d+2]&63]}if(e%3===2){f=f.substring(0,f.length-1)+"="}else if(e%3===1){f=f.substring(0,f.length-2)+"=="}return f};c.decode=function(b){var c=b.length*.75,d=b.length,e,f=0,g,h,i,j;if(b[b.length-1]==="="){c--;if(b[b.length-2]==="="){c--}}var k=new ArrayBuffer(c),l=new Uint8Array(k);for(e=0;e>4;l[f++]=(h&15)<<4|i>>2;l[f++]=(i&3)<<6|j&63}return k}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],27:[function(a,b,c){var d=typeof self!=="undefined"?self:typeof window!=="undefined"?window:{};var e=d.BlobBuilder||d.WebKitBlobBuilder||d.MSBlobBuilder||d.MozBlobBuilder;var f=function(){try{var a=new Blob(["hi"]);return a.size==2}catch(b){return false}}();var g=e&&e.prototype.append&&e.prototype.getBlob;function h(a,b){b=b||{};var c=new e;for(var d=0;d=55296&&e<=56319&&c65535){d-=65536;e+=i(d>>>10&1023|55296);d=56320|d&1023}e+=i(d)}return e}function l(a,b){return i(a>>b&63|128)}function m(a){if((a&4294967168)==0){return i(a)}var b="";if((a&4294965248)==0){b=i(a>>6&31|192)}else if((a&4294901760)==0){b=i(a>>12&15|224);b+=l(a,6)}else if((a&4292870144)==0){b=i(a>>18&7|240);b+=l(a,12);b+=l(a,6)}b+=i(a&63|128);return b}function n(a){var b=j(a);var c=b.length;var d=-1;var e;var f="";while(++d=r){throw Error("Invalid byte index")}var a=q[s]&255;s++;if((a&192)==128){return a&63}throw Error("Invalid continuation byte")}function p(){var a;var b;var c;var d;var e;if(s>r){throw Error("Invalid byte index")}if(s==r){return false}a=q[s]&255;s++;if((a&128)==0){return a}if((a&224)==192){var b=o();e=(a&31)<<6|b;if(e>=128){return e}else{throw Error("Invalid continuation byte")}}if((a&240)==224){b=o();c=o();e=(a&15)<<12|b<<6|c;if(e>=2048){return e}else{throw Error("Invalid continuation byte")}}if((a&248)==240){b=o();c=o();d=o();e=(a&15)<<18|b<<12|c<<6|d;if(e>=65536&&e<=1114111){return e}}throw Error("Invalid UTF-8 detected")}var q;var r;var s;function t(a){q=j(a);r=q.length;s=0;var b=[];var c;while((c=p())!==false){b.push(c)}return k(b)}var u={version:"2.0.0",encode:n,decode:t};if(typeof a=="function"&&typeof a.amd=="object"&&a.amd){a(function(){return u})}else if(f&&!f.nodeType){if(g){g.exports=u}else{var v={};var w=v.hasOwnProperty;for(var x in u){w.call(u,x)&&(f[x]=u[x])}}}else{b.utf8=u}})(this)},{}],29:[function(a,b,c){var d=typeof self!=="undefined"?self:typeof window!=="undefined"?window:{};var e=/^[\],:{}\s]*$/;var f=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g;var g=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;var h=/(?:^|:|,)(?:\s*\[)+/g;var i=/^\s+/;var j=/\s+$/;b.exports=function k(a){if("string"!=typeof a||!a){return null}a=a.replace(i,"").replace(j,"");if(d.JSON&&JSON.parse){return JSON.parse(a)}if(e.test(a.replace(f,"@").replace(g,"]").replace(h,""))){return new Function("return "+a)()}}},{}],30:[function(a,b,c){c.encode=function(a){var b="";for(var c in a){if(a.hasOwnProperty(c)){if(b.length)b+="&";b+=encodeURIComponent(c)+"="+encodeURIComponent(a[c])}}return b};c.decode=function(a){var b={};var c=a.split("&");for(var d=0,e=c.length;d1)))/4)-u((a-1901+b)/100)+u((a-1601+b)/400)}}if(!(e={}.hasOwnProperty)){e=function(a){var b={},d;if((b.__proto__=null,b.__proto__={toString:1},b).toString!=c){e=function(a){var b=this.__proto__,c=a in(this.__proto__=null,this);this.__proto__=b;return c}}else{d=b.constructor;e=function(a){var b=(this.constructor||d).prototype;return a in this&&!(a in b&&this[a]===b[a])}}b=null;return e.call(this,a)}}var x={"boolean":1,number:1,string:1,undefined:1};var y=function(a,b){var c=typeof a[b];return c=="object"?!!a[b]:!x[c]};f=function(a,b){var d=0,g,h,i;(g=function(){this.valueOf=0}).prototype.valueOf=0;h=new g;for(i in h){if(e.call(h,i)){d++}}g=h=null;if(!d){h=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"];f=function(a,b){var d=c.call(a)==n,f,g;var i=!d&&typeof a.constructor!="function"&&y(a,"hasOwnProperty")?a.hasOwnProperty:e;for(f in a){if(!(d&&f=="prototype")&&i.call(a,f)){b(f)}}for(g=h.length;f=h[--g];i.call(a,f)&&b(f));}}else if(d==2){f=function(a,b){var d={},f=c.call(a)==n,g;for(g in a){if(!(f&&g=="prototype")&&!e.call(d,g)&&(d[g]=1)&&e.call(a,g)){b(g)}}}}else{f=function(a,b){var d=c.call(a)==n,f,g;for(f in a){if(!(d&&f=="prototype")&&e.call(a,f)&&!(g=f==="constructor")){b(f)}}if(g||e.call(a,f="constructor")){b(f)}}}return f(a,b)};if(!m("json-stringify")){var z={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"};var A="000000";var B=function(a,b){return(A+(b||0)).slice(-a)};var C="\\u00";var D=function(a){var b='"',c=0,d=a.length,e=d>10&&t,f;if(e){f=a.split("")}for(;c-1/0&&l<1/0){if(w){v=u(l/864e5);for(n=u(v/365.2425)+1970-1;w(n+1,0)<=v;n++);for(t=u((v-w(n,0))/30.42);w(n,t+1)<=v;t++);v=1+v-w(n,t);x=(l%864e5+864e5)%864e5;y=u(x/36e5)%24;z=u(x/6e4)%60;A=u(x/1e3)%60;C=x%1e3}else{n=l.getUTCFullYear();t=l.getUTCMonth();v=l.getUTCDate();y=l.getUTCHours();z=l.getUTCMinutes();A=l.getUTCSeconds();C=l.getUTCMilliseconds()}l=(n<=0||n>=1e4?(n<0?"-":"+")+B(6,n<0?-n:n):B(4,n))+"-"+B(2,t+1)+"-"+B(2,v)+"T"+B(2,y)+":"+B(2,z)+":"+B(2,A)+"."+B(3,C)+"Z"}else{l=null}}else if(typeof l.toJSON=="function"&&(m!=p&&m!=q&&m!=r||e.call(l,"toJSON"))){l=l.toJSON(a)}}if(d){l=d.call(b,a,l)}if(l===null){return"null"}m=c.call(l);if(m==s){return""+l}else if(m==p){return l>-1/0&&l<1/0?""+l:"null"}else if(m==q){return D(""+l)}if(typeof l=="object"){for(I=k.length;I--;){if(k[I]===l){throw TypeError()}}k.push(l);F=[];J=j;j+=i;if(m==r){for(H=0,I=l.length;H0){for(e="",d>10&&(d=10);e.length=48&&g<=57||g>=97&&g<=102||g>=65&&g<=70)){J()}}c+=F("0x"+a.slice(d,H));break;default:J()}}else{if(g==34){break}g=a.charCodeAt(H);d=H;while(g>=32&&g!=92&&g!=34){g=a.charCodeAt(++H)}c+=a.slice(d,H)}}if(a.charCodeAt(H)==34){H++;return c}J();default:d=H;if(g==45){f=true;g=a.charCodeAt(++H)}if(g>=48&&g<=57){if(g==48&&(g=a.charCodeAt(H+1),g>=48&&g<=57)){J()}f=false;for(;H=48&&g<=57);H++);if(a.charCodeAt(H)==46){e=++H;for(;e=48&&g<=57);e++);if(e==H){J()}H=e}g=a.charCodeAt(H);if(g==101||g==69){g=a.charCodeAt(++H);if(g==43||g==45){H++}for(e=H;e=48&&g<=57);e++);if(e==H){J()}H=e}return+a.slice(d,H)}if(f){J()}if(a.slice(H,H+4)=="true"){H+=4;return true}else if(a.slice(H,H+5)=="false"){H+=5;return false}else if(a.slice(H,H+4)=="null"){H+=4;return null}J()}}return"$"};var L=function(a){var b,c;if(a=="$"){J()}if(typeof a=="string"){if((t?a.charAt(0):a[0])=="@"){return a.slice(1)}if(a=="["){b=[];for(;;c||(c=true)){a=K();if(a=="]"){break}if(c){if(a==","){a=K();if(a=="]"){J()}}else{J()}}if(a==","){J()}b.push(L(a))}return b}else if(a=="{"){b={};for(;;c||(c=true)){a=K();if(a=="}"){break}if(c){if(a==","){a=K();if(a=="}"){J()}}else{J()}}if(a==","||typeof a!="string"||(t?a.charAt(0):a[0])!="@"||K()!=":"){J()}b[a.slice(1)]=L(K())}return b}J()}return a};var M=function(a,b,c){var d=N(a,b,c);if(d===g){delete a[b]}else{a[b]=d}};var N=function(a,b,d){var e=a[b],g;if(typeof e=="object"&&e){if(c.call(e)==r){for(g=e.length;g--;){M(e,g,d)}}else{f(e,function(a){M(e,a,d)})}}return d.call(a,b,e)};j.parse=function(a,b){var d,e;H=0;I=""+a;d=L(K());if(K()!="$"){J()}H=I=null;return b&&c.call(b)==n?N((e={},e[""]=d,e),"",b):d}}}if(h){a(function(){return j})}})(this)},{}],43:[function(a,b,c){b.exports=d;function d(a,b){var c=[];b=b||0;for(var d=b||0;d-1){return true}}return false};(function(a,b){"use strict";if(typeof exports==="object"){module.exports=b(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains"))}else if(typeof define==="function"&&define.amd){define(["./punycode","./IPv6","./SecondLevelDomains"],b)}else{a.URI=b(a.punycode,a.IPv6,a.SecondLevelDomains,a)}})(this,function(a,b,c,d){"use strict";var e=d&&d.URI;function f(a,b){if(!(this instanceof f)){return new f(a,b)}if(a===undefined){if(typeof location!=="undefined"){a=location.href+""}else{a=""}}this.href(a);if(b!==undefined){return this.absoluteTo(b)}return this}f.version="1.13.2";var g=f.prototype;var h=Object.prototype.hasOwnProperty;function i(a){return a.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function j(a){if(a===undefined){return"Undefined"}return String(Object.prototype.toString.call(a)).slice(8,-1)}function k(a){return j(a)==="Array"}function l(a,b){var c={};var d,e;if(k(b)){for(d=0,e=b.length;d]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi;f.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/};f.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"};f.invalid_hostname_characters=/[^a-zA-Z0-9\.-]/;f.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src"};f.getDomAttribute=function(a){if(!a||!a.nodeName){return undefined}var b=a.nodeName.toLowerCase();if(b==="input"&&a.type!=="image"){return undefined}return f.domAttributes[b]};function o(a){return escape(a)}function p(a){return encodeURIComponent(a).replace(/[!'()*]/g,o).replace(/\*/g,"%2A")}f.encode=p;f.decode=decodeURIComponent;f.iso8859=function(){f.encode=escape;f.decode=unescape};f.unicode=function(){f.encode=p;f.decode=decodeURIComponent};f.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}}};f.encodeQuery=function(a,b){var c=f.encode(a+"");if(b===undefined){b=f.escapeQuerySpace}return b?c.replace(/%20/g,"+"):c};f.decodeQuery=function(a,b){a+="";if(b===undefined){b=f.escapeQuerySpace}try{return f.decode(b?a.replace(/\+/g,"%20"):a)}catch(c){return a}};f.recodePath=function(a){var b=(a+"").split("/");for(var c=0,d=b.length;c-1){b.fragment=a.substring(c+1)||null;a=a.substring(0,c)}c=a.indexOf("?");if(c>-1){b.query=a.substring(c+1)||null;a=a.substring(0,c)}if(a.substring(0,2)==="//"){b.protocol=null;a=a.substring(2);a=f.parseAuthority(a,b)}else{c=a.indexOf(":");if(c>-1){b.protocol=a.substring(0,c)||null;if(b.protocol&&!b.protocol.match(f.protocol_expression)){b.protocol=undefined}else if(b.protocol==="file"){a=a.substring(c+3)}else if(a.substring(c+1,c+3)==="//"){a=a.substring(c+3);a=f.parseAuthority(a,b)}else{a=a.substring(c+1);b.urn=true}}}b.path=a;return b};f.parseHost=function(a,b){var c=a.indexOf("/");var d;var e;if(c===-1){c=a.length}if(a.charAt(0)==="["){d=a.indexOf("]");b.hostname=a.substring(1,d)||null;b.port=a.substring(d+2,c)||null;if(b.port==="/"){b.port=null}}else if(a.indexOf(":")!==a.lastIndexOf(":")){b.hostname=a.substring(0,c)||null;b.port=null}else{e=a.substring(0,c).split(":");b.hostname=e[0]||null;b.port=e[1]||null}if(b.hostname&&a.substring(c).charAt(0)!=="/"){c++;a="/"+a}return a.substring(c)||"/"};f.parseAuthority=function(a,b){a=f.parseUserinfo(a,b);return f.parseHost(a,b)};f.parseUserinfo=function(a,b){var c=a.indexOf("/");var d=c>-1?a.lastIndexOf("@",c):a.indexOf("@");var e;if(d>-1&&(c===-1||d768&&e.hasClass("chan")){m.focus()}});c.on("click","#sign-out",function(){location.reload()});c.on("click",".close",function(){var b="/close";var c=$(this).closest(".chan");if(c.hasClass("lobby")){b="/quit";var d=c.clone().remove("span").text().trim();if(!confirm("Disconnect from "+d+"?")){return false}}a.emit("input",{target:c.data("id"),text:b});c.css({transition:"none",opacity:.4});return false});d.on("input",".search",function(){var a=$(this).val().toLowerCase();var b=$(this).closest(".users").find(".names");b.find("button").each(function(){var b=$(this);var c=b.text().toLowerCase().replace(/[+%@~]/,"");if(c.indexOf(a)===0){b.show()}else{b.hide()}})});d.on("click",".user",function(){var b=$(this).html().trim().replace(/[+%@~]/,"");if(b.indexOf("#")!==-1){return}var c="/whois "+b;a.emit("input",{target:d.data("id"),text:c})});d.on("msg",".messages",function(a,b,d){var f=c.find(".chan[data-target="+b+"]:not(.active)");var h=f.hasClass("query");var i=d.type;var j=i.contains("highlight");if(j||h){e.play();if(document.hidden||!$(b).hasClass("active")){g.badge("!")}}if(f.length===0){return}var k=["join","part","quit","nick"];if($.inArray(i,k)!==-1){return}var l=f.find(".badge");if(l.length!==0){var m=(parseInt(l.html())||0)+1;l.html(m);if(j||h){l.addClass("highlight")}}});d.on("click",".show-more",function(){var b=$(this);var c=b.data("id");var d=b.next(".messages").children().length;a.emit("more",{target:c,count:d})});var p=$("#windows");var q=$("#sign-in, #connect");p.on("show","#sign-in",function(){var a=$(this);var b=a.find("input");b.each(function(){var a=$(this);if(a.val()===""){a.focus();return false}})});p.on("click",".input",function(){$(this).select()});q.on("submit","form",function(b){b.preventDefault();var c="auth";var d=$(this);if(d.closest(".window").attr("id")=="connect"){c="conn";d.find(".btn").attr("disabled",true).end()}var e={};$.each(d.serializeArray(),function(a,b){if(b.value!==""){e[b.name]=b.value}});if(e.user){$.cookie("user",e.user)}a.emit(c,e)});Mousetrap.bind(["command+up","command+down","ctrl+up","ctrl+down"],function(a,b){var d=c.find(".chan");var e=d.index(d.filter(".active"));var f=b.split("+").pop();switch(f){case"up":var g=Math.max(0,e-1);d.eq(g).click();break;case"down":var g=Math.min(d.length,e+1);d.eq(g).click();break}});function r(a){var e=b.slice();var f=d.find(".active").find(".names").children().each(function(){e.push($(this).text().replace(/[+%@~]/,""))});var g=c.find(".channel").each(function(){var a=$(this).clone().remove("span").text().trim();e.push(a)});return $.grep(e,function(b){return!b.toLowerCase().indexOf(a.toLowerCase())})}document.addEventListener("visibilitychange",function(){if(c.find(".highlight").length==0){g.badge("")}})});(function(){var a=Handlebars.template,b=Handlebars.templates=Handlebars.templates||{};b["chan"]=a({1:function(a,b,c,d){var e,f="function",g=b.helperMissing,h=this.escapeExpression;return'\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(a,b,c,d){var e,f="";e=b.each.call(a,a!=null?a.channels:a,{name:"each",hash:{},fn:this.program(1,d),inverse:this.noop,data:d});if(e!=null){f+=e}return f},useData:true});b["chat"]=a({1:function(a,b,c,d){var e,f,g="function",h=b.helperMissing,i=this.escapeExpression,j='
\n
\n \n \n '+i((f=(f=b.name||(a!=null?a.name:a))!=null?f:h,typeof f===g?f.call(a,{name:"name",hash:{},data:d}):f))+'\n '+i((f=(f=b.type||(a!=null?a.type:a))!=null?f:h,typeof f===g?f.call(a,{name:"type",hash:{},data:d}):f))+' \n
\n
\n';e=(b.equal||a&&a.equal||h).call(a,100,(e=a!=null?a.messages:a)!=null?e.length:e,{name:"equal",hash:{},fn:this.program(2,d),inverse:this.noop,data:d});if(e!=null){j+=e}return j+'
\n '+i((b.partial||a&&a.partial||h).call(a,"msg",{name:"partial",hash:{},data:d}))+'\n
\n
\n \n
\n"},2:function(a,b,c,d){var e,f="function",g=b.helperMissing,h=this.escapeExpression;return' \n'},compiler:[6,">= 2.0.0-beta.1"],main:function(a,b,c,d){var e,f="";e=b.each.call(a,a!=null?a.channels:a,{name:"each",hash:{},fn:this.program(1,d),inverse:this.noop,data:d});if(e!=null){f+=e}return f},useData:true});b["msg"]=a({1:function(a,b,c,d){var e,f,g="function",h=b.helperMissing,i=this.escapeExpression,j='
\n \n '+i((b.tz||a&&a.tz||h).call(a,a!=null?a.time:a,{name:"tz",hash:{},data:d}))+'\n \n \n';e=b["if"].call(a,a!=null?a.from:a,{name:"if",hash:{},fn:this.program(2,d),inverse:this.noop,data:d});if(e!=null){j+=e}j+=' \n \n '+i((f=(f=b.type||(a!=null?a.type:a))!=null?f:h,typeof f===g?f.call(a,{name:"type",hash:{},data:d}):f))+"\n";e=(b.equal||a&&a.equal||h).call(a,a!=null?a.type:a,"image",{name:"equal",hash:{},fn:this.program(4,d),inverse:this.program(6,d),data:d});if(e!=null){j+=e}return j+" \n
\n"},2:function(a,b,c,d){var e,f="function",g=b.helperMissing,h=this.escapeExpression;return' \n"},4:function(a,b,c,d){var e,f="function",g=b.helperMissing,h=this.escapeExpression;return' \n'},6:function(a,b,c,d){var e,f=b.helperMissing,g=" ";e=(b.uri||a&&a.uri||f).call(a,a!=null?a.text:a,{name:"uri",hash:{},data:d});if(e!=null){g+=e}return g+"\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(a,b,c,d){var e,f="";e=b.each.call(a,a!=null?a.messages:a,{name:"each",hash:{},fn:this.program(1,d),inverse:this.noop,data:d});if(e!=null){f+=e}return f},useData:true});b["network"]=a({1:function(a,b,c,d){var e,f="function",g=b.helperMissing,h=this.escapeExpression;return'
\n '+h((b.partial||a&&a.partial||g).call(a,"chan",{name:"partial",hash:{},data:d}))+"\n
\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(a,b,c,d){var e,f="";e=b.each.call(a,a!=null?a.networks:a,{name:"each",hash:{},fn:this.program(1,d),inverse:this.noop,data:d});if(e!=null){f+=e}return f},useData:true});b["user"]=a({1:function(a,b,c,d){var e,f=b.helperMissing,g=this.escapeExpression;return'
\n \n
\n'},3:function(a,b,c,d){var e,f="function",g=b.helperMissing,h=this.escapeExpression;return' \n"},compiler:[6,">= 2.0.0-beta.1"],main:function(a,b,c,d){var e,f="";e=b["if"].call(a,(e=a!=null?a.users:a)!=null?e.length:e,{name:"if",hash:{},fn:this.program(1,d),inverse:this.noop,data:d});if(e!=null){f+=e}f+='
\n';e=b.each.call(a,a!=null?a.users:a,{name:"each",hash:{},fn:this.program(3,d),inverse:this.noop,data:d});if(e!=null){f+=e}return f+"
\n"},useData:true})})(); \ No newline at end of file +s=function(a,b){return function(c,d){if(c===undefined){return this._parts[a]||""}else{if(c!==null){c=c+"";if(c.charAt(0)===b){c=c.substring(1)}}this._parts[a]=c;this.build(!d);return this}}};for(r in q){g[r]=s(r,q[r])}q={search:["?","query"],hash:["#","fragment"]};s=function(a,b){return function(c,d){var e=this[a](c,d);return typeof e==="string"&&e.length?b+e:e}};for(r in q){g[r]=s(q[r][1],q[r][0])}g.pathname=function(a,b){if(a===undefined||a===true){var c=this._parts.path||(this._parts.hostname?"/":"");return a?f.decodePath(c):c}else{this._parts.path=a?f.recodePath(a):"/";this.build(!b);return this}};g.path=g.pathname;g.href=function(a,b){var c;if(a===undefined){return this.toString()}this._string="";this._parts=f._parts();var d=a instanceof f;var e=typeof a==="object"&&(a.hostname||a.path||a.pathname);if(a.nodeName){var g=f.getDomAttribute(a);a=a[g]||"";e=false}if(!d&&e&&a.pathname!==undefined){a=a.toString()}if(typeof a==="string"){this._parts=f.parse(a,this._parts)}else if(d||e){var i=d?a._parts:a;for(c in i){if(h.call(this._parts,c)){this._parts[c]=i[c]}}}else{throw new TypeError("invalid input")}this.build(!b);return this};g.is=function(a){var b=false;var d=false;var e=false;var g=false;var h=false;var i=false;var j=false;var k=!this._parts.urn;if(this._parts.hostname){k=false;d=f.ip4_expression.test(this._parts.hostname);e=f.ip6_expression.test(this._parts.hostname);b=d||e;g=!b;h=g&&c&&c.has(this._parts.hostname);i=g&&f.idn_expression.test(this._parts.hostname);j=g&&f.punycode_expression.test(this._parts.hostname)}switch(a.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return g;case"sld":return h;case"ip":return b;case"ip4":case"ipv4":case"inet4":return d;case"ip6":case"ipv6":case"inet6":return e;case"idn":return i;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return j}return null};var t=g.protocol;var u=g.port;var v=g.hostname;g.protocol=function(a,b){if(a!==undefined){if(a){a=a.replace(/:(\/\/)?$/,"");if(!a.match(f.protocol_expression)){throw new TypeError('Protocol "'+a+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]")}}}return t.call(this,a,b)};g.scheme=g.protocol;g.port=function(a,b){if(this._parts.urn){return a===undefined?"":this}if(a!==undefined){if(a===0){a=null}if(a){a+="";if(a.charAt(0)===":"){a=a.substring(1)}if(a.match(/[^0-9]/)){throw new TypeError('Port "'+a+'" contains characters other than [0-9]')}}}return u.call(this,a,b)};g.hostname=function(a,b){if(this._parts.urn){return a===undefined?"":this}if(a!==undefined){var c={};f.parseHost(a,c);a=c.hostname}return v.call(this,a,b)};g.host=function(a,b){if(this._parts.urn){return a===undefined?"":this}if(a===undefined){return this._parts.hostname?f.buildHost(this._parts):""}else{f.parseHost(a,this._parts);this.build(!b);return this}};g.authority=function(a,b){if(this._parts.urn){return a===undefined?"":this}if(a===undefined){return this._parts.hostname?f.buildAuthority(this._parts):""}else{f.parseAuthority(a,this._parts);this.build(!b);return this}};g.userinfo=function(a,b){if(this._parts.urn){return a===undefined?"":this}if(a===undefined){if(!this._parts.username){return""}var c=f.buildUserinfo(this._parts);return c.substring(0,c.length-1)}else{if(a[a.length-1]!=="@"){a+="@"}f.parseUserinfo(a,this._parts);this.build(!b);return this}};g.resource=function(a,b){var c;if(a===undefined){return this.path()+this.search()+this.hash()}c=f.parse(a);this._parts.path=c.path;this._parts.query=c.query;this._parts.fragment=c.fragment;this.build(!b);return this};g.subdomain=function(a,b){if(this._parts.urn){return a===undefined?"":this}if(a===undefined){if(!this._parts.hostname||this.is("IP")){return""}var c=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,c)||""}else{var d=this._parts.hostname.length-this.domain().length;var e=this._parts.hostname.substring(0,d);var g=new RegExp("^"+i(e));if(a&&a.charAt(a.length-1)!=="."){a+="."}if(a){f.ensureValidHostname(a)}this._parts.hostname=this._parts.hostname.replace(g,a);this.build(!b);return this}};g.domain=function(a,b){if(this._parts.urn){return a===undefined?"":this}if(typeof a==="boolean"){b=a;a=undefined}if(a===undefined){if(!this._parts.hostname||this.is("IP")){return""}var c=this._parts.hostname.match(/\./g);if(c&&c.length<2){return this._parts.hostname}var d=this._parts.hostname.length-this.tld(b).length-1;d=this._parts.hostname.lastIndexOf(".",d-1)+1;return this._parts.hostname.substring(d)||""}else{if(!a){throw new TypeError("cannot set domain empty")}f.ensureValidHostname(a);if(!this._parts.hostname||this.is("IP")){this._parts.hostname=a}else{var e=new RegExp(i(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(e,a)}this.build(!b);return this}};g.tld=function(a,b){if(this._parts.urn){return a===undefined?"":this}if(typeof a==="boolean"){b=a;a=undefined}if(a===undefined){if(!this._parts.hostname||this.is("IP")){return""}var d=this._parts.hostname.lastIndexOf(".");var e=this._parts.hostname.substring(d+1);if(b!==true&&c&&c.list[e.toLowerCase()]){return c.get(this._parts.hostname)||e}return e}else{var f;if(!a){throw new TypeError("cannot set TLD empty")}else if(a.match(/[^a-zA-Z0-9-]/)){if(c&&c.is(a)){f=new RegExp(i(this.tld())+"$");this._parts.hostname=this._parts.hostname.replace(f,a)}else{throw new TypeError('TLD "'+a+'" contains characters other than [A-Z0-9]')}}else if(!this._parts.hostname||this.is("IP")){throw new ReferenceError("cannot set TLD on non-domain host")}else{f=new RegExp(i(this.tld())+"$");this._parts.hostname=this._parts.hostname.replace(f,a)}this.build(!b);return this}};g.directory=function(a,b){if(this._parts.urn){return a===undefined?"":this}if(a===undefined||a===true){if(!this._parts.path&&!this._parts.hostname){return""}if(this._parts.path==="/"){return"/"}var c=this._parts.path.length-this.filename().length-1;var d=this._parts.path.substring(0,c)||(this._parts.hostname?"/":"");return a?f.decodePath(d):d}else{var e=this._parts.path.length-this.filename().length;var g=this._parts.path.substring(0,e);var h=new RegExp("^"+i(g));if(!this.is("relative")){if(!a){a="/"}if(a.charAt(0)!=="/"){a="/"+a}}if(a&&a.charAt(a.length-1)!=="/"){a+="/"}a=f.recodePath(a);this._parts.path=this._parts.path.replace(h,a);this.build(!b);return this}};g.filename=function(a,b){if(this._parts.urn){return a===undefined?"":this}if(a===undefined||a===true){if(!this._parts.path||this._parts.path==="/"){return""}var c=this._parts.path.lastIndexOf("/");var d=this._parts.path.substring(c+1);return a?f.decodePathSegment(d):d}else{var e=false;if(a.charAt(0)==="/"){a=a.substring(1)}if(a.match(/\.?\//)){e=true}var g=new RegExp(i(this.filename())+"$");a=f.recodePath(a);this._parts.path=this._parts.path.replace(g,a);if(e){this.normalizePath(b)}else{this.build(!b)}return this}};g.suffix=function(a,b){if(this._parts.urn){return a===undefined?"":this}if(a===undefined||a===true){if(!this._parts.path||this._parts.path==="/"){return""}var c=this.filename();var d=c.lastIndexOf(".");var e,g;if(d===-1){return""}e=c.substring(d+1);g=/^[a-z0-9%]+$/i.test(e)?e:"";return a?f.decodePathSegment(g):g}else{if(a.charAt(0)==="."){a=a.substring(1)}var h=this.suffix();var j;if(!h){if(!a){return this}this._parts.path+="."+f.recodePath(a)}else if(!a){j=new RegExp(i("."+h)+"$")}else{j=new RegExp(i(h)+"$")}if(j){a=f.recodePath(a);this._parts.path=this._parts.path.replace(j,a)}this.build(!b);return this}};g.segment=function(a,b,c){var d=this._parts.urn?":":"/";var e=this.path();var f=e.substring(0,1)==="/";var g=e.split(d);if(a!==undefined&&typeof a!=="number"){c=b;b=a;a=undefined}if(a!==undefined&&typeof a!=="number"){throw new Error('Bad segment "'+a+'", must be 0-based integer')}if(f){g.shift()}if(a<0){a=Math.max(g.length+a,0)}if(b===undefined){return a===undefined?g:g[a]}else if(a===null||g[a]===undefined){if(k(b)){g=[];for(var h=0,i=b.length;h768&&e.hasClass("chan")){m.focus()}});c.on("click","#sign-out",function(){location.reload()});c.on("click",".close",function(){var b="/close";var c=$(this).closest(".chan");if(c.hasClass("lobby")){b="/quit";var d=c.clone().remove("span").text().trim();if(!confirm("Disconnect from "+d+"?")){return false}}a.emit("input",{target:c.data("id"),text:b});c.css({transition:"none",opacity:.4});return false});d.on("input",".search",function(){var a=$(this).val().toLowerCase();var b=$(this).closest(".users").find(".names");b.find("button").each(function(){var b=$(this);var c=b.text().toLowerCase().replace(/[+%@~]/,"");if(c.indexOf(a)===0){b.show()}else{b.hide()}})});d.on("click",".user",function(){var b=$(this).html().trim().replace(/[+%@~]/,"");if(b.indexOf("#")!==-1){return}var c="/whois "+b;a.emit("input",{target:d.data("id"),text:c})});d.on("msg",".messages",function(a,b,d){var f=c.find(".chan[data-target="+b+"]:not(.active)");var h=f.hasClass("query");var i=d.type;var j=i.contains("highlight");if(j||h){e.play();if(document.hidden||!$(b).hasClass("active")){g.badge("!")}}if(f.length===0){return}var k=["join","part","quit","nick"];if($.inArray(i,k)!==-1){return}var l=f.find(".badge");if(l.length!==0){var m=(parseInt(l.html())||0)+1;l.html(m);if(j||h){l.addClass("highlight")}}});d.on("click",".show-more",function(){var b=$(this);var c=b.data("id");var d=b.next(".messages").children().length;a.emit("more",{target:c,count:d})});var p=$("#windows");var q=$("#sign-in, #connect");p.on("show","#sign-in",function(){var a=$(this);var b=a.find("input");b.each(function(){var a=$(this);if(a.val()===""){a.focus();return false}})});p.on("click",".input",function(){$(this).select()});q.on("submit","form",function(b){b.preventDefault();var c="auth";var d=$(this);if(d.closest(".window").attr("id")=="connect"){c="conn";d.find(".btn").attr("disabled",true).end()}var e={};$.each(d.serializeArray(),function(a,b){if(b.value!==""){e[b.name]=b.value}});if(e.user){$.cookie("user",e.user)}a.emit(c,e)});Mousetrap.bind(["command+up","command+down","ctrl+up","ctrl+down"],function(a,b){var d=c.find(".chan");var e=d.index(d.filter(".active"));var f=b.split("+").pop();switch(f){case"up":var g=Math.max(0,e-1);d.eq(g).click();break;case"down":var g=Math.min(d.length,e+1);d.eq(g).click();break}});function r(a){var e=b.slice();var f=d.find(".active").find(".names").children().each(function(){e.push($(this).text().replace(/[+%@~]/,""))});var g=c.find(".channel").each(function(){var a=$(this).clone().remove("span").text().trim();e.push(a)});return $.grep(e,function(b){return!b.toLowerCase().indexOf(a.toLowerCase())})}document.addEventListener("visibilitychange",function(){if(c.find(".highlight").length==0){g.badge("")}})});(function(){var a=Handlebars.template,b=Handlebars.templates=Handlebars.templates||{};b["chan"]=a({1:function(a,b,c,d){var e,f="function",g=b.helperMissing,h=this.escapeExpression;return'\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(a,b,c,d){var e,f="";e=b.each.call(a,a!=null?a.channels:a,{name:"each",hash:{},fn:this.program(1,d),inverse:this.noop,data:d});if(e!=null){f+=e}return f},useData:true});b["chat"]=a({1:function(a,b,c,d){var e,f,g="function",h=b.helperMissing,i=this.escapeExpression,j='
\n
\n \n \n '+i((f=(f=b.name||(a!=null?a.name:a))!=null?f:h,typeof f===g?f.call(a,{name:"name",hash:{},data:d}):f))+'\n '+i((f=(f=b.type||(a!=null?a.type:a))!=null?f:h,typeof f===g?f.call(a,{name:"type",hash:{},data:d}):f))+' \n
\n
\n';e=(b.equal||a&&a.equal||h).call(a,100,(e=a!=null?a.messages:a)!=null?e.length:e,{name:"equal",hash:{},fn:this.program(2,d),inverse:this.noop,data:d});if(e!=null){j+=e}return j+'
\n '+i((b.partial||a&&a.partial||h).call(a,"msg",{name:"partial",hash:{},data:d}))+'\n
\n
\n \n
\n"},2:function(a,b,c,d){var e,f="function",g=b.helperMissing,h=this.escapeExpression;return' \n'},compiler:[6,">= 2.0.0-beta.1"],main:function(a,b,c,d){var e,f="";e=b.each.call(a,a!=null?a.channels:a,{name:"each",hash:{},fn:this.program(1,d),inverse:this.noop,data:d});if(e!=null){f+=e}return f},useData:true});b["msg"]=a({1:function(a,b,c,d){var e,f,g="function",h=b.helperMissing,i=this.escapeExpression,j='
\n \n '+i((b.tz||a&&a.tz||h).call(a,a!=null?a.time:a,{name:"tz",hash:{},data:d}))+'\n \n \n';e=b["if"].call(a,a!=null?a.from:a,{name:"if",hash:{},fn:this.program(2,d),inverse:this.noop,data:d});if(e!=null){j+=e}j+=' \n \n '+i((f=(f=b.type||(a!=null?a.type:a))!=null?f:h,typeof f===g?f.call(a,{name:"type",hash:{},data:d}):f))+"\n";e=(b.equal||a&&a.equal||h).call(a,a!=null?a.type:a,"image",{name:"equal",hash:{},fn:this.program(4,d),inverse:this.program(6,d),data:d});if(e!=null){j+=e}return j+" \n
\n"},2:function(a,b,c,d){var e,f="function",g=b.helperMissing,h=this.escapeExpression;return' \n"},4:function(a,b,c,d){var e,f="function",g=b.helperMissing,h=this.escapeExpression;return' \n'},6:function(a,b,c,d){var e,f=b.helperMissing,g=" ";e=(b.uri||a&&a.uri||f).call(a,a!=null?a.text:a,{name:"uri",hash:{},data:d});if(e!=null){g+=e}return g+"\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(a,b,c,d){var e,f="";e=b.each.call(a,a!=null?a.messages:a,{name:"each",hash:{},fn:this.program(1,d),inverse:this.noop,data:d});if(e!=null){f+=e}return f},useData:true});b["network"]=a({1:function(a,b,c,d){var e,f="function",g=b.helperMissing,h=this.escapeExpression;return'
\n '+h((b.partial||a&&a.partial||g).call(a,"chan",{name:"partial",hash:{},data:d}))+"\n
\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(a,b,c,d){var e,f="";e=b.each.call(a,a!=null?a.networks:a,{name:"each",hash:{},fn:this.program(1,d),inverse:this.noop,data:d});if(e!=null){f+=e}return f},useData:true});b["user"]=a({1:function(a,b,c,d){var e,f=b.helperMissing,g=this.escapeExpression;return'
\n \n
\n'},3:function(a,b,c,d){var e,f="function",g=b.helperMissing,h=this.escapeExpression;return' \n"},compiler:[6,">= 2.0.0-beta.1"],main:function(a,b,c,d){var e,f="";e=b["if"].call(a,(e=a!=null?a.users:a)!=null?e.length:e,{name:"if",hash:{},fn:this.program(1,d),inverse:this.noop,data:d});if(e!=null){f+=e}f+='
\n';e=b.each.call(a,a!=null?a.users:a,{name:"each",hash:{},fn:this.program(3,d),inverse:this.noop,data:d});if(e!=null){f+=e}return f+"
\n"},useData:true})})(); \ No newline at end of file diff --git a/client/css/style.css b/client/css/style.css index 9c913534..7f70f99e 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -509,6 +509,13 @@ button { #chat .highlight .from { color: #f00; } +#chat.hide-join .join span, +#chat.hide-nick .nick span, +#chat.hide-part .part span, +#chat.hide-mode .mode span, +#chat.hide-quit .quit span { + display: none !important; +} #chat .notice .type { display: none; } diff --git a/client/index.html b/client/index.html index b3a176e3..b9fa80b2 100644 --- a/client/index.html +++ b/client/index.html @@ -123,6 +123,39 @@

Settings

+
+

Messages

+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +

Sound

diff --git a/client/js/shout.js b/client/js/shout.js index c2f73454..89d9f90c 100644 --- a/client/js/shout.js +++ b/client/js/shout.js @@ -238,7 +238,14 @@ $(function() { $.cookie.json = true; var settings = $("#settings"); - var options = $.extend({notification: true}, $.cookie("settings")); + var options = $.extend({ + join: true, + mode: true, + nick: true, + notification: true, + part: true, + quit: true, + }, $.cookie("settings")); for (var i in options) { if (options[i]) { @@ -248,10 +255,20 @@ $(function() { settings.on("change", "input", function() { var self = $(this); - options[self.attr("name")] = self.prop("checked"); + var name = self.attr("name"); + options[name] = self.prop("checked"); $.cookie("settings", options); + if ([ + "join", + "nick", + "part", + "mode", + "quit", + ].indexOf(name) !== -1) { + console.log("toggle " + name); + chat.toggleClass("hide-" + name, !self.prop("checked")); + } }).find("input") - .eq(0) .trigger("change"); var viewport = $("#viewport"); diff --git a/package.json b/package.json index 7213c2e3..e433b08d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "shout", "description": "A web IRC client", - "version": "0.21.4", + "version": "0.22.0", "author": "Mattias Erming", "preferGlobal": true, "bin": {