bootstrap-rails-engine 3.0.3.0 → 3.1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,2 @@
1
- /* =========================================================
2
- * bootstrap-datepicker.js
3
- * http://www.eyecon.ro/bootstrap-datepicker
4
- * =========================================================
5
- * Copyright 2012 Stefan Petre
6
- * Improvements by Andrew Rowls
7
- *
8
- * Licensed under the Apache License, Version 2.0 (the "License");
9
- * you may not use this file except in compliance with the License.
10
- * You may obtain a copy of the License at
11
- *
12
- * http://www.apache.org/licenses/LICENSE-2.0
13
- *
14
- * Unless required by applicable law or agreed to in writing, software
15
- * distributed under the License is distributed on an "AS IS" BASIS,
16
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- * See the License for the specific language governing permissions and
18
- * limitations under the License.
19
- * ========================================================= */
20
- !function(t){function e(){return new Date(Date.UTC.apply(Date,arguments))}function i(e,i){var a,s=t(e).data(),n={},r=new RegExp("^"+i.toLowerCase()+"([A-Z])"),i=new RegExp("^"+i.toLowerCase());for(var h in s)i.test(h)&&(a=h.replace(r,function(t,e){return e.toLowerCase()}),n[a]=s[h]);return n}function a(e){var i={};if(l[e]||(e=e.split("-")[0],l[e])){var a=l[e];return t.each(d,function(t,e){e in a&&(i[e]=a[e])}),i}}var s=t(window),n=function(e,i){this._process_options(i),this.element=t(e),this.isInline=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".date")?this.element.find(".add-on, .btn"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.picker=t(c.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&(this.picker.addClass("datepicker-rtl"),this.picker.find(".prev i, .next i").toggleClass("icon-arrow-left icon-arrow-right")),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.today").attr("colspan",function(t,e){return parseInt(e)+1}),this._allow_update=!1,this.setStartDate(this._o.startDate),this.setEndDate(this._o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};n.prototype={constructor:n,_process_options:function(e){this._o=t.extend({},this._o,e);var i=this.o=t.extend({},this._o),a=i.language;switch(l[a]||(a=a.split("-")[0],l[a]||(a=o.language)),i.language=a,i.startView){case 2:case"decade":i.startView=2;break;case 1:case"year":i.startView=1;break;default:i.startView=0}switch(i.minViewMode){case 1:case"months":i.minViewMode=1;break;case 2:case"years":i.minViewMode=2;break;default:i.minViewMode=0}i.startView=Math.max(i.startView,i.minViewMode),i.weekStart%=7,i.weekEnd=(i.weekStart+6)%7;var s=c.parseFormat(i.format);i.startDate!==-1/0&&(i.startDate=i.startDate?i.startDate instanceof Date?this._local_to_utc(this._zero_time(i.startDate)):c.parseDate(i.startDate,s,i.language):-1/0),1/0!==i.endDate&&(i.endDate=i.endDate?i.endDate instanceof Date?this._local_to_utc(this._zero_time(i.endDate)):c.parseDate(i.endDate,s,i.language):1/0),i.daysOfWeekDisabled=i.daysOfWeekDisabled||[],t.isArray(i.daysOfWeekDisabled)||(i.daysOfWeekDisabled=i.daysOfWeekDisabled.split(/[,\s]*/)),i.daysOfWeekDisabled=t.map(i.daysOfWeekDisabled,function(t){return parseInt(t,10)});var n=String(i.orientation).toLowerCase().split(/\s+/g),r=i.orientation.toLowerCase();if(n=t.grep(n,function(t){return/^auto|left|right|top|bottom$/.test(t)}),i.orientation={x:"auto",y:"auto"},r&&"auto"!==r)if(1===n.length)switch(n[0]){case"top":case"bottom":i.orientation.y=n[0];break;case"left":case"right":i.orientation.x=n[0]}else r=t.grep(n,function(t){return/^left|right$/.test(t)}),i.orientation.x=r[0]||"auto",r=t.grep(n,function(t){return/^top|bottom$/.test(t)}),i.orientation.y=r[0]||"auto";else;},_events:[],_secondaryEvents:[],_applyEvents:function(t){for(var e,i,a=0;a<t.length;a++)e=t[a][0],i=t[a][1],e.on(i)},_unapplyEvents:function(t){for(var e,i,a=0;a<t.length;a++)e=t[a][0],i=t[a][1],e.off(i)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:t.proxy(this.show,this),keyup:t.proxy(this.update,this),keydown:t.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:t.proxy(this.show,this),keyup:t.proxy(this.update,this),keydown:t.proxy(this.keydown,this)}],[this.component,{click:t.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:t.proxy(this.show,this)}]],this._secondaryEvents=[[this.picker,{click:t.proxy(this.click,this)}],[t(window),{resize:t.proxy(this.place,this)}],[t(document),{mousedown:t.proxy(function(t){this.element.is(t.target)||this.element.find(t.target).length||this.picker.is(t.target)||this.picker.find(t.target).length||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(e,i){var a=i||this.date,s=this._utc_to_local(a);this.element.trigger({type:e,date:s,format:t.proxy(function(t){var e=t||this.o.format;return c.formatDate(a,e,this.o.language)},this)})},show:function(t){this.isInline||this.picker.appendTo("body"),this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.place(),this._attachSecondaryEvents(),t&&t.preventDefault(),this._trigger("show")},hide:function(){this.isInline||this.picker.is(":visible")&&(this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide"))},remove:function(){this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date},_utc_to_local:function(t){return new Date(t.getTime()+6e4*t.getTimezoneOffset())},_local_to_utc:function(t){return new Date(t.getTime()-6e4*t.getTimezoneOffset())},_zero_time:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())},_zero_utc_time:function(t){return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()))},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){return this.date},setDate:function(t){this.setUTCDate(this._local_to_utc(t))},setUTCDate:function(t){this.date=t,this.setValue()},setValue:function(){var t=this.getFormattedDate();this.isInput?this.element.val(t).change():this.component&&this.element.find("input").val(t).change()},getFormattedDate:function(t){return void 0===t&&(t=this.o.format),c.formatDate(this.date,t,this.o.language)},setStartDate:function(t){this._process_options({startDate:t}),this.update(),this.updateNavArrows()},setEndDate:function(t){this._process_options({endDate:t}),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(t){this._process_options({daysOfWeekDisabled:t}),this.update(),this.updateNavArrows()},place:function(){if(!this.isInline){var e=this.picker.outerWidth(),i=this.picker.outerHeight(),a=10,n=s.width(),r=s.height(),h=s.scrollTop(),o=parseInt(this.element.parents().filter(function(){return"auto"!=t(this).css("z-index")}).first().css("z-index"))+10,d=this.component?this.component.parent().offset():this.element.offset(),l=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),c=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),p=d.left,u=d.top;this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&&(p-=e-c)):(this.picker.addClass("datepicker-orient-left"),d.left<0?p-=d.left-a:d.left+e>n&&(p=n-e-a));var f,g,v=this.o.orientation.y;"auto"===v&&(f=-h+d.top-i,g=h+r-(d.top+l+i),v=Math.max(f,g)===g?"top":"bottom"),this.picker.addClass("datepicker-orient-"+v),"top"===v?u+=l:u-=i+parseInt(this.picker.css("padding-top")),this.picker.css({top:u,left:p,zIndex:o})}},_allow_update:!0,update:function(){if(this._allow_update){var t,e=new Date(this.date),i=!1;arguments&&arguments.length&&("string"==typeof arguments[0]||arguments[0]instanceof Date)?(t=arguments[0],t instanceof Date&&(t=this._local_to_utc(t)),i=!0):(t=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),delete this.element.data().date),this.date=c.parseDate(t,this.o.format,this.o.language),i?this.setValue():t?e.getTime()!==this.date.getTime()&&this._trigger("changeDate"):this._trigger("clearDate"),this.date<this.o.startDate?(this.viewDate=new Date(this.o.startDate),this.date=new Date(this.o.startDate)):this.date>this.o.endDate?(this.viewDate=new Date(this.o.endDate),this.date=new Date(this.o.endDate)):(this.viewDate=new Date(this.date),this.date=new Date(this.date)),this.fill()}},fillDow:function(){var t=this.o.weekStart,e="<tr>";if(this.o.calendarWeeks){var i='<th class="cw">&nbsp;</th>';e+=i,this.picker.find(".datepicker-days thead tr:first-child").prepend(i)}for(;t<this.o.weekStart+7;)e+='<th class="dow">'+l[this.o.language].daysMin[t++%7]+"</th>";e+="</tr>",this.picker.find(".datepicker-days thead").append(e)},fillMonths:function(){for(var t="",e=0;12>e;)t+='<span class="month">'+l[this.o.language].monthsShort[e++]+"</span>";this.picker.find(".datepicker-months td").html(t)},setRange:function(e){e&&e.length?this.range=t.map(e,function(t){return t.valueOf()}):delete this.range,this.fill()},getClassNames:function(e){var i=[],a=this.viewDate.getUTCFullYear(),s=this.viewDate.getUTCMonth(),n=this.date.valueOf(),r=new Date;return e.getUTCFullYear()<a||e.getUTCFullYear()==a&&e.getUTCMonth()<s?i.push("old"):(e.getUTCFullYear()>a||e.getUTCFullYear()==a&&e.getUTCMonth()>s)&&i.push("new"),this.o.todayHighlight&&e.getUTCFullYear()==r.getFullYear()&&e.getUTCMonth()==r.getMonth()&&e.getUTCDate()==r.getDate()&&i.push("today"),n&&e.valueOf()==n&&i.push("active"),(e.valueOf()<this.o.startDate||e.valueOf()>this.o.endDate||-1!==t.inArray(e.getUTCDay(),this.o.daysOfWeekDisabled))&&i.push("disabled"),this.range&&(e>this.range[0]&&e<this.range[this.range.length-1]&&i.push("range"),-1!=t.inArray(e.valueOf(),this.range)&&i.push("selected")),i},fill:function(){var i,a=new Date(this.viewDate),s=a.getUTCFullYear(),n=a.getUTCMonth(),r=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,h=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,o=1/0!==this.o.endDate?this.o.endDate.getUTCFullYear():1/0,d=1/0!==this.o.endDate?this.o.endDate.getUTCMonth():1/0;this.date&&this.date.valueOf(),this.picker.find(".datepicker-days thead th.datepicker-switch").text(l[this.o.language].months[n]+" "+s),this.picker.find("tfoot th.today").text(l[this.o.language].today).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.clear").text(l[this.o.language].clear).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths();var p=e(s,n-1,28,0,0,0,0),u=c.getDaysInMonth(p.getUTCFullYear(),p.getUTCMonth());p.setUTCDate(u),p.setUTCDate(u-(p.getUTCDay()-this.o.weekStart+7)%7);var f=new Date(p);f.setUTCDate(f.getUTCDate()+42),f=f.valueOf();for(var g,v=[];p.valueOf()<f;){if(p.getUTCDay()==this.o.weekStart&&(v.push("<tr>"),this.o.calendarWeeks)){var D=new Date(+p+864e5*((this.o.weekStart-p.getUTCDay()-7)%7)),m=new Date(+D+864e5*((11-D.getUTCDay())%7)),y=new Date(+(y=e(m.getUTCFullYear(),0,1))+864e5*((11-y.getUTCDay())%7)),w=(m-y)/864e5/7+1;v.push('<td class="cw">'+w+"</td>")}if(g=this.getClassNames(p),g.push("day"),this.o.beforeShowDay!==t.noop){var k=this.o.beforeShowDay(this._utc_to_local(p));void 0===k?k={}:"boolean"==typeof k?k={enabled:k}:"string"==typeof k&&(k={classes:k}),k.enabled===!1&&g.push("disabled"),k.classes&&(g=g.concat(k.classes.split(/\s+/))),k.tooltip&&(i=k.tooltip)}g=t.unique(g),v.push('<td class="'+g.join(" ")+'"'+(i?' title="'+i+'"':"")+">"+p.getUTCDate()+"</td>"),p.getUTCDay()==this.o.weekEnd&&v.push("</tr>"),p.setUTCDate(p.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(v.join(""));var C=this.date&&this.date.getUTCFullYear(),T=this.picker.find(".datepicker-months").find("th:eq(1)").text(s).end().find("span").removeClass("active");C&&C==s&&T.eq(this.date.getUTCMonth()).addClass("active"),(r>s||s>o)&&T.addClass("disabled"),s==r&&T.slice(0,h).addClass("disabled"),s==o&&T.slice(d+1).addClass("disabled"),v="",s=10*parseInt(s/10,10);var _=this.picker.find(".datepicker-years").find("th:eq(1)").text(s+"-"+(s+9)).end().find("td");s-=1;for(var U=-1;11>U;U++)v+='<span class="year'+(-1==U?" old":10==U?" new":"")+(C==s?" active":"")+(r>s||s>o?" disabled":"")+'">'+s+"</span>",s+=1;_.html(v)},updateNavArrows:function(){if(this._allow_update){var t=new Date(this.viewDate),e=t.getUTCFullYear(),i=t.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-1/0&&e<=this.o.startDate.getUTCFullYear()&&i<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.o.endDate&&e>=this.o.endDate.getUTCFullYear()&&i>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-1/0&&e<=this.o.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.o.endDate&&e>=this.o.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(i){i.preventDefault();var a=t(i.target).closest("span, td, th");if(1==a.length)switch(a[0].nodeName.toLowerCase()){case"th":switch(a[0].className){case"datepicker-switch":this.showMode(1);break;case"prev":case"next":var s=c.modes[this.viewMode].navStep*("prev"==a[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,s),this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,s),1===this.viewMode&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"today":var n=new Date;n=e(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0),this.showMode(-2);var r="linked"==this.o.todayBtn?null:"view";this._setDate(n,r);break;case"clear":var h;this.isInput?h=this.element:this.component&&(h=this.element.find("input")),h&&h.val("").change(),this._trigger("changeDate"),this.update(),this.o.autoclose&&this.hide()}break;case"span":if(!a.is(".disabled")){if(this.viewDate.setUTCDate(1),a.is(".month")){var o=1,d=a.parent().find("span").index(a),l=this.viewDate.getUTCFullYear();this.viewDate.setUTCMonth(d),this._trigger("changeMonth",this.viewDate),1===this.o.minViewMode&&this._setDate(e(l,d,o,0,0,0,0))}else{var l=parseInt(a.text(),10)||0,o=1,d=0;this.viewDate.setUTCFullYear(l),this._trigger("changeYear",this.viewDate),2===this.o.minViewMode&&this._setDate(e(l,d,o,0,0,0,0))}this.showMode(-1),this.fill()}break;case"td":if(a.is(".day")&&!a.is(".disabled")){var o=parseInt(a.text(),10)||1,l=this.viewDate.getUTCFullYear(),d=this.viewDate.getUTCMonth();a.is(".old")?0===d?(d=11,l-=1):d-=1:a.is(".new")&&(11==d?(d=0,l+=1):d+=1),this._setDate(e(l,d,o,0,0,0,0))}}},_setDate:function(t,e){e&&"date"!=e||(this.date=new Date(t)),e&&"view"!=e||(this.viewDate=new Date(t)),this.fill(),this.setValue(),this._trigger("changeDate");var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input")),i&&i.change(),!this.o.autoclose||e&&"date"!=e||this.hide()},moveMonth:function(t,e){if(!e)return t;var i,a,s=new Date(t.valueOf()),n=s.getUTCDate(),r=s.getUTCMonth(),h=Math.abs(e);if(e=e>0?1:-1,1==h)a=-1==e?function(){return s.getUTCMonth()==r}:function(){return s.getUTCMonth()!=i},i=r+e,s.setUTCMonth(i),(0>i||i>11)&&(i=(i+12)%12);else{for(var o=0;h>o;o++)s=this.moveMonth(s,e);i=s.getUTCMonth(),s.setUTCDate(n),a=function(){return i!=s.getUTCMonth()}}for(;a();)s.setUTCDate(--n),s.setUTCMonth(i);return s},moveYear:function(t,e){return this.moveMonth(t,12*e)},dateWithinRange:function(t){return t>=this.o.startDate&&t<=this.o.endDate},keydown:function(t){if(this.picker.is(":not(:visible)"))return 27==t.keyCode&&this.show(),void 0;var e,i,a,s=!1;switch(t.keyCode){case 27:this.hide(),t.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;e=37==t.keyCode?-1:1,t.ctrlKey?(i=this.moveYear(this.date,e),a=this.moveYear(this.viewDate,e),this._trigger("changeYear",this.viewDate)):t.shiftKey?(i=this.moveMonth(this.date,e),a=this.moveMonth(this.viewDate,e),this._trigger("changeMonth",this.viewDate)):(i=new Date(this.date),i.setUTCDate(this.date.getUTCDate()+e),a=new Date(this.viewDate),a.setUTCDate(this.viewDate.getUTCDate()+e)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=a,this.setValue(),this.update(),t.preventDefault(),s=!0);break;case 38:case 40:if(!this.o.keyboardNavigation)break;e=38==t.keyCode?-1:1,t.ctrlKey?(i=this.moveYear(this.date,e),a=this.moveYear(this.viewDate,e),this._trigger("changeYear",this.viewDate)):t.shiftKey?(i=this.moveMonth(this.date,e),a=this.moveMonth(this.viewDate,e),this._trigger("changeMonth",this.viewDate)):(i=new Date(this.date),i.setUTCDate(this.date.getUTCDate()+7*e),a=new Date(this.viewDate),a.setUTCDate(this.viewDate.getUTCDate()+7*e)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=a,this.setValue(),this.update(),t.preventDefault(),s=!0);break;case 13:this.hide(),t.preventDefault();break;case 9:this.hide()}if(s){this._trigger("changeDate");var n;this.isInput?n=this.element:this.component&&(n=this.element.find("input")),n&&n.change()}},showMode:function(t){t&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+t))),this.picker.find(">div").hide().filter(".datepicker-"+c.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var r=function(e,i){this.element=t(e),this.inputs=t.map(i.inputs,function(t){return t.jquery?t[0]:t}),delete i.inputs,t(this.inputs).datepicker(i).bind("changeDate",t.proxy(this.dateUpdated,this)),this.pickers=t.map(this.inputs,function(e){return t(e).data("datepicker")}),this.updateDates()};r.prototype={updateDates:function(){this.dates=t.map(this.pickers,function(t){return t.date}),this.updateRanges()},updateRanges:function(){var e=t.map(this.dates,function(t){return t.valueOf()});t.each(this.pickers,function(t,i){i.setRange(e)})},dateUpdated:function(e){var i=t(e.target).data("datepicker"),a=i.getUTCDate(),s=t.inArray(e.target,this.inputs),n=this.inputs.length;if(-1!=s){if(a<this.dates[s])for(;s>=0&&a<this.dates[s];)this.pickers[s--].setUTCDate(a);else if(a>this.dates[s])for(;n>s&&a>this.dates[s];)this.pickers[s++].setUTCDate(a);this.updateDates()}},remove:function(){t.map(this.pickers,function(t){t.remove()}),delete this.element.data().datepicker}};var h=t.fn.datepicker;t.fn.datepicker=function(e){var s=Array.apply(null,arguments);s.shift();var h;return this.each(function(){var d=t(this),l=d.data("datepicker"),c="object"==typeof e&&e;if(!l){var p=i(this,"date"),u=t.extend({},o,p,c),f=a(u.language),g=t.extend({},o,f,p,c);if(d.is(".input-daterange")||g.inputs){var v={inputs:g.inputs||d.find("input").toArray()};d.data("datepicker",l=new r(this,t.extend(g,v)))}else d.data("datepicker",l=new n(this,g))}return"string"==typeof e&&"function"==typeof l[e]&&(h=l[e].apply(l,s),void 0!==h)?!1:void 0}),void 0!==h?h:this};var o=t.fn.datepicker.defaults={autoclose:!1,beforeShowDay:t.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,orientation:"auto",rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0},d=t.fn.datepicker.locale_opts=["format","rtl","weekStart"];t.fn.datepicker.Constructor=n;var l=t.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}},c={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(t){return 0===t%4&&0!==t%100||0===t%400},getDaysInMonth:function(t,e){return[31,c.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(t){var e=t.replace(this.validParts,"\0").split("\0"),i=t.match(this.validParts);if(!e||!e.length||!i||0===i.length)throw new Error("Invalid date format.");return{separators:e,parts:i}},parseDate:function(i,a,s){if(i instanceof Date)return i;if("string"==typeof a&&(a=c.parseFormat(a)),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(i)){var r,h,o=/([\-+]\d+)([dmwy])/,d=i.match(/([\-+]\d+)([dmwy])/g);i=new Date;for(var p=0;p<d.length;p++)switch(r=o.exec(d[p]),h=parseInt(r[1]),r[2]){case"d":i.setUTCDate(i.getUTCDate()+h);break;case"m":i=n.prototype.moveMonth.call(n.prototype,i,h);break;case"w":i.setUTCDate(i.getUTCDate()+7*h);break;case"y":i=n.prototype.moveYear.call(n.prototype,i,h)}return e(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate(),0,0,0)}var u,f,r,d=i&&i.match(this.nonpunctuation)||[],i=new Date,g={},v=["yyyy","yy","M","MM","m","mm","d","dd"],D={yyyy:function(t,e){return t.setUTCFullYear(e)},yy:function(t,e){return t.setUTCFullYear(2e3+e)},m:function(t,e){if(isNaN(t))return t;for(e-=1;0>e;)e+=12;for(e%=12,t.setUTCMonth(e);t.getUTCMonth()!=e;)t.setUTCDate(t.getUTCDate()-1);return t},d:function(t,e){return t.setUTCDate(e)}};D.M=D.MM=D.mm=D.m,D.dd=D.d,i=e(i.getFullYear(),i.getMonth(),i.getDate(),0,0,0);var m=a.parts.slice();if(d.length!=m.length&&(m=t(m).filter(function(e,i){return-1!==t.inArray(i,v)}).toArray()),d.length==m.length){for(var p=0,y=m.length;y>p;p++){if(u=parseInt(d[p],10),r=m[p],isNaN(u))switch(r){case"MM":f=t(l[s].months).filter(function(){var t=this.slice(0,d[p].length),e=d[p].slice(0,t.length);return t==e}),u=t.inArray(f[0],l[s].months)+1;break;case"M":f=t(l[s].monthsShort).filter(function(){var t=this.slice(0,d[p].length),e=d[p].slice(0,t.length);return t==e}),u=t.inArray(f[0],l[s].monthsShort)+1}g[r]=u}for(var w,k,p=0;p<v.length;p++)k=v[p],k in g&&!isNaN(g[k])&&(w=new Date(i),D[k](w,g[k]),isNaN(w)||(i=w))}return i},formatDate:function(e,i,a){"string"==typeof i&&(i=c.parseFormat(i));var s={d:e.getUTCDate(),D:l[a].daysShort[e.getUTCDay()],DD:l[a].days[e.getUTCDay()],m:e.getUTCMonth()+1,M:l[a].monthsShort[e.getUTCMonth()],MM:l[a].months[e.getUTCMonth()],yy:e.getUTCFullYear().toString().substring(2),yyyy:e.getUTCFullYear()};s.dd=(s.d<10?"0":"")+s.d,s.mm=(s.m<10?"0":"")+s.m;for(var e=[],n=t.extend([],i.separators),r=0,h=i.parts.length;h>=r;r++)n.length&&e.push(n.shift()),e.push(s[i.parts[r]]);return e.join("")},headTemplate:'<thead><tr><th class="prev">&laquo;</th><th colspan="5" class="datepicker-switch"></th><th class="next">&raquo;</th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};c.template='<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">'+c.headTemplate+"<tbody></tbody>"+c.footTemplate+"</table>"+"</div>"+'<div class="datepicker-months">'+'<table class="table-condensed">'+c.headTemplate+c.contTemplate+c.footTemplate+"</table>"+"</div>"+'<div class="datepicker-years">'+'<table class="table-condensed">'+c.headTemplate+c.contTemplate+c.footTemplate+"</table>"+"</div>"+"</div>",t.fn.datepicker.DPGlobal=c,t.fn.datepicker.noConflict=function(){return t.fn.datepicker=h,this},t(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(e){var i=t(this);i.data("datepicker")||(e.preventDefault(),i.datepicker("show"))}),t(function(){t('[data-provide="datepicker-inline"]').datepicker()})}(window.jQuery);
1
+ /* bootstrap-datepicker.js (https://github.com/eternicode/bootstrap-datepicker/) */
2
+ !function(t,e){function i(){return new Date(Date.UTC.apply(Date,arguments))}function a(){var t=new Date;return i(t.getFullYear(),t.getMonth(),t.getDate())}function s(t){return function(){return this[t].apply(this,arguments)}}function n(e,i){function a(t,e){return e.toLowerCase()}var s,n=t(e).data(),r={},h=new RegExp("^"+i.toLowerCase()+"([A-Z])");i=new RegExp("^"+i.toLowerCase());for(var o in n)i.test(o)&&(s=o.replace(h,a),r[s]=n[o]);return r}function r(e){var i={};if(f[e]||(e=e.split("-")[0],f[e])){var a=f[e];return t.each(p,function(t,e){e in a&&(i[e]=a[e])}),i}}var h=t(window),o=function(){var e={get:function(t){return this.slice(t)[0]},contains:function(t){for(var e=t&&t.valueOf(),i=0,a=this.length;a>i;i++)if(this[i].valueOf()===e)return i;return-1},remove:function(t){this.splice(t,1)},replace:function(e){e&&(t.isArray(e)||(e=[e]),this.clear(),this.push.apply(this,e))},clear:function(){this.splice(0)},copy:function(){var t=new o;return t.replace(this),t}};return function(){var i=[];return i.push.apply(i,arguments),t.extend(i,e),i}}(),d=function(e,i){this.dates=new o,this.viewDate=a(),this.focusDate=null,this._process_options(i),this.element=t(e),this.isInline=!1,this.isInput=this.element.is("input"),this.component=this.element.is(".date")?this.element.find(".add-on, .input-group-addon, .btn"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.picker=t(g.template),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&this.picker.addClass("datepicker-rtl"),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("tfoot th.today").attr("colspan",function(t,e){return parseInt(e)+1}),this._allow_update=!1,this.setStartDate(this._o.startDate),this.setEndDate(this._o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};d.prototype={constructor:d,_process_options:function(e){this._o=t.extend({},this._o,e);var i=this.o=t.extend({},this._o),a=i.language;switch(f[a]||(a=a.split("-")[0],f[a]||(a=u.language)),i.language=a,i.startView){case 2:case"decade":i.startView=2;break;case 1:case"year":i.startView=1;break;default:i.startView=0}switch(i.minViewMode){case 1:case"months":i.minViewMode=1;break;case 2:case"years":i.minViewMode=2;break;default:i.minViewMode=0}i.startView=Math.max(i.startView,i.minViewMode),i.multidate!==!0&&(i.multidate=Number(i.multidate)||!1,i.multidate=i.multidate!==!1?Math.max(0,i.multidate):1),i.multidateSeparator=String(i.multidateSeparator),i.weekStart%=7,i.weekEnd=(i.weekStart+6)%7;var s=g.parseFormat(i.format);i.startDate!==-1/0&&(i.startDate=i.startDate?i.startDate instanceof Date?this._local_to_utc(this._zero_time(i.startDate)):g.parseDate(i.startDate,s,i.language):-1/0),1/0!==i.endDate&&(i.endDate=i.endDate?i.endDate instanceof Date?this._local_to_utc(this._zero_time(i.endDate)):g.parseDate(i.endDate,s,i.language):1/0),i.daysOfWeekDisabled=i.daysOfWeekDisabled||[],t.isArray(i.daysOfWeekDisabled)||(i.daysOfWeekDisabled=i.daysOfWeekDisabled.split(/[,\s]*/)),i.daysOfWeekDisabled=t.map(i.daysOfWeekDisabled,function(t){return parseInt(t,10)});var n=String(i.orientation).toLowerCase().split(/\s+/g),r=i.orientation.toLowerCase();if(n=t.grep(n,function(t){return/^auto|left|right|top|bottom$/.test(t)}),i.orientation={x:"auto",y:"auto"},r&&"auto"!==r)if(1===n.length)switch(n[0]){case"top":case"bottom":i.orientation.y=n[0];break;case"left":case"right":i.orientation.x=n[0]}else r=t.grep(n,function(t){return/^left|right$/.test(t)}),i.orientation.x=r[0]||"auto",r=t.grep(n,function(t){return/^top|bottom$/.test(t)}),i.orientation.y=r[0]||"auto";else;},_events:[],_secondaryEvents:[],_applyEvents:function(t){for(var i,a,s,n=0;n<t.length;n++)i=t[n][0],2===t[n].length?(a=e,s=t[n][1]):3===t[n].length&&(a=t[n][1],s=t[n][2]),i.on(s,a)},_unapplyEvents:function(t){for(var i,a,s,n=0;n<t.length;n++)i=t[n][0],2===t[n].length?(s=e,a=t[n][1]):3===t[n].length&&(s=t[n][1],a=t[n][2]),i.off(a,s)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:t.proxy(this.show,this),keyup:t.proxy(function(e){-1===t.inArray(e.keyCode,[27,37,39,38,40,32,13,9])&&this.update()},this),keydown:t.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:t.proxy(this.show,this),keyup:t.proxy(function(e){-1===t.inArray(e.keyCode,[27,37,39,38,40,32,13,9])&&this.update()},this),keydown:t.proxy(this.keydown,this)}],[this.component,{click:t.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:t.proxy(this.show,this)}]],this._events.push([this.element,"*",{blur:t.proxy(function(t){this._focused_from=t.target},this)}],[this.element,{blur:t.proxy(function(t){this._focused_from=t.target},this)}]),this._secondaryEvents=[[this.picker,{click:t.proxy(this.click,this)}],[t(window),{resize:t.proxy(this.place,this)}],[t(document),{"mousedown touchstart":t.proxy(function(t){this.element.is(t.target)||this.element.find(t.target).length||this.picker.is(t.target)||this.picker.find(t.target).length||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(e,i){var a=i||this.dates.get(-1),s=this._utc_to_local(a);this.element.trigger({type:e,date:s,dates:t.map(this.dates,this._utc_to_local),format:t.proxy(function(t,e){0===arguments.length?(t=this.dates.length-1,e=this.o.format):"string"==typeof t&&(e=t,t=this.dates.length-1),e=e||this.o.format;var i=this.dates.get(t);return g.formatDate(i,e,this.o.language)},this)})},show:function(){this.isInline||this.picker.appendTo("body"),this.picker.show(),this.place(),this._attachSecondaryEvents(),this._trigger("show")},hide:function(){this.isInline||this.picker.is(":visible")&&(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide"))},remove:function(){this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date},_utc_to_local:function(t){return t&&new Date(t.getTime()+6e4*t.getTimezoneOffset())},_local_to_utc:function(t){return t&&new Date(t.getTime()-6e4*t.getTimezoneOffset())},_zero_time:function(t){return t&&new Date(t.getFullYear(),t.getMonth(),t.getDate())},_zero_utc_time:function(t){return t&&new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()))},getDates:function(){return t.map(this.dates,this._utc_to_local)},getUTCDates:function(){return t.map(this.dates,function(t){return new Date(t)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){return new Date(this.dates.get(-1))},setDates:function(){var e=t.isArray(arguments[0])?arguments[0]:arguments;this.update.apply(this,e),this._trigger("changeDate"),this.setValue()},setUTCDates:function(){var e=t.isArray(arguments[0])?arguments[0]:arguments;this.update.apply(this,t.map(e,this._utc_to_local)),this._trigger("changeDate"),this.setValue()},setDate:s("setDates"),setUTCDate:s("setUTCDates"),setValue:function(){var t=this.getFormattedDate();this.isInput?this.element.val(t).change():this.component&&this.element.find("input").val(t).change()},getFormattedDate:function(i){i===e&&(i=this.o.format);var a=this.o.language;return t.map(this.dates,function(t){return g.formatDate(t,i,a)}).join(this.o.multidateSeparator)},setStartDate:function(t){this._process_options({startDate:t}),this.update(),this.updateNavArrows()},setEndDate:function(t){this._process_options({endDate:t}),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(t){this._process_options({daysOfWeekDisabled:t}),this.update(),this.updateNavArrows()},place:function(){if(!this.isInline){var e=this.picker.outerWidth(),i=this.picker.outerHeight(),a=10,s=h.width(),n=h.height(),r=h.scrollTop(),o=parseInt(this.element.parents().filter(function(){return"auto"!==t(this).css("z-index")}).first().css("z-index"))+10,d=this.component?this.component.parent().offset():this.element.offset(),l=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),c=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),u=d.left,p=d.top;this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&&(u-=e-c)):(this.picker.addClass("datepicker-orient-left"),d.left<0?u-=d.left-a:d.left+e>s&&(u=s-e-a));var f,g,v=this.o.orientation.y;"auto"===v&&(f=-r+d.top-i,g=r+n-(d.top+l+i),v=Math.max(f,g)===g?"top":"bottom"),this.picker.addClass("datepicker-orient-"+v),"top"===v?p+=l:p-=i+parseInt(this.picker.css("padding-top")),this.picker.css({top:p,left:u,zIndex:o})}},_allow_update:!0,update:function(){if(this._allow_update){var e=this.dates.copy(),i=[],a=!1;arguments.length?(t.each(arguments,t.proxy(function(t,e){e instanceof Date&&(e=this._local_to_utc(e)),i.push(e)},this)),a=!0):(i=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),i=i&&this.o.multidate?i.split(this.o.multidateSeparator):[i],delete this.element.data().date),i=t.map(i,t.proxy(function(t){return g.parseDate(t,this.o.format,this.o.language)},this)),i=t.grep(i,t.proxy(function(t){return t<this.o.startDate||t>this.o.endDate||!t},this),!0),this.dates.replace(i),this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate&&(this.viewDate=new Date(this.o.endDate)),a?this.setValue():i.length&&String(e)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&e.length&&this._trigger("clearDate"),this.fill()}},fillDow:function(){var t=this.o.weekStart,e="<tr>";if(this.o.calendarWeeks){var i='<th class="cw">&nbsp;</th>';e+=i,this.picker.find(".datepicker-days thead tr:first-child").prepend(i)}for(;t<this.o.weekStart+7;)e+='<th class="dow">'+f[this.o.language].daysMin[t++%7]+"</th>";e+="</tr>",this.picker.find(".datepicker-days thead").append(e)},fillMonths:function(){for(var t="",e=0;12>e;)t+='<span class="month">'+f[this.o.language].monthsShort[e++]+"</span>";this.picker.find(".datepicker-months td").html(t)},setRange:function(e){e&&e.length?this.range=t.map(e,function(t){return t.valueOf()}):delete this.range,this.fill()},getClassNames:function(e){var i=[],a=this.viewDate.getUTCFullYear(),s=this.viewDate.getUTCMonth(),n=new Date;return e.getUTCFullYear()<a||e.getUTCFullYear()===a&&e.getUTCMonth()<s?i.push("old"):(e.getUTCFullYear()>a||e.getUTCFullYear()===a&&e.getUTCMonth()>s)&&i.push("new"),this.focusDate&&e.valueOf()===this.focusDate.valueOf()&&i.push("focused"),this.o.todayHighlight&&e.getUTCFullYear()===n.getFullYear()&&e.getUTCMonth()===n.getMonth()&&e.getUTCDate()===n.getDate()&&i.push("today"),-1!==this.dates.contains(e)&&i.push("active"),(e.valueOf()<this.o.startDate||e.valueOf()>this.o.endDate||-1!==t.inArray(e.getUTCDay(),this.o.daysOfWeekDisabled))&&i.push("disabled"),this.range&&(e>this.range[0]&&e<this.range[this.range.length-1]&&i.push("range"),-1!==t.inArray(e.valueOf(),this.range)&&i.push("selected")),i},fill:function(){var a,s=new Date(this.viewDate),n=s.getUTCFullYear(),r=s.getUTCMonth(),h=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,o=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,d=1/0!==this.o.endDate?this.o.endDate.getUTCFullYear():1/0,l=1/0!==this.o.endDate?this.o.endDate.getUTCMonth():1/0,c=f[this.o.language].today||f.en.today||"",u=f[this.o.language].clear||f.en.clear||"";this.picker.find(".datepicker-days thead th.datepicker-switch").text(f[this.o.language].months[r]+" "+n),this.picker.find("tfoot th.today").text(c).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.clear").text(u).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths();var p=i(n,r-1,28),v=g.getDaysInMonth(p.getUTCFullYear(),p.getUTCMonth());p.setUTCDate(v),p.setUTCDate(v-(p.getUTCDay()-this.o.weekStart+7)%7);var D=new Date(p);D.setUTCDate(D.getUTCDate()+42),D=D.valueOf();for(var m,y=[];p.valueOf()<D;){if(p.getUTCDay()===this.o.weekStart&&(y.push("<tr>"),this.o.calendarWeeks)){var w=new Date(+p+(this.o.weekStart-p.getUTCDay()-7)%7*864e5),k=new Date(Number(w)+(11-w.getUTCDay())%7*864e5),_=new Date(Number(_=i(k.getUTCFullYear(),0,1))+(11-_.getUTCDay())%7*864e5),C=(k-_)/864e5/7+1;y.push('<td class="cw">'+C+"</td>")}if(m=this.getClassNames(p),m.push("day"),this.o.beforeShowDay!==t.noop){var T=this.o.beforeShowDay(this._utc_to_local(p));T===e?T={}:"boolean"==typeof T?T={enabled:T}:"string"==typeof T&&(T={classes:T}),T.enabled===!1&&m.push("disabled"),T.classes&&(m=m.concat(T.classes.split(/\s+/))),T.tooltip&&(a=T.tooltip)}m=t.unique(m),y.push('<td class="'+m.join(" ")+'"'+(a?' title="'+a+'"':"")+">"+p.getUTCDate()+"</td>"),p.getUTCDay()===this.o.weekEnd&&y.push("</tr>"),p.setUTCDate(p.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(y.join(""));var b=this.picker.find(".datepicker-months").find("th:eq(1)").text(n).end().find("span").removeClass("active");t.each(this.dates,function(t,e){e.getUTCFullYear()===n&&b.eq(e.getUTCMonth()).addClass("active")}),(h>n||n>d)&&b.addClass("disabled"),n===h&&b.slice(0,o).addClass("disabled"),n===d&&b.slice(l+1).addClass("disabled"),y="",n=10*parseInt(n/10,10);var U=this.picker.find(".datepicker-years").find("th:eq(1)").text(n+"-"+(n+9)).end().find("td");n-=1;for(var M,x=t.map(this.dates,function(t){return t.getUTCFullYear()}),S=-1;11>S;S++)M=["year"],-1===S?M.push("old"):10===S&&M.push("new"),-1!==t.inArray(n,x)&&M.push("active"),(h>n||n>d)&&M.push("disabled"),y+='<span class="'+M.join(" ")+'">'+n+"</span>",n+=1;U.html(y)},updateNavArrows:function(){if(this._allow_update){var t=new Date(this.viewDate),e=t.getUTCFullYear(),i=t.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-1/0&&e<=this.o.startDate.getUTCFullYear()&&i<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.o.endDate&&e>=this.o.endDate.getUTCFullYear()&&i>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-1/0&&e<=this.o.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.o.endDate&&e>=this.o.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(e){e.preventDefault();var a,s,n,r=t(e.target).closest("span, td, th");if(1===r.length)switch(r[0].nodeName.toLowerCase()){case"th":switch(r[0].className){case"datepicker-switch":this.showMode(1);break;case"prev":case"next":var h=g.modes[this.viewMode].navStep*("prev"===r[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,h),this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,h),1===this.viewMode&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"today":var o=new Date;o=i(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0),this.showMode(-2);var d="linked"===this.o.todayBtn?null:"view";this._setDate(o,d);break;case"clear":var l;this.isInput?l=this.element:this.component&&(l=this.element.find("input")),l&&l.val("").change(),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()}break;case"span":r.is(".disabled")||(this.viewDate.setUTCDate(1),r.is(".month")?(n=1,s=r.parent().find("span").index(r),a=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(s),this._trigger("changeMonth",this.viewDate),1===this.o.minViewMode&&this._setDate(i(a,s,n))):(n=1,s=0,a=parseInt(r.text(),10)||0,this.viewDate.setUTCFullYear(a),this._trigger("changeYear",this.viewDate),2===this.o.minViewMode&&this._setDate(i(a,s,n))),this.showMode(-1),this.fill());break;case"td":r.is(".day")&&!r.is(".disabled")&&(n=parseInt(r.text(),10)||1,a=this.viewDate.getUTCFullYear(),s=this.viewDate.getUTCMonth(),r.is(".old")?0===s?(s=11,a-=1):s-=1:r.is(".new")&&(11===s?(s=0,a+=1):s+=1),this._setDate(i(a,s,n)))}this.picker.is(":visible")&&this._focused_from&&t(this._focused_from).focus(),delete this._focused_from},_toggle_multidate:function(t){var e=this.dates.contains(t);if(t?-1!==e?this.dates.remove(e):this.dates.push(t):this.dates.clear(),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(t,e){e&&"date"!==e||this._toggle_multidate(t&&new Date(t)),e&&"view"!==e||(this.viewDate=t&&new Date(t)),this.fill(),this.setValue(),this._trigger("changeDate");var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input")),i&&i.change(),!this.o.autoclose||e&&"date"!==e||this.hide()},moveMonth:function(t,i){if(!t)return e;if(!i)return t;var a,s,n=new Date(t.valueOf()),r=n.getUTCDate(),h=n.getUTCMonth(),o=Math.abs(i);if(i=i>0?1:-1,1===o)s=-1===i?function(){return n.getUTCMonth()===h}:function(){return n.getUTCMonth()!==a},a=h+i,n.setUTCMonth(a),(0>a||a>11)&&(a=(a+12)%12);else{for(var d=0;o>d;d++)n=this.moveMonth(n,i);a=n.getUTCMonth(),n.setUTCDate(r),s=function(){return a!==n.getUTCMonth()}}for(;s();)n.setUTCDate(--r),n.setUTCMonth(a);return n},moveYear:function(t,e){return this.moveMonth(t,12*e)},dateWithinRange:function(t){return t>=this.o.startDate&&t<=this.o.endDate},keydown:function(t){if(this.picker.is(":not(:visible)"))return 27===t.keyCode&&this.show(),void 0;var e,i,s,n=!1,r=this.focusDate||this.viewDate;switch(t.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),t.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;e=37===t.keyCode?-1:1,t.ctrlKey?(i=this.moveYear(this.dates.get(-1)||a(),e),s=this.moveYear(r,e),this._trigger("changeYear",this.viewDate)):t.shiftKey?(i=this.moveMonth(this.dates.get(-1)||a(),e),s=this.moveMonth(r,e),this._trigger("changeMonth",this.viewDate)):(i=new Date(this.dates.get(-1)||a()),i.setUTCDate(i.getUTCDate()+e),s=new Date(r),s.setUTCDate(r.getUTCDate()+e)),this.dateWithinRange(i)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),t.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;e=38===t.keyCode?-1:1,t.ctrlKey?(i=this.moveYear(this.dates.get(-1)||a(),e),s=this.moveYear(r,e),this._trigger("changeYear",this.viewDate)):t.shiftKey?(i=this.moveMonth(this.dates.get(-1)||a(),e),s=this.moveMonth(r,e),this._trigger("changeMonth",this.viewDate)):(i=new Date(this.dates.get(-1)||a()),i.setUTCDate(i.getUTCDate()+7*e),s=new Date(r),s.setUTCDate(r.getUTCDate()+7*e)),this.dateWithinRange(i)&&(this.focusDate=this.viewDate=s,this.setValue(),this.fill(),t.preventDefault());break;case 32:break;case 13:r=this.focusDate||this.dates.get(-1)||this.viewDate,this._toggle_multidate(r),n=!0,this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(t.preventDefault(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}if(n){this.dates.length?this._trigger("changeDate"):this._trigger("clearDate");var h;this.isInput?h=this.element:this.component&&(h=this.element.find("input")),h&&h.change()}},showMode:function(t){t&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+t))),this.picker.find(">div").hide().filter(".datepicker-"+g.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()}};var l=function(e,i){this.element=t(e),this.inputs=t.map(i.inputs,function(t){return t.jquery?t[0]:t}),delete i.inputs,t(this.inputs).datepicker(i).bind("changeDate",t.proxy(this.dateUpdated,this)),this.pickers=t.map(this.inputs,function(e){return t(e).data("datepicker")}),this.updateDates()};l.prototype={updateDates:function(){this.dates=t.map(this.pickers,function(t){return t.getUTCDate()}),this.updateRanges()},updateRanges:function(){var e=t.map(this.dates,function(t){return t.valueOf()});t.each(this.pickers,function(t,i){i.setRange(e)})},dateUpdated:function(e){if(!this.updating){this.updating=!0;var i=t(e.target).data("datepicker"),a=i.getUTCDate(),s=t.inArray(e.target,this.inputs),n=this.inputs.length;if(-1!==s){if(t.each(this.pickers,function(t,e){e.getUTCDate()||e.setUTCDate(a)}),a<this.dates[s])for(;s>=0&&a<this.dates[s];)this.pickers[s--].setUTCDate(a);else if(a>this.dates[s])for(;n>s&&a>this.dates[s];)this.pickers[s++].setUTCDate(a);this.updateDates(),delete this.updating}}},remove:function(){t.map(this.pickers,function(t){t.remove()}),delete this.element.data().datepicker}};var c=t.fn.datepicker;t.fn.datepicker=function(i){var a=Array.apply(null,arguments);a.shift();var s;return this.each(function(){var h=t(this),o=h.data("datepicker"),c="object"==typeof i&&i;if(!o){var p=n(this,"date"),f=t.extend({},u,p,c),g=r(f.language),v=t.extend({},u,g,p,c);if(h.is(".input-daterange")||v.inputs){var D={inputs:v.inputs||h.find("input").toArray()};h.data("datepicker",o=new l(this,t.extend(v,D)))}else h.data("datepicker",o=new d(this,v))}return"string"==typeof i&&"function"==typeof o[i]&&(s=o[i].apply(o,a),s!==e)?!1:void 0}),s!==e?s:this};var u=t.fn.datepicker.defaults={autoclose:!1,beforeShowDay:t.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0},p=t.fn.datepicker.locale_opts=["format","rtl","weekStart"];t.fn.datepicker.Constructor=d;var f=t.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}},g={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(t){return t%4===0&&t%100!==0||t%400===0},getDaysInMonth:function(t,e){return[31,g.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(t){var e=t.replace(this.validParts,"\x00").split("\x00"),i=t.match(this.validParts);if(!e||!e.length||!i||0===i.length)throw new Error("Invalid date format.");return{separators:e,parts:i}},parseDate:function(a,s,n){function r(){var t=this.slice(0,u[l].length),e=u[l].slice(0,t.length);return t===e}if(!a)return e;if(a instanceof Date)return a;"string"==typeof s&&(s=g.parseFormat(s));var h,o,l,c=/([\-+]\d+)([dmwy])/,u=a.match(/([\-+]\d+)([dmwy])/g);if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(a)){for(a=new Date,l=0;l<u.length;l++)switch(h=c.exec(u[l]),o=parseInt(h[1]),h[2]){case"d":a.setUTCDate(a.getUTCDate()+o);break;case"m":a=d.prototype.moveMonth.call(d.prototype,a,o);break;case"w":a.setUTCDate(a.getUTCDate()+7*o);break;case"y":a=d.prototype.moveYear.call(d.prototype,a,o)}return i(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),0,0,0)}u=a&&a.match(this.nonpunctuation)||[],a=new Date;var p,v,D={},m=["yyyy","yy","M","MM","m","mm","d","dd"],y={yyyy:function(t,e){return t.setUTCFullYear(e)},yy:function(t,e){return t.setUTCFullYear(2e3+e)},m:function(t,e){if(isNaN(t))return t;for(e-=1;0>e;)e+=12;for(e%=12,t.setUTCMonth(e);t.getUTCMonth()!==e;)t.setUTCDate(t.getUTCDate()-1);return t},d:function(t,e){return t.setUTCDate(e)}};y.M=y.MM=y.mm=y.m,y.dd=y.d,a=i(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0);var w=s.parts.slice();if(u.length!==w.length&&(w=t(w).filter(function(e,i){return-1!==t.inArray(i,m)}).toArray()),u.length===w.length){var k;for(l=0,k=w.length;k>l;l++){if(p=parseInt(u[l],10),h=w[l],isNaN(p))switch(h){case"MM":v=t(f[n].months).filter(r),p=t.inArray(v[0],f[n].months)+1;break;case"M":v=t(f[n].monthsShort).filter(r),p=t.inArray(v[0],f[n].monthsShort)+1}D[h]=p}var _,C;for(l=0;l<m.length;l++)C=m[l],C in D&&!isNaN(D[C])&&(_=new Date(a),y[C](_,D[C]),isNaN(_)||(a=_))}return a},formatDate:function(e,i,a){if(!e)return"";"string"==typeof i&&(i=g.parseFormat(i));var s={d:e.getUTCDate(),D:f[a].daysShort[e.getUTCDay()],DD:f[a].days[e.getUTCDay()],m:e.getUTCMonth()+1,M:f[a].monthsShort[e.getUTCMonth()],MM:f[a].months[e.getUTCMonth()],yy:e.getUTCFullYear().toString().substring(2),yyyy:e.getUTCFullYear()};s.dd=(s.d<10?"0":"")+s.d,s.mm=(s.m<10?"0":"")+s.m,e=[];for(var n=t.extend([],i.separators),r=0,h=i.parts.length;h>=r;r++)n.length&&e.push(n.shift()),e.push(s[i.parts[r]]);return e.join("")},headTemplate:'<thead><tr><th class="prev">&laquo;</th><th colspan="5" class="datepicker-switch"></th><th class="next">&raquo;</th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};g.template='<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">'+g.headTemplate+"<tbody></tbody>"+g.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+g.headTemplate+g.contTemplate+g.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+g.headTemplate+g.contTemplate+g.footTemplate+"</table></div></div>",t.fn.datepicker.DPGlobal=g,t.fn.datepicker.noConflict=function(){return t.fn.datepicker=c,this},t(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(e){var i=t(this);i.data("datepicker")||(e.preventDefault(),i.datepicker("show"))}),t(function(){t('[data-provide="datepicker-inline"]').datepicker()})}(window.jQuery);
@@ -1,32 +1,22 @@
1
1
  /*!
2
- * Bootstrap v3.0.3 (http://getbootstrap.com)
3
- * Copyright 2013 Twitter, Inc.
4
- * Licensed under http://www.apache.org/licenses/LICENSE-2.0
2
+ * Bootstrap v3.1.1 (http://getbootstrap.com)
3
+ * Copyright 2011-2014 Twitter, Inc.
4
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
5
  */
6
6
 
7
- if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery") }
7
+ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') }
8
8
 
9
9
  /* ========================================================================
10
- * Bootstrap: transition.js v3.0.3
10
+ * Bootstrap: transition.js v3.1.1
11
11
  * http://getbootstrap.com/javascript/#transitions
12
12
  * ========================================================================
13
- * Copyright 2013 Twitter, Inc.
14
- *
15
- * Licensed under the Apache License, Version 2.0 (the "License");
16
- * you may not use this file except in compliance with the License.
17
- * You may obtain a copy of the License at
18
- *
19
- * http://www.apache.org/licenses/LICENSE-2.0
20
- *
21
- * Unless required by applicable law or agreed to in writing, software
22
- * distributed under the License is distributed on an "AS IS" BASIS,
23
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
- * See the License for the specific language governing permissions and
25
- * limitations under the License.
13
+ * Copyright 2011-2014 Twitter, Inc.
14
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
26
15
  * ======================================================================== */
27
16
 
28
17
 
29
- +function ($) { "use strict";
18
+ +function ($) {
19
+ 'use strict';
30
20
 
31
21
  // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
32
22
  // ============================================================
@@ -35,10 +25,10 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
35
25
  var el = document.createElement('bootstrap')
36
26
 
37
27
  var transEndEventNames = {
38
- 'WebkitTransition' : 'webkitTransitionEnd'
39
- , 'MozTransition' : 'transitionend'
40
- , 'OTransition' : 'oTransitionEnd otransitionend'
41
- , 'transition' : 'transitionend'
28
+ 'WebkitTransition' : 'webkitTransitionEnd',
29
+ 'MozTransition' : 'transitionend',
30
+ 'OTransition' : 'oTransitionEnd otransitionend',
31
+ 'transition' : 'transitionend'
42
32
  }
43
33
 
44
34
  for (var name in transEndEventNames) {
@@ -46,6 +36,8 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
46
36
  return { end: transEndEventNames[name] }
47
37
  }
48
38
  }
39
+
40
+ return false // explicit for ie8 ( ._.)
49
41
  }
50
42
 
51
43
  // http://blog.alexmaccaw.com/css-transitions
@@ -64,26 +56,16 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
64
56
  }(jQuery);
65
57
 
66
58
  /* ========================================================================
67
- * Bootstrap: alert.js v3.0.3
59
+ * Bootstrap: alert.js v3.1.1
68
60
  * http://getbootstrap.com/javascript/#alerts
69
61
  * ========================================================================
70
- * Copyright 2013 Twitter, Inc.
71
- *
72
- * Licensed under the Apache License, Version 2.0 (the "License");
73
- * you may not use this file except in compliance with the License.
74
- * You may obtain a copy of the License at
75
- *
76
- * http://www.apache.org/licenses/LICENSE-2.0
77
- *
78
- * Unless required by applicable law or agreed to in writing, software
79
- * distributed under the License is distributed on an "AS IS" BASIS,
80
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
81
- * See the License for the specific language governing permissions and
82
- * limitations under the License.
62
+ * Copyright 2011-2014 Twitter, Inc.
63
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
83
64
  * ======================================================================== */
84
65
 
85
66
 
86
- +function ($) { "use strict";
67
+ +function ($) {
68
+ 'use strict';
87
69
 
88
70
  // ALERT CLASS DEFINITION
89
71
  // ======================
@@ -163,33 +145,24 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
163
145
  }(jQuery);
164
146
 
165
147
  /* ========================================================================
166
- * Bootstrap: button.js v3.0.3
148
+ * Bootstrap: button.js v3.1.1
167
149
  * http://getbootstrap.com/javascript/#buttons
168
150
  * ========================================================================
169
- * Copyright 2013 Twitter, Inc.
170
- *
171
- * Licensed under the Apache License, Version 2.0 (the "License");
172
- * you may not use this file except in compliance with the License.
173
- * You may obtain a copy of the License at
174
- *
175
- * http://www.apache.org/licenses/LICENSE-2.0
176
- *
177
- * Unless required by applicable law or agreed to in writing, software
178
- * distributed under the License is distributed on an "AS IS" BASIS,
179
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
180
- * See the License for the specific language governing permissions and
181
- * limitations under the License.
151
+ * Copyright 2011-2014 Twitter, Inc.
152
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
182
153
  * ======================================================================== */
183
154
 
184
155
 
185
- +function ($) { "use strict";
156
+ +function ($) {
157
+ 'use strict';
186
158
 
187
159
  // BUTTON PUBLIC CLASS DEFINITION
188
160
  // ==============================
189
161
 
190
162
  var Button = function (element, options) {
191
- this.$element = $(element)
192
- this.options = $.extend({}, Button.DEFAULTS, options)
163
+ this.$element = $(element)
164
+ this.options = $.extend({}, Button.DEFAULTS, options)
165
+ this.isLoading = false
193
166
  }
194
167
 
195
168
  Button.DEFAULTS = {
@@ -209,25 +182,26 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
209
182
  $el[val](data[state] || this.options[state])
210
183
 
211
184
  // push to event loop to allow forms to submit
212
- setTimeout(function () {
213
- state == 'loadingText' ?
214
- $el.addClass(d).attr(d, d) :
215
- $el.removeClass(d).removeAttr(d);
216
- }, 0)
185
+ setTimeout($.proxy(function () {
186
+ if (state == 'loadingText') {
187
+ this.isLoading = true
188
+ $el.addClass(d).attr(d, d)
189
+ } else if (this.isLoading) {
190
+ this.isLoading = false
191
+ $el.removeClass(d).removeAttr(d)
192
+ }
193
+ }, this), 0)
217
194
  }
218
195
 
219
196
  Button.prototype.toggle = function () {
220
- var $parent = this.$element.closest('[data-toggle="buttons"]')
221
197
  var changed = true
198
+ var $parent = this.$element.closest('[data-toggle="buttons"]')
222
199
 
223
200
  if ($parent.length) {
224
201
  var $input = this.$element.find('input')
225
- if ($input.prop('type') === 'radio') {
226
- // see if clicking on current one
227
- if ($input.prop('checked') && this.$element.hasClass('active'))
228
- changed = false
229
- else
230
- $parent.find('.active').removeClass('active')
202
+ if ($input.prop('type') == 'radio') {
203
+ if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
204
+ else $parent.find('.active').removeClass('active')
231
205
  }
232
206
  if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
233
207
  }
@@ -279,26 +253,16 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
279
253
  }(jQuery);
280
254
 
281
255
  /* ========================================================================
282
- * Bootstrap: carousel.js v3.0.3
256
+ * Bootstrap: carousel.js v3.1.1
283
257
  * http://getbootstrap.com/javascript/#carousel
284
258
  * ========================================================================
285
- * Copyright 2013 Twitter, Inc.
286
- *
287
- * Licensed under the Apache License, Version 2.0 (the "License");
288
- * you may not use this file except in compliance with the License.
289
- * You may obtain a copy of the License at
290
- *
291
- * http://www.apache.org/licenses/LICENSE-2.0
292
- *
293
- * Unless required by applicable law or agreed to in writing, software
294
- * distributed under the License is distributed on an "AS IS" BASIS,
295
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
296
- * See the License for the specific language governing permissions and
297
- * limitations under the License.
259
+ * Copyright 2011-2014 Twitter, Inc.
260
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
298
261
  * ======================================================================== */
299
262
 
300
263
 
301
- +function ($) { "use strict";
264
+ +function ($) {
265
+ 'use strict';
302
266
 
303
267
  // CAROUSEL CLASS DEFINITION
304
268
  // =========================
@@ -319,9 +283,9 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
319
283
  }
320
284
 
321
285
  Carousel.DEFAULTS = {
322
- interval: 5000
323
- , pause: 'hover'
324
- , wrap: true
286
+ interval: 5000,
287
+ pause: 'hover',
288
+ wrap: true
325
289
  }
326
290
 
327
291
  Carousel.prototype.cycle = function (e) {
@@ -358,7 +322,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
358
322
  Carousel.prototype.pause = function (e) {
359
323
  e || (this.paused = true)
360
324
 
361
- if (this.$element.find('.next, .prev').length && $.support.transition.end) {
325
+ if (this.$element.find('.next, .prev').length && $.support.transition) {
362
326
  this.$element.trigger($.support.transition.end)
363
327
  this.cycle(true)
364
328
  }
@@ -391,13 +355,15 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
391
355
  $next = this.$element.find('.item')[fallback]()
392
356
  }
393
357
 
394
- this.sliding = true
395
-
396
- isCycling && this.pause()
358
+ if ($next.hasClass('active')) return this.sliding = false
397
359
 
398
360
  var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
361
+ this.$element.trigger(e)
362
+ if (e.isDefaultPrevented()) return
399
363
 
400
- if ($next.hasClass('active')) return
364
+ this.sliding = true
365
+
366
+ isCycling && this.pause()
401
367
 
402
368
  if (this.$indicators.length) {
403
369
  this.$indicators.find('.active').removeClass('active')
@@ -408,8 +374,6 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
408
374
  }
409
375
 
410
376
  if ($.support.transition && this.$element.hasClass('slide')) {
411
- this.$element.trigger(e)
412
- if (e.isDefaultPrevented()) return
413
377
  $next.addClass(type)
414
378
  $next[0].offsetWidth // force reflow
415
379
  $active.addClass(direction)
@@ -421,10 +385,8 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
421
385
  that.sliding = false
422
386
  setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
423
387
  })
424
- .emulateTransitionEnd(600)
388
+ .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
425
389
  } else {
426
- this.$element.trigger(e)
427
- if (e.isDefaultPrevented()) return
428
390
  $active.removeClass('active')
429
391
  $next.addClass('active')
430
392
  this.sliding = false
@@ -497,26 +459,16 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
497
459
  }(jQuery);
498
460
 
499
461
  /* ========================================================================
500
- * Bootstrap: collapse.js v3.0.3
462
+ * Bootstrap: collapse.js v3.1.1
501
463
  * http://getbootstrap.com/javascript/#collapse
502
464
  * ========================================================================
503
- * Copyright 2013 Twitter, Inc.
504
- *
505
- * Licensed under the Apache License, Version 2.0 (the "License");
506
- * you may not use this file except in compliance with the License.
507
- * You may obtain a copy of the License at
508
- *
509
- * http://www.apache.org/licenses/LICENSE-2.0
510
- *
511
- * Unless required by applicable law or agreed to in writing, software
512
- * distributed under the License is distributed on an "AS IS" BASIS,
513
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
514
- * See the License for the specific language governing permissions and
515
- * limitations under the License.
465
+ * Copyright 2011-2014 Twitter, Inc.
466
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
516
467
  * ======================================================================== */
517
468
 
518
469
 
519
- +function ($) { "use strict";
470
+ +function ($) {
471
+ 'use strict';
520
472
 
521
473
  // COLLAPSE PUBLIC CLASS DEFINITION
522
474
  // ================================
@@ -567,7 +519,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
567
519
  var complete = function () {
568
520
  this.$element
569
521
  .removeClass('collapsing')
570
- .addClass('in')
522
+ .addClass('collapse in')
571
523
  [dimension]('auto')
572
524
  this.transitioning = 0
573
525
  this.$element.trigger('shown.bs.collapse')
@@ -635,6 +587,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
635
587
  var data = $this.data('bs.collapse')
636
588
  var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
637
589
 
590
+ if (!data && options.toggle && option == 'show') option = !option
638
591
  if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
639
592
  if (typeof option == 'string') data[option]()
640
593
  })
@@ -677,26 +630,16 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
677
630
  }(jQuery);
678
631
 
679
632
  /* ========================================================================
680
- * Bootstrap: dropdown.js v3.0.3
633
+ * Bootstrap: dropdown.js v3.1.1
681
634
  * http://getbootstrap.com/javascript/#dropdowns
682
635
  * ========================================================================
683
- * Copyright 2013 Twitter, Inc.
684
- *
685
- * Licensed under the Apache License, Version 2.0 (the "License");
686
- * you may not use this file except in compliance with the License.
687
- * You may obtain a copy of the License at
688
- *
689
- * http://www.apache.org/licenses/LICENSE-2.0
690
- *
691
- * Unless required by applicable law or agreed to in writing, software
692
- * distributed under the License is distributed on an "AS IS" BASIS,
693
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
694
- * See the License for the specific language governing permissions and
695
- * limitations under the License.
636
+ * Copyright 2011-2014 Twitter, Inc.
637
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
696
638
  * ======================================================================== */
697
639
 
698
640
 
699
- +function ($) { "use strict";
641
+ +function ($) {
642
+ 'use strict';
700
643
 
701
644
  // DROPDOWN CLASS DEFINITION
702
645
  // =========================
@@ -723,13 +666,14 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
723
666
  $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
724
667
  }
725
668
 
726
- $parent.trigger(e = $.Event('show.bs.dropdown'))
669
+ var relatedTarget = { relatedTarget: this }
670
+ $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
727
671
 
728
672
  if (e.isDefaultPrevented()) return
729
673
 
730
674
  $parent
731
675
  .toggleClass('open')
732
- .trigger('shown.bs.dropdown')
676
+ .trigger('shown.bs.dropdown', relatedTarget)
733
677
 
734
678
  $this.focus()
735
679
  }
@@ -755,7 +699,8 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
755
699
  return $this.click()
756
700
  }
757
701
 
758
- var $items = $('[role=menu] li:not(.divider):visible a', $parent)
702
+ var desc = ' li:not(.divider):visible a'
703
+ var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
759
704
 
760
705
  if (!$items.length) return
761
706
 
@@ -763,19 +708,20 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
763
708
 
764
709
  if (e.keyCode == 38 && index > 0) index-- // up
765
710
  if (e.keyCode == 40 && index < $items.length - 1) index++ // down
766
- if (!~index) index=0
711
+ if (!~index) index = 0
767
712
 
768
713
  $items.eq(index).focus()
769
714
  }
770
715
 
771
- function clearMenus() {
716
+ function clearMenus(e) {
772
717
  $(backdrop).remove()
773
- $(toggle).each(function (e) {
718
+ $(toggle).each(function () {
774
719
  var $parent = getParent($(this))
720
+ var relatedTarget = { relatedTarget: this }
775
721
  if (!$parent.hasClass('open')) return
776
- $parent.trigger(e = $.Event('hide.bs.dropdown'))
722
+ $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
777
723
  if (e.isDefaultPrevented()) return
778
- $parent.removeClass('open').trigger('hidden.bs.dropdown')
724
+ $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
779
725
  })
780
726
  }
781
727
 
@@ -784,7 +730,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
784
730
 
785
731
  if (!selector) {
786
732
  selector = $this.attr('href')
787
- selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
733
+ selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
788
734
  }
789
735
 
790
736
  var $parent = selector && $(selector)
@@ -826,32 +772,22 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
826
772
  $(document)
827
773
  .on('click.bs.dropdown.data-api', clearMenus)
828
774
  .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
829
- .on('click.bs.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
830
- .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
775
+ .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
776
+ .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)
831
777
 
832
778
  }(jQuery);
833
779
 
834
780
  /* ========================================================================
835
- * Bootstrap: modal.js v3.0.3
781
+ * Bootstrap: modal.js v3.1.1
836
782
  * http://getbootstrap.com/javascript/#modals
837
783
  * ========================================================================
838
- * Copyright 2013 Twitter, Inc.
839
- *
840
- * Licensed under the Apache License, Version 2.0 (the "License");
841
- * you may not use this file except in compliance with the License.
842
- * You may obtain a copy of the License at
843
- *
844
- * http://www.apache.org/licenses/LICENSE-2.0
845
- *
846
- * Unless required by applicable law or agreed to in writing, software
847
- * distributed under the License is distributed on an "AS IS" BASIS,
848
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
849
- * See the License for the specific language governing permissions and
850
- * limitations under the License.
784
+ * Copyright 2011-2014 Twitter, Inc.
785
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
851
786
  * ======================================================================== */
852
787
 
853
788
 
854
- +function ($) { "use strict";
789
+ +function ($) {
790
+ 'use strict';
855
791
 
856
792
  // MODAL CLASS DEFINITION
857
793
  // ======================
@@ -862,13 +798,19 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
862
798
  this.$backdrop =
863
799
  this.isShown = null
864
800
 
865
- if (this.options.remote) this.$element.load(this.options.remote)
801
+ if (this.options.remote) {
802
+ this.$element
803
+ .find('.modal-content')
804
+ .load(this.options.remote, $.proxy(function () {
805
+ this.$element.trigger('loaded.bs.modal')
806
+ }, this))
807
+ }
866
808
  }
867
809
 
868
810
  Modal.DEFAULTS = {
869
- backdrop: true
870
- , keyboard: true
871
- , show: true
811
+ backdrop: true,
812
+ keyboard: true,
813
+ show: true
872
814
  }
873
815
 
874
816
  Modal.prototype.toggle = function (_relatedTarget) {
@@ -887,7 +829,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
887
829
 
888
830
  this.escape()
889
831
 
890
- this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
832
+ this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
891
833
 
892
834
  this.backdrop(function () {
893
835
  var transition = $.support.transition && that.$element.hasClass('fade')
@@ -896,7 +838,9 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
896
838
  that.$element.appendTo(document.body) // don't move modals dom position
897
839
  }
898
840
 
899
- that.$element.show()
841
+ that.$element
842
+ .show()
843
+ .scrollTop(0)
900
844
 
901
845
  if (transition) {
902
846
  that.$element[0].offsetWidth // force reflow
@@ -938,7 +882,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
938
882
  this.$element
939
883
  .removeClass('in')
940
884
  .attr('aria-hidden', true)
941
- .off('click.dismiss.modal')
885
+ .off('click.dismiss.bs.modal')
942
886
 
943
887
  $.support.transition && this.$element.hasClass('fade') ?
944
888
  this.$element
@@ -982,7 +926,6 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
982
926
  }
983
927
 
984
928
  Modal.prototype.backdrop = function (callback) {
985
- var that = this
986
929
  var animate = this.$element.hasClass('fade') ? 'fade' : ''
987
930
 
988
931
  if (this.isShown && this.options.backdrop) {
@@ -991,7 +934,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
991
934
  this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
992
935
  .appendTo(document.body)
993
936
 
994
- this.$element.on('click.dismiss.modal', $.proxy(function (e) {
937
+ this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
995
938
  if (e.target !== e.currentTarget) return
996
939
  this.options.backdrop == 'static'
997
940
  ? this.$element[0].focus.call(this.$element[0])
@@ -1013,7 +956,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1013
956
  } else if (!this.isShown && this.$backdrop) {
1014
957
  this.$backdrop.removeClass('in')
1015
958
 
1016
- $.support.transition && this.$element.hasClass('fade')?
959
+ $.support.transition && this.$element.hasClass('fade') ?
1017
960
  this.$backdrop
1018
961
  .one($.support.transition.end, callback)
1019
962
  .emulateTransitionEnd(150) :
@@ -1061,9 +1004,9 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1061
1004
  var $this = $(this)
1062
1005
  var href = $this.attr('href')
1063
1006
  var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
1064
- var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
1007
+ var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
1065
1008
 
1066
- e.preventDefault()
1009
+ if ($this.is('a')) e.preventDefault()
1067
1010
 
1068
1011
  $target
1069
1012
  .modal(option, this)
@@ -1073,33 +1016,23 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1073
1016
  })
1074
1017
 
1075
1018
  $(document)
1076
- .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
1019
+ .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
1077
1020
  .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
1078
1021
 
1079
1022
  }(jQuery);
1080
1023
 
1081
1024
  /* ========================================================================
1082
- * Bootstrap: tooltip.js v3.0.3
1025
+ * Bootstrap: tooltip.js v3.1.1
1083
1026
  * http://getbootstrap.com/javascript/#tooltip
1084
1027
  * Inspired by the original jQuery.tipsy by Jason Frame
1085
1028
  * ========================================================================
1086
- * Copyright 2013 Twitter, Inc.
1087
- *
1088
- * Licensed under the Apache License, Version 2.0 (the "License");
1089
- * you may not use this file except in compliance with the License.
1090
- * You may obtain a copy of the License at
1091
- *
1092
- * http://www.apache.org/licenses/LICENSE-2.0
1093
- *
1094
- * Unless required by applicable law or agreed to in writing, software
1095
- * distributed under the License is distributed on an "AS IS" BASIS,
1096
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1097
- * See the License for the specific language governing permissions and
1098
- * limitations under the License.
1029
+ * Copyright 2011-2014 Twitter, Inc.
1030
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1099
1031
  * ======================================================================== */
1100
1032
 
1101
1033
 
1102
- +function ($) { "use strict";
1034
+ +function ($) {
1035
+ 'use strict';
1103
1036
 
1104
1037
  // TOOLTIP PUBLIC CLASS DEFINITION
1105
1038
  // ===============================
@@ -1116,15 +1049,15 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1116
1049
  }
1117
1050
 
1118
1051
  Tooltip.DEFAULTS = {
1119
- animation: true
1120
- , placement: 'top'
1121
- , selector: false
1122
- , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
1123
- , trigger: 'hover focus'
1124
- , title: ''
1125
- , delay: 0
1126
- , html: false
1127
- , container: false
1052
+ animation: true,
1053
+ placement: 'top',
1054
+ selector: false,
1055
+ template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
1056
+ trigger: 'hover focus',
1057
+ title: '',
1058
+ delay: 0,
1059
+ html: false,
1060
+ container: false
1128
1061
  }
1129
1062
 
1130
1063
  Tooltip.prototype.init = function (type, element, options) {
@@ -1141,8 +1074,8 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1141
1074
  if (trigger == 'click') {
1142
1075
  this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
1143
1076
  } else if (trigger != 'manual') {
1144
- var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
1145
- var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
1077
+ var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
1078
+ var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
1146
1079
 
1147
1080
  this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1148
1081
  this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
@@ -1163,8 +1096,8 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1163
1096
 
1164
1097
  if (options.delay && typeof options.delay == 'number') {
1165
1098
  options.delay = {
1166
- show: options.delay
1167
- , hide: options.delay
1099
+ show: options.delay,
1100
+ hide: options.delay
1168
1101
  }
1169
1102
  }
1170
1103
 
@@ -1213,12 +1146,13 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1213
1146
  }
1214
1147
 
1215
1148
  Tooltip.prototype.show = function () {
1216
- var e = $.Event('show.bs.'+ this.type)
1149
+ var e = $.Event('show.bs.' + this.type)
1217
1150
 
1218
1151
  if (this.hasContent() && this.enabled) {
1219
1152
  this.$element.trigger(e)
1220
1153
 
1221
1154
  if (e.isDefaultPrevented()) return
1155
+ var that = this;
1222
1156
 
1223
1157
  var $tip = this.tip()
1224
1158
 
@@ -1268,11 +1202,21 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1268
1202
  var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
1269
1203
 
1270
1204
  this.applyPlacement(calculatedOffset, placement)
1271
- this.$element.trigger('shown.bs.' + this.type)
1205
+ this.hoverState = null
1206
+
1207
+ var complete = function() {
1208
+ that.$element.trigger('shown.bs.' + that.type)
1209
+ }
1210
+
1211
+ $.support.transition && this.$tip.hasClass('fade') ?
1212
+ $tip
1213
+ .one($.support.transition.end, complete)
1214
+ .emulateTransitionEnd(150) :
1215
+ complete()
1272
1216
  }
1273
1217
  }
1274
1218
 
1275
- Tooltip.prototype.applyPlacement = function(offset, placement) {
1219
+ Tooltip.prototype.applyPlacement = function (offset, placement) {
1276
1220
  var replace
1277
1221
  var $tip = this.tip()
1278
1222
  var width = $tip[0].offsetWidth
@@ -1289,9 +1233,18 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1289
1233
  offset.top = offset.top + marginTop
1290
1234
  offset.left = offset.left + marginLeft
1291
1235
 
1292
- $tip
1293
- .offset(offset)
1294
- .addClass('in')
1236
+ // $.fn.offset doesn't round pixel values
1237
+ // so we use setOffset directly with our own function B-0
1238
+ $.offset.setOffset($tip[0], $.extend({
1239
+ using: function (props) {
1240
+ $tip.css({
1241
+ top: Math.round(props.top),
1242
+ left: Math.round(props.left)
1243
+ })
1244
+ }
1245
+ }, offset), 0)
1246
+
1247
+ $tip.addClass('in')
1295
1248
 
1296
1249
  // check to see if placing tip in new offset caused the tip to resize itself
1297
1250
  var actualWidth = $tip[0].offsetWidth
@@ -1323,8 +1276,8 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1323
1276
  if (replace) $tip.offset(offset)
1324
1277
  }
1325
1278
 
1326
- Tooltip.prototype.replaceArrow = function(delta, dimension, position) {
1327
- this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
1279
+ Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
1280
+ this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '')
1328
1281
  }
1329
1282
 
1330
1283
  Tooltip.prototype.setContent = function () {
@@ -1342,6 +1295,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1342
1295
 
1343
1296
  function complete() {
1344
1297
  if (that.hoverState != 'in') $tip.detach()
1298
+ that.$element.trigger('hidden.bs.' + that.type)
1345
1299
  }
1346
1300
 
1347
1301
  this.$element.trigger(e)
@@ -1356,7 +1310,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1356
1310
  .emulateTransitionEnd(150) :
1357
1311
  complete()
1358
1312
 
1359
- this.$element.trigger('hidden.bs.' + this.type)
1313
+ this.hoverState = null
1360
1314
 
1361
1315
  return this
1362
1316
  }
@@ -1375,8 +1329,8 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1375
1329
  Tooltip.prototype.getPosition = function () {
1376
1330
  var el = this.$element[0]
1377
1331
  return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
1378
- width: el.offsetWidth
1379
- , height: el.offsetHeight
1332
+ width: el.offsetWidth,
1333
+ height: el.offsetHeight
1380
1334
  }, this.$element.offset())
1381
1335
  }
1382
1336
 
@@ -1432,6 +1386,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1432
1386
  }
1433
1387
 
1434
1388
  Tooltip.prototype.destroy = function () {
1389
+ clearTimeout(this.timeout)
1435
1390
  this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
1436
1391
  }
1437
1392
 
@@ -1447,6 +1402,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1447
1402
  var data = $this.data('bs.tooltip')
1448
1403
  var options = typeof option == 'object' && option
1449
1404
 
1405
+ if (!data && option == 'destroy') return
1450
1406
  if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
1451
1407
  if (typeof option == 'string') data[option]()
1452
1408
  })
@@ -1466,26 +1422,16 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1466
1422
  }(jQuery);
1467
1423
 
1468
1424
  /* ========================================================================
1469
- * Bootstrap: popover.js v3.0.3
1425
+ * Bootstrap: popover.js v3.1.1
1470
1426
  * http://getbootstrap.com/javascript/#popovers
1471
1427
  * ========================================================================
1472
- * Copyright 2013 Twitter, Inc.
1473
- *
1474
- * Licensed under the Apache License, Version 2.0 (the "License");
1475
- * you may not use this file except in compliance with the License.
1476
- * You may obtain a copy of the License at
1477
- *
1478
- * http://www.apache.org/licenses/LICENSE-2.0
1479
- *
1480
- * Unless required by applicable law or agreed to in writing, software
1481
- * distributed under the License is distributed on an "AS IS" BASIS,
1482
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1483
- * See the License for the specific language governing permissions and
1484
- * limitations under the License.
1428
+ * Copyright 2011-2014 Twitter, Inc.
1429
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1485
1430
  * ======================================================================== */
1486
1431
 
1487
1432
 
1488
- +function ($) { "use strict";
1433
+ +function ($) {
1434
+ 'use strict';
1489
1435
 
1490
1436
  // POPOVER PUBLIC CLASS DEFINITION
1491
1437
  // ===============================
@@ -1496,11 +1442,11 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1496
1442
 
1497
1443
  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
1498
1444
 
1499
- Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, {
1500
- placement: 'right'
1501
- , trigger: 'click'
1502
- , content: ''
1503
- , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
1445
+ Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
1446
+ placement: 'right',
1447
+ trigger: 'click',
1448
+ content: '',
1449
+ template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
1504
1450
  })
1505
1451
 
1506
1452
 
@@ -1521,7 +1467,9 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1521
1467
  var content = this.getContent()
1522
1468
 
1523
1469
  $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1524
- $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
1470
+ $tip.find('.popover-content')[ // we use append for html objects to maintain js events
1471
+ this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
1472
+ ](content)
1525
1473
 
1526
1474
  $tip.removeClass('fade top bottom left right in')
1527
1475
 
@@ -1565,6 +1513,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1565
1513
  var data = $this.data('bs.popover')
1566
1514
  var options = typeof option == 'object' && option
1567
1515
 
1516
+ if (!data && option == 'destroy') return
1568
1517
  if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
1569
1518
  if (typeof option == 'string') data[option]()
1570
1519
  })
@@ -1584,26 +1533,16 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1584
1533
  }(jQuery);
1585
1534
 
1586
1535
  /* ========================================================================
1587
- * Bootstrap: scrollspy.js v3.0.3
1536
+ * Bootstrap: scrollspy.js v3.1.1
1588
1537
  * http://getbootstrap.com/javascript/#scrollspy
1589
1538
  * ========================================================================
1590
- * Copyright 2013 Twitter, Inc.
1591
- *
1592
- * Licensed under the Apache License, Version 2.0 (the "License");
1593
- * you may not use this file except in compliance with the License.
1594
- * You may obtain a copy of the License at
1595
- *
1596
- * http://www.apache.org/licenses/LICENSE-2.0
1597
- *
1598
- * Unless required by applicable law or agreed to in writing, software
1599
- * distributed under the License is distributed on an "AS IS" BASIS,
1600
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1601
- * See the License for the specific language governing permissions and
1602
- * limitations under the License.
1539
+ * Copyright 2011-2014 Twitter, Inc.
1540
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1603
1541
  * ======================================================================== */
1604
1542
 
1605
1543
 
1606
- +function ($) { "use strict";
1544
+ +function ($) {
1545
+ 'use strict';
1607
1546
 
1608
1547
  // SCROLLSPY CLASS DEFINITION
1609
1548
  // ==========================
@@ -1643,10 +1582,11 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1643
1582
  .map(function () {
1644
1583
  var $el = $(this)
1645
1584
  var href = $el.data('target') || $el.attr('href')
1646
- var $href = /^#\w/.test(href) && $(href)
1585
+ var $href = /^#./.test(href) && $(href)
1647
1586
 
1648
1587
  return ($href
1649
1588
  && $href.length
1589
+ && $href.is(':visible')
1650
1590
  && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
1651
1591
  })
1652
1592
  .sort(function (a, b) { return a[0] - b[0] })
@@ -1669,6 +1609,10 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1669
1609
  return activeTarget != (i = targets.last()[0]) && this.activate(i)
1670
1610
  }
1671
1611
 
1612
+ if (activeTarget && scrollTop <= offsets[0]) {
1613
+ return activeTarget != (i = targets[0]) && this.activate(i)
1614
+ }
1615
+
1672
1616
  for (i = offsets.length; i--;) {
1673
1617
  activeTarget != targets[i]
1674
1618
  && scrollTop >= offsets[i]
@@ -1681,18 +1625,18 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1681
1625
  this.activeTarget = target
1682
1626
 
1683
1627
  $(this.selector)
1684
- .parents('.active')
1628
+ .parentsUntil(this.options.target, '.active')
1685
1629
  .removeClass('active')
1686
1630
 
1687
- var selector = this.selector
1688
- + '[data-target="' + target + '"],'
1689
- + this.selector + '[href="' + target + '"]'
1631
+ var selector = this.selector +
1632
+ '[data-target="' + target + '"],' +
1633
+ this.selector + '[href="' + target + '"]'
1690
1634
 
1691
1635
  var active = $(selector)
1692
1636
  .parents('li')
1693
1637
  .addClass('active')
1694
1638
 
1695
- if (active.parent('.dropdown-menu').length) {
1639
+ if (active.parent('.dropdown-menu').length) {
1696
1640
  active = active
1697
1641
  .closest('li.dropdown')
1698
1642
  .addClass('active')
@@ -1743,26 +1687,16 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1743
1687
  }(jQuery);
1744
1688
 
1745
1689
  /* ========================================================================
1746
- * Bootstrap: tab.js v3.0.3
1690
+ * Bootstrap: tab.js v3.1.1
1747
1691
  * http://getbootstrap.com/javascript/#tabs
1748
1692
  * ========================================================================
1749
- * Copyright 2013 Twitter, Inc.
1750
- *
1751
- * Licensed under the Apache License, Version 2.0 (the "License");
1752
- * you may not use this file except in compliance with the License.
1753
- * You may obtain a copy of the License at
1754
- *
1755
- * http://www.apache.org/licenses/LICENSE-2.0
1756
- *
1757
- * Unless required by applicable law or agreed to in writing, software
1758
- * distributed under the License is distributed on an "AS IS" BASIS,
1759
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1760
- * See the License for the specific language governing permissions and
1761
- * limitations under the License.
1693
+ * Copyright 2011-2014 Twitter, Inc.
1694
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1762
1695
  * ======================================================================== */
1763
1696
 
1764
1697
 
1765
- +function ($) { "use strict";
1698
+ +function ($) {
1699
+ 'use strict';
1766
1700
 
1767
1701
  // TAB CLASS DEFINITION
1768
1702
  // ====================
@@ -1797,8 +1731,8 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1797
1731
  this.activate($this.parent('li'), $ul)
1798
1732
  this.activate($target, $target.parent(), function () {
1799
1733
  $this.trigger({
1800
- type: 'shown.bs.tab'
1801
- , relatedTarget: previous
1734
+ type: 'shown.bs.tab',
1735
+ relatedTarget: previous
1802
1736
  })
1803
1737
  })
1804
1738
  }
@@ -1879,26 +1813,16 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1879
1813
  }(jQuery);
1880
1814
 
1881
1815
  /* ========================================================================
1882
- * Bootstrap: affix.js v3.0.3
1816
+ * Bootstrap: affix.js v3.1.1
1883
1817
  * http://getbootstrap.com/javascript/#affix
1884
1818
  * ========================================================================
1885
- * Copyright 2013 Twitter, Inc.
1886
- *
1887
- * Licensed under the Apache License, Version 2.0 (the "License");
1888
- * you may not use this file except in compliance with the License.
1889
- * You may obtain a copy of the License at
1890
- *
1891
- * http://www.apache.org/licenses/LICENSE-2.0
1892
- *
1893
- * Unless required by applicable law or agreed to in writing, software
1894
- * distributed under the License is distributed on an "AS IS" BASIS,
1895
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1896
- * See the License for the specific language governing permissions and
1897
- * limitations under the License.
1819
+ * Copyright 2011-2014 Twitter, Inc.
1820
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1898
1821
  * ======================================================================== */
1899
1822
 
1900
1823
 
1901
- +function ($) { "use strict";
1824
+ +function ($) {
1825
+ 'use strict';
1902
1826
 
1903
1827
  // AFFIX CLASS DEFINITION
1904
1828
  // ======================
@@ -1909,9 +1833,10 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1909
1833
  .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
1910
1834
  .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
1911
1835
 
1912
- this.$element = $(element)
1913
- this.affixed =
1914
- this.unpin = null
1836
+ this.$element = $(element)
1837
+ this.affixed =
1838
+ this.unpin =
1839
+ this.pinnedOffset = null
1915
1840
 
1916
1841
  this.checkPosition()
1917
1842
  }
@@ -1922,6 +1847,14 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1922
1847
  offset: 0
1923
1848
  }
1924
1849
 
1850
+ Affix.prototype.getPinnedOffset = function () {
1851
+ if (this.pinnedOffset) return this.pinnedOffset
1852
+ this.$element.removeClass(Affix.RESET).addClass('affix')
1853
+ var scrollTop = this.$window.scrollTop()
1854
+ var position = this.$element.offset()
1855
+ return (this.pinnedOffset = position.top - scrollTop)
1856
+ }
1857
+
1925
1858
  Affix.prototype.checkPositionWithEventLoop = function () {
1926
1859
  setTimeout($.proxy(this.checkPosition, this), 1)
1927
1860
  }
@@ -1936,9 +1869,11 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1936
1869
  var offsetTop = offset.top
1937
1870
  var offsetBottom = offset.bottom
1938
1871
 
1872
+ if (this.affixed == 'top') position.top += scrollTop
1873
+
1939
1874
  if (typeof offset != 'object') offsetBottom = offsetTop = offset
1940
- if (typeof offsetTop == 'function') offsetTop = offset.top()
1941
- if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
1875
+ if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
1876
+ if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
1942
1877
 
1943
1878
  var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
1944
1879
  offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
@@ -1947,13 +1882,23 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
1947
1882
  if (this.affixed === affix) return
1948
1883
  if (this.unpin) this.$element.css('top', '')
1949
1884
 
1885
+ var affixType = 'affix' + (affix ? '-' + affix : '')
1886
+ var e = $.Event(affixType + '.bs.affix')
1887
+
1888
+ this.$element.trigger(e)
1889
+
1890
+ if (e.isDefaultPrevented()) return
1891
+
1950
1892
  this.affixed = affix
1951
- this.unpin = affix == 'bottom' ? position.top - scrollTop : null
1893
+ this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
1952
1894
 
1953
- this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : ''))
1895
+ this.$element
1896
+ .removeClass(Affix.RESET)
1897
+ .addClass(affixType)
1898
+ .trigger($.Event(affixType.replace('affix', 'affixed')))
1954
1899
 
1955
1900
  if (affix == 'bottom') {
1956
- this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() })
1901
+ this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() })
1957
1902
  }
1958
1903
  }
1959
1904