From 5aaa9d5876dbe9de9efffc668342a4884de48741 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Fri, 16 Aug 2013 12:44:31 -0700 Subject: [PATCH 1/3] Upgraded moment.js, added paneladd.html --- common/lib/moment.js | 4 ++-- partials/paneladd.html | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 partials/paneladd.html diff --git a/common/lib/moment.js b/common/lib/moment.js index 4e8497a9d7d70a..62b1697b6a2153 100644 --- a/common/lib/moment.js +++ b/common/lib/moment.js @@ -1,6 +1,6 @@ // moment.js -// version : 2.0.0 +// version : 2.1.0 // author : Tim Wood // license : MIT // momentjs.com -(function(e){function O(e,t){return function(n){return j(e.call(this,n),t)}}function M(e){return function(t){return this.lang().ordinal(e.call(this,t))}}function _(){}function D(e){H(this,e)}function P(e){var t=this._data={},n=e.years||e.year||e.y||0,r=e.months||e.month||e.M||0,i=e.weeks||e.week||e.w||0,s=e.days||e.day||e.d||0,o=e.hours||e.hour||e.h||0,u=e.minutes||e.minute||e.m||0,a=e.seconds||e.second||e.s||0,f=e.milliseconds||e.millisecond||e.ms||0;this._milliseconds=f+a*1e3+u*6e4+o*36e5,this._days=s+i*7,this._months=r+n*12,t.milliseconds=f%1e3,a+=B(f/1e3),t.seconds=a%60,u+=B(a/60),t.minutes=u%60,o+=B(u/60),t.hours=o%24,s+=B(o/24),s+=i*7,t.days=s%30,r+=B(s/30),t.months=r%12,n+=B(r/12),t.years=n}function H(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function B(e){return e<0?Math.ceil(e):Math.floor(e)}function j(e,t){var n=e+"";while(n.length68?1900:2e3);break;case"YYYY":case"YYYYY":s[0]=~~t;break;case"a":case"A":n._isPm=(t+"").toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":s[3]=~~t;break;case"m":case"mm":s[4]=~~t;break;case"s":case"ss":s[5]=~~t;break;case"S":case"SS":case"SSS":s[6]=~~(("0."+t)*1e3);break;case"X":n._d=new Date(parseFloat(t)*1e3);break;case"Z":case"ZZ":n._useUTC=!0,r=(t+"").match(x),r&&r[1]&&(n._tzh=~~r[1]),r&&r[2]&&(n._tzm=~~r[2]),r&&r[0]==="+"&&(n._tzh=-n._tzh,n._tzm=-n._tzm)}t==null&&(n._isValid=!1)}function J(e){var t,n,r=[];if(e._d)return;for(t=0;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];r[3]+=e._tzh||0,r[4]+=e._tzm||0,n=new Date(0),e._useUTC?(n.setUTCFullYear(r[0],r[1],r[2]),n.setUTCHours(r[3],r[4],r[5],r[6])):(n.setFullYear(r[0],r[1],r[2]),n.setHours(r[3],r[4],r[5],r[6])),e._d=n}function K(e){var t=e._f.match(a),n=e._i,r,i;e._a=[];for(r=0;r0,f[4]=n,Z.apply({},f)}function tt(e,n,r){var i=r-n,s=r-e.day();return s>i&&(s-=7),s11?n?"pm":"PM":n?"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(e,t){var n=this._calendar[e];return typeof n=="function"?n.apply(t):n},_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(e,t,n,r){var i=this._relativeTime[n];return typeof i=="function"?i(e,t,n,r):i.replace(/%d/i,e)},pastFuture:function(e,t){var n=this._relativeTime[e>0?"future":"past"];return typeof n=="function"?n(t):n.replace(/%s/i,t)},ordinal:function(e){return this._ordinal.replace("%d",e)},_ordinal:"%d",preparse:function(e){return e},postformat:function(e){return e},week:function(e){return tt(e,this._week.dow,this._week.doy)},_week:{dow:0,doy:6}},t=function(e,t,n){return nt({_i:e,_f:t,_l:n,_isUTC:!1})},t.utc=function(e,t,n){return nt({_useUTC:!0,_isUTC:!0,_l:n,_i:e,_f:t})},t.unix=function(e){return t(e*1e3)},t.duration=function(e,n){var r=t.isDuration(e),i=typeof e=="number",s=r?e._data:i?{}:e,o;return i&&(n?s[n]=e:s.milliseconds=e),o=new P(s),r&&e.hasOwnProperty("_lang")&&(o._lang=e._lang),o},t.version=n,t.defaultFormat=E,t.lang=function(e,n){var r;if(!e)return t.fn._lang._abbr;n?R(e,n):s[e]||U(e),t.duration.fn._lang=t.fn._lang=U(e)},t.langData=function(e){return e&&e._lang&&e._lang._abbr&&(e=e._lang._abbr),U(e)},t.isMoment=function(e){return e instanceof D},t.isDuration=function(e){return e instanceof P},t.fn=D.prototype={clone:function(){return t(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1e3)},toString:function(){return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._d},toJSON:function(){return t.utc(this).format("YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var e=this;return[e.year(),e.month(),e.date(),e.hours(),e.minutes(),e.seconds(),e.milliseconds()]},isValid:function(){return this._isValid==null&&(this._a?this._isValid=!q(this._a,(this._isUTC?t.utc(this._a):t(this._a)).toArray()):this._isValid=!isNaN(this._d.getTime())),!!this._isValid},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(e){var n=X(this,e||t.defaultFormat);return this.lang().postformat(n)},add:function(e,n){var r;return typeof e=="string"?r=t.duration(+n,e):r=t.duration(e,n),F(this,r,1),this},subtract:function(e,n){var r;return typeof e=="string"?r=t.duration(+n,e):r=t.duration(e,n),F(this,r,-1),this},diff:function(e,n,r){var i=this._isUTC?t(e).utc():t(e).local(),s=(this.zone()-i.zone())*6e4,o,u;return n&&(n=n.replace(/s$/,"")),n==="year"||n==="month"?(o=(this.daysInMonth()+i.daysInMonth())*432e5,u=(this.year()-i.year())*12+(this.month()-i.month()),u+=(this-t(this).startOf("month")-(i-t(i).startOf("month")))/o,n==="year"&&(u/=12)):(o=this-i-s,u=n==="second"?o/1e3:n==="minute"?o/6e4:n==="hour"?o/36e5:n==="day"?o/864e5:n==="week"?o/6048e5:o),r?u:B(u)},from:function(e,n){return t.duration(this.diff(e)).lang(this.lang()._abbr).humanize(!n)},fromNow:function(e){return this.from(t(),e)},calendar:function(){var e=this.diff(t().startOf("day"),"days",!0),n=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(n,this))},isLeapYear:function(){var e=this.year();return e%4===0&&e%100!==0||e%400===0},isDST:function(){return this.zone()+t(e).startOf(n)},isBefore:function(e,n){return n=typeof n!="undefined"?n:"millisecond",+this.clone().startOf(n)<+t(e).startOf(n)},isSame:function(e,n){return n=typeof n!="undefined"?n:"millisecond",+this.clone().startOf(n)===+t(e).startOf(n)},zone:function(){return this._isUTC?0:this._d.getTimezoneOffset()},daysInMonth:function(){return t.utc([this.year(),this.month()+1,0]).date()},dayOfYear:function(e){var n=r((t(this).startOf("day")-t(this).startOf("year"))/864e5)+1;return e==null?n:this.add("d",e-n)},isoWeek:function(e){var t=tt(this,1,4);return e==null?t:this.add("d",(e-t)*7)},week:function(e){var t=this.lang().week(this);return e==null?t:this.add("d",(e-t)*7)},lang:function(t){return t===e?this._lang:(this._lang=U(t),this)}};for(i=0;it?Math.ceil(t):Math.floor(t)}function u(t,e){for(var n=t+"";n.lengthn;n++)~~t[n]!==~~e[n]&&r++;return r+i}function f(t){return t?ie[t]||t.toLowerCase().replace(/(.)s$/,"$1"):t}function l(t,e){return e.abbr=t,x[t]||(x[t]=new s),x[t].set(e),x[t]}function _(t){if(!t)return H.fn._lang;if(!x[t]&&A)try{require("./lang/"+t)}catch(e){return H.fn._lang}return x[t]}function m(t){return t.match(/\[.*\]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function y(t){var e,n,s=t.match(E);for(e=0,n=s.length;n>e;e++)s[e]=ue[s[e]]?ue[s[e]]:m(s[e]);return function(i){var r="";for(e=0;n>e;e++)r+=s[e]instanceof Function?s[e].call(i,t):s[e];return r}}function M(t,e){function n(e){return t.lang().longDateFormat(e)||e}for(var s=5;s--&&N.test(e);)e=e.replace(N,n);return re[e]||(re[e]=y(e)),re[e](t)}function g(t,e){switch(t){case"DDDD":return V;case"YYYY":return X;case"YYYYY":return $;case"S":case"SS":case"SSS":case"DDD":return I;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return R;case"a":case"A":return _(e._l)._meridiemParse;case"X":return B;case"Z":case"ZZ":return j;case"T":return q;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return J;default:return new RegExp(t.replace("\\",""))}}function p(t){var e=(j.exec(t)||[])[0],n=(e+"").match(ee)||["-",0,0],s=+(60*n[1])+~~n[2];return"+"===n[0]?-s:s}function D(t,e,n){var s,i=n._a;switch(t){case"M":case"MM":i[1]=null==e?0:~~e-1;break;case"MMM":case"MMMM":s=_(n._l).monthsParse(e),null!=s?i[1]=s:n._isValid=!1;break;case"D":case"DD":case"DDD":case"DDDD":null!=e&&(i[2]=~~e);break;case"YY":i[0]=~~e+(~~e>68?1900:2e3);break;case"YYYY":case"YYYYY":i[0]=~~e;break;case"a":case"A":n._isPm=_(n._l).isPM(e);break;case"H":case"HH":case"h":case"hh":i[3]=~~e;break;case"m":case"mm":i[4]=~~e;break;case"s":case"ss":i[5]=~~e;break;case"S":case"SS":case"SSS":i[6]=~~(1e3*("0."+e));break;case"X":n._d=new Date(1e3*parseFloat(e));break;case"Z":case"ZZ":n._useUTC=!0,n._tzm=p(e)}null==e&&(n._isValid=!1)}function Y(t){var e,n,s=[];if(!t._d){for(e=0;7>e;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];s[3]+=~~((t._tzm||0)/60),s[4]+=~~((t._tzm||0)%60),n=new Date(0),t._useUTC?(n.setUTCFullYear(s[0],s[1],s[2]),n.setUTCHours(s[3],s[4],s[5],s[6])):(n.setFullYear(s[0],s[1],s[2]),n.setHours(s[3],s[4],s[5],s[6])),t._d=n}}function w(t){var e,n,s=t._f.match(E),i=t._i;for(t._a=[],e=0;eo&&(u=o,s=n);a(t,s)}function v(t){var e,n=t._i,s=K.exec(n);if(s){for(t._f="YYYY-MM-DD"+(s[2]||" "),e=0;4>e;e++)if(te[e][1].exec(n)){t._f+=te[e][0];break}j.exec(n)&&(t._f+=" Z"),w(t)}else t._d=new Date(n)}function T(e){var n=e._i,s=G.exec(n);n===t?e._d=new Date:s?e._d=new Date(+s[1]):"string"==typeof n?v(e):d(n)?(e._a=n.slice(0),Y(e)):e._d=n instanceof Date?new Date(+n):new Date(n)}function b(t,e,n,s,i){return i.relativeTime(e||1,!!n,t,s)}function S(t,e,n){var s=W(Math.abs(t)/1e3),i=W(s/60),r=W(i/60),a=W(r/24),o=W(a/365),u=45>s&&["s",s]||1===i&&["m"]||45>i&&["mm",i]||1===r&&["h"]||22>r&&["hh",r]||1===a&&["d"]||25>=a&&["dd",a]||45>=a&&["M"]||345>a&&["MM",W(a/30)]||1===o&&["y"]||["yy",o];return u[2]=e,u[3]=t>0,u[4]=n,b.apply({},u)}function F(t,e,n){var s,i=n-e,r=n-t.day();return r>i&&(r-=7),i-7>r&&(r+=7),s=H(t).add("d",r),{week:Math.ceil(s.dayOfYear()/7),year:s.year()}}function O(t){var e=t._i,n=t._f;return null===e||""===e?null:("string"==typeof e&&(t._i=e=_().preparse(e)),H.isMoment(e)?(t=a({},e),t._d=new Date(+e._d)):n?d(n)?k(t):w(t):T(t),new i(t))}function z(t,e){H.fn[t]=H.fn[t+"s"]=function(t){var n=this._isUTC?"UTC":"";return null!=t?(this._d["set"+n+e](t),H.updateOffset(this),this):this._d["get"+n+e]()}}function C(t){H.duration.fn[t]=function(){return this._data[t]}}function L(t,e){H.duration.fn["as"+t]=function(){return+this/e}}for(var H,P,U="2.1.0",W=Math.round,x={},A="undefined"!=typeof module&&module.exports,G=/^\/?Date\((\-?\d+)/i,Z=/(\-)?(\d*)?\.?(\d+)\:(\d+)\:(\d+)\.?(\d{3})?/,E=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,N=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,J=/\d\d?/,I=/\d{1,3}/,V=/\d{3}/,X=/\d{1,4}/,$=/[+\-]?\d{1,6}/,R=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,j=/Z|[\+\-]\d\d:?\d\d/i,q=/T/i,B=/[\+\-]?\d+(\.\d{1,3})?/,K=/^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,Q="YYYY-MM-DDTHH:mm:ssZ",te=[["HH:mm:ss.S",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],ee=/([\+\-]|\d\d)/gi,ne="Date|Hours|Minutes|Seconds|Milliseconds".split("|"),se={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},ie={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",w:"week",M:"month",y:"year"},re={},ae="DDD w W M D d".split(" "),oe="M D H h m s w W".split(" "),ue={M:function(){return this.month()+1},MMM:function(t){return this.lang().monthsShort(this,t)},MMMM:function(t){return this.lang().months(this,t)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(t){return this.lang().weekdaysMin(this,t)},ddd:function(t){return this.lang().weekdaysShort(this,t)},dddd:function(t){return this.lang().weekdays(this,t)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return u(this.year()%100,2)},YYYY:function(){return u(this.year(),4)},YYYYY:function(){return u(this.year(),5)},gg:function(){return u(this.weekYear()%100,2)},gggg:function(){return this.weekYear()},ggggg:function(){return u(this.weekYear(),5)},GG:function(){return u(this.isoWeekYear()%100,2)},GGGG:function(){return this.isoWeekYear()},GGGGG:function(){return u(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return~~(this.milliseconds()/100)},SS:function(){return u(~~(this.milliseconds()/10),2)},SSS:function(){return u(this.milliseconds(),3)},Z:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+u(~~(t/60),2)+":"+u(~~t%60,2)},ZZ:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+u(~~(10*t/6),4)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()}};ae.length;)P=ae.pop(),ue[P+"o"]=n(ue[P],P);for(;oe.length;)P=oe.pop(),ue[P+P]=e(ue[P],2);for(ue.DDDD=e(ue.DDD,3),s.prototype={set:function(t){var e,n;for(n in t)e=t[n],"function"==typeof e?this[n]=e:this["_"+n]=e},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(t){return this._months[t.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(t){return this._monthsShort[t.month()]},monthsParse:function(t){var e,n,s;for(this._monthsParse||(this._monthsParse=[]),e=0;12>e;e++)if(this._monthsParse[e]||(n=H([2e3,e]),s="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[e]=new RegExp(s.replace(".",""),"i")),this._monthsParse[e].test(t))return e},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(t){return this._weekdays[t.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(t){return this._weekdaysShort[t.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(t){return this._weekdaysMin[t.day()]},weekdaysParse:function(t){var e,n,s;for(this._weekdaysParse||(this._weekdaysParse=[]),e=0;7>e;e++)if(this._weekdaysParse[e]||(n=H([2e3,1]).day(e),s="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[e]=new RegExp(s.replace(".",""),"i")),this._weekdaysParse[e].test(t))return e},_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(t){var e=this._longDateFormat[t];return!e&&this._longDateFormat[t.toUpperCase()]&&(e=this._longDateFormat[t.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t]=e),e},isPM:function(t){return"p"===(t+"").toLowerCase()[0]},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(t,e,n){return t>11?n?"pm":"PM":n?"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(t,e){var n=this._calendar[t];return"function"==typeof n?n.apply(e):n},_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(t,e,n,s){var i=this._relativeTime[n];return"function"==typeof i?i(t,e,n,s):i.replace(/%d/i,t)},pastFuture:function(t,e){var n=this._relativeTime[t>0?"future":"past"];return"function"==typeof n?n(e):n.replace(/%s/i,e)},ordinal:function(t){return this._ordinal.replace("%d",t)},_ordinal:"%d",preparse:function(t){return t},postformat:function(t){return t},week:function(t){return F(t,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6}},H=function(t,e,n){return O({_i:t,_f:e,_l:n,_isUTC:!1})},H.utc=function(t,e,n){return O({_useUTC:!0,_isUTC:!0,_l:n,_i:t,_f:e})},H.unix=function(t){return H(1e3*t)},H.duration=function(t,e){var n,s,i=H.isDuration(t),a="number"==typeof t,o=i?t._input:a?{}:t,u=Z.exec(t);return a?e?o[e]=t:o.milliseconds=t:u&&(n="-"===u[1]?-1:1,o={y:0,d:~~u[2]*n,h:~~u[3]*n,m:~~u[4]*n,s:~~u[5]*n,ms:~~u[6]*n}),s=new r(o),i&&t.hasOwnProperty("_lang")&&(s._lang=t._lang),s},H.version=U,H.defaultFormat=Q,H.updateOffset=function(){},H.lang=function(t,e){return t?(e?l(t,e):x[t]||_(t),H.duration.fn._lang=H.fn._lang=_(t),void 0):H.fn._lang._abbr},H.langData=function(t){return t&&t._lang&&t._lang._abbr&&(t=t._lang._abbr),_(t)},H.isMoment=function(t){return t instanceof i},H.isDuration=function(t){return t instanceof r},H.fn=i.prototype={clone:function(){return H(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){return M(H(this).utc(),"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var t=this;return[t.year(),t.month(),t.date(),t.hours(),t.minutes(),t.seconds(),t.milliseconds()]},isValid:function(){return null==this._isValid&&(this._isValid=this._a?!c(this._a,(this._isUTC?H.utc(this._a):H(this._a)).toArray()):!isNaN(this._d.getTime())),!!this._isValid},utc:function(){return this.zone(0)},local:function(){return this.zone(0),this._isUTC=!1,this},format:function(t){var e=M(this,t||H.defaultFormat);return this.lang().postformat(e)},add:function(t,e){var n;return n="string"==typeof t?H.duration(+e,t):H.duration(t,e),h(this,n,1),this},subtract:function(t,e){var n;return n="string"==typeof t?H.duration(+e,t):H.duration(t,e),h(this,n,-1),this},diff:function(t,e,n){var s,i,r=this._isUTC?H(t).zone(this._offset||0):H(t).local(),a=6e4*(this.zone()-r.zone());return e=f(e),"year"===e||"month"===e?(s=432e5*(this.daysInMonth()+r.daysInMonth()),i=12*(this.year()-r.year())+(this.month()-r.month()),i+=(this-H(this).startOf("month")-(r-H(r).startOf("month")))/s,i-=6e4*(this.zone()-H(this).startOf("month").zone()-(r.zone()-H(r).startOf("month").zone()))/s,"year"===e&&(i/=12)):(s=this-r,i="second"===e?s/1e3:"minute"===e?s/6e4:"hour"===e?s/36e5:"day"===e?(s-a)/864e5:"week"===e?(s-a)/6048e5:s),n?i:o(i)},from:function(t,e){return H.duration(this.diff(t)).lang(this.lang()._abbr).humanize(!e)},fromNow:function(t){return this.from(H(),t)},calendar:function(){var t=this.diff(H().startOf("day"),"days",!0),e=-6>t?"sameElse":-1>t?"lastWeek":0>t?"lastDay":1>t?"sameDay":2>t?"nextDay":7>t?"nextWeek":"sameElse";return this.format(this.lang().calendar(e,this))},isLeapYear:function(){var t=this.year();return 0===t%4&&0!==t%100||0===t%400},isDST:function(){return this.zone()+H(t).startOf(e)},isBefore:function(t,e){return e="undefined"!=typeof e?e:"millisecond",+this.clone().startOf(e)<+H(t).startOf(e)},isSame:function(t,e){return e="undefined"!=typeof e?e:"millisecond",+this.clone().startOf(e)===+H(t).startOf(e)},min:function(t){return t=H.apply(null,arguments),this>t?this:t},max:function(t){return t=H.apply(null,arguments),t>this?this:t},zone:function(t){var e=this._offset||0;return null==t?this._isUTC?e:this._d.getTimezoneOffset():("string"==typeof t&&(t=p(t)),Math.abs(t)<16&&(t=60*t),this._offset=t,this._isUTC=!0,e!==t&&h(this,H.duration(e-t,"m"),1,!0),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},daysInMonth:function(){return H.utc([this.year(),this.month()+1,0]).date()},dayOfYear:function(t){var e=W((H(this).startOf("day")-H(this).startOf("year"))/864e5)+1;return null==t?e:this.add("d",t-e)},weekYear:function(t){var e=F(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==t?e:this.add("y",t-e)},isoWeekYear:function(t){var e=F(this,1,4).year;return null==t?e:this.add("y",t-e)},week:function(t){var e=this.lang().week(this);return null==t?e:this.add("d",7*(t-e))},isoWeek:function(t){var e=F(this,1,4).week;return null==t?e:this.add("d",7*(t-e))},weekday:function(t){var e=(this._d.getDay()+7-this.lang()._week.dow)%7;return null==t?e:this.add("d",t-e)},isoWeekday:function(t){return null==t?this.day()||7:this.day(this.day()%7?t:t-7)},lang:function(e){return e===t?this._lang:(this._lang=_(e),this)}},P=0;P +
+ + +
+
+
+ +
+

