pact_broker 0.0.10 → 1.0.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/Gemfile +0 -3
- data/README.md +28 -1
- data/Rakefile +4 -2
- data/assets/d3.v3.js +9263 -0
- data/assets/force.csv +29 -0
- data/assets/index.html +186 -0
- data/assets/index2.html +224 -0
- data/assets/relationships +4 -0
- data/assets/stylesheets/github.css +387 -0
- data/bethtest.rb +67 -0
- data/config.ru +10 -4
- data/config/boot.rb +4 -0
- data/example/Gemfile +5 -0
- data/example/config.ru +18 -0
- data/lib/db.rb +52 -0
- data/lib/pact_broker.rb +2 -0
- data/lib/pact_broker/api.rb +2 -0
- data/lib/pact_broker/api/decorators/pact_collection_decorator.rb +1 -1
- data/lib/pact_broker/api/decorators/pacticipant_collection_decorator.rb +1 -1
- data/lib/pact_broker/api/decorators/relationships_csv_decorator.rb +32 -0
- data/lib/pact_broker/api/renderers/html_pact_renderer.rb +43 -0
- data/lib/pact_broker/api/resources/latest_pact.rb +7 -1
- data/lib/pact_broker/api/resources/relationships.rb +29 -0
- data/lib/pact_broker/app.rb +82 -0
- data/lib/pact_broker/configuration.rb +47 -0
- data/lib/pact_broker/db.rb +7 -39
- data/lib/pact_broker/models/relationship.rb +27 -0
- data/lib/pact_broker/project_root.rb +7 -0
- data/lib/pact_broker/services/pacticipant_service.rb +6 -0
- data/lib/pact_broker/ui/controllers/base_controller.rb +15 -0
- data/lib/pact_broker/ui/controllers/clusters.rb +28 -0
- data/lib/pact_broker/ui/controllers/relationships.rb +21 -0
- data/lib/pact_broker/ui/view_models/clusters.rb +0 -0
- data/lib/pact_broker/ui/view_models/relationship.rb +35 -0
- data/lib/pact_broker/ui/view_models/relationships.rb +21 -0
- data/lib/pact_broker/ui/views/clusters/show.haml +2 -0
- data/lib/pact_broker/ui/views/layouts/main.haml +2 -0
- data/lib/pact_broker/ui/views/relationships/show.haml +44 -0
- data/lib/pact_broker/version.rb +1 -1
- data/lib/rack/hal_browser.rb +1 -0
- data/lib/rack/hal_browser/redirect.rb +45 -0
- data/pact_broker.gemspec +10 -8
- data/public/bootstrap.zip +0 -0
- data/public/config.json +412 -0
- data/public/css/bootstrap-theme.css +346 -0
- data/public/css/bootstrap-theme.min.css +7 -0
- data/public/css/bootstrap.css +5780 -0
- data/public/css/bootstrap.min.css +7 -0
- data/public/fonts/glyphicons-halflings-regular.eot +0 -0
- data/public/fonts/glyphicons-halflings-regular.svg +229 -0
- data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/public/fonts/glyphicons-halflings-regular.woff +0 -0
- data/public/javascripts/jquery-2.1.1.min.js +4 -0
- data/public/javascripts/jquery.tablesorter.js +1765 -0
- data/public/javascripts/jquery.tablesorter.min.js +5 -0
- data/public/js/bootstrap.js +1943 -0
- data/public/js/bootstrap.min.js +7 -0
- data/public/stylesheets/github.css +387 -0
- data/public/stylesheets/relationships.css +18 -0
- data/script/update-hal-browser +6 -0
- data/spec/fixtures/renderer_pact.json +34 -0
- data/spec/lib/pact_broker/api/decorators/relationships_csv_decorator_spec.rb +30 -0
- data/spec/lib/pact_broker/api/renderers/html_pact_renderer_spec.rb +29 -0
- data/spec/lib/pact_broker/api/resources/latest_pact_spec.rb +57 -0
- data/spec/lib/pact_broker/configuration_spec.rb +21 -0
- data/spec/lib/pact_broker/services/pacticipant_service_spec.rb +30 -0
- data/spec/lib/pact_broker/ui/controllers/clusters_spec.rb +27 -0
- data/spec/lib/pact_broker/ui/controllers/relationships_spec.rb +37 -0
- data/spec/lib/pact_broker/ui/view_models/relationship_spec.rb +29 -0
- data/spec/lib/rack/hal_browser/redirect_spec.rb +63 -0
- data/spec/service_consumers/pact_helper.rb +1 -1
- data/spec/spec_helper.rb +10 -3
- data/tasks/database.rb +57 -0
- data/tasks/db.rake +57 -12
- data/tasks/pact.rake +1 -1
- data/tasks/rspec.rake +1 -9
- data/vendor/hal-browser/.gitignore +1 -0
- data/vendor/hal-browser/MIT-LICENSE.txt +20 -0
- data/vendor/hal-browser/README.md +35 -0
- data/vendor/hal-browser/browser.html +246 -0
- data/vendor/hal-browser/js/hal.js +57 -0
- data/vendor/hal-browser/js/hal/browser.js +60 -0
- data/vendor/hal-browser/js/hal/http/client.js +38 -0
- data/vendor/hal-browser/js/hal/resource.js +34 -0
- data/vendor/hal-browser/js/hal/views/browser.js +29 -0
- data/vendor/hal-browser/js/hal/views/documentation.js +7 -0
- data/vendor/hal-browser/js/hal/views/embedded_resource.js +56 -0
- data/vendor/hal-browser/js/hal/views/embedded_resources.js +41 -0
- data/vendor/hal-browser/js/hal/views/explorer.js +23 -0
- data/vendor/hal-browser/js/hal/views/inspector.js +39 -0
- data/vendor/hal-browser/js/hal/views/links.js +54 -0
- data/vendor/hal-browser/js/hal/views/location_bar.js +40 -0
- data/vendor/hal-browser/js/hal/views/navigation.js +19 -0
- data/vendor/hal-browser/js/hal/views/non_safe_request_dialog.js +53 -0
- data/vendor/hal-browser/js/hal/views/properties.js +14 -0
- data/vendor/hal-browser/js/hal/views/query_uri_dialog.js +69 -0
- data/vendor/hal-browser/js/hal/views/request_headers.js +30 -0
- data/vendor/hal-browser/js/hal/views/resource.js +38 -0
- data/vendor/hal-browser/js/hal/views/response.js +24 -0
- data/vendor/hal-browser/js/hal/views/response_body.js +40 -0
- data/vendor/hal-browser/js/hal/views/response_headers.js +19 -0
- data/vendor/hal-browser/styles.css +67 -0
- data/vendor/hal-browser/vendor/css/bootstrap-responsive.css +1109 -0
- data/vendor/hal-browser/vendor/css/bootstrap.css +6158 -0
- data/vendor/hal-browser/vendor/img/ajax-loader.gif +0 -0
- data/vendor/hal-browser/vendor/img/glyphicons-halflings-white.png +0 -0
- data/vendor/hal-browser/vendor/img/glyphicons-halflings.png +0 -0
- data/vendor/hal-browser/vendor/js/backbone.js +1487 -0
- data/vendor/hal-browser/vendor/js/bootstrap.js +2276 -0
- data/vendor/hal-browser/vendor/js/jquery-1.9.1.js +9597 -0
- data/vendor/hal-browser/vendor/js/underscore.js +1227 -0
- data/vendor/hal-browser/vendor/js/uritemplates.js +438 -0
- metadata +162 -47
- data/Gemfile.lock +0 -110
@@ -0,0 +1,5 @@
|
|
1
|
+
/*!
|
2
|
+
* TableSorter 2.16.4 min - Client-side table sorting with ease!
|
3
|
+
* Copyright (c) 2007 Christian Bach
|
4
|
+
*/
|
5
|
+
!function(g){g.extend({tablesorter:new function(){function d(){var b=arguments[0],a=1<arguments.length?Array.prototype.slice.call(arguments):b;if("undefined"!==typeof console&&"undefined"!==typeof console.log)console[/error/i.test(b)?"error":/warn/i.test(b)?"warn":"log"](a);else alert(a)}function u(b,a){d(b+" ("+((new Date).getTime()-a.getTime())+"ms)")}function n(b){for(var a in b)return!1;return!0}function p(b,a,c){if(!a)return"";var h=b.config,e=h.textExtraction||"",f="",f="basic"===e?g(a).attr(h.textAttribute)|| a.textContent||a.innerText||g(a).text()||"":"function"===typeof e?e(a,b,c):"object"===typeof e&&e.hasOwnProperty(c)?e[c](a,b,c):a.textContent||a.innerText||g(a).text()||"";return g.trim(f)}function s(b){var a=b.config,c=a.$tbodies=a.$table.children("tbody:not(."+a.cssInfoBlock+")"),h,e,t,k,l,m,g,n,w=0,q="",r=c.length;if(0===r)return a.debug?d("Warning: *Empty table!* Not building a parser cache"):"";a.debug&&(n=new Date,d("Detecting parsers for each column"));for(e=[];w<r;){h=c[w].rows;if(h[w])for(t= h[w].cells.length,k=0;k<t;k++){l=a.$headers.filter(":not([colspan])");l=l.add(a.$headers.filter('[colspan="1"]')).filter('[data-column="'+k+'"]:last');m=a.$headers.index(l);m=a.headers[m];g=f.getParserById(f.getData(l,m,"sorter"));a.empties[k]=f.getData(l,m,"empty")||a.emptyTo||(a.emptyToBottom?"bottom":"top");a.strings[k]=f.getData(l,m,"string")||a.stringTo||"max";if(!g)a:{l=b;m=h;g=-1;for(var s=k,A=void 0,x=f.parsers.length,y=!1,F="",A=!0;""===F&&A;)g++,m[g]?(y=m[g].cells[s],F=p(l,y,s),l.config.debug&& d("Checking if value was empty on row "+g+", column: "+s+': "'+F+'"')):A=!1;for(;0<=--x;)if((A=f.parsers[x])&&"text"!==A.id&&A.is&&A.is(F,l,y)){g=A;break a}g=f.getParserById("text")}a.debug&&(q+="column:"+k+"; parser:"+g.id+"; string:"+a.strings[k]+"; empty: "+a.empties[k]+"\n");e.push(g)}w+=e.length?r:1}a.debug&&(d(q?q:"No parsers detected"),u("Completed detecting parsers",n));a.parsers=e}function x(b){var a,c,h,e,t,k,l,m,z,n,w,q=b.config,r=q.$table.children("tbody"),s=q.parsers;q.cache={};if(!s)return q.debug? d("Warning: *Empty table!* Not building a cache"):"";q.debug&&(m=new Date);q.showProcessing&&f.isProcessing(b,!0);for(t=0;t<r.length;t++)if(w=[],a=q.cache[t]={normalized:[]},!r.eq(t).hasClass(q.cssInfoBlock)){z=r[t]&&r[t].rows.length||0;for(h=0;h<z;++h)if(n={child:[]},k=g(r[t].rows[h]),l=[],k.hasClass(q.cssChildRow)&&0!==h)c=a.normalized.length-1,a.normalized[c][q.columns].$row=a.normalized[c][q.columns].$row.add(k),k.prev().hasClass(q.cssChildRow)||k.prev().addClass(f.css.cssHasChild),n.child[c]= g.trim(k[0].textContent||k[0].innerText||k.text()||"");else{n.$row=k;n.order=h;for(e=0;e<q.columns;++e)"undefined"===typeof s[e]?q.debug&&d("No parser found for cell:",k[0].cells[e],"does it have a header?"):(c=p(b,k[0].cells[e],e),c=s[e].format(c,b,k[0].cells[e],e),l.push(c),"numeric"===(s[e].type||"").toLowerCase()&&(w[e]=Math.max(Math.abs(c)||0,w[e]||0)));l[q.columns]=n;a.normalized.push(l)}a.colMax=w}q.showProcessing&&f.isProcessing(b);q.debug&&u("Building cache for "+z+" rows",m)}function y(b, a){var c=b.config,h=c.widgetOptions,e=b.tBodies,t=[],k=c.cache,d,m,z,p,w,q;if(n(k))return c.appender?c.appender(b,t):b.isUpdating?c.$table.trigger("updateComplete",b):"";c.debug&&(q=new Date);for(w=0;w<e.length;w++)if(d=g(e[w]),d.length&&!d.hasClass(c.cssInfoBlock)){z=f.processTbody(b,d,!0);d=k[w].normalized;m=d.length;for(p=0;p<m;p++)t.push(d[p][c.columns].$row),c.appender&&(!c.pager||c.pager.removeRows&&h.pager_removeRows||c.pager.ajax)||z.append(d[p][c.columns].$row);f.processTbody(b,z,!1)}c.appender&& c.appender(b,t);c.debug&&u("Rebuilt table",q);a||c.appender||f.applyWidget(b);b.isUpdating&&c.$table.trigger("updateComplete",b)}function C(b){return/^d/i.test(b)||1===b}function D(b){var a,c,h,e,t,k,l,m=b.config;m.headerList=[];m.headerContent=[];m.debug&&(l=new Date);m.columns=f.computeColumnIndex(m.$table.children("thead, tfoot").children("tr"));e=m.cssIcon?'<i class="'+(m.cssIcon===f.css.icon?f.css.icon:m.cssIcon+" "+f.css.icon)+'"></i>':"";m.$headers=g(b).find(m.selectorHeaders).each(function(b){c= g(this);a=m.headers[b];m.headerContent[b]=g(this).html();t=m.headerTemplate.replace(/\{content\}/g,g(this).html()).replace(/\{icon\}/g,e);m.onRenderTemplate&&(h=m.onRenderTemplate.apply(c,[b,t]))&&"string"===typeof h&&(t=h);g(this).html('<div class="'+f.css.headerIn+'">'+t+"</div>");m.onRenderHeader&&m.onRenderHeader.apply(c,[b]);this.column=parseInt(g(this).attr("data-column"),10);this.order=C(f.getData(c,a,"sortInitialOrder")||m.sortInitialOrder)?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1; k=f.getData(c,a,"lockedOrder")||!1;"undefined"!==typeof k&&!1!==k&&(this.order=this.lockedOrder=C(k)?[1,1,1]:[0,0,0]);c.addClass(f.css.header+" "+m.cssHeader);m.headerList[b]=this;c.parent().addClass(f.css.headerRow+" "+m.cssHeaderRow).attr("role","row");m.tabIndex&&c.attr("tabindex",0)}).attr({scope:"col",role:"columnheader"});B(b);m.debug&&(u("Built headers:",l),d(m.$headers))}function E(b,a,c){var h=b.config;h.$table.find(h.selectorRemove).remove();s(b);x(b);H(h.$table,a,c)}function B(b){var a, c,h=b.config;h.$headers.each(function(e,t){c=g(t);a="false"===f.getData(t,h.headers[e],"sorter");t.sortDisabled=a;c[a?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+a);b.id&&(a?c.removeAttr("aria-controls"):c.attr("aria-controls",b.id))})}function G(b){var a,c,h=b.config,e=h.sortList,t=e.length,d=f.css.sortNone+" "+h.cssNone,l=[f.css.sortAsc+" "+h.cssAsc,f.css.sortDesc+" "+h.cssDesc],m=["ascending","descending"],n=g(b).find("tfoot tr").children().add(h.$extraHeaders).removeClass(l.join(" ")); h.$headers.removeClass(l.join(" ")).addClass(d).attr("aria-sort","none");for(a=0;a<t;a++)if(2!==e[a][1]&&(b=h.$headers.not(".sorter-false").filter('[data-column="'+e[a][0]+'"]'+(1===t?":last":"")),b.length)){for(c=0;c<b.length;c++)b[c].sortDisabled||b.eq(c).removeClass(d).addClass(l[e[a][1]]).attr("aria-sort",m[e[a][1]]);n.length&&n.filter('[data-column="'+e[a][0]+'"]').removeClass(d).addClass(l[e[a][1]])}h.$headers.not(".sorter-false").each(function(){var b=g(this),a=this.order[(this.count+1)%(h.sortReset? 3:2)],a=b.text()+": "+f.language[b.hasClass(f.css.sortAsc)?"sortAsc":b.hasClass(f.css.sortDesc)?"sortDesc":"sortNone"]+f.language[0===a?"nextAsc":1===a?"nextDesc":"nextNone"];b.attr("aria-label",a)})}function L(b){if(b.config.widthFixed&&0===g(b).find("colgroup").length){var a=g("<colgroup>"),c=g(b).width();g(b.tBodies[0]).find("tr:first").children("td:visible").each(function(){a.append(g("<col>").css("width",parseInt(g(this).width()/c*1E3,10)/10+"%"))});g(b).prepend(a)}}function M(b,a,c){var h,e, f,d=b.config;b=a||d.sortList;d.sortList=[];g.each(b,function(b,a){h=[parseInt(a[0],10),parseInt(a[1],10)];if(f=d.$headers.filter('[data-column="'+h[0]+'"]:last')[0])d.sortList.push(h),e=g.inArray(h[1],f.order),c&&(f.count+=1),f.count=0<=e?e:h[1]%(d.sortReset?3:2)})}function N(b,a){return b&&b[a]?b[a].type||"":""}function O(b,a,c){var h,e,d,k=b.config,l=!c[k.sortMultiSortKey],m=k.$table;m.trigger("sortStart",b);a.count=c[k.sortResetKey]?2:(a.count+1)%(k.sortReset?3:2);k.sortRestart&&(e=a,k.$headers.each(function(){this=== e||!l&&g(this).is("."+f.css.sortDesc+",."+f.css.sortAsc)||(this.count=-1)}));e=a.column;if(l){k.sortList=[];if(null!==k.sortForce)for(h=k.sortForce,c=0;c<h.length;c++)h[c][0]!==e&&k.sortList.push(h[c]);h=a.order[a.count];if(2>h&&(k.sortList.push([e,h]),1<a.colSpan))for(c=1;c<a.colSpan;c++)k.sortList.push([e+c,h])}else{if(k.sortAppend&&1<k.sortList.length)for(c=0;c<k.sortAppend.length;c++)d=f.isValueInArray(k.sortAppend[c][0],k.sortList),0<=d&&k.sortList.splice(d,1);if(0<=f.isValueInArray(e,k.sortList))for(c= 0;c<k.sortList.length;c++)d=k.sortList[c],h=k.$headers.filter('[data-column="'+d[0]+'"]:last')[0],d[0]===e&&(d[1]=h.order[a.count],2===d[1]&&(k.sortList.splice(c,1),h.count=-1));else if(h=a.order[a.count],2>h&&(k.sortList.push([e,h]),1<a.colSpan))for(c=1;c<a.colSpan;c++)k.sortList.push([e+c,h])}if(null!==k.sortAppend)for(h=k.sortAppend,c=0;c<h.length;c++)h[c][0]!==e&&k.sortList.push(h[c]);m.trigger("sortBegin",b);setTimeout(function(){G(b);I(b);y(b);m.trigger("sortEnd",b)},1)}function I(b){var a, c,h,e,d,k,g,m,z,p,w,q=0,r=b.config,s=r.textSorter||"",v=r.sortList,x=v.length,y=b.tBodies.length;if(!r.serverSideSorting&&!n(r.cache)){r.debug&&(d=new Date);for(c=0;c<y;c++)k=r.cache[c].colMax,g=r.cache[c].normalized,g.sort(function(c,d){for(a=0;a<x;a++){e=v[a][0];m=v[a][1];q=0===m;if(r.sortStable&&c[e]===d[e]&&1===x)break;(h=/n/i.test(N(r.parsers,e)))&&r.strings[e]?(h="boolean"===typeof r.string[r.strings[e]]?(q?1:-1)*(r.string[r.strings[e]]?-1:1):r.strings[e]?r.string[r.strings[e]]||0:0,z=r.numberSorter? r.numberSorter(c[e],d[e],q,k[e],b):f["sortNumeric"+(q?"Asc":"Desc")](c[e],d[e],h,k[e],e,b)):(p=q?c:d,w=q?d:c,z="function"===typeof s?s(p[e],w[e],q,e,b):"object"===typeof s&&s.hasOwnProperty(e)?s[e](p[e],w[e],q,e,b):f["sortNatural"+(q?"Asc":"Desc")](c[e],d[e],e,b,r));if(z)return z}return c[r.columns].order-d[r.columns].order});r.debug&&u("Sorting on "+v.toString()+" and dir "+m+" time",d)}}function J(b,a){b[0].isUpdating&&b.trigger("updateComplete");g.isFunction(a)&&a(b[0])}function H(b,a,c){var h= b[0].config.sortList;!1!==a&&!b[0].isProcessing&&h.length?b.trigger("sorton",[h,function(){J(b,c)},!0]):(J(b,c),f.applyWidget(b[0],!1))}function K(b){var a=b.config,c=a.$table;c.unbind("sortReset update updateRows updateCell updateAll addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(a.namespace+" ")).bind("sortReset"+a.namespace,function(c,e){c.stopPropagation();a.sortList=[];G(b);I(b);y(b);g.isFunction(e)&& e(b)}).bind("updateAll"+a.namespace,function(c,e,d){c.stopPropagation();b.isUpdating=!0;f.refreshWidgets(b,!0,!0);f.restoreHeaders(b);D(b);f.bindEvents(b,a.$headers,!0);K(b);E(b,e,d)}).bind("update"+a.namespace+" updateRows"+a.namespace,function(a,c,d){a.stopPropagation();b.isUpdating=!0;B(b);E(b,c,d)}).bind("updateCell"+a.namespace,function(h,e,d,f){h.stopPropagation();b.isUpdating=!0;c.find(a.selectorRemove).remove();var l,m;l=c.find("tbody");m=g(e);h=l.index(g.fn.closest?m.closest("tbody"):m.parents("tbody").filter(":first")); var n=g.fn.closest?m.closest("tr"):m.parents("tr").filter(":first");e=m[0];l.length&&0<=h&&(l=l.eq(h).find("tr").index(n),m=m.index(),a.cache[h].normalized[l][a.columns].$row=n,e=a.cache[h].normalized[l][m]=a.parsers[m].format(p(b,e,m),b,e,m),"numeric"===(a.parsers[m].type||"").toLowerCase()&&(a.cache[h].colMax[m]=Math.max(Math.abs(e)||0,a.cache[h].colMax[m]||0)),H(c,d,f))}).bind("addRows"+a.namespace,function(h,e,d,f){h.stopPropagation();b.isUpdating=!0;if(n(a.cache))B(b),E(b,d,f);else{e=g(e);var l, m,u,x,w=e.filter("tr").length,q=c.find("tbody").index(e.parents("tbody").filter(":first"));a.parsers&&a.parsers.length||s(b);for(h=0;h<w;h++){m=e[h].cells.length;x=[];u={child:[],$row:e.eq(h),order:a.cache[q].normalized.length};for(l=0;l<m;l++)x[l]=a.parsers[l].format(p(b,e[h].cells[l],l),b,e[h].cells[l],l),"numeric"===(a.parsers[l].type||"").toLowerCase()&&(a.cache[q].colMax[l]=Math.max(Math.abs(x[l])||0,a.cache[q].colMax[l]||0));x.push(u);a.cache[q].normalized.push(x)}H(c,d,f)}}).bind("updateComplete"+ a.namespace,function(){b.isUpdating=!1}).bind("sorton"+a.namespace,function(a,e,d,k){var l=b.config;a.stopPropagation();c.trigger("sortStart",this);M(b,e,!0);G(b);l.delayInit&&n(l.cache)&&x(b);c.trigger("sortBegin",this);I(b);y(b,k);c.trigger("sortEnd",this);f.applyWidget(b);g.isFunction(d)&&d(b)}).bind("appendCache"+a.namespace,function(a,c,d){a.stopPropagation();y(b,d);g.isFunction(c)&&c(b)}).bind("updateCache"+a.namespace,function(c,e){a.parsers&&a.parsers.length||s(b);x(b);g.isFunction(e)&&e(b)}).bind("applyWidgetId"+ a.namespace,function(c,e){c.stopPropagation();f.getWidgetById(e).format(b,a,a.widgetOptions)}).bind("applyWidgets"+a.namespace,function(a,c){a.stopPropagation();f.applyWidget(b,c)}).bind("refreshWidgets"+a.namespace,function(a,c,d){a.stopPropagation();f.refreshWidgets(b,c,d)}).bind("destroy"+a.namespace,function(a,c,d){a.stopPropagation();f.destroy(b,c,d)})}var f=this;f.version="2.16.4";f.parsers=[];f.widgets=[];f.defaults={theme:"default",widthFixed:!1,showProcessing:!1,headerTemplate:"{content}", onRenderTemplate:null,onRenderHeader:null,cancelSelection:!0,tabIndex:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:!0,delayInit:!1,serverSideSorting:!1,headers:{},ignoreCase:!0,sortForce:null,sortList:[],sortAppend:null,sortStable:!1,sortInitialOrder:"asc",sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",textExtraction:"basic",textAttribute:"data-text",textSorter:null,numberSorter:null,widgets:[],widgetOptions:{zebra:["even", "odd"]},initWidgets:!0,initialized:null,tableClass:"",cssAsc:"",cssDesc:"",cssNone:"",cssHeader:"",cssHeaderRow:"",cssProcessing:"",cssChildRow:"tablesorter-childRow",cssIcon:"tablesorter-icon",cssInfoBlock:"tablesorter-infoOnly",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};f.css={table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",header:"tablesorter-header", headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",info:"tablesorter-infoOnly",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"};f.language={sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"}; f.log=d;f.benchmark=u;f.construct=function(b){return this.each(function(){var a=g.extend(!0,{},f.defaults,b);!this.hasInitialized&&f.buildTable&&"TABLE"!==this.tagName?f.buildTable(this,a):f.setup(this,a)})};f.setup=function(b,a){if(!b||!b.tHead||0===b.tBodies.length||!0===b.hasInitialized)return a.debug?d("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var c="",h=g(b),e=g.metadata;b.hasInitialized=!1;b.isProcessing=!0;b.config=a;g.data(b,"tablesorter", a);a.debug&&g.data(b,"startoveralltimer",new Date);a.supportsDataObject=function(a){a[0]=parseInt(a[0],10);return 1<a[0]||1===a[0]&&4<=parseInt(a[1],10)}(g.fn.jquery.split("."));a.string={max:1,min:-1,emptyMin:1,emptyMax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1};/tablesorter\-/.test(h.attr("class"))||(c=""!==a.theme?" tablesorter-"+a.theme:"");a.$table=h.addClass(f.css.table+" "+a.tableClass+c).attr({role:"grid"});a.namespace=a.namespace?"."+a.namespace.replace(/\W/g,""):".tablesorter"+Math.random().toString(16).slice(2); a.$tbodies=h.children("tbody:not(."+a.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"});a.$table.find("caption").length&&a.$table.attr("aria-labelledby","theCaption");a.widgetInit={};a.textExtraction=a.$table.attr("data-text-extraction")||a.textExtraction||"basic";D(b);L(b);s(b);a.delayInit||x(b);f.bindEvents(b,a.$headers,!0);K(b);a.supportsDataObject&&"undefined"!==typeof h.data().sortlist?a.sortList=h.data().sortlist:e&&h.metadata()&&h.metadata().sortlist&&(a.sortList=h.metadata().sortlist); f.applyWidget(b,!0);0<a.sortList.length?h.trigger("sorton",[a.sortList,{},!a.initWidgets,!0]):(G(b),a.initWidgets&&f.applyWidget(b,!1));a.showProcessing&&h.unbind("sortBegin"+a.namespace+" sortEnd"+a.namespace).bind("sortBegin"+a.namespace+" sortEnd"+a.namespace,function(c){clearTimeout(a.processTimer);f.isProcessing(b);"sortBegin"===c.type&&(a.processTimer=setTimeout(function(){f.isProcessing(b,!0)},500))});b.hasInitialized=!0;b.isProcessing=!1;a.debug&&f.benchmark("Overall initialization time", g.data(b,"startoveralltimer"));h.trigger("tablesorter-initialized",b);"function"===typeof a.initialized&&a.initialized(b)};f.computeColumnIndex=function(b){var a=[],c=0,h,e,d,f,l,m,n,u,p,q;for(h=0;h<b.length;h++)for(l=b[h].cells,e=0;e<l.length;e++){d=l[e];f=g(d);m=d.parentNode.rowIndex;f.index();n=d.rowSpan||1;u=d.colSpan||1;"undefined"===typeof a[m]&&(a[m]=[]);for(d=0;d<a[m].length+1;d++)if("undefined"===typeof a[m][d]){p=d;break}c=Math.max(p,c);f.attr({"data-column":p});for(d=m;d<m+n;d++)for("undefined"=== typeof a[d]&&(a[d]=[]),q=a[d],f=p;f<p+u;f++)q[f]="x"}return c+1};f.isProcessing=function(b,a,c){b=g(b);var d=b[0].config;b=c||b.find("."+f.css.header);a?("undefined"!==typeof c&&0<d.sortList.length&&(b=b.filter(function(){return this.sortDisabled?!1:0<=f.isValueInArray(parseFloat(g(this).attr("data-column")),d.sortList)})),b.addClass(f.css.processing+" "+d.cssProcessing)):b.removeClass(f.css.processing+" "+d.cssProcessing)};f.processTbody=function(b,a,c){b=g(b)[0];if(c)return b.isProcessing=!0,a.before('<span class="tablesorter-savemyplace"/>'), c=g.fn.detach?a.detach():a.remove();c=g(b).find("span.tablesorter-savemyplace");a.insertAfter(c);c.remove();b.isProcessing=!1};f.clearTableBody=function(b){g(b)[0].config.$tbodies.empty()};f.bindEvents=function(b,a,c){b=g(b)[0];var d,e=b.config;!0!==c&&(e.$extraHeaders=e.$extraHeaders?e.$extraHeaders.add(a):a);a.find(e.selectorSort).add(a.filter(e.selectorSort)).unbind(["mousedown","mouseup","sort","keyup",""].join(e.namespace+" ")).bind(["mousedown","mouseup","sort","keyup",""].join(e.namespace+ " "),function(c,f){var l;l=c.type;if(!(1!==(c.which||c.button)&&!/sort|keyup/.test(l)||"keyup"===l&&13!==c.which||"mouseup"===l&&!0!==f&&250<(new Date).getTime()-d)){if("mousedown"===l)return d=(new Date).getTime(),"INPUT"===c.target.tagName?"":!e.cancelSelection;e.delayInit&&n(e.cache)&&x(b);l=g.fn.closest?g(this).closest("th, td")[0]:/TH|TD/.test(this.tagName)?this:g(this).parents("th, td")[0];l=e.$headers[a.index(l)];l.sortDisabled||O(b,l,c)}});e.cancelSelection&&a.attr("unselectable","on").bind("selectstart", !1).css({"user-select":"none",MozUserSelect:"none"})};f.restoreHeaders=function(b){var a=g(b)[0].config;a.$table.find(a.selectorHeaders).each(function(b){g(this).find("."+f.css.headerIn).length&&g(this).html(a.headerContent[b])})};f.destroy=function(b,a,c){b=g(b)[0];if(b.hasInitialized){f.refreshWidgets(b,!0,!0);var d=g(b),e=b.config,t=d.find("thead:first"),k=t.find("tr."+f.css.headerRow).removeClass(f.css.headerRow+" "+e.cssHeaderRow),l=d.find("tfoot:first > tr").children("th, td");!1===a&&0<=g.inArray("uitheme", e.widgets)&&(d.trigger("applyWidgetId",["uitheme"]),d.trigger("applyWidgetId",["zebra"]));t.find("tr").not(k).remove();d.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd ".split(" ").join(e.namespace+" "));e.$headers.add(l).removeClass([f.css.header,e.cssHeader,e.cssAsc,e.cssDesc,f.css.sortAsc,f.css.sortDesc,f.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled", "true");k.find(e.selectorSort).unbind(["mousedown","mouseup","keypress",""].join(e.namespace+" "));f.restoreHeaders(b);d.toggleClass(f.css.table+" "+e.tableClass+" tablesorter-"+e.theme,!1===a);b.hasInitialized=!1;delete b.config.cache;"function"===typeof c&&c(b)}};f.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i};f.sortNatural=function(b,a){if(b===a)return 0;var c,d,e,g,k,l;d=f.regex;if(d.hex.test(a)){c=parseInt(b.match(d.hex), 16);e=parseInt(a.match(d.hex),16);if(c<e)return-1;if(c>e)return 1}c=b.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0");d=a.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0");l=Math.max(c.length,d.length);for(k=0;k<l;k++){e=isNaN(c[k])?c[k]||0:parseFloat(c[k])||0;g=isNaN(d[k])?d[k]||0:parseFloat(d[k])||0;if(isNaN(e)!==isNaN(g))return isNaN(e)?1:-1;typeof e!==typeof g&&(e+="",g+="");if(e<g)return-1;if(e>g)return 1}return 0};f.sortNaturalAsc=function(b,a,c,d,e){if(b===a)return 0; c=e.string[e.empties[c]||e.emptyTo];return""===b&&0!==c?"boolean"===typeof c?c?-1:1:-c||-1:""===a&&0!==c?"boolean"===typeof c?c?1:-1:c||1:f.sortNatural(b,a)};f.sortNaturalDesc=function(b,a,c,d,e){if(b===a)return 0;c=e.string[e.empties[c]||e.emptyTo];return""===b&&0!==c?"boolean"===typeof c?c?-1:1:c||1:""===a&&0!==c?"boolean"===typeof c?c?1:-1:-c||-1:f.sortNatural(a,b)};f.sortText=function(b,a){return b>a?1:b<a?-1:0};f.getTextValue=function(b,a,c){if(c){var d=b?b.length:0,e=c+a;for(c=0;c<d;c++)e+= b.charCodeAt(c);return a*e}return 0};f.sortNumericAsc=function(b,a,c,d,e,g){if(b===a)return 0;g=g.config;e=g.string[g.empties[e]||g.emptyTo];if(""===b&&0!==e)return"boolean"===typeof e?e?-1:1:-e||-1;if(""===a&&0!==e)return"boolean"===typeof e?e?1:-1:e||1;isNaN(b)&&(b=f.getTextValue(b,c,d));isNaN(a)&&(a=f.getTextValue(a,c,d));return b-a};f.sortNumericDesc=function(b,a,c,d,e,g){if(b===a)return 0;g=g.config;e=g.string[g.empties[e]||g.emptyTo];if(""===b&&0!==e)return"boolean"===typeof e?e?-1:1:e||1;if(""=== a&&0!==e)return"boolean"===typeof e?e?1:-1:-e||-1;isNaN(b)&&(b=f.getTextValue(b,c,d));isNaN(a)&&(a=f.getTextValue(a,c,d));return a-b};f.sortNumeric=function(b,a){return b-a};f.characterEquivalents={a:"\u00e1\u00e0\u00e2\u00e3\u00e4\u0105\u00e5",A:"\u00c1\u00c0\u00c2\u00c3\u00c4\u0104\u00c5",c:"\u00e7\u0107\u010d",C:"\u00c7\u0106\u010c",e:"\u00e9\u00e8\u00ea\u00eb\u011b\u0119",E:"\u00c9\u00c8\u00ca\u00cb\u011a\u0118",i:"\u00ed\u00ec\u0130\u00ee\u00ef\u0131",I:"\u00cd\u00cc\u0130\u00ce\u00cf",o:"\u00f3\u00f2\u00f4\u00f5\u00f6", O:"\u00d3\u00d2\u00d4\u00d5\u00d6",ss:"\u00df",SS:"\u1e9e",u:"\u00fa\u00f9\u00fb\u00fc\u016f",U:"\u00da\u00d9\u00db\u00dc\u016e"};f.replaceAccents=function(b){var a,c="[",d=f.characterEquivalents;if(!f.characterRegex){f.characterRegexArray={};for(a in d)"string"===typeof a&&(c+=d[a],f.characterRegexArray[a]=RegExp("["+d[a]+"]","g"));f.characterRegex=RegExp(c+"]")}if(f.characterRegex.test(b))for(a in d)"string"===typeof a&&(b=b.replace(f.characterRegexArray[a],a));return b};f.isValueInArray=function(b, a){var c,d=a.length;for(c=0;c<d;c++)if(a[c][0]===b)return c;return-1};f.addParser=function(b){var a,c=f.parsers.length,d=!0;for(a=0;a<c;a++)f.parsers[a].id.toLowerCase()===b.id.toLowerCase()&&(d=!1);d&&f.parsers.push(b)};f.getParserById=function(b){var a,c=f.parsers.length;for(a=0;a<c;a++)if(f.parsers[a].id.toLowerCase()===b.toString().toLowerCase())return f.parsers[a];return!1};f.addWidget=function(b){f.widgets.push(b)};f.getWidgetById=function(b){var a,c,d=f.widgets.length;for(a=0;a<d;a++)if((c= f.widgets[a])&&c.hasOwnProperty("id")&&c.id.toLowerCase()===b.toLowerCase())return c};f.applyWidget=function(b,a){b=g(b)[0];var c=b.config,d=c.widgetOptions,e=[],n,k,l;!1!==a&&b.hasInitialized&&(b.isApplyingWidgets||b.isUpdating)||(c.debug&&(n=new Date),c.widgets.length&&(b.isApplyingWidgets=!0,c.widgets=g.grep(c.widgets,function(a,b){return g.inArray(a,c.widgets)===b}),g.each(c.widgets||[],function(a,b){(l=f.getWidgetById(b))&&l.id&&(l.priority||(l.priority=10),e[a]=l)}),e.sort(function(a,b){return a.priority< b.priority?-1:a.priority===b.priority?0:1}),g.each(e,function(e,f){if(f){if(a||!c.widgetInit[f.id])f.hasOwnProperty("options")&&(d=b.config.widgetOptions=g.extend(!0,{},f.options,d)),f.hasOwnProperty("init")&&f.init(b,f,c,d),c.widgetInit[f.id]=!0;!a&&f.hasOwnProperty("format")&&f.format(b,c,d,!1)}})),setTimeout(function(){b.isApplyingWidgets=!1},0),c.debug&&(k=c.widgets.length,u("Completed "+(!0===a?"initializing ":"applying ")+k+" widget"+(1!==k?"s":""),n)))};f.refreshWidgets=function(b,a,c){b=g(b)[0]; var h,e=b.config,n=e.widgets,k=f.widgets,l=k.length;for(h=0;h<l;h++)k[h]&&k[h].id&&(a||0>g.inArray(k[h].id,n))&&(e.debug&&d('Refeshing widgets: Removing "'+k[h].id+'"'),k[h].hasOwnProperty("remove")&&e.widgetInit[k[h].id]&&(k[h].remove(b,e,e.widgetOptions),e.widgetInit[k[h].id]=!1));!0!==c&&f.applyWidget(b,a)};f.getData=function(b,a,c){var d="";b=g(b);var e,f;if(!b.length)return"";e=g.metadata?b.metadata():!1;f=" "+(b.attr("class")||"");"undefined"!==typeof b.data(c)||"undefined"!==typeof b.data(c.toLowerCase())? d+=b.data(c)||b.data(c.toLowerCase()):e&&"undefined"!==typeof e[c]?d+=e[c]:a&&"undefined"!==typeof a[c]?d+=a[c]:" "!==f&&f.match(" "+c+"-")&&(d=f.match(RegExp("\\s"+c+"-([\\w-]+)"))[1]||"");return g.trim(d)};f.formatFloat=function(b,a){if("string"!==typeof b||""===b)return b;var c;b=(a&&a.config?!1!==a.config.usNumberFormat:"undefined"!==typeof a?a:1)?b.replace(/,/g,""):b.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(b)&&(b=b.replace(/^\s*\(([.\d]+)\)/,"-$1"));c=parseFloat(b);return isNaN(c)? g.trim(b):c};f.isDigit=function(b){return isNaN(b)?/^[\-+(]?\d+[)]?$/.test(b.toString().replace(/[,.'"\s]/g,"")):!0}}});var p=g.tablesorter;g.fn.extend({tablesorter:p.construct});p.addParser({id:"text",is:function(){return!0},format:function(d,u){var n=u.config;d&&(d=g.trim(n.ignoreCase?d.toLocaleLowerCase():d),d=n.sortLocaleCompare?p.replaceAccents(d):d);return d},type:"text"});p.addParser({id:"digit",is:function(d){return p.isDigit(d)},format:function(d,u){var n=p.formatFloat((d||"").replace(/[^\w,. \-()]/g, ""),u);return d&&"number"===typeof n?n:d?g.trim(d&&u.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});p.addParser({id:"currency",is:function(d){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((d||"").replace(/[+\-,. ]/g,""))},format:function(d,u){var n=p.formatFloat((d||"").replace(/[^\w,. \-()]/g,""),u);return d&&"number"===typeof n?n:d?g.trim(d&&u.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});p.addParser({id:"ipAddress", is:function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},format:function(d,g){var n,v=d?d.split("."):"",s="",x=v.length;for(n=0;n<x;n++)s+=("00"+v[n]).slice(-3);return d?p.formatFloat(s,g):d},type:"numeric"});p.addParser({id:"url",is:function(d){return/^(https?|ftp|file):\/\//.test(d)},format:function(d){return d?g.trim(d.replace(/(https?|ftp|file):\/\//,"")):d},type:"text"});p.addParser({id:"isoDate",is:function(d){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/.test(d)},format:function(d, g){return d?p.formatFloat(""!==d?(new Date(d.replace(/-/g,"/"))).getTime()||d:"",g):d},type:"numeric"});p.addParser({id:"percent",is:function(d){return/(\d\s*?%|%\s*?\d)/.test(d)&&15>d.length},format:function(d,g){return d?p.formatFloat(d.replace(/%/g,""),g):d},type:"numeric"});p.addParser({id:"usLongDate",is:function(d){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(d)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(d)},format:function(d,g){return d?p.formatFloat((new Date(d.replace(/(\S)([AP]M)$/i, "$1 $2"))).getTime()||d,g):d},type:"numeric"});p.addParser({id:"shortDate",is:function(d){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((d||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(d,g,n,v){if(d){n=g.config;var s=n.$headers.filter("[data-column="+v+"]:last");v=s.length&&s[0].dateFormat||p.getData(s,n.headers[v],"dateFormat")||n.dateFormat;d=d.replace(/\s+/g," ").replace(/[\-.,]/g,"/");"mmddyyyy"===v?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/, "$3/$1/$2"):"ddmmyyyy"===v?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===v&&(d=d.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3"))}return d?p.formatFloat((new Date(d)).getTime()||d,g):d},type:"numeric"});p.addParser({id:"time",is:function(d){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(d)},format:function(d,g){return d?p.formatFloat((new Date("2000/01/01 "+d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||d,g):d},type:"numeric"});p.addParser({id:"metadata", is:function(){return!1},format:function(d,p,n){d=p.config;d=d.parserMetadataName?d.parserMetadataName:"sortValue";return g(n).metadata()[d]},type:"numeric"});p.addWidget({id:"zebra",priority:90,format:function(d,u,n){var v,s,x,y,C,D,E=RegExp(u.cssChildRow,"i"),B=u.$tbodies;u.debug&&(C=new Date);for(d=0;d<B.length;d++)v=B.eq(d),D=v.children("tr").length,1<D&&(x=0,v=v.children("tr:visible").not(u.selectorRemove),v.each(function(){s=g(this);E.test(this.className)||x++;y=0===x%2;s.removeClass(n.zebra[y? 1:0]).addClass(n.zebra[y?0:1])}));u.debug&&p.benchmark("Applying Zebra widget",C)},remove:function(d,p,n){var v;p=p.$tbodies;var s=(n.zebra||["even","odd"]).join(" ");for(n=0;n<p.length;n++)v=g.tablesorter.processTbody(d,p.eq(n),!0),v.children().removeClass(s),g.tablesorter.processTbody(d,v,!1)}})}(jQuery);
|
@@ -0,0 +1,1943 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: alert.js v3.1.1
|
3
|
+
* http://getbootstrap.com/javascript/#alerts
|
4
|
+
* ========================================================================
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
|
+
* ======================================================================== */
|
8
|
+
|
9
|
+
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
12
|
+
|
13
|
+
// ALERT CLASS DEFINITION
|
14
|
+
// ======================
|
15
|
+
|
16
|
+
var dismiss = '[data-dismiss="alert"]'
|
17
|
+
var Alert = function (el) {
|
18
|
+
$(el).on('click', dismiss, this.close)
|
19
|
+
}
|
20
|
+
|
21
|
+
Alert.prototype.close = function (e) {
|
22
|
+
var $this = $(this)
|
23
|
+
var selector = $this.attr('data-target')
|
24
|
+
|
25
|
+
if (!selector) {
|
26
|
+
selector = $this.attr('href')
|
27
|
+
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
28
|
+
}
|
29
|
+
|
30
|
+
var $parent = $(selector)
|
31
|
+
|
32
|
+
if (e) e.preventDefault()
|
33
|
+
|
34
|
+
if (!$parent.length) {
|
35
|
+
$parent = $this.hasClass('alert') ? $this : $this.parent()
|
36
|
+
}
|
37
|
+
|
38
|
+
$parent.trigger(e = $.Event('close.bs.alert'))
|
39
|
+
|
40
|
+
if (e.isDefaultPrevented()) return
|
41
|
+
|
42
|
+
$parent.removeClass('in')
|
43
|
+
|
44
|
+
function removeElement() {
|
45
|
+
$parent.trigger('closed.bs.alert').remove()
|
46
|
+
}
|
47
|
+
|
48
|
+
$.support.transition && $parent.hasClass('fade') ?
|
49
|
+
$parent
|
50
|
+
.one($.support.transition.end, removeElement)
|
51
|
+
.emulateTransitionEnd(150) :
|
52
|
+
removeElement()
|
53
|
+
}
|
54
|
+
|
55
|
+
|
56
|
+
// ALERT PLUGIN DEFINITION
|
57
|
+
// =======================
|
58
|
+
|
59
|
+
var old = $.fn.alert
|
60
|
+
|
61
|
+
$.fn.alert = function (option) {
|
62
|
+
return this.each(function () {
|
63
|
+
var $this = $(this)
|
64
|
+
var data = $this.data('bs.alert')
|
65
|
+
|
66
|
+
if (!data) $this.data('bs.alert', (data = new Alert(this)))
|
67
|
+
if (typeof option == 'string') data[option].call($this)
|
68
|
+
})
|
69
|
+
}
|
70
|
+
|
71
|
+
$.fn.alert.Constructor = Alert
|
72
|
+
|
73
|
+
|
74
|
+
// ALERT NO CONFLICT
|
75
|
+
// =================
|
76
|
+
|
77
|
+
$.fn.alert.noConflict = function () {
|
78
|
+
$.fn.alert = old
|
79
|
+
return this
|
80
|
+
}
|
81
|
+
|
82
|
+
|
83
|
+
// ALERT DATA-API
|
84
|
+
// ==============
|
85
|
+
|
86
|
+
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
|
87
|
+
|
88
|
+
}(jQuery);
|
89
|
+
|
90
|
+
/* ========================================================================
|
91
|
+
* Bootstrap: button.js v3.1.1
|
92
|
+
* http://getbootstrap.com/javascript/#buttons
|
93
|
+
* ========================================================================
|
94
|
+
* Copyright 2011-2014 Twitter, Inc.
|
95
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
96
|
+
* ======================================================================== */
|
97
|
+
|
98
|
+
|
99
|
+
+function ($) {
|
100
|
+
'use strict';
|
101
|
+
|
102
|
+
// BUTTON PUBLIC CLASS DEFINITION
|
103
|
+
// ==============================
|
104
|
+
|
105
|
+
var Button = function (element, options) {
|
106
|
+
this.$element = $(element)
|
107
|
+
this.options = $.extend({}, Button.DEFAULTS, options)
|
108
|
+
this.isLoading = false
|
109
|
+
}
|
110
|
+
|
111
|
+
Button.DEFAULTS = {
|
112
|
+
loadingText: 'loading...'
|
113
|
+
}
|
114
|
+
|
115
|
+
Button.prototype.setState = function (state) {
|
116
|
+
var d = 'disabled'
|
117
|
+
var $el = this.$element
|
118
|
+
var val = $el.is('input') ? 'val' : 'html'
|
119
|
+
var data = $el.data()
|
120
|
+
|
121
|
+
state = state + 'Text'
|
122
|
+
|
123
|
+
if (!data.resetText) $el.data('resetText', $el[val]())
|
124
|
+
|
125
|
+
$el[val](data[state] || this.options[state])
|
126
|
+
|
127
|
+
// push to event loop to allow forms to submit
|
128
|
+
setTimeout($.proxy(function () {
|
129
|
+
if (state == 'loadingText') {
|
130
|
+
this.isLoading = true
|
131
|
+
$el.addClass(d).attr(d, d)
|
132
|
+
} else if (this.isLoading) {
|
133
|
+
this.isLoading = false
|
134
|
+
$el.removeClass(d).removeAttr(d)
|
135
|
+
}
|
136
|
+
}, this), 0)
|
137
|
+
}
|
138
|
+
|
139
|
+
Button.prototype.toggle = function () {
|
140
|
+
var changed = true
|
141
|
+
var $parent = this.$element.closest('[data-toggle="buttons"]')
|
142
|
+
|
143
|
+
if ($parent.length) {
|
144
|
+
var $input = this.$element.find('input')
|
145
|
+
if ($input.prop('type') == 'radio') {
|
146
|
+
if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
|
147
|
+
else $parent.find('.active').removeClass('active')
|
148
|
+
}
|
149
|
+
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
|
150
|
+
}
|
151
|
+
|
152
|
+
if (changed) this.$element.toggleClass('active')
|
153
|
+
}
|
154
|
+
|
155
|
+
|
156
|
+
// BUTTON PLUGIN DEFINITION
|
157
|
+
// ========================
|
158
|
+
|
159
|
+
var old = $.fn.button
|
160
|
+
|
161
|
+
$.fn.button = function (option) {
|
162
|
+
return this.each(function () {
|
163
|
+
var $this = $(this)
|
164
|
+
var data = $this.data('bs.button')
|
165
|
+
var options = typeof option == 'object' && option
|
166
|
+
|
167
|
+
if (!data) $this.data('bs.button', (data = new Button(this, options)))
|
168
|
+
|
169
|
+
if (option == 'toggle') data.toggle()
|
170
|
+
else if (option) data.setState(option)
|
171
|
+
})
|
172
|
+
}
|
173
|
+
|
174
|
+
$.fn.button.Constructor = Button
|
175
|
+
|
176
|
+
|
177
|
+
// BUTTON NO CONFLICT
|
178
|
+
// ==================
|
179
|
+
|
180
|
+
$.fn.button.noConflict = function () {
|
181
|
+
$.fn.button = old
|
182
|
+
return this
|
183
|
+
}
|
184
|
+
|
185
|
+
|
186
|
+
// BUTTON DATA-API
|
187
|
+
// ===============
|
188
|
+
|
189
|
+
$(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
|
190
|
+
var $btn = $(e.target)
|
191
|
+
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
192
|
+
$btn.button('toggle')
|
193
|
+
e.preventDefault()
|
194
|
+
})
|
195
|
+
|
196
|
+
}(jQuery);
|
197
|
+
|
198
|
+
/* ========================================================================
|
199
|
+
* Bootstrap: carousel.js v3.1.1
|
200
|
+
* http://getbootstrap.com/javascript/#carousel
|
201
|
+
* ========================================================================
|
202
|
+
* Copyright 2011-2014 Twitter, Inc.
|
203
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
204
|
+
* ======================================================================== */
|
205
|
+
|
206
|
+
|
207
|
+
+function ($) {
|
208
|
+
'use strict';
|
209
|
+
|
210
|
+
// CAROUSEL CLASS DEFINITION
|
211
|
+
// =========================
|
212
|
+
|
213
|
+
var Carousel = function (element, options) {
|
214
|
+
this.$element = $(element)
|
215
|
+
this.$indicators = this.$element.find('.carousel-indicators')
|
216
|
+
this.options = options
|
217
|
+
this.paused =
|
218
|
+
this.sliding =
|
219
|
+
this.interval =
|
220
|
+
this.$active =
|
221
|
+
this.$items = null
|
222
|
+
|
223
|
+
this.options.pause == 'hover' && this.$element
|
224
|
+
.on('mouseenter', $.proxy(this.pause, this))
|
225
|
+
.on('mouseleave', $.proxy(this.cycle, this))
|
226
|
+
}
|
227
|
+
|
228
|
+
Carousel.DEFAULTS = {
|
229
|
+
interval: 5000,
|
230
|
+
pause: 'hover',
|
231
|
+
wrap: true
|
232
|
+
}
|
233
|
+
|
234
|
+
Carousel.prototype.cycle = function (e) {
|
235
|
+
e || (this.paused = false)
|
236
|
+
|
237
|
+
this.interval && clearInterval(this.interval)
|
238
|
+
|
239
|
+
this.options.interval
|
240
|
+
&& !this.paused
|
241
|
+
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
242
|
+
|
243
|
+
return this
|
244
|
+
}
|
245
|
+
|
246
|
+
Carousel.prototype.getActiveIndex = function () {
|
247
|
+
this.$active = this.$element.find('.item.active')
|
248
|
+
this.$items = this.$active.parent().children()
|
249
|
+
|
250
|
+
return this.$items.index(this.$active)
|
251
|
+
}
|
252
|
+
|
253
|
+
Carousel.prototype.to = function (pos) {
|
254
|
+
var that = this
|
255
|
+
var activeIndex = this.getActiveIndex()
|
256
|
+
|
257
|
+
if (pos > (this.$items.length - 1) || pos < 0) return
|
258
|
+
|
259
|
+
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
|
260
|
+
if (activeIndex == pos) return this.pause().cycle()
|
261
|
+
|
262
|
+
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
263
|
+
}
|
264
|
+
|
265
|
+
Carousel.prototype.pause = function (e) {
|
266
|
+
e || (this.paused = true)
|
267
|
+
|
268
|
+
if (this.$element.find('.next, .prev').length && $.support.transition) {
|
269
|
+
this.$element.trigger($.support.transition.end)
|
270
|
+
this.cycle(true)
|
271
|
+
}
|
272
|
+
|
273
|
+
this.interval = clearInterval(this.interval)
|
274
|
+
|
275
|
+
return this
|
276
|
+
}
|
277
|
+
|
278
|
+
Carousel.prototype.next = function () {
|
279
|
+
if (this.sliding) return
|
280
|
+
return this.slide('next')
|
281
|
+
}
|
282
|
+
|
283
|
+
Carousel.prototype.prev = function () {
|
284
|
+
if (this.sliding) return
|
285
|
+
return this.slide('prev')
|
286
|
+
}
|
287
|
+
|
288
|
+
Carousel.prototype.slide = function (type, next) {
|
289
|
+
var $active = this.$element.find('.item.active')
|
290
|
+
var $next = next || $active[type]()
|
291
|
+
var isCycling = this.interval
|
292
|
+
var direction = type == 'next' ? 'left' : 'right'
|
293
|
+
var fallback = type == 'next' ? 'first' : 'last'
|
294
|
+
var that = this
|
295
|
+
|
296
|
+
if (!$next.length) {
|
297
|
+
if (!this.options.wrap) return
|
298
|
+
$next = this.$element.find('.item')[fallback]()
|
299
|
+
}
|
300
|
+
|
301
|
+
if ($next.hasClass('active')) return this.sliding = false
|
302
|
+
|
303
|
+
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
|
304
|
+
this.$element.trigger(e)
|
305
|
+
if (e.isDefaultPrevented()) return
|
306
|
+
|
307
|
+
this.sliding = true
|
308
|
+
|
309
|
+
isCycling && this.pause()
|
310
|
+
|
311
|
+
if (this.$indicators.length) {
|
312
|
+
this.$indicators.find('.active').removeClass('active')
|
313
|
+
this.$element.one('slid.bs.carousel', function () {
|
314
|
+
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
|
315
|
+
$nextIndicator && $nextIndicator.addClass('active')
|
316
|
+
})
|
317
|
+
}
|
318
|
+
|
319
|
+
if ($.support.transition && this.$element.hasClass('slide')) {
|
320
|
+
$next.addClass(type)
|
321
|
+
$next[0].offsetWidth // force reflow
|
322
|
+
$active.addClass(direction)
|
323
|
+
$next.addClass(direction)
|
324
|
+
$active
|
325
|
+
.one($.support.transition.end, function () {
|
326
|
+
$next.removeClass([type, direction].join(' ')).addClass('active')
|
327
|
+
$active.removeClass(['active', direction].join(' '))
|
328
|
+
that.sliding = false
|
329
|
+
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
|
330
|
+
})
|
331
|
+
.emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
|
332
|
+
} else {
|
333
|
+
$active.removeClass('active')
|
334
|
+
$next.addClass('active')
|
335
|
+
this.sliding = false
|
336
|
+
this.$element.trigger('slid.bs.carousel')
|
337
|
+
}
|
338
|
+
|
339
|
+
isCycling && this.cycle()
|
340
|
+
|
341
|
+
return this
|
342
|
+
}
|
343
|
+
|
344
|
+
|
345
|
+
// CAROUSEL PLUGIN DEFINITION
|
346
|
+
// ==========================
|
347
|
+
|
348
|
+
var old = $.fn.carousel
|
349
|
+
|
350
|
+
$.fn.carousel = function (option) {
|
351
|
+
return this.each(function () {
|
352
|
+
var $this = $(this)
|
353
|
+
var data = $this.data('bs.carousel')
|
354
|
+
var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
355
|
+
var action = typeof option == 'string' ? option : options.slide
|
356
|
+
|
357
|
+
if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
|
358
|
+
if (typeof option == 'number') data.to(option)
|
359
|
+
else if (action) data[action]()
|
360
|
+
else if (options.interval) data.pause().cycle()
|
361
|
+
})
|
362
|
+
}
|
363
|
+
|
364
|
+
$.fn.carousel.Constructor = Carousel
|
365
|
+
|
366
|
+
|
367
|
+
// CAROUSEL NO CONFLICT
|
368
|
+
// ====================
|
369
|
+
|
370
|
+
$.fn.carousel.noConflict = function () {
|
371
|
+
$.fn.carousel = old
|
372
|
+
return this
|
373
|
+
}
|
374
|
+
|
375
|
+
|
376
|
+
// CAROUSEL DATA-API
|
377
|
+
// =================
|
378
|
+
|
379
|
+
$(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
|
380
|
+
var $this = $(this), href
|
381
|
+
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
382
|
+
var options = $.extend({}, $target.data(), $this.data())
|
383
|
+
var slideIndex = $this.attr('data-slide-to')
|
384
|
+
if (slideIndex) options.interval = false
|
385
|
+
|
386
|
+
$target.carousel(options)
|
387
|
+
|
388
|
+
if (slideIndex = $this.attr('data-slide-to')) {
|
389
|
+
$target.data('bs.carousel').to(slideIndex)
|
390
|
+
}
|
391
|
+
|
392
|
+
e.preventDefault()
|
393
|
+
})
|
394
|
+
|
395
|
+
$(window).on('load', function () {
|
396
|
+
$('[data-ride="carousel"]').each(function () {
|
397
|
+
var $carousel = $(this)
|
398
|
+
$carousel.carousel($carousel.data())
|
399
|
+
})
|
400
|
+
})
|
401
|
+
|
402
|
+
}(jQuery);
|
403
|
+
|
404
|
+
/* ========================================================================
|
405
|
+
* Bootstrap: dropdown.js v3.1.1
|
406
|
+
* http://getbootstrap.com/javascript/#dropdowns
|
407
|
+
* ========================================================================
|
408
|
+
* Copyright 2011-2014 Twitter, Inc.
|
409
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
410
|
+
* ======================================================================== */
|
411
|
+
|
412
|
+
|
413
|
+
+function ($) {
|
414
|
+
'use strict';
|
415
|
+
|
416
|
+
// DROPDOWN CLASS DEFINITION
|
417
|
+
// =========================
|
418
|
+
|
419
|
+
var backdrop = '.dropdown-backdrop'
|
420
|
+
var toggle = '[data-toggle=dropdown]'
|
421
|
+
var Dropdown = function (element) {
|
422
|
+
$(element).on('click.bs.dropdown', this.toggle)
|
423
|
+
}
|
424
|
+
|
425
|
+
Dropdown.prototype.toggle = function (e) {
|
426
|
+
var $this = $(this)
|
427
|
+
|
428
|
+
if ($this.is('.disabled, :disabled')) return
|
429
|
+
|
430
|
+
var $parent = getParent($this)
|
431
|
+
var isActive = $parent.hasClass('open')
|
432
|
+
|
433
|
+
clearMenus()
|
434
|
+
|
435
|
+
if (!isActive) {
|
436
|
+
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
|
437
|
+
// if mobile we use a backdrop because click events don't delegate
|
438
|
+
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
|
439
|
+
}
|
440
|
+
|
441
|
+
var relatedTarget = { relatedTarget: this }
|
442
|
+
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
|
443
|
+
|
444
|
+
if (e.isDefaultPrevented()) return
|
445
|
+
|
446
|
+
$parent
|
447
|
+
.toggleClass('open')
|
448
|
+
.trigger('shown.bs.dropdown', relatedTarget)
|
449
|
+
|
450
|
+
$this.focus()
|
451
|
+
}
|
452
|
+
|
453
|
+
return false
|
454
|
+
}
|
455
|
+
|
456
|
+
Dropdown.prototype.keydown = function (e) {
|
457
|
+
if (!/(38|40|27)/.test(e.keyCode)) return
|
458
|
+
|
459
|
+
var $this = $(this)
|
460
|
+
|
461
|
+
e.preventDefault()
|
462
|
+
e.stopPropagation()
|
463
|
+
|
464
|
+
if ($this.is('.disabled, :disabled')) return
|
465
|
+
|
466
|
+
var $parent = getParent($this)
|
467
|
+
var isActive = $parent.hasClass('open')
|
468
|
+
|
469
|
+
if (!isActive || (isActive && e.keyCode == 27)) {
|
470
|
+
if (e.which == 27) $parent.find(toggle).focus()
|
471
|
+
return $this.click()
|
472
|
+
}
|
473
|
+
|
474
|
+
var desc = ' li:not(.divider):visible a'
|
475
|
+
var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
|
476
|
+
|
477
|
+
if (!$items.length) return
|
478
|
+
|
479
|
+
var index = $items.index($items.filter(':focus'))
|
480
|
+
|
481
|
+
if (e.keyCode == 38 && index > 0) index-- // up
|
482
|
+
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
483
|
+
if (!~index) index = 0
|
484
|
+
|
485
|
+
$items.eq(index).focus()
|
486
|
+
}
|
487
|
+
|
488
|
+
function clearMenus(e) {
|
489
|
+
$(backdrop).remove()
|
490
|
+
$(toggle).each(function () {
|
491
|
+
var $parent = getParent($(this))
|
492
|
+
var relatedTarget = { relatedTarget: this }
|
493
|
+
if (!$parent.hasClass('open')) return
|
494
|
+
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
|
495
|
+
if (e.isDefaultPrevented()) return
|
496
|
+
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
|
497
|
+
})
|
498
|
+
}
|
499
|
+
|
500
|
+
function getParent($this) {
|
501
|
+
var selector = $this.attr('data-target')
|
502
|
+
|
503
|
+
if (!selector) {
|
504
|
+
selector = $this.attr('href')
|
505
|
+
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
506
|
+
}
|
507
|
+
|
508
|
+
var $parent = selector && $(selector)
|
509
|
+
|
510
|
+
return $parent && $parent.length ? $parent : $this.parent()
|
511
|
+
}
|
512
|
+
|
513
|
+
|
514
|
+
// DROPDOWN PLUGIN DEFINITION
|
515
|
+
// ==========================
|
516
|
+
|
517
|
+
var old = $.fn.dropdown
|
518
|
+
|
519
|
+
$.fn.dropdown = function (option) {
|
520
|
+
return this.each(function () {
|
521
|
+
var $this = $(this)
|
522
|
+
var data = $this.data('bs.dropdown')
|
523
|
+
|
524
|
+
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
|
525
|
+
if (typeof option == 'string') data[option].call($this)
|
526
|
+
})
|
527
|
+
}
|
528
|
+
|
529
|
+
$.fn.dropdown.Constructor = Dropdown
|
530
|
+
|
531
|
+
|
532
|
+
// DROPDOWN NO CONFLICT
|
533
|
+
// ====================
|
534
|
+
|
535
|
+
$.fn.dropdown.noConflict = function () {
|
536
|
+
$.fn.dropdown = old
|
537
|
+
return this
|
538
|
+
}
|
539
|
+
|
540
|
+
|
541
|
+
// APPLY TO STANDARD DROPDOWN ELEMENTS
|
542
|
+
// ===================================
|
543
|
+
|
544
|
+
$(document)
|
545
|
+
.on('click.bs.dropdown.data-api', clearMenus)
|
546
|
+
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
547
|
+
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
548
|
+
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)
|
549
|
+
|
550
|
+
}(jQuery);
|
551
|
+
|
552
|
+
/* ========================================================================
|
553
|
+
* Bootstrap: modal.js v3.1.1
|
554
|
+
* http://getbootstrap.com/javascript/#modals
|
555
|
+
* ========================================================================
|
556
|
+
* Copyright 2011-2014 Twitter, Inc.
|
557
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
558
|
+
* ======================================================================== */
|
559
|
+
|
560
|
+
|
561
|
+
+function ($) {
|
562
|
+
'use strict';
|
563
|
+
|
564
|
+
// MODAL CLASS DEFINITION
|
565
|
+
// ======================
|
566
|
+
|
567
|
+
var Modal = function (element, options) {
|
568
|
+
this.options = options
|
569
|
+
this.$element = $(element)
|
570
|
+
this.$backdrop =
|
571
|
+
this.isShown = null
|
572
|
+
|
573
|
+
if (this.options.remote) {
|
574
|
+
this.$element
|
575
|
+
.find('.modal-content')
|
576
|
+
.load(this.options.remote, $.proxy(function () {
|
577
|
+
this.$element.trigger('loaded.bs.modal')
|
578
|
+
}, this))
|
579
|
+
}
|
580
|
+
}
|
581
|
+
|
582
|
+
Modal.DEFAULTS = {
|
583
|
+
backdrop: true,
|
584
|
+
keyboard: true,
|
585
|
+
show: true
|
586
|
+
}
|
587
|
+
|
588
|
+
Modal.prototype.toggle = function (_relatedTarget) {
|
589
|
+
return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
|
590
|
+
}
|
591
|
+
|
592
|
+
Modal.prototype.show = function (_relatedTarget) {
|
593
|
+
var that = this
|
594
|
+
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
|
595
|
+
|
596
|
+
this.$element.trigger(e)
|
597
|
+
|
598
|
+
if (this.isShown || e.isDefaultPrevented()) return
|
599
|
+
|
600
|
+
this.isShown = true
|
601
|
+
|
602
|
+
this.escape()
|
603
|
+
|
604
|
+
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
605
|
+
|
606
|
+
this.backdrop(function () {
|
607
|
+
var transition = $.support.transition && that.$element.hasClass('fade')
|
608
|
+
|
609
|
+
if (!that.$element.parent().length) {
|
610
|
+
that.$element.appendTo(document.body) // don't move modals dom position
|
611
|
+
}
|
612
|
+
|
613
|
+
that.$element
|
614
|
+
.show()
|
615
|
+
.scrollTop(0)
|
616
|
+
|
617
|
+
if (transition) {
|
618
|
+
that.$element[0].offsetWidth // force reflow
|
619
|
+
}
|
620
|
+
|
621
|
+
that.$element
|
622
|
+
.addClass('in')
|
623
|
+
.attr('aria-hidden', false)
|
624
|
+
|
625
|
+
that.enforceFocus()
|
626
|
+
|
627
|
+
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
|
628
|
+
|
629
|
+
transition ?
|
630
|
+
that.$element.find('.modal-dialog') // wait for modal to slide in
|
631
|
+
.one($.support.transition.end, function () {
|
632
|
+
that.$element.focus().trigger(e)
|
633
|
+
})
|
634
|
+
.emulateTransitionEnd(300) :
|
635
|
+
that.$element.focus().trigger(e)
|
636
|
+
})
|
637
|
+
}
|
638
|
+
|
639
|
+
Modal.prototype.hide = function (e) {
|
640
|
+
if (e) e.preventDefault()
|
641
|
+
|
642
|
+
e = $.Event('hide.bs.modal')
|
643
|
+
|
644
|
+
this.$element.trigger(e)
|
645
|
+
|
646
|
+
if (!this.isShown || e.isDefaultPrevented()) return
|
647
|
+
|
648
|
+
this.isShown = false
|
649
|
+
|
650
|
+
this.escape()
|
651
|
+
|
652
|
+
$(document).off('focusin.bs.modal')
|
653
|
+
|
654
|
+
this.$element
|
655
|
+
.removeClass('in')
|
656
|
+
.attr('aria-hidden', true)
|
657
|
+
.off('click.dismiss.bs.modal')
|
658
|
+
|
659
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
660
|
+
this.$element
|
661
|
+
.one($.support.transition.end, $.proxy(this.hideModal, this))
|
662
|
+
.emulateTransitionEnd(300) :
|
663
|
+
this.hideModal()
|
664
|
+
}
|
665
|
+
|
666
|
+
Modal.prototype.enforceFocus = function () {
|
667
|
+
$(document)
|
668
|
+
.off('focusin.bs.modal') // guard against infinite focus loop
|
669
|
+
.on('focusin.bs.modal', $.proxy(function (e) {
|
670
|
+
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
671
|
+
this.$element.focus()
|
672
|
+
}
|
673
|
+
}, this))
|
674
|
+
}
|
675
|
+
|
676
|
+
Modal.prototype.escape = function () {
|
677
|
+
if (this.isShown && this.options.keyboard) {
|
678
|
+
this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
|
679
|
+
e.which == 27 && this.hide()
|
680
|
+
}, this))
|
681
|
+
} else if (!this.isShown) {
|
682
|
+
this.$element.off('keyup.dismiss.bs.modal')
|
683
|
+
}
|
684
|
+
}
|
685
|
+
|
686
|
+
Modal.prototype.hideModal = function () {
|
687
|
+
var that = this
|
688
|
+
this.$element.hide()
|
689
|
+
this.backdrop(function () {
|
690
|
+
that.removeBackdrop()
|
691
|
+
that.$element.trigger('hidden.bs.modal')
|
692
|
+
})
|
693
|
+
}
|
694
|
+
|
695
|
+
Modal.prototype.removeBackdrop = function () {
|
696
|
+
this.$backdrop && this.$backdrop.remove()
|
697
|
+
this.$backdrop = null
|
698
|
+
}
|
699
|
+
|
700
|
+
Modal.prototype.backdrop = function (callback) {
|
701
|
+
var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
702
|
+
|
703
|
+
if (this.isShown && this.options.backdrop) {
|
704
|
+
var doAnimate = $.support.transition && animate
|
705
|
+
|
706
|
+
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
707
|
+
.appendTo(document.body)
|
708
|
+
|
709
|
+
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
710
|
+
if (e.target !== e.currentTarget) return
|
711
|
+
this.options.backdrop == 'static'
|
712
|
+
? this.$element[0].focus.call(this.$element[0])
|
713
|
+
: this.hide.call(this)
|
714
|
+
}, this))
|
715
|
+
|
716
|
+
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
717
|
+
|
718
|
+
this.$backdrop.addClass('in')
|
719
|
+
|
720
|
+
if (!callback) return
|
721
|
+
|
722
|
+
doAnimate ?
|
723
|
+
this.$backdrop
|
724
|
+
.one($.support.transition.end, callback)
|
725
|
+
.emulateTransitionEnd(150) :
|
726
|
+
callback()
|
727
|
+
|
728
|
+
} else if (!this.isShown && this.$backdrop) {
|
729
|
+
this.$backdrop.removeClass('in')
|
730
|
+
|
731
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
732
|
+
this.$backdrop
|
733
|
+
.one($.support.transition.end, callback)
|
734
|
+
.emulateTransitionEnd(150) :
|
735
|
+
callback()
|
736
|
+
|
737
|
+
} else if (callback) {
|
738
|
+
callback()
|
739
|
+
}
|
740
|
+
}
|
741
|
+
|
742
|
+
|
743
|
+
// MODAL PLUGIN DEFINITION
|
744
|
+
// =======================
|
745
|
+
|
746
|
+
var old = $.fn.modal
|
747
|
+
|
748
|
+
$.fn.modal = function (option, _relatedTarget) {
|
749
|
+
return this.each(function () {
|
750
|
+
var $this = $(this)
|
751
|
+
var data = $this.data('bs.modal')
|
752
|
+
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
753
|
+
|
754
|
+
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
755
|
+
if (typeof option == 'string') data[option](_relatedTarget)
|
756
|
+
else if (options.show) data.show(_relatedTarget)
|
757
|
+
})
|
758
|
+
}
|
759
|
+
|
760
|
+
$.fn.modal.Constructor = Modal
|
761
|
+
|
762
|
+
|
763
|
+
// MODAL NO CONFLICT
|
764
|
+
// =================
|
765
|
+
|
766
|
+
$.fn.modal.noConflict = function () {
|
767
|
+
$.fn.modal = old
|
768
|
+
return this
|
769
|
+
}
|
770
|
+
|
771
|
+
|
772
|
+
// MODAL DATA-API
|
773
|
+
// ==============
|
774
|
+
|
775
|
+
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
776
|
+
var $this = $(this)
|
777
|
+
var href = $this.attr('href')
|
778
|
+
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
779
|
+
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
780
|
+
|
781
|
+
if ($this.is('a')) e.preventDefault()
|
782
|
+
|
783
|
+
$target
|
784
|
+
.modal(option, this)
|
785
|
+
.one('hide', function () {
|
786
|
+
$this.is(':visible') && $this.focus()
|
787
|
+
})
|
788
|
+
})
|
789
|
+
|
790
|
+
$(document)
|
791
|
+
.on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
|
792
|
+
.on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
|
793
|
+
|
794
|
+
}(jQuery);
|
795
|
+
|
796
|
+
/* ========================================================================
|
797
|
+
* Bootstrap: tooltip.js v3.1.1
|
798
|
+
* http://getbootstrap.com/javascript/#tooltip
|
799
|
+
* Inspired by the original jQuery.tipsy by Jason Frame
|
800
|
+
* ========================================================================
|
801
|
+
* Copyright 2011-2014 Twitter, Inc.
|
802
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
803
|
+
* ======================================================================== */
|
804
|
+
|
805
|
+
|
806
|
+
+function ($) {
|
807
|
+
'use strict';
|
808
|
+
|
809
|
+
// TOOLTIP PUBLIC CLASS DEFINITION
|
810
|
+
// ===============================
|
811
|
+
|
812
|
+
var Tooltip = function (element, options) {
|
813
|
+
this.type =
|
814
|
+
this.options =
|
815
|
+
this.enabled =
|
816
|
+
this.timeout =
|
817
|
+
this.hoverState =
|
818
|
+
this.$element = null
|
819
|
+
|
820
|
+
this.init('tooltip', element, options)
|
821
|
+
}
|
822
|
+
|
823
|
+
Tooltip.DEFAULTS = {
|
824
|
+
animation: true,
|
825
|
+
placement: 'top',
|
826
|
+
selector: false,
|
827
|
+
template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
|
828
|
+
trigger: 'hover focus',
|
829
|
+
title: '',
|
830
|
+
delay: 0,
|
831
|
+
html: false,
|
832
|
+
container: false
|
833
|
+
}
|
834
|
+
|
835
|
+
Tooltip.prototype.init = function (type, element, options) {
|
836
|
+
this.enabled = true
|
837
|
+
this.type = type
|
838
|
+
this.$element = $(element)
|
839
|
+
this.options = this.getOptions(options)
|
840
|
+
|
841
|
+
var triggers = this.options.trigger.split(' ')
|
842
|
+
|
843
|
+
for (var i = triggers.length; i--;) {
|
844
|
+
var trigger = triggers[i]
|
845
|
+
|
846
|
+
if (trigger == 'click') {
|
847
|
+
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
848
|
+
} else if (trigger != 'manual') {
|
849
|
+
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
|
850
|
+
var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
|
851
|
+
|
852
|
+
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
853
|
+
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
854
|
+
}
|
855
|
+
}
|
856
|
+
|
857
|
+
this.options.selector ?
|
858
|
+
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
859
|
+
this.fixTitle()
|
860
|
+
}
|
861
|
+
|
862
|
+
Tooltip.prototype.getDefaults = function () {
|
863
|
+
return Tooltip.DEFAULTS
|
864
|
+
}
|
865
|
+
|
866
|
+
Tooltip.prototype.getOptions = function (options) {
|
867
|
+
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
|
868
|
+
|
869
|
+
if (options.delay && typeof options.delay == 'number') {
|
870
|
+
options.delay = {
|
871
|
+
show: options.delay,
|
872
|
+
hide: options.delay
|
873
|
+
}
|
874
|
+
}
|
875
|
+
|
876
|
+
return options
|
877
|
+
}
|
878
|
+
|
879
|
+
Tooltip.prototype.getDelegateOptions = function () {
|
880
|
+
var options = {}
|
881
|
+
var defaults = this.getDefaults()
|
882
|
+
|
883
|
+
this._options && $.each(this._options, function (key, value) {
|
884
|
+
if (defaults[key] != value) options[key] = value
|
885
|
+
})
|
886
|
+
|
887
|
+
return options
|
888
|
+
}
|
889
|
+
|
890
|
+
Tooltip.prototype.enter = function (obj) {
|
891
|
+
var self = obj instanceof this.constructor ?
|
892
|
+
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
|
893
|
+
|
894
|
+
clearTimeout(self.timeout)
|
895
|
+
|
896
|
+
self.hoverState = 'in'
|
897
|
+
|
898
|
+
if (!self.options.delay || !self.options.delay.show) return self.show()
|
899
|
+
|
900
|
+
self.timeout = setTimeout(function () {
|
901
|
+
if (self.hoverState == 'in') self.show()
|
902
|
+
}, self.options.delay.show)
|
903
|
+
}
|
904
|
+
|
905
|
+
Tooltip.prototype.leave = function (obj) {
|
906
|
+
var self = obj instanceof this.constructor ?
|
907
|
+
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
|
908
|
+
|
909
|
+
clearTimeout(self.timeout)
|
910
|
+
|
911
|
+
self.hoverState = 'out'
|
912
|
+
|
913
|
+
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
914
|
+
|
915
|
+
self.timeout = setTimeout(function () {
|
916
|
+
if (self.hoverState == 'out') self.hide()
|
917
|
+
}, self.options.delay.hide)
|
918
|
+
}
|
919
|
+
|
920
|
+
Tooltip.prototype.show = function () {
|
921
|
+
var e = $.Event('show.bs.' + this.type)
|
922
|
+
|
923
|
+
if (this.hasContent() && this.enabled) {
|
924
|
+
this.$element.trigger(e)
|
925
|
+
|
926
|
+
if (e.isDefaultPrevented()) return
|
927
|
+
var that = this;
|
928
|
+
|
929
|
+
var $tip = this.tip()
|
930
|
+
|
931
|
+
this.setContent()
|
932
|
+
|
933
|
+
if (this.options.animation) $tip.addClass('fade')
|
934
|
+
|
935
|
+
var placement = typeof this.options.placement == 'function' ?
|
936
|
+
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
937
|
+
this.options.placement
|
938
|
+
|
939
|
+
var autoToken = /\s?auto?\s?/i
|
940
|
+
var autoPlace = autoToken.test(placement)
|
941
|
+
if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
|
942
|
+
|
943
|
+
$tip
|
944
|
+
.detach()
|
945
|
+
.css({ top: 0, left: 0, display: 'block' })
|
946
|
+
.addClass(placement)
|
947
|
+
|
948
|
+
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
949
|
+
|
950
|
+
var pos = this.getPosition()
|
951
|
+
var actualWidth = $tip[0].offsetWidth
|
952
|
+
var actualHeight = $tip[0].offsetHeight
|
953
|
+
|
954
|
+
if (autoPlace) {
|
955
|
+
var $parent = this.$element.parent()
|
956
|
+
|
957
|
+
var orgPlacement = placement
|
958
|
+
var docScroll = document.documentElement.scrollTop || document.body.scrollTop
|
959
|
+
var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth()
|
960
|
+
var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()
|
961
|
+
var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left
|
962
|
+
|
963
|
+
placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' :
|
964
|
+
placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' :
|
965
|
+
placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' :
|
966
|
+
placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' :
|
967
|
+
placement
|
968
|
+
|
969
|
+
$tip
|
970
|
+
.removeClass(orgPlacement)
|
971
|
+
.addClass(placement)
|
972
|
+
}
|
973
|
+
|
974
|
+
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
|
975
|
+
|
976
|
+
this.applyPlacement(calculatedOffset, placement)
|
977
|
+
this.hoverState = null
|
978
|
+
|
979
|
+
var complete = function() {
|
980
|
+
that.$element.trigger('shown.bs.' + that.type)
|
981
|
+
}
|
982
|
+
|
983
|
+
$.support.transition && this.$tip.hasClass('fade') ?
|
984
|
+
$tip
|
985
|
+
.one($.support.transition.end, complete)
|
986
|
+
.emulateTransitionEnd(150) :
|
987
|
+
complete()
|
988
|
+
}
|
989
|
+
}
|
990
|
+
|
991
|
+
Tooltip.prototype.applyPlacement = function (offset, placement) {
|
992
|
+
var replace
|
993
|
+
var $tip = this.tip()
|
994
|
+
var width = $tip[0].offsetWidth
|
995
|
+
var height = $tip[0].offsetHeight
|
996
|
+
|
997
|
+
// manually read margins because getBoundingClientRect includes difference
|
998
|
+
var marginTop = parseInt($tip.css('margin-top'), 10)
|
999
|
+
var marginLeft = parseInt($tip.css('margin-left'), 10)
|
1000
|
+
|
1001
|
+
// we must check for NaN for ie 8/9
|
1002
|
+
if (isNaN(marginTop)) marginTop = 0
|
1003
|
+
if (isNaN(marginLeft)) marginLeft = 0
|
1004
|
+
|
1005
|
+
offset.top = offset.top + marginTop
|
1006
|
+
offset.left = offset.left + marginLeft
|
1007
|
+
|
1008
|
+
// $.fn.offset doesn't round pixel values
|
1009
|
+
// so we use setOffset directly with our own function B-0
|
1010
|
+
$.offset.setOffset($tip[0], $.extend({
|
1011
|
+
using: function (props) {
|
1012
|
+
$tip.css({
|
1013
|
+
top: Math.round(props.top),
|
1014
|
+
left: Math.round(props.left)
|
1015
|
+
})
|
1016
|
+
}
|
1017
|
+
}, offset), 0)
|
1018
|
+
|
1019
|
+
$tip.addClass('in')
|
1020
|
+
|
1021
|
+
// check to see if placing tip in new offset caused the tip to resize itself
|
1022
|
+
var actualWidth = $tip[0].offsetWidth
|
1023
|
+
var actualHeight = $tip[0].offsetHeight
|
1024
|
+
|
1025
|
+
if (placement == 'top' && actualHeight != height) {
|
1026
|
+
replace = true
|
1027
|
+
offset.top = offset.top + height - actualHeight
|
1028
|
+
}
|
1029
|
+
|
1030
|
+
if (/bottom|top/.test(placement)) {
|
1031
|
+
var delta = 0
|
1032
|
+
|
1033
|
+
if (offset.left < 0) {
|
1034
|
+
delta = offset.left * -2
|
1035
|
+
offset.left = 0
|
1036
|
+
|
1037
|
+
$tip.offset(offset)
|
1038
|
+
|
1039
|
+
actualWidth = $tip[0].offsetWidth
|
1040
|
+
actualHeight = $tip[0].offsetHeight
|
1041
|
+
}
|
1042
|
+
|
1043
|
+
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
|
1044
|
+
} else {
|
1045
|
+
this.replaceArrow(actualHeight - height, actualHeight, 'top')
|
1046
|
+
}
|
1047
|
+
|
1048
|
+
if (replace) $tip.offset(offset)
|
1049
|
+
}
|
1050
|
+
|
1051
|
+
Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
|
1052
|
+
this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '')
|
1053
|
+
}
|
1054
|
+
|
1055
|
+
Tooltip.prototype.setContent = function () {
|
1056
|
+
var $tip = this.tip()
|
1057
|
+
var title = this.getTitle()
|
1058
|
+
|
1059
|
+
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
|
1060
|
+
$tip.removeClass('fade in top bottom left right')
|
1061
|
+
}
|
1062
|
+
|
1063
|
+
Tooltip.prototype.hide = function () {
|
1064
|
+
var that = this
|
1065
|
+
var $tip = this.tip()
|
1066
|
+
var e = $.Event('hide.bs.' + this.type)
|
1067
|
+
|
1068
|
+
function complete() {
|
1069
|
+
if (that.hoverState != 'in') $tip.detach()
|
1070
|
+
that.$element.trigger('hidden.bs.' + that.type)
|
1071
|
+
}
|
1072
|
+
|
1073
|
+
this.$element.trigger(e)
|
1074
|
+
|
1075
|
+
if (e.isDefaultPrevented()) return
|
1076
|
+
|
1077
|
+
$tip.removeClass('in')
|
1078
|
+
|
1079
|
+
$.support.transition && this.$tip.hasClass('fade') ?
|
1080
|
+
$tip
|
1081
|
+
.one($.support.transition.end, complete)
|
1082
|
+
.emulateTransitionEnd(150) :
|
1083
|
+
complete()
|
1084
|
+
|
1085
|
+
this.hoverState = null
|
1086
|
+
|
1087
|
+
return this
|
1088
|
+
}
|
1089
|
+
|
1090
|
+
Tooltip.prototype.fixTitle = function () {
|
1091
|
+
var $e = this.$element
|
1092
|
+
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
|
1093
|
+
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
|
1094
|
+
}
|
1095
|
+
}
|
1096
|
+
|
1097
|
+
Tooltip.prototype.hasContent = function () {
|
1098
|
+
return this.getTitle()
|
1099
|
+
}
|
1100
|
+
|
1101
|
+
Tooltip.prototype.getPosition = function () {
|
1102
|
+
var el = this.$element[0]
|
1103
|
+
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
|
1104
|
+
width: el.offsetWidth,
|
1105
|
+
height: el.offsetHeight
|
1106
|
+
}, this.$element.offset())
|
1107
|
+
}
|
1108
|
+
|
1109
|
+
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
|
1110
|
+
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
1111
|
+
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
1112
|
+
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
|
1113
|
+
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
|
1114
|
+
}
|
1115
|
+
|
1116
|
+
Tooltip.prototype.getTitle = function () {
|
1117
|
+
var title
|
1118
|
+
var $e = this.$element
|
1119
|
+
var o = this.options
|
1120
|
+
|
1121
|
+
title = $e.attr('data-original-title')
|
1122
|
+
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
1123
|
+
|
1124
|
+
return title
|
1125
|
+
}
|
1126
|
+
|
1127
|
+
Tooltip.prototype.tip = function () {
|
1128
|
+
return this.$tip = this.$tip || $(this.options.template)
|
1129
|
+
}
|
1130
|
+
|
1131
|
+
Tooltip.prototype.arrow = function () {
|
1132
|
+
return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
|
1133
|
+
}
|
1134
|
+
|
1135
|
+
Tooltip.prototype.validate = function () {
|
1136
|
+
if (!this.$element[0].parentNode) {
|
1137
|
+
this.hide()
|
1138
|
+
this.$element = null
|
1139
|
+
this.options = null
|
1140
|
+
}
|
1141
|
+
}
|
1142
|
+
|
1143
|
+
Tooltip.prototype.enable = function () {
|
1144
|
+
this.enabled = true
|
1145
|
+
}
|
1146
|
+
|
1147
|
+
Tooltip.prototype.disable = function () {
|
1148
|
+
this.enabled = false
|
1149
|
+
}
|
1150
|
+
|
1151
|
+
Tooltip.prototype.toggleEnabled = function () {
|
1152
|
+
this.enabled = !this.enabled
|
1153
|
+
}
|
1154
|
+
|
1155
|
+
Tooltip.prototype.toggle = function (e) {
|
1156
|
+
var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
|
1157
|
+
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
|
1158
|
+
}
|
1159
|
+
|
1160
|
+
Tooltip.prototype.destroy = function () {
|
1161
|
+
clearTimeout(this.timeout)
|
1162
|
+
this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
|
1163
|
+
}
|
1164
|
+
|
1165
|
+
|
1166
|
+
// TOOLTIP PLUGIN DEFINITION
|
1167
|
+
// =========================
|
1168
|
+
|
1169
|
+
var old = $.fn.tooltip
|
1170
|
+
|
1171
|
+
$.fn.tooltip = function (option) {
|
1172
|
+
return this.each(function () {
|
1173
|
+
var $this = $(this)
|
1174
|
+
var data = $this.data('bs.tooltip')
|
1175
|
+
var options = typeof option == 'object' && option
|
1176
|
+
|
1177
|
+
if (!data && option == 'destroy') return
|
1178
|
+
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
1179
|
+
if (typeof option == 'string') data[option]()
|
1180
|
+
})
|
1181
|
+
}
|
1182
|
+
|
1183
|
+
$.fn.tooltip.Constructor = Tooltip
|
1184
|
+
|
1185
|
+
|
1186
|
+
// TOOLTIP NO CONFLICT
|
1187
|
+
// ===================
|
1188
|
+
|
1189
|
+
$.fn.tooltip.noConflict = function () {
|
1190
|
+
$.fn.tooltip = old
|
1191
|
+
return this
|
1192
|
+
}
|
1193
|
+
|
1194
|
+
}(jQuery);
|
1195
|
+
|
1196
|
+
/* ========================================================================
|
1197
|
+
* Bootstrap: popover.js v3.1.1
|
1198
|
+
* http://getbootstrap.com/javascript/#popovers
|
1199
|
+
* ========================================================================
|
1200
|
+
* Copyright 2011-2014 Twitter, Inc.
|
1201
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1202
|
+
* ======================================================================== */
|
1203
|
+
|
1204
|
+
|
1205
|
+
+function ($) {
|
1206
|
+
'use strict';
|
1207
|
+
|
1208
|
+
// POPOVER PUBLIC CLASS DEFINITION
|
1209
|
+
// ===============================
|
1210
|
+
|
1211
|
+
var Popover = function (element, options) {
|
1212
|
+
this.init('popover', element, options)
|
1213
|
+
}
|
1214
|
+
|
1215
|
+
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
1216
|
+
|
1217
|
+
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
|
1218
|
+
placement: 'right',
|
1219
|
+
trigger: 'click',
|
1220
|
+
content: '',
|
1221
|
+
template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
1222
|
+
})
|
1223
|
+
|
1224
|
+
|
1225
|
+
// NOTE: POPOVER EXTENDS tooltip.js
|
1226
|
+
// ================================
|
1227
|
+
|
1228
|
+
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
|
1229
|
+
|
1230
|
+
Popover.prototype.constructor = Popover
|
1231
|
+
|
1232
|
+
Popover.prototype.getDefaults = function () {
|
1233
|
+
return Popover.DEFAULTS
|
1234
|
+
}
|
1235
|
+
|
1236
|
+
Popover.prototype.setContent = function () {
|
1237
|
+
var $tip = this.tip()
|
1238
|
+
var title = this.getTitle()
|
1239
|
+
var content = this.getContent()
|
1240
|
+
|
1241
|
+
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
1242
|
+
$tip.find('.popover-content')[ // we use append for html objects to maintain js events
|
1243
|
+
this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
|
1244
|
+
](content)
|
1245
|
+
|
1246
|
+
$tip.removeClass('fade top bottom left right in')
|
1247
|
+
|
1248
|
+
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
|
1249
|
+
// this manually by checking the contents.
|
1250
|
+
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
|
1251
|
+
}
|
1252
|
+
|
1253
|
+
Popover.prototype.hasContent = function () {
|
1254
|
+
return this.getTitle() || this.getContent()
|
1255
|
+
}
|
1256
|
+
|
1257
|
+
Popover.prototype.getContent = function () {
|
1258
|
+
var $e = this.$element
|
1259
|
+
var o = this.options
|
1260
|
+
|
1261
|
+
return $e.attr('data-content')
|
1262
|
+
|| (typeof o.content == 'function' ?
|
1263
|
+
o.content.call($e[0]) :
|
1264
|
+
o.content)
|
1265
|
+
}
|
1266
|
+
|
1267
|
+
Popover.prototype.arrow = function () {
|
1268
|
+
return this.$arrow = this.$arrow || this.tip().find('.arrow')
|
1269
|
+
}
|
1270
|
+
|
1271
|
+
Popover.prototype.tip = function () {
|
1272
|
+
if (!this.$tip) this.$tip = $(this.options.template)
|
1273
|
+
return this.$tip
|
1274
|
+
}
|
1275
|
+
|
1276
|
+
|
1277
|
+
// POPOVER PLUGIN DEFINITION
|
1278
|
+
// =========================
|
1279
|
+
|
1280
|
+
var old = $.fn.popover
|
1281
|
+
|
1282
|
+
$.fn.popover = function (option) {
|
1283
|
+
return this.each(function () {
|
1284
|
+
var $this = $(this)
|
1285
|
+
var data = $this.data('bs.popover')
|
1286
|
+
var options = typeof option == 'object' && option
|
1287
|
+
|
1288
|
+
if (!data && option == 'destroy') return
|
1289
|
+
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
1290
|
+
if (typeof option == 'string') data[option]()
|
1291
|
+
})
|
1292
|
+
}
|
1293
|
+
|
1294
|
+
$.fn.popover.Constructor = Popover
|
1295
|
+
|
1296
|
+
|
1297
|
+
// POPOVER NO CONFLICT
|
1298
|
+
// ===================
|
1299
|
+
|
1300
|
+
$.fn.popover.noConflict = function () {
|
1301
|
+
$.fn.popover = old
|
1302
|
+
return this
|
1303
|
+
}
|
1304
|
+
|
1305
|
+
}(jQuery);
|
1306
|
+
|
1307
|
+
/* ========================================================================
|
1308
|
+
* Bootstrap: tab.js v3.1.1
|
1309
|
+
* http://getbootstrap.com/javascript/#tabs
|
1310
|
+
* ========================================================================
|
1311
|
+
* Copyright 2011-2014 Twitter, Inc.
|
1312
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1313
|
+
* ======================================================================== */
|
1314
|
+
|
1315
|
+
|
1316
|
+
+function ($) {
|
1317
|
+
'use strict';
|
1318
|
+
|
1319
|
+
// TAB CLASS DEFINITION
|
1320
|
+
// ====================
|
1321
|
+
|
1322
|
+
var Tab = function (element) {
|
1323
|
+
this.element = $(element)
|
1324
|
+
}
|
1325
|
+
|
1326
|
+
Tab.prototype.show = function () {
|
1327
|
+
var $this = this.element
|
1328
|
+
var $ul = $this.closest('ul:not(.dropdown-menu)')
|
1329
|
+
var selector = $this.data('target')
|
1330
|
+
|
1331
|
+
if (!selector) {
|
1332
|
+
selector = $this.attr('href')
|
1333
|
+
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
1334
|
+
}
|
1335
|
+
|
1336
|
+
if ($this.parent('li').hasClass('active')) return
|
1337
|
+
|
1338
|
+
var previous = $ul.find('.active:last a')[0]
|
1339
|
+
var e = $.Event('show.bs.tab', {
|
1340
|
+
relatedTarget: previous
|
1341
|
+
})
|
1342
|
+
|
1343
|
+
$this.trigger(e)
|
1344
|
+
|
1345
|
+
if (e.isDefaultPrevented()) return
|
1346
|
+
|
1347
|
+
var $target = $(selector)
|
1348
|
+
|
1349
|
+
this.activate($this.parent('li'), $ul)
|
1350
|
+
this.activate($target, $target.parent(), function () {
|
1351
|
+
$this.trigger({
|
1352
|
+
type: 'shown.bs.tab',
|
1353
|
+
relatedTarget: previous
|
1354
|
+
})
|
1355
|
+
})
|
1356
|
+
}
|
1357
|
+
|
1358
|
+
Tab.prototype.activate = function (element, container, callback) {
|
1359
|
+
var $active = container.find('> .active')
|
1360
|
+
var transition = callback
|
1361
|
+
&& $.support.transition
|
1362
|
+
&& $active.hasClass('fade')
|
1363
|
+
|
1364
|
+
function next() {
|
1365
|
+
$active
|
1366
|
+
.removeClass('active')
|
1367
|
+
.find('> .dropdown-menu > .active')
|
1368
|
+
.removeClass('active')
|
1369
|
+
|
1370
|
+
element.addClass('active')
|
1371
|
+
|
1372
|
+
if (transition) {
|
1373
|
+
element[0].offsetWidth // reflow for transition
|
1374
|
+
element.addClass('in')
|
1375
|
+
} else {
|
1376
|
+
element.removeClass('fade')
|
1377
|
+
}
|
1378
|
+
|
1379
|
+
if (element.parent('.dropdown-menu')) {
|
1380
|
+
element.closest('li.dropdown').addClass('active')
|
1381
|
+
}
|
1382
|
+
|
1383
|
+
callback && callback()
|
1384
|
+
}
|
1385
|
+
|
1386
|
+
transition ?
|
1387
|
+
$active
|
1388
|
+
.one($.support.transition.end, next)
|
1389
|
+
.emulateTransitionEnd(150) :
|
1390
|
+
next()
|
1391
|
+
|
1392
|
+
$active.removeClass('in')
|
1393
|
+
}
|
1394
|
+
|
1395
|
+
|
1396
|
+
// TAB PLUGIN DEFINITION
|
1397
|
+
// =====================
|
1398
|
+
|
1399
|
+
var old = $.fn.tab
|
1400
|
+
|
1401
|
+
$.fn.tab = function ( option ) {
|
1402
|
+
return this.each(function () {
|
1403
|
+
var $this = $(this)
|
1404
|
+
var data = $this.data('bs.tab')
|
1405
|
+
|
1406
|
+
if (!data) $this.data('bs.tab', (data = new Tab(this)))
|
1407
|
+
if (typeof option == 'string') data[option]()
|
1408
|
+
})
|
1409
|
+
}
|
1410
|
+
|
1411
|
+
$.fn.tab.Constructor = Tab
|
1412
|
+
|
1413
|
+
|
1414
|
+
// TAB NO CONFLICT
|
1415
|
+
// ===============
|
1416
|
+
|
1417
|
+
$.fn.tab.noConflict = function () {
|
1418
|
+
$.fn.tab = old
|
1419
|
+
return this
|
1420
|
+
}
|
1421
|
+
|
1422
|
+
|
1423
|
+
// TAB DATA-API
|
1424
|
+
// ============
|
1425
|
+
|
1426
|
+
$(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
|
1427
|
+
e.preventDefault()
|
1428
|
+
$(this).tab('show')
|
1429
|
+
})
|
1430
|
+
|
1431
|
+
}(jQuery);
|
1432
|
+
|
1433
|
+
/* ========================================================================
|
1434
|
+
* Bootstrap: affix.js v3.1.1
|
1435
|
+
* http://getbootstrap.com/javascript/#affix
|
1436
|
+
* ========================================================================
|
1437
|
+
* Copyright 2011-2014 Twitter, Inc.
|
1438
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1439
|
+
* ======================================================================== */
|
1440
|
+
|
1441
|
+
|
1442
|
+
+function ($) {
|
1443
|
+
'use strict';
|
1444
|
+
|
1445
|
+
// AFFIX CLASS DEFINITION
|
1446
|
+
// ======================
|
1447
|
+
|
1448
|
+
var Affix = function (element, options) {
|
1449
|
+
this.options = $.extend({}, Affix.DEFAULTS, options)
|
1450
|
+
this.$window = $(window)
|
1451
|
+
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
|
1452
|
+
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
|
1453
|
+
|
1454
|
+
this.$element = $(element)
|
1455
|
+
this.affixed =
|
1456
|
+
this.unpin =
|
1457
|
+
this.pinnedOffset = null
|
1458
|
+
|
1459
|
+
this.checkPosition()
|
1460
|
+
}
|
1461
|
+
|
1462
|
+
Affix.RESET = 'affix affix-top affix-bottom'
|
1463
|
+
|
1464
|
+
Affix.DEFAULTS = {
|
1465
|
+
offset: 0
|
1466
|
+
}
|
1467
|
+
|
1468
|
+
Affix.prototype.getPinnedOffset = function () {
|
1469
|
+
if (this.pinnedOffset) return this.pinnedOffset
|
1470
|
+
this.$element.removeClass(Affix.RESET).addClass('affix')
|
1471
|
+
var scrollTop = this.$window.scrollTop()
|
1472
|
+
var position = this.$element.offset()
|
1473
|
+
return (this.pinnedOffset = position.top - scrollTop)
|
1474
|
+
}
|
1475
|
+
|
1476
|
+
Affix.prototype.checkPositionWithEventLoop = function () {
|
1477
|
+
setTimeout($.proxy(this.checkPosition, this), 1)
|
1478
|
+
}
|
1479
|
+
|
1480
|
+
Affix.prototype.checkPosition = function () {
|
1481
|
+
if (!this.$element.is(':visible')) return
|
1482
|
+
|
1483
|
+
var scrollHeight = $(document).height()
|
1484
|
+
var scrollTop = this.$window.scrollTop()
|
1485
|
+
var position = this.$element.offset()
|
1486
|
+
var offset = this.options.offset
|
1487
|
+
var offsetTop = offset.top
|
1488
|
+
var offsetBottom = offset.bottom
|
1489
|
+
|
1490
|
+
if (this.affixed == 'top') position.top += scrollTop
|
1491
|
+
|
1492
|
+
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
1493
|
+
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
|
1494
|
+
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
|
1495
|
+
|
1496
|
+
var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
|
1497
|
+
offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
|
1498
|
+
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
|
1499
|
+
|
1500
|
+
if (this.affixed === affix) return
|
1501
|
+
if (this.unpin) this.$element.css('top', '')
|
1502
|
+
|
1503
|
+
var affixType = 'affix' + (affix ? '-' + affix : '')
|
1504
|
+
var e = $.Event(affixType + '.bs.affix')
|
1505
|
+
|
1506
|
+
this.$element.trigger(e)
|
1507
|
+
|
1508
|
+
if (e.isDefaultPrevented()) return
|
1509
|
+
|
1510
|
+
this.affixed = affix
|
1511
|
+
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
|
1512
|
+
|
1513
|
+
this.$element
|
1514
|
+
.removeClass(Affix.RESET)
|
1515
|
+
.addClass(affixType)
|
1516
|
+
.trigger($.Event(affixType.replace('affix', 'affixed')))
|
1517
|
+
|
1518
|
+
if (affix == 'bottom') {
|
1519
|
+
this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() })
|
1520
|
+
}
|
1521
|
+
}
|
1522
|
+
|
1523
|
+
|
1524
|
+
// AFFIX PLUGIN DEFINITION
|
1525
|
+
// =======================
|
1526
|
+
|
1527
|
+
var old = $.fn.affix
|
1528
|
+
|
1529
|
+
$.fn.affix = function (option) {
|
1530
|
+
return this.each(function () {
|
1531
|
+
var $this = $(this)
|
1532
|
+
var data = $this.data('bs.affix')
|
1533
|
+
var options = typeof option == 'object' && option
|
1534
|
+
|
1535
|
+
if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
|
1536
|
+
if (typeof option == 'string') data[option]()
|
1537
|
+
})
|
1538
|
+
}
|
1539
|
+
|
1540
|
+
$.fn.affix.Constructor = Affix
|
1541
|
+
|
1542
|
+
|
1543
|
+
// AFFIX NO CONFLICT
|
1544
|
+
// =================
|
1545
|
+
|
1546
|
+
$.fn.affix.noConflict = function () {
|
1547
|
+
$.fn.affix = old
|
1548
|
+
return this
|
1549
|
+
}
|
1550
|
+
|
1551
|
+
|
1552
|
+
// AFFIX DATA-API
|
1553
|
+
// ==============
|
1554
|
+
|
1555
|
+
$(window).on('load', function () {
|
1556
|
+
$('[data-spy="affix"]').each(function () {
|
1557
|
+
var $spy = $(this)
|
1558
|
+
var data = $spy.data()
|
1559
|
+
|
1560
|
+
data.offset = data.offset || {}
|
1561
|
+
|
1562
|
+
if (data.offsetBottom) data.offset.bottom = data.offsetBottom
|
1563
|
+
if (data.offsetTop) data.offset.top = data.offsetTop
|
1564
|
+
|
1565
|
+
$spy.affix(data)
|
1566
|
+
})
|
1567
|
+
})
|
1568
|
+
|
1569
|
+
}(jQuery);
|
1570
|
+
|
1571
|
+
/* ========================================================================
|
1572
|
+
* Bootstrap: collapse.js v3.1.1
|
1573
|
+
* http://getbootstrap.com/javascript/#collapse
|
1574
|
+
* ========================================================================
|
1575
|
+
* Copyright 2011-2014 Twitter, Inc.
|
1576
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1577
|
+
* ======================================================================== */
|
1578
|
+
|
1579
|
+
|
1580
|
+
+function ($) {
|
1581
|
+
'use strict';
|
1582
|
+
|
1583
|
+
// COLLAPSE PUBLIC CLASS DEFINITION
|
1584
|
+
// ================================
|
1585
|
+
|
1586
|
+
var Collapse = function (element, options) {
|
1587
|
+
this.$element = $(element)
|
1588
|
+
this.options = $.extend({}, Collapse.DEFAULTS, options)
|
1589
|
+
this.transitioning = null
|
1590
|
+
|
1591
|
+
if (this.options.parent) this.$parent = $(this.options.parent)
|
1592
|
+
if (this.options.toggle) this.toggle()
|
1593
|
+
}
|
1594
|
+
|
1595
|
+
Collapse.DEFAULTS = {
|
1596
|
+
toggle: true
|
1597
|
+
}
|
1598
|
+
|
1599
|
+
Collapse.prototype.dimension = function () {
|
1600
|
+
var hasWidth = this.$element.hasClass('width')
|
1601
|
+
return hasWidth ? 'width' : 'height'
|
1602
|
+
}
|
1603
|
+
|
1604
|
+
Collapse.prototype.show = function () {
|
1605
|
+
if (this.transitioning || this.$element.hasClass('in')) return
|
1606
|
+
|
1607
|
+
var startEvent = $.Event('show.bs.collapse')
|
1608
|
+
this.$element.trigger(startEvent)
|
1609
|
+
if (startEvent.isDefaultPrevented()) return
|
1610
|
+
|
1611
|
+
var actives = this.$parent && this.$parent.find('> .panel > .in')
|
1612
|
+
|
1613
|
+
if (actives && actives.length) {
|
1614
|
+
var hasData = actives.data('bs.collapse')
|
1615
|
+
if (hasData && hasData.transitioning) return
|
1616
|
+
actives.collapse('hide')
|
1617
|
+
hasData || actives.data('bs.collapse', null)
|
1618
|
+
}
|
1619
|
+
|
1620
|
+
var dimension = this.dimension()
|
1621
|
+
|
1622
|
+
this.$element
|
1623
|
+
.removeClass('collapse')
|
1624
|
+
.addClass('collapsing')
|
1625
|
+
[dimension](0)
|
1626
|
+
|
1627
|
+
this.transitioning = 1
|
1628
|
+
|
1629
|
+
var complete = function () {
|
1630
|
+
this.$element
|
1631
|
+
.removeClass('collapsing')
|
1632
|
+
.addClass('collapse in')
|
1633
|
+
[dimension]('auto')
|
1634
|
+
this.transitioning = 0
|
1635
|
+
this.$element.trigger('shown.bs.collapse')
|
1636
|
+
}
|
1637
|
+
|
1638
|
+
if (!$.support.transition) return complete.call(this)
|
1639
|
+
|
1640
|
+
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
|
1641
|
+
|
1642
|
+
this.$element
|
1643
|
+
.one($.support.transition.end, $.proxy(complete, this))
|
1644
|
+
.emulateTransitionEnd(350)
|
1645
|
+
[dimension](this.$element[0][scrollSize])
|
1646
|
+
}
|
1647
|
+
|
1648
|
+
Collapse.prototype.hide = function () {
|
1649
|
+
if (this.transitioning || !this.$element.hasClass('in')) return
|
1650
|
+
|
1651
|
+
var startEvent = $.Event('hide.bs.collapse')
|
1652
|
+
this.$element.trigger(startEvent)
|
1653
|
+
if (startEvent.isDefaultPrevented()) return
|
1654
|
+
|
1655
|
+
var dimension = this.dimension()
|
1656
|
+
|
1657
|
+
this.$element
|
1658
|
+
[dimension](this.$element[dimension]())
|
1659
|
+
[0].offsetHeight
|
1660
|
+
|
1661
|
+
this.$element
|
1662
|
+
.addClass('collapsing')
|
1663
|
+
.removeClass('collapse')
|
1664
|
+
.removeClass('in')
|
1665
|
+
|
1666
|
+
this.transitioning = 1
|
1667
|
+
|
1668
|
+
var complete = function () {
|
1669
|
+
this.transitioning = 0
|
1670
|
+
this.$element
|
1671
|
+
.trigger('hidden.bs.collapse')
|
1672
|
+
.removeClass('collapsing')
|
1673
|
+
.addClass('collapse')
|
1674
|
+
}
|
1675
|
+
|
1676
|
+
if (!$.support.transition) return complete.call(this)
|
1677
|
+
|
1678
|
+
this.$element
|
1679
|
+
[dimension](0)
|
1680
|
+
.one($.support.transition.end, $.proxy(complete, this))
|
1681
|
+
.emulateTransitionEnd(350)
|
1682
|
+
}
|
1683
|
+
|
1684
|
+
Collapse.prototype.toggle = function () {
|
1685
|
+
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
1686
|
+
}
|
1687
|
+
|
1688
|
+
|
1689
|
+
// COLLAPSE PLUGIN DEFINITION
|
1690
|
+
// ==========================
|
1691
|
+
|
1692
|
+
var old = $.fn.collapse
|
1693
|
+
|
1694
|
+
$.fn.collapse = function (option) {
|
1695
|
+
return this.each(function () {
|
1696
|
+
var $this = $(this)
|
1697
|
+
var data = $this.data('bs.collapse')
|
1698
|
+
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
1699
|
+
|
1700
|
+
if (!data && options.toggle && option == 'show') option = !option
|
1701
|
+
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
|
1702
|
+
if (typeof option == 'string') data[option]()
|
1703
|
+
})
|
1704
|
+
}
|
1705
|
+
|
1706
|
+
$.fn.collapse.Constructor = Collapse
|
1707
|
+
|
1708
|
+
|
1709
|
+
// COLLAPSE NO CONFLICT
|
1710
|
+
// ====================
|
1711
|
+
|
1712
|
+
$.fn.collapse.noConflict = function () {
|
1713
|
+
$.fn.collapse = old
|
1714
|
+
return this
|
1715
|
+
}
|
1716
|
+
|
1717
|
+
|
1718
|
+
// COLLAPSE DATA-API
|
1719
|
+
// =================
|
1720
|
+
|
1721
|
+
$(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
|
1722
|
+
var $this = $(this), href
|
1723
|
+
var target = $this.attr('data-target')
|
1724
|
+
|| e.preventDefault()
|
1725
|
+
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
1726
|
+
var $target = $(target)
|
1727
|
+
var data = $target.data('bs.collapse')
|
1728
|
+
var option = data ? 'toggle' : $this.data()
|
1729
|
+
var parent = $this.attr('data-parent')
|
1730
|
+
var $parent = parent && $(parent)
|
1731
|
+
|
1732
|
+
if (!data || !data.transitioning) {
|
1733
|
+
if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
|
1734
|
+
$this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
1735
|
+
}
|
1736
|
+
|
1737
|
+
$target.collapse(option)
|
1738
|
+
})
|
1739
|
+
|
1740
|
+
}(jQuery);
|
1741
|
+
|
1742
|
+
/* ========================================================================
|
1743
|
+
* Bootstrap: scrollspy.js v3.1.1
|
1744
|
+
* http://getbootstrap.com/javascript/#scrollspy
|
1745
|
+
* ========================================================================
|
1746
|
+
* Copyright 2011-2014 Twitter, Inc.
|
1747
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1748
|
+
* ======================================================================== */
|
1749
|
+
|
1750
|
+
|
1751
|
+
+function ($) {
|
1752
|
+
'use strict';
|
1753
|
+
|
1754
|
+
// SCROLLSPY CLASS DEFINITION
|
1755
|
+
// ==========================
|
1756
|
+
|
1757
|
+
function ScrollSpy(element, options) {
|
1758
|
+
var href
|
1759
|
+
var process = $.proxy(this.process, this)
|
1760
|
+
|
1761
|
+
this.$element = $(element).is('body') ? $(window) : $(element)
|
1762
|
+
this.$body = $('body')
|
1763
|
+
this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
|
1764
|
+
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
|
1765
|
+
this.selector = (this.options.target
|
1766
|
+
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
1767
|
+
|| '') + ' .nav li > a'
|
1768
|
+
this.offsets = $([])
|
1769
|
+
this.targets = $([])
|
1770
|
+
this.activeTarget = null
|
1771
|
+
|
1772
|
+
this.refresh()
|
1773
|
+
this.process()
|
1774
|
+
}
|
1775
|
+
|
1776
|
+
ScrollSpy.DEFAULTS = {
|
1777
|
+
offset: 10
|
1778
|
+
}
|
1779
|
+
|
1780
|
+
ScrollSpy.prototype.refresh = function () {
|
1781
|
+
var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
|
1782
|
+
|
1783
|
+
this.offsets = $([])
|
1784
|
+
this.targets = $([])
|
1785
|
+
|
1786
|
+
var self = this
|
1787
|
+
var $targets = this.$body
|
1788
|
+
.find(this.selector)
|
1789
|
+
.map(function () {
|
1790
|
+
var $el = $(this)
|
1791
|
+
var href = $el.data('target') || $el.attr('href')
|
1792
|
+
var $href = /^#./.test(href) && $(href)
|
1793
|
+
|
1794
|
+
return ($href
|
1795
|
+
&& $href.length
|
1796
|
+
&& $href.is(':visible')
|
1797
|
+
&& [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
|
1798
|
+
})
|
1799
|
+
.sort(function (a, b) { return a[0] - b[0] })
|
1800
|
+
.each(function () {
|
1801
|
+
self.offsets.push(this[0])
|
1802
|
+
self.targets.push(this[1])
|
1803
|
+
})
|
1804
|
+
}
|
1805
|
+
|
1806
|
+
ScrollSpy.prototype.process = function () {
|
1807
|
+
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
|
1808
|
+
var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
|
1809
|
+
var maxScroll = scrollHeight - this.$scrollElement.height()
|
1810
|
+
var offsets = this.offsets
|
1811
|
+
var targets = this.targets
|
1812
|
+
var activeTarget = this.activeTarget
|
1813
|
+
var i
|
1814
|
+
|
1815
|
+
if (scrollTop >= maxScroll) {
|
1816
|
+
return activeTarget != (i = targets.last()[0]) && this.activate(i)
|
1817
|
+
}
|
1818
|
+
|
1819
|
+
if (activeTarget && scrollTop <= offsets[0]) {
|
1820
|
+
return activeTarget != (i = targets[0]) && this.activate(i)
|
1821
|
+
}
|
1822
|
+
|
1823
|
+
for (i = offsets.length; i--;) {
|
1824
|
+
activeTarget != targets[i]
|
1825
|
+
&& scrollTop >= offsets[i]
|
1826
|
+
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
1827
|
+
&& this.activate( targets[i] )
|
1828
|
+
}
|
1829
|
+
}
|
1830
|
+
|
1831
|
+
ScrollSpy.prototype.activate = function (target) {
|
1832
|
+
this.activeTarget = target
|
1833
|
+
|
1834
|
+
$(this.selector)
|
1835
|
+
.parentsUntil(this.options.target, '.active')
|
1836
|
+
.removeClass('active')
|
1837
|
+
|
1838
|
+
var selector = this.selector +
|
1839
|
+
'[data-target="' + target + '"],' +
|
1840
|
+
this.selector + '[href="' + target + '"]'
|
1841
|
+
|
1842
|
+
var active = $(selector)
|
1843
|
+
.parents('li')
|
1844
|
+
.addClass('active')
|
1845
|
+
|
1846
|
+
if (active.parent('.dropdown-menu').length) {
|
1847
|
+
active = active
|
1848
|
+
.closest('li.dropdown')
|
1849
|
+
.addClass('active')
|
1850
|
+
}
|
1851
|
+
|
1852
|
+
active.trigger('activate.bs.scrollspy')
|
1853
|
+
}
|
1854
|
+
|
1855
|
+
|
1856
|
+
// SCROLLSPY PLUGIN DEFINITION
|
1857
|
+
// ===========================
|
1858
|
+
|
1859
|
+
var old = $.fn.scrollspy
|
1860
|
+
|
1861
|
+
$.fn.scrollspy = function (option) {
|
1862
|
+
return this.each(function () {
|
1863
|
+
var $this = $(this)
|
1864
|
+
var data = $this.data('bs.scrollspy')
|
1865
|
+
var options = typeof option == 'object' && option
|
1866
|
+
|
1867
|
+
if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
|
1868
|
+
if (typeof option == 'string') data[option]()
|
1869
|
+
})
|
1870
|
+
}
|
1871
|
+
|
1872
|
+
$.fn.scrollspy.Constructor = ScrollSpy
|
1873
|
+
|
1874
|
+
|
1875
|
+
// SCROLLSPY NO CONFLICT
|
1876
|
+
// =====================
|
1877
|
+
|
1878
|
+
$.fn.scrollspy.noConflict = function () {
|
1879
|
+
$.fn.scrollspy = old
|
1880
|
+
return this
|
1881
|
+
}
|
1882
|
+
|
1883
|
+
|
1884
|
+
// SCROLLSPY DATA-API
|
1885
|
+
// ==================
|
1886
|
+
|
1887
|
+
$(window).on('load', function () {
|
1888
|
+
$('[data-spy="scroll"]').each(function () {
|
1889
|
+
var $spy = $(this)
|
1890
|
+
$spy.scrollspy($spy.data())
|
1891
|
+
})
|
1892
|
+
})
|
1893
|
+
|
1894
|
+
}(jQuery);
|
1895
|
+
|
1896
|
+
/* ========================================================================
|
1897
|
+
* Bootstrap: transition.js v3.1.1
|
1898
|
+
* http://getbootstrap.com/javascript/#transitions
|
1899
|
+
* ========================================================================
|
1900
|
+
* Copyright 2011-2014 Twitter, Inc.
|
1901
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
1902
|
+
* ======================================================================== */
|
1903
|
+
|
1904
|
+
|
1905
|
+
+function ($) {
|
1906
|
+
'use strict';
|
1907
|
+
|
1908
|
+
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
|
1909
|
+
// ============================================================
|
1910
|
+
|
1911
|
+
function transitionEnd() {
|
1912
|
+
var el = document.createElement('bootstrap')
|
1913
|
+
|
1914
|
+
var transEndEventNames = {
|
1915
|
+
'WebkitTransition' : 'webkitTransitionEnd',
|
1916
|
+
'MozTransition' : 'transitionend',
|
1917
|
+
'OTransition' : 'oTransitionEnd otransitionend',
|
1918
|
+
'transition' : 'transitionend'
|
1919
|
+
}
|
1920
|
+
|
1921
|
+
for (var name in transEndEventNames) {
|
1922
|
+
if (el.style[name] !== undefined) {
|
1923
|
+
return { end: transEndEventNames[name] }
|
1924
|
+
}
|
1925
|
+
}
|
1926
|
+
|
1927
|
+
return false // explicit for ie8 ( ._.)
|
1928
|
+
}
|
1929
|
+
|
1930
|
+
// http://blog.alexmaccaw.com/css-transitions
|
1931
|
+
$.fn.emulateTransitionEnd = function (duration) {
|
1932
|
+
var called = false, $el = this
|
1933
|
+
$(this).one($.support.transition.end, function () { called = true })
|
1934
|
+
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
|
1935
|
+
setTimeout(callback, duration)
|
1936
|
+
return this
|
1937
|
+
}
|
1938
|
+
|
1939
|
+
$(function () {
|
1940
|
+
$.support.transition = transitionEnd()
|
1941
|
+
})
|
1942
|
+
|
1943
|
+
}(jQuery);
|