{{tab.title}}

+
+
\ No newline at end of file From 93b48a7d2944ba45cf968dd6c0499a5700cafdf9 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Fri, 16 Aug 2013 12:45:22 -0700 Subject: [PATCH 2/3] added ability to add new tabs to editor panels --- js/controllers.js | 11 +++++++-- js/directives.js | 7 +++--- js/services.js | 3 +-- panels/bettermap/editor.html | 1 - panels/bettermap/module.js | 3 +++ panels/column/module.js | 1 - panels/fields/module.js | 1 - panels/histogram/editor.html | 1 - panels/histogram/module.js | 3 +++ panels/hits/editor.html | 1 - panels/hits/module.js | 3 +++ panels/map/editor.html | 7 ------ panels/map/module.js | 3 +++ panels/pie/editor.html | 1 - panels/pie/module.js | 3 +++ panels/query/module.js | 2 ++ panels/table/editor.html | 4 +--- panels/table/module.js | 5 ++++- panels/terms/editor.html | 1 - panels/terms/module.js | 3 +++ panels/timepicker/module.js | 3 --- panels/trends/editor.html | 1 - panels/trends/module.js | 3 +++ partials/dasheditor.html | 8 +++---- partials/inspector.html | 3 +-- partials/paneleditor.html | 15 ++++++++----- partials/querySelect.html | 43 +++++++++++++++++++----------------- 27 files changed, 78 insertions(+), 62 deletions(-) diff --git a/js/controllers.js b/js/controllers.js index 7c724f59aef331..f6ca8e3f845583 100644 --- a/js/controllers.js +++ b/js/controllers.js @@ -71,6 +71,14 @@ angular.module('kibana.controllers', []) } }; + $scope.setEditorTabs = function(panelMeta) { + $scope.editorTabs = ['General','Panel']; + if(!_.isUndefined(panelMeta.editorTabs)) { + $scope.editorTabs = _.union($scope.editorTabs,_.pluck(panelMeta.editorTabs,'title')); + } + return $scope.editorTabs; + }; + // This is whoafully incomplete, but will do for now $scope.parse_error = function(data) { var _error = data.match("nested: (.*?);"); @@ -125,8 +133,7 @@ angular.module('kibana.controllers', []) $scope.panel = { error : false, span : 3, - editable: true, - group : ['default'] + editable: true }; }; diff --git a/js/directives.js b/js/directives.js index cff795b45c6948..708ff5fa02385b 100644 --- a/js/directives.js +++ b/js/directives.js @@ -26,10 +26,9 @@ angular.module('kibana.directives', []) link: function(scope, elem, attrs) { scope.$watch('panel.type', function(n,o) { if(!_.isUndefined(scope.panel.type)) { - var template = '
'+ - '
'+ - '
'+ - '
'; + var template = '
'+ + ''+ + '
'; elem.html($compile(angular.element(template))(scope)); } }); diff --git a/js/services.js b/js/services.js index 2dfdd42b2a30d8..443e990b49f873 100644 --- a/js/services.js +++ b/js/services.js @@ -166,7 +166,6 @@ angular.module('kibana.services', []) } } }) - .service('timer', function($timeout) { // This service really just tracks a list of $timeout promises to give us a // method for cancelling them all when we need to @@ -451,7 +450,7 @@ angular.module('kibana.services', []) // TOFIX: Error handling when there is more than one field this.timeField = function() { - return self.getByType('time')[0].field; + return _.pluck(self.getByType('time'),'field'); }; // This special function looks for all time filters, and returns a time range according to the mode diff --git a/panels/bettermap/editor.html b/panels/bettermap/editor.html index fd8223015f1e33..5f89f49f29593f 100644 --- a/panels/bettermap/editor.html +++ b/panels/bettermap/editor.html @@ -15,7 +15,6 @@
Tooltip Field
-
Panel Spy
diff --git a/panels/bettermap/module.js b/panels/bettermap/module.js index a6afa237bfe68b..3ba77bc0891100 100644 --- a/panels/bettermap/module.js +++ b/panels/bettermap/module.js @@ -18,6 +18,9 @@ angular.module('kibana.bettermap', []) .controller('bettermap', function($scope, querySrv, dashboard, filterSrv) { $scope.panelMeta = { + editorTabs : [ + {title:'Queries', src:'partials/querySelect.html'} + ], status : "Experimental", description : "Displays geo points in clustered groups on a map. The cavaet for this panel is"+ " that, for better or worse, it does NOT use the terms facet and it does query "+ diff --git a/panels/column/module.js b/panels/column/module.js index 79bff92605f68d..9bf1c03540c901 100644 --- a/panels/column/module.js +++ b/panels/column/module.js @@ -55,7 +55,6 @@ angular.module('kibana.column', []) span: 12, height: "150px", editable: true, - group: ['default'], type: type, }; }; diff --git a/panels/fields/module.js b/panels/fields/module.js index 8651d6c3b36d16..6119d79e1dfc6a 100644 --- a/panels/fields/module.js +++ b/panels/fields/module.js @@ -21,7 +21,6 @@ angular.module('kibana.fields', []) // Set and populate defaults var _d = { - group : "default", style : {}, arrange : 'vertical', micropanel_position : 'right', diff --git a/panels/histogram/editor.html b/panels/histogram/editor.html index 81a7b8ee4b1717..028e7687363f6d 100644 --- a/panels/histogram/editor.html +++ b/panels/histogram/editor.html @@ -60,7 +60,6 @@
Chart Settings
-
Panel Spy
diff --git a/panels/histogram/module.js b/panels/histogram/module.js index 64df1a593825d5..78630e3d373ace 100644 --- a/panels/histogram/module.js +++ b/panels/histogram/module.js @@ -37,6 +37,9 @@ angular.module('kibana.histogram', []) .controller('histogram', function($scope, querySrv, dashboard, filterSrv) { $scope.panelMeta = { + editorTabs : [ + {title:'Queries', src:'partials/querySelect.html'} + ], status : "Stable", description : "A bucketed time series chart of the current query or queries. Uses the "+ "Elasticsearch date_histogram facet. If using time stamped indices this panel will query"+ diff --git a/panels/hits/editor.html b/panels/hits/editor.html index 68b2b845bc1da4..ee68d06624b8b8 100644 --- a/panels/hits/editor.html +++ b/panels/hits/editor.html @@ -26,7 +26,6 @@
-
Panel Spy
diff --git a/panels/hits/module.js b/panels/hits/module.js index a204bd8bd90814..271ebc10a097a1 100644 --- a/panels/hits/module.js +++ b/panels/hits/module.js @@ -21,6 +21,9 @@ angular.module('kibana.hits', []) .controller('hits', function($scope, querySrv, dashboard, filterSrv) { $scope.panelMeta = { + editorTabs : [ + {title:'Queries', src:'partials/querySelect.html'} + ], status : "Stable", description : "The total hits for a query or set of queries. Can be a pie chart, bar chart, "+ "list, or absolute total of all queries combined" diff --git a/panels/map/editor.html b/panels/map/editor.html index 83045f1d5e26c5..d20f7c4466dd05 100644 --- a/panels/map/editor.html +++ b/panels/map/editor.html @@ -1,9 +1,3 @@ -
-
- The map panel uses 2 letter country or US state codes to plot concentrations on a map. Darker terroritories mean more records matched that area. If multiple queries are sent from a single panel the first query will be displayed -
-
-
@@ -15,7 +9,6 @@
Field
-
Panel Spy
diff --git a/panels/map/module.js b/panels/map/module.js index a95c1df1b41ee3..9737b6022eccbc 100644 --- a/panels/map/module.js +++ b/panels/map/module.js @@ -23,6 +23,9 @@ angular.module('kibana.map', []) .controller('map', function($scope, $rootScope, querySrv, dashboard, filterSrv) { $scope.panelMeta = { + editorTabs : [ + {title:'Queries', src:'partials/querySelect.html'} + ], status : "Stable", description : "Displays a map of shaded regions using a field containing a 2 letter country "+ ", or US state, code. Regions with more hit are shaded darker. Node that this does use the"+ diff --git a/panels/pie/editor.html b/panels/pie/editor.html index fd826c1c69dc5a..d650cbdf80d357 100644 --- a/panels/pie/editor.html +++ b/panels/pie/editor.html @@ -48,7 +48,6 @@
-
Panel Spy
diff --git a/panels/pie/module.js b/panels/pie/module.js index 6311ae16d0a7b0..fb8386b8230726 100644 --- a/panels/pie/module.js +++ b/panels/pie/module.js @@ -33,6 +33,9 @@ angular.module('kibana.pie', []) // Set and populate defaults var _d = { + editorTabs : [ + {title:'Queries', src:'partials/querySelect.html'} + ], query : { field:"_type", goal: 100}, queries : { mode : 'all', diff --git a/panels/query/module.js b/panels/query/module.js index a15cf30ca1c00a..f43306d693e312 100644 --- a/panels/query/module.js +++ b/panels/query/module.js @@ -60,4 +60,6 @@ angular.module('kibana.query', []) } }; + $scope.init(); + }); \ No newline at end of file diff --git a/panels/table/editor.html b/panels/table/editor.html index 7a2248546aae3a..d31ed8e912cd0f 100644 --- a/panels/table/editor.html +++ b/panels/table/editor.html @@ -71,8 +71,7 @@
Pageable
Page Overflow
-
-
+
Panel Spy
@@ -84,4 +83,3 @@
Panel Spy
of the panel.
- diff --git a/panels/table/module.js b/panels/table/module.js index 3a6b8643796c09..c25f1f4cc33b9c 100644 --- a/panels/table/module.js +++ b/panels/table/module.js @@ -26,6 +26,9 @@ angular.module('kibana.table', []) .controller('table', function($rootScope, $scope, fields, querySrv, dashboard, filterSrv) { $scope.panelMeta = { + editorTabs : [ + {title:'Queries', src:'partials/querySelect.html'} + ], status: "Stable", description: "A paginated table of records matching your query or queries. Click on a row to "+ "expand it and review all of the fields associated with that document.

" @@ -221,7 +224,7 @@ angular.module('kibana.table', []) // size*pages results // Otherwise, only get size*pages results then stop querying if (($scope.data.length < $scope.panel.size*$scope.panel.pages || - !(($scope.panel.sort[0] === filterSrv.timeField()) && $scope.panel.sort[1] === 'desc')) && + !((_.contains(filterSrv.timeField(),$scope.panel.sort[0])) && $scope.panel.sort[1] === 'desc')) && _segment+1 < dashboard.indices.length) { $scope.get_data(_segment+1,$scope.query_id); } diff --git a/panels/terms/editor.html b/panels/terms/editor.html index a1371c764f7851..7c6757502b9135 100644 --- a/panels/terms/editor.html +++ b/panels/terms/editor.html @@ -50,7 +50,6 @@

-
Panel Spy
diff --git a/panels/terms/module.js b/panels/terms/module.js index e8d72d4ae433d6..cefde518bb4938 100644 --- a/panels/terms/module.js +++ b/panels/terms/module.js @@ -22,6 +22,9 @@ angular.module('kibana.terms', []) .controller('terms', function($scope, querySrv, dashboard, filterSrv) { $scope.panelMeta = { + editorTabs : [ + {title:'Queries', src:'partials/querySelect.html'} + ], status : "Beta", description : "Displays the results of an elasticsearch facet as a pie chart, bar chart, or a "+ "table" diff --git a/panels/timepicker/module.js b/panels/timepicker/module.js index cb50ac8b06436b..6c398847b0465a 100644 --- a/panels/timepicker/module.js +++ b/panels/timepicker/module.js @@ -43,9 +43,6 @@ angular.module('kibana.timepicker', []) }; _.defaults($scope.panel,_d); - var _groups = _.isArray($scope.panel.group) ? - $scope.panel.group : [$scope.panel.group]; - $scope.init = function() { // Private refresh interval that we can use for view display without causing // unnecessary refreshes during changes diff --git a/panels/trends/editor.html b/panels/trends/editor.html index a14f519d0cd2d4..74d341222587e6 100644 --- a/panels/trends/editor.html +++ b/panels/trends/editor.html @@ -26,5 +26,4 @@

Settings

-
diff --git a/panels/trends/module.js b/panels/trends/module.js index abf88a9c07b679..9624ed94ae84e0 100644 --- a/panels/trends/module.js +++ b/panels/trends/module.js @@ -17,6 +17,9 @@ angular.module('kibana.trends', []) .controller('trends', function($scope, kbnIndex, querySrv, dashboard, filterSrv) { $scope.panelMeta = { + editorTabs : [ + {title:'Queries', src:'partials/querySelect.html'} + ], status : "Beta", description : "A stock-ticker style representation of how queries are moving over time. "+ "For example, if the time is 1:10pm, your time picker was set to \"Last 10m\", and the \"Time "+ diff --git a/partials/dasheditor.html b/partials/dasheditor.html index 0bdb6b6ee889f0..c520e70bd6468b 100644 --- a/partials/dasheditor.html +++ b/partials/dasheditor.html @@ -2,7 +2,7 @@
Dashboard settings
-
+
@@ -86,11 +86,11 @@
Default Index If
-
-
+ \ No newline at end of file diff --git a/partials/inspector.html b/partials/inspector.html index 08973474a87210..0b2ebe622dd752 100644 --- a/partials/inspector.html +++ b/partials/inspector.html @@ -1,11 +1,10 @@