sql-jarvis 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -1
  3. data/LICENSE.txt +1 -1
  4. data/README.md +153 -52
  5. data/app/assets/fonts/blazer/glyphicons-halflings-regular.eot +0 -0
  6. data/app/assets/fonts/blazer/glyphicons-halflings-regular.svg +0 -0
  7. data/app/assets/fonts/blazer/glyphicons-halflings-regular.ttf +0 -0
  8. data/app/assets/fonts/blazer/glyphicons-halflings-regular.woff +0 -0
  9. data/app/assets/fonts/blazer/glyphicons-halflings-regular.woff2 +0 -0
  10. data/app/assets/images/blazer/favicon.png +0 -0
  11. data/app/assets/javascripts/blazer/Chart.js +4195 -3884
  12. data/app/assets/javascripts/blazer/Sortable.js +1493 -1097
  13. data/app/assets/javascripts/blazer/ace/ace.js +21294 -4
  14. data/app/assets/javascripts/blazer/ace/ext-language_tools.js +1991 -3
  15. data/app/assets/javascripts/blazer/ace/mode-sql.js +110 -1
  16. data/app/assets/javascripts/blazer/ace/snippets/sql.js +40 -1
  17. data/app/assets/javascripts/blazer/ace/snippets/text.js +14 -1
  18. data/app/assets/javascripts/blazer/ace/theme-twilight.js +116 -1
  19. data/app/assets/javascripts/blazer/application.js +4 -3
  20. data/app/assets/javascripts/blazer/bootstrap.js +623 -612
  21. data/app/assets/javascripts/blazer/chartkick.js +1769 -1248
  22. data/app/assets/javascripts/blazer/daterangepicker.js +263 -115
  23. data/app/assets/javascripts/blazer/highlight.min.js +3 -0
  24. data/app/assets/javascripts/blazer/{jquery_ujs.js → jquery-ujs.js} +161 -75
  25. data/app/assets/javascripts/blazer/jquery.js +9506 -9450
  26. data/app/assets/javascripts/blazer/jquery.stickytableheaders.js +321 -259
  27. data/app/assets/javascripts/blazer/moment-timezone-with-data.js +1212 -0
  28. data/app/assets/javascripts/blazer/queries.js +1 -1
  29. data/app/assets/javascripts/blazer/routes.js +3 -0
  30. data/app/assets/javascripts/blazer/selectize.js +3828 -3604
  31. data/app/assets/javascripts/blazer/stupidtable.js +255 -88
  32. data/app/assets/javascripts/blazer/vue.js +8015 -4583
  33. data/app/assets/stylesheets/blazer/application.css +41 -5
  34. data/app/assets/stylesheets/blazer/bootstrap.css.erb +879 -325
  35. data/app/assets/stylesheets/blazer/daterangepicker.css +269 -0
  36. data/app/assets/stylesheets/blazer/selectize.default.css +26 -10
  37. data/app/controllers/blazer/base_controller.rb +7 -0
  38. data/app/controllers/blazer/checks_controller.rb +1 -1
  39. data/app/controllers/blazer/dashboards_controller.rb +0 -4
  40. data/app/controllers/blazer/queries_controller.rb +20 -12
  41. data/app/helpers/blazer/base_helper.rb +1 -1
  42. data/app/mailers/blazer/slack_notifier.rb +76 -0
  43. data/app/models/blazer/check.rb +9 -0
  44. data/app/views/blazer/_nav.html.erb +0 -1
  45. data/app/views/blazer/_variables.html.erb +41 -19
  46. data/app/views/blazer/checks/_form.html.erb +16 -8
  47. data/app/views/blazer/checks/edit.html.erb +2 -0
  48. data/app/views/blazer/checks/index.html.erb +33 -4
  49. data/app/views/blazer/checks/new.html.erb +2 -0
  50. data/app/views/blazer/dashboards/_form.html.erb +4 -4
  51. data/app/views/blazer/dashboards/edit.html.erb +2 -0
  52. data/app/views/blazer/dashboards/new.html.erb +2 -0
  53. data/app/views/blazer/dashboards/show.html.erb +7 -3
  54. data/app/views/blazer/queries/_form.html.erb +11 -6
  55. data/app/views/blazer/queries/docs.html.erb +131 -0
  56. data/app/views/blazer/queries/home.html.erb +12 -3
  57. data/app/views/blazer/queries/run.html.erb +36 -6
  58. data/app/views/blazer/queries/schema.html.erb +46 -8
  59. data/app/views/blazer/queries/show.html.erb +4 -4
  60. data/app/views/layouts/blazer/application.html.erb +3 -3
  61. data/config/routes.rb +5 -1
  62. data/lib/blazer.rb +32 -13
  63. data/lib/blazer/adapters/athena_adapter.rb +1 -1
  64. data/lib/blazer/adapters/elasticsearch_adapter.rb +14 -17
  65. data/lib/blazer/adapters/mongodb_adapter.rb +1 -1
  66. data/lib/blazer/adapters/sql_adapter.rb +7 -1
  67. data/lib/blazer/engine.rb +4 -0
  68. data/lib/blazer/result.rb +62 -29
  69. data/lib/blazer/run_statement_job.rb +6 -9
  70. data/lib/blazer/version.rb +1 -1
  71. data/lib/generators/blazer/templates/config.yml.tt +13 -2
  72. data/lib/generators/blazer/templates/install.rb.tt +1 -0
  73. data/lib/tasks/blazer.rake +1 -0
  74. metadata +33 -37
  75. data/.gitattributes +0 -1
  76. data/.github/ISSUE_TEMPLATE.md +0 -7
  77. data/.gitignore +0 -14
  78. data/Gemfile +0 -7
  79. data/Rakefile +0 -1
  80. data/app/assets/javascripts/blazer/highlight.pack.js +0 -1
  81. data/app/assets/javascripts/blazer/moment-timezone.js +0 -1007
  82. data/app/assets/stylesheets/blazer/daterangepicker-bs3.css +0 -375
  83. data/blazer.gemspec +0 -30
@@ -1 +1,110 @@
1
- ace.define("ace/mode/sql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|when|else|end|type|left|right|join|on|outer|desc|asc",t="true|false|null",n="count|min|max|avg|sum|rank|now|coalesce",r=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"comment",start:"/\\*",end:"\\*/"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]},this.normalizeRules()};r.inherits(s,i),t.SqlHighlightRules=s}),ace.define("ace/mode/sql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sql_highlight_rules","ace/range"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./sql_highlight_rules").SqlHighlightRules,o=e("../range").Range,u=function(){this.HighlightRules=s};r.inherits(u,i),function(){this.lineCommentStart="--",this.$id="ace/mode/sql"}.call(u.prototype),t.Mode=u})
1
+ define("ace/mode/sql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2
+ "use strict";
3
+
4
+ var oop = require("../lib/oop");
5
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
6
+
7
+ var SqlHighlightRules = function() {
8
+
9
+ var keywords = (
10
+ "select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|" +
11
+ "when|then|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|" +
12
+ "foreign|not|references|default|null|inner|cross|natural|database|drop|grant"
13
+ );
14
+
15
+ var builtinConstants = (
16
+ "true|false"
17
+ );
18
+
19
+ var builtinFunctions = (
20
+ "avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|" +
21
+ "coalesce|ifnull|isnull|nvl"
22
+ );
23
+
24
+ var dataTypes = (
25
+ "int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|" +
26
+ "money|real|number|integer"
27
+ );
28
+
29
+ var keywordMapper = this.createKeywordMapper({
30
+ "support.function": builtinFunctions,
31
+ "keyword": keywords,
32
+ "constant.language": builtinConstants,
33
+ "storage.type": dataTypes
34
+ }, "identifier", true);
35
+
36
+ this.$rules = {
37
+ "start" : [ {
38
+ token : "comment",
39
+ regex : "--.*$"
40
+ }, {
41
+ token : "comment",
42
+ start : "/\\*",
43
+ end : "\\*/"
44
+ }, {
45
+ token : "string", // " string
46
+ regex : '".*?"'
47
+ }, {
48
+ token : "string", // ' string
49
+ regex : "'.*?'"
50
+ }, {
51
+ token : "string", // ` string (apache drill)
52
+ regex : "`.*?`"
53
+ }, {
54
+ token : "constant.numeric", // float
55
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
56
+ }, {
57
+ token : keywordMapper,
58
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
59
+ }, {
60
+ token : "keyword.operator",
61
+ regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="
62
+ }, {
63
+ token : "paren.lparen",
64
+ regex : "[\\(]"
65
+ }, {
66
+ token : "paren.rparen",
67
+ regex : "[\\)]"
68
+ }, {
69
+ token : "text",
70
+ regex : "\\s+"
71
+ } ]
72
+ };
73
+ this.normalizeRules();
74
+ };
75
+
76
+ oop.inherits(SqlHighlightRules, TextHighlightRules);
77
+
78
+ exports.SqlHighlightRules = SqlHighlightRules;
79
+ });
80
+
81
+ define("ace/mode/sql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sql_highlight_rules"], function(require, exports, module) {
82
+ "use strict";
83
+
84
+ var oop = require("../lib/oop");
85
+ var TextMode = require("./text").Mode;
86
+ var SqlHighlightRules = require("./sql_highlight_rules").SqlHighlightRules;
87
+
88
+ var Mode = function() {
89
+ this.HighlightRules = SqlHighlightRules;
90
+ this.$behaviour = this.$defaultBehaviour;
91
+ };
92
+ oop.inherits(Mode, TextMode);
93
+
94
+ (function() {
95
+
96
+ this.lineCommentStart = "--";
97
+
98
+ this.$id = "ace/mode/sql";
99
+ }).call(Mode.prototype);
100
+
101
+ exports.Mode = Mode;
102
+
103
+ }); (function() {
104
+ window.require(["ace/mode/sql"], function(m) {
105
+ if (typeof module == "object" && typeof exports == "object" && module) {
106
+ module.exports = m;
107
+ }
108
+ });
109
+ })();
110
+
@@ -1 +1,40 @@
1
- ace.define("ace/snippets/sql",["require","exports","module"],function(e,t,n){"use strict";t.snippetText="snippet tbl\n create table ${1:table} (\n ${2:columns}\n );\nsnippet col\n ${1:name} ${2:type} ${3:default ''} ${4:not null}\nsnippet ccol\n ${1:name} varchar2(${2:size}) ${3:default ''} ${4:not null}\nsnippet ncol\n ${1:name} number ${3:default 0} ${4:not null}\nsnippet dcol\n ${1:name} date ${3:default sysdate} ${4:not null}\nsnippet ind\n create index ${3:$1_$2} on ${1:table}(${2:column});\nsnippet uind\n create unique index ${1:name} on ${2:table}(${3:column});\nsnippet tblcom\n comment on table ${1:table} is '${2:comment}';\nsnippet colcom\n comment on column ${1:table}.${2:column} is '${3:comment}';\nsnippet addcol\n alter table ${1:table} add (${2:column} ${3:type});\nsnippet seq\n create sequence ${1:name} start with ${2:1} increment by ${3:1} minvalue ${4:1};\nsnippet s*\n select * from ${1:table}\n",t.scope="sql"})
1
+ define("ace/snippets/sql",["require","exports","module"], function(require, exports, module) {
2
+ "use strict";
3
+
4
+ exports.snippetText = "snippet tbl\n\
5
+ create table ${1:table} (\n\
6
+ ${2:columns}\n\
7
+ );\n\
8
+ snippet col\n\
9
+ ${1:name} ${2:type} ${3:default ''} ${4:not null}\n\
10
+ snippet ccol\n\
11
+ ${1:name} varchar2(${2:size}) ${3:default ''} ${4:not null}\n\
12
+ snippet ncol\n\
13
+ ${1:name} number ${3:default 0} ${4:not null}\n\
14
+ snippet dcol\n\
15
+ ${1:name} date ${3:default sysdate} ${4:not null}\n\
16
+ snippet ind\n\
17
+ create index ${3:$1_$2} on ${1:table}(${2:column});\n\
18
+ snippet uind\n\
19
+ create unique index ${1:name} on ${2:table}(${3:column});\n\
20
+ snippet tblcom\n\
21
+ comment on table ${1:table} is '${2:comment}';\n\
22
+ snippet colcom\n\
23
+ comment on column ${1:table}.${2:column} is '${3:comment}';\n\
24
+ snippet addcol\n\
25
+ alter table ${1:table} add (${2:column} ${3:type});\n\
26
+ snippet seq\n\
27
+ create sequence ${1:name} start with ${2:1} increment by ${3:1} minvalue ${4:1};\n\
28
+ snippet s*\n\
29
+ select * from ${1:table}\n\
30
+ ";
31
+ exports.scope = "sql";
32
+
33
+ }); (function() {
34
+ window.require(["ace/snippets/sql"], function(m) {
35
+ if (typeof module == "object" && typeof exports == "object" && module) {
36
+ module.exports = m;
37
+ }
38
+ });
39
+ })();
40
+
@@ -1 +1,14 @@
1
- ace.define("ace/snippets/text",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="text"})
1
+ define("ace/snippets/text",["require","exports","module"], function(require, exports, module) {
2
+ "use strict";
3
+
4
+ exports.snippetText =undefined;
5
+ exports.scope = "text";
6
+
7
+ }); (function() {
8
+ window.require(["ace/snippets/text"], function(m) {
9
+ if (typeof module == "object" && typeof exports == "object" && module) {
10
+ module.exports = m;
11
+ }
12
+ });
13
+ })();
14
+
@@ -1 +1,116 @@
1
- ace.define("ace/theme/twilight",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-twilight",t.cssText=".ace-twilight .ace_gutter {background: #232323;color: #E2E2E2}.ace-twilight .ace_print-margin {width: 1px;background: #232323}.ace-twilight {background-color: #141414;color: #F8F8F8}.ace-twilight .ace_cursor {color: #A7A7A7}.ace-twilight .ace_marker-layer .ace_selection {background: rgba(221, 240, 255, 0.20)}.ace-twilight.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #141414;border-radius: 2px}.ace-twilight .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-twilight .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 255, 255, 0.25)}.ace-twilight .ace_marker-layer .ace_active-line {background: rgba(255, 255, 255, 0.031)}.ace-twilight .ace_gutter-active-line {background-color: rgba(255, 255, 255, 0.031)}.ace-twilight .ace_marker-layer .ace_selected-word {border: 1px solid rgba(221, 240, 255, 0.20)}.ace-twilight .ace_invisible {color: rgba(255, 255, 255, 0.25)}.ace-twilight .ace_keyword,.ace-twilight .ace_meta {color: #CDA869}.ace-twilight .ace_constant,.ace-twilight .ace_constant.ace_character,.ace-twilight .ace_constant.ace_character.ace_escape,.ace-twilight .ace_constant.ace_other,.ace-twilight .ace_heading,.ace-twilight .ace_markup.ace_heading,.ace-twilight .ace_support.ace_constant {color: #CF6A4C}.ace-twilight .ace_invalid.ace_illegal {color: #F8F8F8;background-color: rgba(86, 45, 86, 0.75)}.ace-twilight .ace_invalid.ace_deprecated {text-decoration: underline;font-style: italic;color: #D2A8A1}.ace-twilight .ace_support {color: #9B859D}.ace-twilight .ace_fold {background-color: #AC885B;border-color: #F8F8F8}.ace-twilight .ace_support.ace_function {color: #DAD085}.ace-twilight .ace_list,.ace-twilight .ace_markup.ace_list,.ace-twilight .ace_storage {color: #F9EE98}.ace-twilight .ace_entity.ace_name.ace_function,.ace-twilight .ace_meta.ace_tag,.ace-twilight .ace_variable {color: #AC885B}.ace-twilight .ace_string {color: #8F9D6A}.ace-twilight .ace_string.ace_regexp {color: #E9C062}.ace-twilight .ace_comment {font-style: italic;color: #5F5A60}.ace-twilight .ace_variable {color: #7587A6}.ace-twilight .ace_xml-pe {color: #494949}.ace-twilight .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERFpYLC1tf0PAAgOAnPnhxyiAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
1
+ define("ace/theme/twilight",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
2
+
3
+ exports.isDark = true;
4
+ exports.cssClass = "ace-twilight";
5
+ exports.cssText = ".ace-twilight .ace_gutter {\
6
+ background: #232323;\
7
+ color: #E2E2E2\
8
+ }\
9
+ .ace-twilight .ace_print-margin {\
10
+ width: 1px;\
11
+ background: #232323\
12
+ }\
13
+ .ace-twilight {\
14
+ background-color: #141414;\
15
+ color: #F8F8F8\
16
+ }\
17
+ .ace-twilight .ace_cursor {\
18
+ color: #A7A7A7\
19
+ }\
20
+ .ace-twilight .ace_marker-layer .ace_selection {\
21
+ background: rgba(221, 240, 255, 0.20)\
22
+ }\
23
+ .ace-twilight.ace_multiselect .ace_selection.ace_start {\
24
+ box-shadow: 0 0 3px 0px #141414;\
25
+ }\
26
+ .ace-twilight .ace_marker-layer .ace_step {\
27
+ background: rgb(102, 82, 0)\
28
+ }\
29
+ .ace-twilight .ace_marker-layer .ace_bracket {\
30
+ margin: -1px 0 0 -1px;\
31
+ border: 1px solid rgba(255, 255, 255, 0.25)\
32
+ }\
33
+ .ace-twilight .ace_marker-layer .ace_active-line {\
34
+ background: rgba(255, 255, 255, 0.031)\
35
+ }\
36
+ .ace-twilight .ace_gutter-active-line {\
37
+ background-color: rgba(255, 255, 255, 0.031)\
38
+ }\
39
+ .ace-twilight .ace_marker-layer .ace_selected-word {\
40
+ border: 1px solid rgba(221, 240, 255, 0.20)\
41
+ }\
42
+ .ace-twilight .ace_invisible {\
43
+ color: rgba(255, 255, 255, 0.25)\
44
+ }\
45
+ .ace-twilight .ace_keyword,\
46
+ .ace-twilight .ace_meta {\
47
+ color: #CDA869\
48
+ }\
49
+ .ace-twilight .ace_constant,\
50
+ .ace-twilight .ace_constant.ace_character,\
51
+ .ace-twilight .ace_constant.ace_character.ace_escape,\
52
+ .ace-twilight .ace_constant.ace_other,\
53
+ .ace-twilight .ace_heading,\
54
+ .ace-twilight .ace_markup.ace_heading,\
55
+ .ace-twilight .ace_support.ace_constant {\
56
+ color: #CF6A4C\
57
+ }\
58
+ .ace-twilight .ace_invalid.ace_illegal {\
59
+ color: #F8F8F8;\
60
+ background-color: rgba(86, 45, 86, 0.75)\
61
+ }\
62
+ .ace-twilight .ace_invalid.ace_deprecated {\
63
+ text-decoration: underline;\
64
+ font-style: italic;\
65
+ color: #D2A8A1\
66
+ }\
67
+ .ace-twilight .ace_support {\
68
+ color: #9B859D\
69
+ }\
70
+ .ace-twilight .ace_fold {\
71
+ background-color: #AC885B;\
72
+ border-color: #F8F8F8\
73
+ }\
74
+ .ace-twilight .ace_support.ace_function {\
75
+ color: #DAD085\
76
+ }\
77
+ .ace-twilight .ace_list,\
78
+ .ace-twilight .ace_markup.ace_list,\
79
+ .ace-twilight .ace_storage {\
80
+ color: #F9EE98\
81
+ }\
82
+ .ace-twilight .ace_entity.ace_name.ace_function,\
83
+ .ace-twilight .ace_meta.ace_tag,\
84
+ .ace-twilight .ace_variable {\
85
+ color: #AC885B\
86
+ }\
87
+ .ace-twilight .ace_string {\
88
+ color: #8F9D6A\
89
+ }\
90
+ .ace-twilight .ace_string.ace_regexp {\
91
+ color: #E9C062\
92
+ }\
93
+ .ace-twilight .ace_comment {\
94
+ font-style: italic;\
95
+ color: #5F5A60\
96
+ }\
97
+ .ace-twilight .ace_variable {\
98
+ color: #7587A6\
99
+ }\
100
+ .ace-twilight .ace_xml-pe {\
101
+ color: #494949\
102
+ }\
103
+ .ace-twilight .ace_indent-guide {\
104
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERFpYLC1tf0PAAgOAnPnhxyiAAAAAElFTkSuQmCC) right repeat-y\
105
+ }";
106
+
107
+ var dom = require("../lib/dom");
108
+ dom.importCssString(exports.cssText, exports.cssClass);
109
+ }); (function() {
110
+ window.require(["ace/theme/twilight"], function(m) {
111
+ if (typeof module == "object" && typeof exports == "object" && module) {
112
+ module.exports = m;
113
+ }
114
+ });
115
+ })();
116
+
@@ -1,11 +1,11 @@
1
1
  //= require ./jquery
2
- //= require ./jquery_ujs
2
+ //= require ./jquery-ujs
3
3
  //= require ./stupidtable
4
4
  //= require ./jquery.stickytableheaders
5
5
  //= require ./selectize
6
- //= require ./highlight.pack
6
+ //= require ./highlight.min
7
7
  //= require ./moment
8
- //= require ./moment-timezone
8
+ //= require ./moment-timezone-with-data
9
9
  //= require ./daterangepicker
10
10
  //= require ./Chart.js
11
11
  //= require ./chartkick
@@ -19,6 +19,7 @@
19
19
  //= require ./select2
20
20
 
21
21
  Vue.config.devtools = false
22
+ Vue.config.productionTip = false
22
23
 
23
24
  $(document).on('mouseenter', '.dropdown-toggle', function () {
24
25
  $(this).parent().addClass('open')
@@ -1,29 +1,86 @@
1
1
  /*!
2
- * Bootstrap v3.3.5 (http://getbootstrap.com)
3
- * Copyright 2011-2015 Twitter, Inc.
4
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2
+ * Bootstrap v3.3.7 (http://getbootstrap.com)
3
+ * Copyright 2011-2016 Twitter, Inc.
4
+ * Licensed under the MIT license
5
5
  */
6
6
 
7
- /*!
8
- * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=d036843dd9c06213abe3)
9
- * Config saved to config.json and https://gist.github.com/d036843dd9c06213abe3
10
- */
11
7
  if (typeof jQuery === 'undefined') {
12
8
  throw new Error('Bootstrap\'s JavaScript requires jQuery')
13
9
  }
10
+
14
11
  +function ($) {
15
12
  'use strict';
16
13
  var version = $.fn.jquery.split(' ')[0].split('.')
17
- if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {
18
- throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')
14
+ if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) {
15
+ throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4')
16
+ }
17
+ }(jQuery);
18
+
19
+ /* ========================================================================
20
+ * Bootstrap: transition.js v3.3.7
21
+ * http://getbootstrap.com/javascript/#transitions
22
+ * ========================================================================
23
+ * Copyright 2011-2016 Twitter, Inc.
24
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
25
+ * ======================================================================== */
26
+
27
+
28
+ +function ($) {
29
+ 'use strict';
30
+
31
+ // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
32
+ // ============================================================
33
+
34
+ function transitionEnd() {
35
+ var el = document.createElement('bootstrap')
36
+
37
+ var transEndEventNames = {
38
+ WebkitTransition : 'webkitTransitionEnd',
39
+ MozTransition : 'transitionend',
40
+ OTransition : 'oTransitionEnd otransitionend',
41
+ transition : 'transitionend'
42
+ }
43
+
44
+ for (var name in transEndEventNames) {
45
+ if (el.style[name] !== undefined) {
46
+ return { end: transEndEventNames[name] }
47
+ }
48
+ }
49
+
50
+ return false // explicit for ie8 ( ._.)
51
+ }
52
+
53
+ // http://blog.alexmaccaw.com/css-transitions
54
+ $.fn.emulateTransitionEnd = function (duration) {
55
+ var called = false
56
+ var $el = this
57
+ $(this).one('bsTransitionEnd', function () { called = true })
58
+ var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
59
+ setTimeout(callback, duration)
60
+ return this
19
61
  }
62
+
63
+ $(function () {
64
+ $.support.transition = transitionEnd()
65
+
66
+ if (!$.support.transition) return
67
+
68
+ $.event.special.bsTransitionEnd = {
69
+ bindType: $.support.transition.end,
70
+ delegateType: $.support.transition.end,
71
+ handle: function (e) {
72
+ if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
73
+ }
74
+ }
75
+ })
76
+
20
77
  }(jQuery);
21
78
 
22
79
  /* ========================================================================
23
- * Bootstrap: alert.js v3.3.5
80
+ * Bootstrap: alert.js v3.3.7
24
81
  * http://getbootstrap.com/javascript/#alerts
25
82
  * ========================================================================
26
- * Copyright 2011-2015 Twitter, Inc.
83
+ * Copyright 2011-2016 Twitter, Inc.
27
84
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
28
85
  * ======================================================================== */
29
86
 
@@ -39,7 +96,7 @@ if (typeof jQuery === 'undefined') {
39
96
  $(el).on('click', dismiss, this.close)
40
97
  }
41
98
 
42
- Alert.VERSION = '3.3.5'
99
+ Alert.VERSION = '3.3.7'
43
100
 
44
101
  Alert.TRANSITION_DURATION = 150
45
102
 
@@ -52,7 +109,7 @@ if (typeof jQuery === 'undefined') {
52
109
  selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
53
110
  }
54
111
 
55
- var $parent = $(selector)
112
+ var $parent = $(selector === '#' ? [] : selector)
56
113
 
57
114
  if (e) e.preventDefault()
58
115
 
@@ -115,10 +172,10 @@ if (typeof jQuery === 'undefined') {
115
172
  }(jQuery);
116
173
 
117
174
  /* ========================================================================
118
- * Bootstrap: button.js v3.3.5
175
+ * Bootstrap: button.js v3.3.7
119
176
  * http://getbootstrap.com/javascript/#buttons
120
177
  * ========================================================================
121
- * Copyright 2011-2015 Twitter, Inc.
178
+ * Copyright 2011-2016 Twitter, Inc.
122
179
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
123
180
  * ======================================================================== */
124
181
 
@@ -135,7 +192,7 @@ if (typeof jQuery === 'undefined') {
135
192
  this.isLoading = false
136
193
  }
137
194
 
138
- Button.VERSION = '3.3.5'
195
+ Button.VERSION = '3.3.7'
139
196
 
140
197
  Button.DEFAULTS = {
141
198
  loadingText: 'loading...'
@@ -157,10 +214,10 @@ if (typeof jQuery === 'undefined') {
157
214
 
158
215
  if (state == 'loadingText') {
159
216
  this.isLoading = true
160
- $el.addClass(d).attr(d, d)
217
+ $el.addClass(d).attr(d, d).prop(d, true)
161
218
  } else if (this.isLoading) {
162
219
  this.isLoading = false
163
- $el.removeClass(d).removeAttr(d)
220
+ $el.removeClass(d).removeAttr(d).prop(d, false)
164
221
  }
165
222
  }, this), 0)
166
223
  }
@@ -224,10 +281,15 @@ if (typeof jQuery === 'undefined') {
224
281
 
225
282
  $(document)
226
283
  .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
227
- var $btn = $(e.target)
228
- if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
284
+ var $btn = $(e.target).closest('.btn')
229
285
  Plugin.call($btn, 'toggle')
230
- if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault()
286
+ if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) {
287
+ // Prevent double click on radios, and the double selections (so cancellation) on checkboxes
288
+ e.preventDefault()
289
+ // The target component still receive the focus
290
+ if ($btn.is('input,button')) $btn.trigger('focus')
291
+ else $btn.find('input:visible,button:visible').first().trigger('focus')
292
+ }
231
293
  })
232
294
  .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
233
295
  $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
@@ -236,10 +298,10 @@ if (typeof jQuery === 'undefined') {
236
298
  }(jQuery);
237
299
 
238
300
  /* ========================================================================
239
- * Bootstrap: carousel.js v3.3.5
301
+ * Bootstrap: carousel.js v3.3.7
240
302
  * http://getbootstrap.com/javascript/#carousel
241
303
  * ========================================================================
242
- * Copyright 2011-2015 Twitter, Inc.
304
+ * Copyright 2011-2016 Twitter, Inc.
243
305
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
244
306
  * ======================================================================== */
245
307
 
@@ -267,7 +329,7 @@ if (typeof jQuery === 'undefined') {
267
329
  .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
268
330
  }
269
331
 
270
- Carousel.VERSION = '3.3.5'
332
+ Carousel.VERSION = '3.3.7'
271
333
 
272
334
  Carousel.TRANSITION_DURATION = 600
273
335
 
@@ -474,138 +536,351 @@ if (typeof jQuery === 'undefined') {
474
536
  }(jQuery);
475
537
 
476
538
  /* ========================================================================
477
- * Bootstrap: dropdown.js v3.3.5
478
- * http://getbootstrap.com/javascript/#dropdowns
539
+ * Bootstrap: collapse.js v3.3.7
540
+ * http://getbootstrap.com/javascript/#collapse
479
541
  * ========================================================================
480
- * Copyright 2011-2015 Twitter, Inc.
542
+ * Copyright 2011-2016 Twitter, Inc.
481
543
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
482
544
  * ======================================================================== */
483
545
 
546
+ /* jshint latedef: false */
484
547
 
485
548
  +function ($) {
486
549
  'use strict';
487
550
 
488
- // DROPDOWN CLASS DEFINITION
489
- // =========================
551
+ // COLLAPSE PUBLIC CLASS DEFINITION
552
+ // ================================
490
553
 
491
- var backdrop = '.dropdown-backdrop'
492
- var toggle = '[data-toggle="dropdown"]'
493
- var Dropdown = function (element) {
494
- $(element).on('click.bs.dropdown', this.toggle)
495
- }
554
+ var Collapse = function (element, options) {
555
+ this.$element = $(element)
556
+ this.options = $.extend({}, Collapse.DEFAULTS, options)
557
+ this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
558
+ '[data-toggle="collapse"][data-target="#' + element.id + '"]')
559
+ this.transitioning = null
496
560
 
497
- Dropdown.VERSION = '3.3.5'
561
+ if (this.options.parent) {
562
+ this.$parent = this.getParent()
563
+ } else {
564
+ this.addAriaAndCollapsedClass(this.$element, this.$trigger)
565
+ }
498
566
 
499
- function getParent($this) {
500
- var selector = $this.attr('data-target')
567
+ if (this.options.toggle) this.toggle()
568
+ }
501
569
 
502
- if (!selector) {
503
- selector = $this.attr('href')
504
- selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
505
- }
570
+ Collapse.VERSION = '3.3.7'
506
571
 
507
- var $parent = selector && $(selector)
572
+ Collapse.TRANSITION_DURATION = 350
508
573
 
509
- return $parent && $parent.length ? $parent : $this.parent()
574
+ Collapse.DEFAULTS = {
575
+ toggle: true
510
576
  }
511
577
 
512
- function clearMenus(e) {
513
- if (e && e.which === 3) return
514
- $(backdrop).remove()
515
- $(toggle).each(function () {
516
- var $this = $(this)
517
- var $parent = getParent($this)
518
- var relatedTarget = { relatedTarget: this }
578
+ Collapse.prototype.dimension = function () {
579
+ var hasWidth = this.$element.hasClass('width')
580
+ return hasWidth ? 'width' : 'height'
581
+ }
519
582
 
520
- if (!$parent.hasClass('open')) return
583
+ Collapse.prototype.show = function () {
584
+ if (this.transitioning || this.$element.hasClass('in')) return
521
585
 
522
- if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
586
+ var activesData
587
+ var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
523
588
 
524
- $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
589
+ if (actives && actives.length) {
590
+ activesData = actives.data('bs.collapse')
591
+ if (activesData && activesData.transitioning) return
592
+ }
525
593
 
526
- if (e.isDefaultPrevented()) return
594
+ var startEvent = $.Event('show.bs.collapse')
595
+ this.$element.trigger(startEvent)
596
+ if (startEvent.isDefaultPrevented()) return
527
597
 
528
- $this.attr('aria-expanded', 'false')
529
- $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
530
- })
531
- }
598
+ if (actives && actives.length) {
599
+ Plugin.call(actives, 'hide')
600
+ activesData || actives.data('bs.collapse', null)
601
+ }
532
602
 
533
- Dropdown.prototype.toggle = function (e) {
534
- var $this = $(this)
603
+ var dimension = this.dimension()
535
604
 
536
- if ($this.is('.disabled, :disabled')) return
605
+ this.$element
606
+ .removeClass('collapse')
607
+ .addClass('collapsing')[dimension](0)
608
+ .attr('aria-expanded', true)
537
609
 
538
- var $parent = getParent($this)
539
- var isActive = $parent.hasClass('open')
610
+ this.$trigger
611
+ .removeClass('collapsed')
612
+ .attr('aria-expanded', true)
540
613
 
541
- clearMenus()
614
+ this.transitioning = 1
542
615
 
543
- if (!isActive) {
544
- if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
545
- // if mobile we use a backdrop because click events don't delegate
546
- $(document.createElement('div'))
547
- .addClass('dropdown-backdrop')
548
- .insertAfter($(this))
549
- .on('click', clearMenus)
550
- }
616
+ var complete = function () {
617
+ this.$element
618
+ .removeClass('collapsing')
619
+ .addClass('collapse in')[dimension]('')
620
+ this.transitioning = 0
621
+ this.$element
622
+ .trigger('shown.bs.collapse')
623
+ }
551
624
 
552
- var relatedTarget = { relatedTarget: this }
553
- $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
625
+ if (!$.support.transition) return complete.call(this)
554
626
 
555
- if (e.isDefaultPrevented()) return
627
+ var scrollSize = $.camelCase(['scroll', dimension].join('-'))
556
628
 
557
- $this
558
- .trigger('focus')
559
- .attr('aria-expanded', 'true')
629
+ this.$element
630
+ .one('bsTransitionEnd', $.proxy(complete, this))
631
+ .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
632
+ }
560
633
 
561
- $parent
562
- .toggleClass('open')
563
- .trigger('shown.bs.dropdown', relatedTarget)
564
- }
634
+ Collapse.prototype.hide = function () {
635
+ if (this.transitioning || !this.$element.hasClass('in')) return
565
636
 
566
- return false
567
- }
637
+ var startEvent = $.Event('hide.bs.collapse')
638
+ this.$element.trigger(startEvent)
639
+ if (startEvent.isDefaultPrevented()) return
568
640
 
569
- Dropdown.prototype.keydown = function (e) {
570
- if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
641
+ var dimension = this.dimension()
571
642
 
572
- var $this = $(this)
643
+ this.$element[dimension](this.$element[dimension]())[0].offsetHeight
573
644
 
574
- e.preventDefault()
575
- e.stopPropagation()
645
+ this.$element
646
+ .addClass('collapsing')
647
+ .removeClass('collapse in')
648
+ .attr('aria-expanded', false)
576
649
 
577
- if ($this.is('.disabled, :disabled')) return
650
+ this.$trigger
651
+ .addClass('collapsed')
652
+ .attr('aria-expanded', false)
578
653
 
579
- var $parent = getParent($this)
580
- var isActive = $parent.hasClass('open')
654
+ this.transitioning = 1
581
655
 
582
- if (!isActive && e.which != 27 || isActive && e.which == 27) {
583
- if (e.which == 27) $parent.find(toggle).trigger('focus')
584
- return $this.trigger('click')
656
+ var complete = function () {
657
+ this.transitioning = 0
658
+ this.$element
659
+ .removeClass('collapsing')
660
+ .addClass('collapse')
661
+ .trigger('hidden.bs.collapse')
585
662
  }
586
663
 
587
- var desc = ' li:not(.disabled):visible a'
588
- var $items = $parent.find('.dropdown-menu' + desc)
664
+ if (!$.support.transition) return complete.call(this)
589
665
 
590
- if (!$items.length) return
666
+ this.$element
667
+ [dimension](0)
668
+ .one('bsTransitionEnd', $.proxy(complete, this))
669
+ .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
670
+ }
591
671
 
592
- var index = $items.index(e.target)
672
+ Collapse.prototype.toggle = function () {
673
+ this[this.$element.hasClass('in') ? 'hide' : 'show']()
674
+ }
593
675
 
594
- if (e.which == 38 && index > 0) index-- // up
595
- if (e.which == 40 && index < $items.length - 1) index++ // down
596
- if (!~index) index = 0
676
+ Collapse.prototype.getParent = function () {
677
+ return $(this.options.parent)
678
+ .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
679
+ .each($.proxy(function (i, element) {
680
+ var $element = $(element)
681
+ this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
682
+ }, this))
683
+ .end()
684
+ }
597
685
 
598
- $items.eq(index).trigger('focus')
686
+ Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
687
+ var isOpen = $element.hasClass('in')
688
+
689
+ $element.attr('aria-expanded', isOpen)
690
+ $trigger
691
+ .toggleClass('collapsed', !isOpen)
692
+ .attr('aria-expanded', isOpen)
693
+ }
694
+
695
+ function getTargetFromTrigger($trigger) {
696
+ var href
697
+ var target = $trigger.attr('data-target')
698
+ || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
699
+
700
+ return $(target)
599
701
  }
600
702
 
601
703
 
602
- // DROPDOWN PLUGIN DEFINITION
704
+ // COLLAPSE PLUGIN DEFINITION
603
705
  // ==========================
604
706
 
605
707
  function Plugin(option) {
606
708
  return this.each(function () {
607
- var $this = $(this)
608
- var data = $this.data('bs.dropdown')
709
+ var $this = $(this)
710
+ var data = $this.data('bs.collapse')
711
+ var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
712
+
713
+ if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
714
+ if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
715
+ if (typeof option == 'string') data[option]()
716
+ })
717
+ }
718
+
719
+ var old = $.fn.collapse
720
+
721
+ $.fn.collapse = Plugin
722
+ $.fn.collapse.Constructor = Collapse
723
+
724
+
725
+ // COLLAPSE NO CONFLICT
726
+ // ====================
727
+
728
+ $.fn.collapse.noConflict = function () {
729
+ $.fn.collapse = old
730
+ return this
731
+ }
732
+
733
+
734
+ // COLLAPSE DATA-API
735
+ // =================
736
+
737
+ $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
738
+ var $this = $(this)
739
+
740
+ if (!$this.attr('data-target')) e.preventDefault()
741
+
742
+ var $target = getTargetFromTrigger($this)
743
+ var data = $target.data('bs.collapse')
744
+ var option = data ? 'toggle' : $this.data()
745
+
746
+ Plugin.call($target, option)
747
+ })
748
+
749
+ }(jQuery);
750
+
751
+ /* ========================================================================
752
+ * Bootstrap: dropdown.js v3.3.7
753
+ * http://getbootstrap.com/javascript/#dropdowns
754
+ * ========================================================================
755
+ * Copyright 2011-2016 Twitter, Inc.
756
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
757
+ * ======================================================================== */
758
+
759
+
760
+ +function ($) {
761
+ 'use strict';
762
+
763
+ // DROPDOWN CLASS DEFINITION
764
+ // =========================
765
+
766
+ var backdrop = '.dropdown-backdrop'
767
+ var toggle = '[data-toggle="dropdown"]'
768
+ var Dropdown = function (element) {
769
+ $(element).on('click.bs.dropdown', this.toggle)
770
+ }
771
+
772
+ Dropdown.VERSION = '3.3.7'
773
+
774
+ function getParent($this) {
775
+ var selector = $this.attr('data-target')
776
+
777
+ if (!selector) {
778
+ selector = $this.attr('href')
779
+ selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
780
+ }
781
+
782
+ var $parent = selector && $(selector)
783
+
784
+ return $parent && $parent.length ? $parent : $this.parent()
785
+ }
786
+
787
+ function clearMenus(e) {
788
+ if (e && e.which === 3) return
789
+ $(backdrop).remove()
790
+ $(toggle).each(function () {
791
+ var $this = $(this)
792
+ var $parent = getParent($this)
793
+ var relatedTarget = { relatedTarget: this }
794
+
795
+ if (!$parent.hasClass('open')) return
796
+
797
+ if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
798
+
799
+ $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
800
+
801
+ if (e.isDefaultPrevented()) return
802
+
803
+ $this.attr('aria-expanded', 'false')
804
+ $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
805
+ })
806
+ }
807
+
808
+ Dropdown.prototype.toggle = function (e) {
809
+ var $this = $(this)
810
+
811
+ if ($this.is('.disabled, :disabled')) return
812
+
813
+ var $parent = getParent($this)
814
+ var isActive = $parent.hasClass('open')
815
+
816
+ clearMenus()
817
+
818
+ if (!isActive) {
819
+ if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
820
+ // if mobile we use a backdrop because click events don't delegate
821
+ $(document.createElement('div'))
822
+ .addClass('dropdown-backdrop')
823
+ .insertAfter($(this))
824
+ .on('click', clearMenus)
825
+ }
826
+
827
+ var relatedTarget = { relatedTarget: this }
828
+ $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
829
+
830
+ if (e.isDefaultPrevented()) return
831
+
832
+ $this
833
+ .trigger('focus')
834
+ .attr('aria-expanded', 'true')
835
+
836
+ $parent
837
+ .toggleClass('open')
838
+ .trigger($.Event('shown.bs.dropdown', relatedTarget))
839
+ }
840
+
841
+ return false
842
+ }
843
+
844
+ Dropdown.prototype.keydown = function (e) {
845
+ if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
846
+
847
+ var $this = $(this)
848
+
849
+ e.preventDefault()
850
+ e.stopPropagation()
851
+
852
+ if ($this.is('.disabled, :disabled')) return
853
+
854
+ var $parent = getParent($this)
855
+ var isActive = $parent.hasClass('open')
856
+
857
+ if (!isActive && e.which != 27 || isActive && e.which == 27) {
858
+ if (e.which == 27) $parent.find(toggle).trigger('focus')
859
+ return $this.trigger('click')
860
+ }
861
+
862
+ var desc = ' li:not(.disabled):visible a'
863
+ var $items = $parent.find('.dropdown-menu' + desc)
864
+
865
+ if (!$items.length) return
866
+
867
+ var index = $items.index(e.target)
868
+
869
+ if (e.which == 38 && index > 0) index-- // up
870
+ if (e.which == 40 && index < $items.length - 1) index++ // down
871
+ if (!~index) index = 0
872
+
873
+ $items.eq(index).trigger('focus')
874
+ }
875
+
876
+
877
+ // DROPDOWN PLUGIN DEFINITION
878
+ // ==========================
879
+
880
+ function Plugin(option) {
881
+ return this.each(function () {
882
+ var $this = $(this)
883
+ var data = $this.data('bs.dropdown')
609
884
 
610
885
  if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
611
886
  if (typeof option == 'string') data[option].call($this)
@@ -640,10 +915,10 @@ if (typeof jQuery === 'undefined') {
640
915
  }(jQuery);
641
916
 
642
917
  /* ========================================================================
643
- * Bootstrap: modal.js v3.3.5
918
+ * Bootstrap: modal.js v3.3.7
644
919
  * http://getbootstrap.com/javascript/#modals
645
920
  * ========================================================================
646
- * Copyright 2011-2015 Twitter, Inc.
921
+ * Copyright 2011-2016 Twitter, Inc.
647
922
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
648
923
  * ======================================================================== */
649
924
 
@@ -674,7 +949,7 @@ if (typeof jQuery === 'undefined') {
674
949
  }
675
950
  }
676
951
 
677
- Modal.VERSION = '3.3.5'
952
+ Modal.VERSION = '3.3.7'
678
953
 
679
954
  Modal.TRANSITION_DURATION = 300
680
955
  Modal.BACKDROP_TRANSITION_DURATION = 150
@@ -781,7 +1056,9 @@ if (typeof jQuery === 'undefined') {
781
1056
  $(document)
782
1057
  .off('focusin.bs.modal') // guard against infinite focus loop
783
1058
  .on('focusin.bs.modal', $.proxy(function (e) {
784
- if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
1059
+ if (document !== e.target &&
1060
+ this.$element[0] !== e.target &&
1061
+ !this.$element.has(e.target).length) {
785
1062
  this.$element.trigger('focus')
786
1063
  }
787
1064
  }, this))
@@ -978,11 +1255,11 @@ if (typeof jQuery === 'undefined') {
978
1255
  }(jQuery);
979
1256
 
980
1257
  /* ========================================================================
981
- * Bootstrap: tooltip.js v3.3.5
1258
+ * Bootstrap: tooltip.js v3.3.7
982
1259
  * http://getbootstrap.com/javascript/#tooltip
983
1260
  * Inspired by the original jQuery.tipsy by Jason Frame
984
1261
  * ========================================================================
985
- * Copyright 2011-2015 Twitter, Inc.
1262
+ * Copyright 2011-2016 Twitter, Inc.
986
1263
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
987
1264
  * ======================================================================== */
988
1265
 
@@ -1005,7 +1282,7 @@ if (typeof jQuery === 'undefined') {
1005
1282
  this.init('tooltip', element, options)
1006
1283
  }
1007
1284
 
1008
- Tooltip.VERSION = '3.3.5'
1285
+ Tooltip.VERSION = '3.3.7'
1009
1286
 
1010
1287
  Tooltip.TRANSITION_DURATION = 150
1011
1288
 
@@ -1296,9 +1573,11 @@ if (typeof jQuery === 'undefined') {
1296
1573
 
1297
1574
  function complete() {
1298
1575
  if (that.hoverState != 'in') $tip.detach()
1299
- that.$element
1300
- .removeAttr('aria-describedby')
1301
- .trigger('hidden.bs.' + that.type)
1576
+ if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary.
1577
+ that.$element
1578
+ .removeAttr('aria-describedby')
1579
+ .trigger('hidden.bs.' + that.type)
1580
+ }
1302
1581
  callback && callback()
1303
1582
  }
1304
1583
 
@@ -1341,7 +1620,10 @@ if (typeof jQuery === 'undefined') {
1341
1620
  // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
1342
1621
  elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
1343
1622
  }
1344
- var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
1623
+ var isSvg = window.SVGElement && el instanceof window.SVGElement
1624
+ // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3.
1625
+ // See https://github.com/twbs/bootstrap/issues/20280
1626
+ var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset())
1345
1627
  var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
1346
1628
  var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
1347
1629
 
@@ -1457,6 +1739,7 @@ if (typeof jQuery === 'undefined') {
1457
1739
  that.$tip = null
1458
1740
  that.$arrow = null
1459
1741
  that.$viewport = null
1742
+ that.$element = null
1460
1743
  })
1461
1744
  }
1462
1745
 
@@ -1493,10 +1776,10 @@ if (typeof jQuery === 'undefined') {
1493
1776
  }(jQuery);
1494
1777
 
1495
1778
  /* ========================================================================
1496
- * Bootstrap: popover.js v3.3.5
1779
+ * Bootstrap: popover.js v3.3.7
1497
1780
  * http://getbootstrap.com/javascript/#popovers
1498
1781
  * ========================================================================
1499
- * Copyright 2011-2015 Twitter, Inc.
1782
+ * Copyright 2011-2016 Twitter, Inc.
1500
1783
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1501
1784
  * ======================================================================== */
1502
1785
 
@@ -1513,7 +1796,7 @@ if (typeof jQuery === 'undefined') {
1513
1796
 
1514
1797
  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
1515
1798
 
1516
- Popover.VERSION = '3.3.5'
1799
+ Popover.VERSION = '3.3.7'
1517
1800
 
1518
1801
  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
1519
1802
  placement: 'right',
@@ -1602,10 +1885,10 @@ if (typeof jQuery === 'undefined') {
1602
1885
  }(jQuery);
1603
1886
 
1604
1887
  /* ========================================================================
1605
- * Bootstrap: tab.js v3.3.5
1606
- * http://getbootstrap.com/javascript/#tabs
1888
+ * Bootstrap: scrollspy.js v3.3.7
1889
+ * http://getbootstrap.com/javascript/#scrollspy
1607
1890
  * ========================================================================
1608
- * Copyright 2011-2015 Twitter, Inc.
1891
+ * Copyright 2011-2016 Twitter, Inc.
1609
1892
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1610
1893
  * ======================================================================== */
1611
1894
 
@@ -1613,58 +1896,231 @@ if (typeof jQuery === 'undefined') {
1613
1896
  +function ($) {
1614
1897
  'use strict';
1615
1898
 
1616
- // TAB CLASS DEFINITION
1617
- // ====================
1618
-
1619
- var Tab = function (element) {
1620
- // jscs:disable requireDollarBeforejQueryAssignment
1621
- this.element = $(element)
1622
- // jscs:enable requireDollarBeforejQueryAssignment
1623
- }
1899
+ // SCROLLSPY CLASS DEFINITION
1900
+ // ==========================
1624
1901
 
1625
- Tab.VERSION = '3.3.5'
1902
+ function ScrollSpy(element, options) {
1903
+ this.$body = $(document.body)
1904
+ this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
1905
+ this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
1906
+ this.selector = (this.options.target || '') + ' .nav li > a'
1907
+ this.offsets = []
1908
+ this.targets = []
1909
+ this.activeTarget = null
1910
+ this.scrollHeight = 0
1626
1911
 
1627
- Tab.TRANSITION_DURATION = 150
1912
+ this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
1913
+ this.refresh()
1914
+ this.process()
1915
+ }
1628
1916
 
1629
- Tab.prototype.show = function () {
1630
- var $this = this.element
1631
- var $ul = $this.closest('ul:not(.dropdown-menu)')
1632
- var selector = $this.data('target')
1917
+ ScrollSpy.VERSION = '3.3.7'
1633
1918
 
1634
- if (!selector) {
1635
- selector = $this.attr('href')
1636
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
1637
- }
1919
+ ScrollSpy.DEFAULTS = {
1920
+ offset: 10
1921
+ }
1638
1922
 
1639
- if ($this.parent('li').hasClass('active')) return
1923
+ ScrollSpy.prototype.getScrollHeight = function () {
1924
+ return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
1925
+ }
1640
1926
 
1641
- var $previous = $ul.find('.active:last a')
1642
- var hideEvent = $.Event('hide.bs.tab', {
1643
- relatedTarget: $this[0]
1644
- })
1645
- var showEvent = $.Event('show.bs.tab', {
1646
- relatedTarget: $previous[0]
1647
- })
1927
+ ScrollSpy.prototype.refresh = function () {
1928
+ var that = this
1929
+ var offsetMethod = 'offset'
1930
+ var offsetBase = 0
1648
1931
 
1649
- $previous.trigger(hideEvent)
1650
- $this.trigger(showEvent)
1932
+ this.offsets = []
1933
+ this.targets = []
1934
+ this.scrollHeight = this.getScrollHeight()
1651
1935
 
1652
- if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
1936
+ if (!$.isWindow(this.$scrollElement[0])) {
1937
+ offsetMethod = 'position'
1938
+ offsetBase = this.$scrollElement.scrollTop()
1939
+ }
1653
1940
 
1654
- var $target = $(selector)
1941
+ this.$body
1942
+ .find(this.selector)
1943
+ .map(function () {
1944
+ var $el = $(this)
1945
+ var href = $el.data('target') || $el.attr('href')
1946
+ var $href = /^#./.test(href) && $(href)
1655
1947
 
1656
- this.activate($this.closest('li'), $ul)
1657
- this.activate($target, $target.parent(), function () {
1658
- $previous.trigger({
1659
- type: 'hidden.bs.tab',
1660
- relatedTarget: $this[0]
1661
- })
1662
- $this.trigger({
1663
- type: 'shown.bs.tab',
1664
- relatedTarget: $previous[0]
1948
+ return ($href
1949
+ && $href.length
1950
+ && $href.is(':visible')
1951
+ && [[$href[offsetMethod]().top + offsetBase, href]]) || null
1665
1952
  })
1666
- })
1667
- }
1953
+ .sort(function (a, b) { return a[0] - b[0] })
1954
+ .each(function () {
1955
+ that.offsets.push(this[0])
1956
+ that.targets.push(this[1])
1957
+ })
1958
+ }
1959
+
1960
+ ScrollSpy.prototype.process = function () {
1961
+ var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
1962
+ var scrollHeight = this.getScrollHeight()
1963
+ var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
1964
+ var offsets = this.offsets
1965
+ var targets = this.targets
1966
+ var activeTarget = this.activeTarget
1967
+ var i
1968
+
1969
+ if (this.scrollHeight != scrollHeight) {
1970
+ this.refresh()
1971
+ }
1972
+
1973
+ if (scrollTop >= maxScroll) {
1974
+ return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
1975
+ }
1976
+
1977
+ if (activeTarget && scrollTop < offsets[0]) {
1978
+ this.activeTarget = null
1979
+ return this.clear()
1980
+ }
1981
+
1982
+ for (i = offsets.length; i--;) {
1983
+ activeTarget != targets[i]
1984
+ && scrollTop >= offsets[i]
1985
+ && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
1986
+ && this.activate(targets[i])
1987
+ }
1988
+ }
1989
+
1990
+ ScrollSpy.prototype.activate = function (target) {
1991
+ this.activeTarget = target
1992
+
1993
+ this.clear()
1994
+
1995
+ var selector = this.selector +
1996
+ '[data-target="' + target + '"],' +
1997
+ this.selector + '[href="' + target + '"]'
1998
+
1999
+ var active = $(selector)
2000
+ .parents('li')
2001
+ .addClass('active')
2002
+
2003
+ if (active.parent('.dropdown-menu').length) {
2004
+ active = active
2005
+ .closest('li.dropdown')
2006
+ .addClass('active')
2007
+ }
2008
+
2009
+ active.trigger('activate.bs.scrollspy')
2010
+ }
2011
+
2012
+ ScrollSpy.prototype.clear = function () {
2013
+ $(this.selector)
2014
+ .parentsUntil(this.options.target, '.active')
2015
+ .removeClass('active')
2016
+ }
2017
+
2018
+
2019
+ // SCROLLSPY PLUGIN DEFINITION
2020
+ // ===========================
2021
+
2022
+ function Plugin(option) {
2023
+ return this.each(function () {
2024
+ var $this = $(this)
2025
+ var data = $this.data('bs.scrollspy')
2026
+ var options = typeof option == 'object' && option
2027
+
2028
+ if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
2029
+ if (typeof option == 'string') data[option]()
2030
+ })
2031
+ }
2032
+
2033
+ var old = $.fn.scrollspy
2034
+
2035
+ $.fn.scrollspy = Plugin
2036
+ $.fn.scrollspy.Constructor = ScrollSpy
2037
+
2038
+
2039
+ // SCROLLSPY NO CONFLICT
2040
+ // =====================
2041
+
2042
+ $.fn.scrollspy.noConflict = function () {
2043
+ $.fn.scrollspy = old
2044
+ return this
2045
+ }
2046
+
2047
+
2048
+ // SCROLLSPY DATA-API
2049
+ // ==================
2050
+
2051
+ $(window).on('load.bs.scrollspy.data-api', function () {
2052
+ $('[data-spy="scroll"]').each(function () {
2053
+ var $spy = $(this)
2054
+ Plugin.call($spy, $spy.data())
2055
+ })
2056
+ })
2057
+
2058
+ }(jQuery);
2059
+
2060
+ /* ========================================================================
2061
+ * Bootstrap: tab.js v3.3.7
2062
+ * http://getbootstrap.com/javascript/#tabs
2063
+ * ========================================================================
2064
+ * Copyright 2011-2016 Twitter, Inc.
2065
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2066
+ * ======================================================================== */
2067
+
2068
+
2069
+ +function ($) {
2070
+ 'use strict';
2071
+
2072
+ // TAB CLASS DEFINITION
2073
+ // ====================
2074
+
2075
+ var Tab = function (element) {
2076
+ // jscs:disable requireDollarBeforejQueryAssignment
2077
+ this.element = $(element)
2078
+ // jscs:enable requireDollarBeforejQueryAssignment
2079
+ }
2080
+
2081
+ Tab.VERSION = '3.3.7'
2082
+
2083
+ Tab.TRANSITION_DURATION = 150
2084
+
2085
+ Tab.prototype.show = function () {
2086
+ var $this = this.element
2087
+ var $ul = $this.closest('ul:not(.dropdown-menu)')
2088
+ var selector = $this.data('target')
2089
+
2090
+ if (!selector) {
2091
+ selector = $this.attr('href')
2092
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
2093
+ }
2094
+
2095
+ if ($this.parent('li').hasClass('active')) return
2096
+
2097
+ var $previous = $ul.find('.active:last a')
2098
+ var hideEvent = $.Event('hide.bs.tab', {
2099
+ relatedTarget: $this[0]
2100
+ })
2101
+ var showEvent = $.Event('show.bs.tab', {
2102
+ relatedTarget: $previous[0]
2103
+ })
2104
+
2105
+ $previous.trigger(hideEvent)
2106
+ $this.trigger(showEvent)
2107
+
2108
+ if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
2109
+
2110
+ var $target = $(selector)
2111
+
2112
+ this.activate($this.closest('li'), $ul)
2113
+ this.activate($target, $target.parent(), function () {
2114
+ $previous.trigger({
2115
+ type: 'hidden.bs.tab',
2116
+ relatedTarget: $this[0]
2117
+ })
2118
+ $this.trigger({
2119
+ type: 'shown.bs.tab',
2120
+ relatedTarget: $previous[0]
2121
+ })
2122
+ })
2123
+ }
1668
2124
 
1669
2125
  Tab.prototype.activate = function (element, container, callback) {
1670
2126
  var $active = container.find('> .active')
@@ -1758,10 +2214,10 @@ if (typeof jQuery === 'undefined') {
1758
2214
  }(jQuery);
1759
2215
 
1760
2216
  /* ========================================================================
1761
- * Bootstrap: affix.js v3.3.5
2217
+ * Bootstrap: affix.js v3.3.7
1762
2218
  * http://getbootstrap.com/javascript/#affix
1763
2219
  * ========================================================================
1764
- * Copyright 2011-2015 Twitter, Inc.
2220
+ * Copyright 2011-2016 Twitter, Inc.
1765
2221
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1766
2222
  * ======================================================================== */
1767
2223
 
@@ -1787,7 +2243,7 @@ if (typeof jQuery === 'undefined') {
1787
2243
  this.checkPosition()
1788
2244
  }
1789
2245
 
1790
- Affix.VERSION = '3.3.5'
2246
+ Affix.VERSION = '3.3.7'
1791
2247
 
1792
2248
  Affix.RESET = 'affix affix-top affix-bottom'
1793
2249
 
@@ -1919,448 +2375,3 @@ if (typeof jQuery === 'undefined') {
1919
2375
  })
1920
2376
 
1921
2377
  }(jQuery);
1922
-
1923
- /* ========================================================================
1924
- * Bootstrap: collapse.js v3.3.5
1925
- * http://getbootstrap.com/javascript/#collapse
1926
- * ========================================================================
1927
- * Copyright 2011-2015 Twitter, Inc.
1928
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1929
- * ======================================================================== */
1930
-
1931
-
1932
- +function ($) {
1933
- 'use strict';
1934
-
1935
- // COLLAPSE PUBLIC CLASS DEFINITION
1936
- // ================================
1937
-
1938
- var Collapse = function (element, options) {
1939
- this.$element = $(element)
1940
- this.options = $.extend({}, Collapse.DEFAULTS, options)
1941
- this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
1942
- '[data-toggle="collapse"][data-target="#' + element.id + '"]')
1943
- this.transitioning = null
1944
-
1945
- if (this.options.parent) {
1946
- this.$parent = this.getParent()
1947
- } else {
1948
- this.addAriaAndCollapsedClass(this.$element, this.$trigger)
1949
- }
1950
-
1951
- if (this.options.toggle) this.toggle()
1952
- }
1953
-
1954
- Collapse.VERSION = '3.3.5'
1955
-
1956
- Collapse.TRANSITION_DURATION = 350
1957
-
1958
- Collapse.DEFAULTS = {
1959
- toggle: true
1960
- }
1961
-
1962
- Collapse.prototype.dimension = function () {
1963
- var hasWidth = this.$element.hasClass('width')
1964
- return hasWidth ? 'width' : 'height'
1965
- }
1966
-
1967
- Collapse.prototype.show = function () {
1968
- if (this.transitioning || this.$element.hasClass('in')) return
1969
-
1970
- var activesData
1971
- var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
1972
-
1973
- if (actives && actives.length) {
1974
- activesData = actives.data('bs.collapse')
1975
- if (activesData && activesData.transitioning) return
1976
- }
1977
-
1978
- var startEvent = $.Event('show.bs.collapse')
1979
- this.$element.trigger(startEvent)
1980
- if (startEvent.isDefaultPrevented()) return
1981
-
1982
- if (actives && actives.length) {
1983
- Plugin.call(actives, 'hide')
1984
- activesData || actives.data('bs.collapse', null)
1985
- }
1986
-
1987
- var dimension = this.dimension()
1988
-
1989
- this.$element
1990
- .removeClass('collapse')
1991
- .addClass('collapsing')[dimension](0)
1992
- .attr('aria-expanded', true)
1993
-
1994
- this.$trigger
1995
- .removeClass('collapsed')
1996
- .attr('aria-expanded', true)
1997
-
1998
- this.transitioning = 1
1999
-
2000
- var complete = function () {
2001
- this.$element
2002
- .removeClass('collapsing')
2003
- .addClass('collapse in')[dimension]('')
2004
- this.transitioning = 0
2005
- this.$element
2006
- .trigger('shown.bs.collapse')
2007
- }
2008
-
2009
- if (!$.support.transition) return complete.call(this)
2010
-
2011
- var scrollSize = $.camelCase(['scroll', dimension].join('-'))
2012
-
2013
- this.$element
2014
- .one('bsTransitionEnd', $.proxy(complete, this))
2015
- .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
2016
- }
2017
-
2018
- Collapse.prototype.hide = function () {
2019
- if (this.transitioning || !this.$element.hasClass('in')) return
2020
-
2021
- var startEvent = $.Event('hide.bs.collapse')
2022
- this.$element.trigger(startEvent)
2023
- if (startEvent.isDefaultPrevented()) return
2024
-
2025
- var dimension = this.dimension()
2026
-
2027
- this.$element[dimension](this.$element[dimension]())[0].offsetHeight
2028
-
2029
- this.$element
2030
- .addClass('collapsing')
2031
- .removeClass('collapse in')
2032
- .attr('aria-expanded', false)
2033
-
2034
- this.$trigger
2035
- .addClass('collapsed')
2036
- .attr('aria-expanded', false)
2037
-
2038
- this.transitioning = 1
2039
-
2040
- var complete = function () {
2041
- this.transitioning = 0
2042
- this.$element
2043
- .removeClass('collapsing')
2044
- .addClass('collapse')
2045
- .trigger('hidden.bs.collapse')
2046
- }
2047
-
2048
- if (!$.support.transition) return complete.call(this)
2049
-
2050
- this.$element
2051
- [dimension](0)
2052
- .one('bsTransitionEnd', $.proxy(complete, this))
2053
- .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
2054
- }
2055
-
2056
- Collapse.prototype.toggle = function () {
2057
- this[this.$element.hasClass('in') ? 'hide' : 'show']()
2058
- }
2059
-
2060
- Collapse.prototype.getParent = function () {
2061
- return $(this.options.parent)
2062
- .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
2063
- .each($.proxy(function (i, element) {
2064
- var $element = $(element)
2065
- this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
2066
- }, this))
2067
- .end()
2068
- }
2069
-
2070
- Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
2071
- var isOpen = $element.hasClass('in')
2072
-
2073
- $element.attr('aria-expanded', isOpen)
2074
- $trigger
2075
- .toggleClass('collapsed', !isOpen)
2076
- .attr('aria-expanded', isOpen)
2077
- }
2078
-
2079
- function getTargetFromTrigger($trigger) {
2080
- var href
2081
- var target = $trigger.attr('data-target')
2082
- || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
2083
-
2084
- return $(target)
2085
- }
2086
-
2087
-
2088
- // COLLAPSE PLUGIN DEFINITION
2089
- // ==========================
2090
-
2091
- function Plugin(option) {
2092
- return this.each(function () {
2093
- var $this = $(this)
2094
- var data = $this.data('bs.collapse')
2095
- var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
2096
-
2097
- if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
2098
- if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
2099
- if (typeof option == 'string') data[option]()
2100
- })
2101
- }
2102
-
2103
- var old = $.fn.collapse
2104
-
2105
- $.fn.collapse = Plugin
2106
- $.fn.collapse.Constructor = Collapse
2107
-
2108
-
2109
- // COLLAPSE NO CONFLICT
2110
- // ====================
2111
-
2112
- $.fn.collapse.noConflict = function () {
2113
- $.fn.collapse = old
2114
- return this
2115
- }
2116
-
2117
-
2118
- // COLLAPSE DATA-API
2119
- // =================
2120
-
2121
- $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
2122
- var $this = $(this)
2123
-
2124
- if (!$this.attr('data-target')) e.preventDefault()
2125
-
2126
- var $target = getTargetFromTrigger($this)
2127
- var data = $target.data('bs.collapse')
2128
- var option = data ? 'toggle' : $this.data()
2129
-
2130
- Plugin.call($target, option)
2131
- })
2132
-
2133
- }(jQuery);
2134
-
2135
- /* ========================================================================
2136
- * Bootstrap: scrollspy.js v3.3.5
2137
- * http://getbootstrap.com/javascript/#scrollspy
2138
- * ========================================================================
2139
- * Copyright 2011-2015 Twitter, Inc.
2140
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2141
- * ======================================================================== */
2142
-
2143
-
2144
- +function ($) {
2145
- 'use strict';
2146
-
2147
- // SCROLLSPY CLASS DEFINITION
2148
- // ==========================
2149
-
2150
- function ScrollSpy(element, options) {
2151
- this.$body = $(document.body)
2152
- this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
2153
- this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
2154
- this.selector = (this.options.target || '') + ' .nav li > a'
2155
- this.offsets = []
2156
- this.targets = []
2157
- this.activeTarget = null
2158
- this.scrollHeight = 0
2159
-
2160
- this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
2161
- this.refresh()
2162
- this.process()
2163
- }
2164
-
2165
- ScrollSpy.VERSION = '3.3.5'
2166
-
2167
- ScrollSpy.DEFAULTS = {
2168
- offset: 10
2169
- }
2170
-
2171
- ScrollSpy.prototype.getScrollHeight = function () {
2172
- return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
2173
- }
2174
-
2175
- ScrollSpy.prototype.refresh = function () {
2176
- var that = this
2177
- var offsetMethod = 'offset'
2178
- var offsetBase = 0
2179
-
2180
- this.offsets = []
2181
- this.targets = []
2182
- this.scrollHeight = this.getScrollHeight()
2183
-
2184
- if (!$.isWindow(this.$scrollElement[0])) {
2185
- offsetMethod = 'position'
2186
- offsetBase = this.$scrollElement.scrollTop()
2187
- }
2188
-
2189
- this.$body
2190
- .find(this.selector)
2191
- .map(function () {
2192
- var $el = $(this)
2193
- var href = $el.data('target') || $el.attr('href')
2194
- var $href = /^#./.test(href) && $(href)
2195
-
2196
- return ($href
2197
- && $href.length
2198
- && $href.is(':visible')
2199
- && [[$href[offsetMethod]().top + offsetBase, href]]) || null
2200
- })
2201
- .sort(function (a, b) { return a[0] - b[0] })
2202
- .each(function () {
2203
- that.offsets.push(this[0])
2204
- that.targets.push(this[1])
2205
- })
2206
- }
2207
-
2208
- ScrollSpy.prototype.process = function () {
2209
- var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
2210
- var scrollHeight = this.getScrollHeight()
2211
- var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
2212
- var offsets = this.offsets
2213
- var targets = this.targets
2214
- var activeTarget = this.activeTarget
2215
- var i
2216
-
2217
- if (this.scrollHeight != scrollHeight) {
2218
- this.refresh()
2219
- }
2220
-
2221
- if (scrollTop >= maxScroll) {
2222
- return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
2223
- }
2224
-
2225
- if (activeTarget && scrollTop < offsets[0]) {
2226
- this.activeTarget = null
2227
- return this.clear()
2228
- }
2229
-
2230
- for (i = offsets.length; i--;) {
2231
- activeTarget != targets[i]
2232
- && scrollTop >= offsets[i]
2233
- && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
2234
- && this.activate(targets[i])
2235
- }
2236
- }
2237
-
2238
- ScrollSpy.prototype.activate = function (target) {
2239
- this.activeTarget = target
2240
-
2241
- this.clear()
2242
-
2243
- var selector = this.selector +
2244
- '[data-target="' + target + '"],' +
2245
- this.selector + '[href="' + target + '"]'
2246
-
2247
- var active = $(selector)
2248
- .parents('li')
2249
- .addClass('active')
2250
-
2251
- if (active.parent('.dropdown-menu').length) {
2252
- active = active
2253
- .closest('li.dropdown')
2254
- .addClass('active')
2255
- }
2256
-
2257
- active.trigger('activate.bs.scrollspy')
2258
- }
2259
-
2260
- ScrollSpy.prototype.clear = function () {
2261
- $(this.selector)
2262
- .parentsUntil(this.options.target, '.active')
2263
- .removeClass('active')
2264
- }
2265
-
2266
-
2267
- // SCROLLSPY PLUGIN DEFINITION
2268
- // ===========================
2269
-
2270
- function Plugin(option) {
2271
- return this.each(function () {
2272
- var $this = $(this)
2273
- var data = $this.data('bs.scrollspy')
2274
- var options = typeof option == 'object' && option
2275
-
2276
- if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
2277
- if (typeof option == 'string') data[option]()
2278
- })
2279
- }
2280
-
2281
- var old = $.fn.scrollspy
2282
-
2283
- $.fn.scrollspy = Plugin
2284
- $.fn.scrollspy.Constructor = ScrollSpy
2285
-
2286
-
2287
- // SCROLLSPY NO CONFLICT
2288
- // =====================
2289
-
2290
- $.fn.scrollspy.noConflict = function () {
2291
- $.fn.scrollspy = old
2292
- return this
2293
- }
2294
-
2295
-
2296
- // SCROLLSPY DATA-API
2297
- // ==================
2298
-
2299
- $(window).on('load.bs.scrollspy.data-api', function () {
2300
- $('[data-spy="scroll"]').each(function () {
2301
- var $spy = $(this)
2302
- Plugin.call($spy, $spy.data())
2303
- })
2304
- })
2305
-
2306
- }(jQuery);
2307
-
2308
- /* ========================================================================
2309
- * Bootstrap: transition.js v3.3.5
2310
- * http://getbootstrap.com/javascript/#transitions
2311
- * ========================================================================
2312
- * Copyright 2011-2015 Twitter, Inc.
2313
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2314
- * ======================================================================== */
2315
-
2316
-
2317
- +function ($) {
2318
- 'use strict';
2319
-
2320
- // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
2321
- // ============================================================
2322
-
2323
- function transitionEnd() {
2324
- var el = document.createElement('bootstrap')
2325
-
2326
- var transEndEventNames = {
2327
- WebkitTransition : 'webkitTransitionEnd',
2328
- MozTransition : 'transitionend',
2329
- OTransition : 'oTransitionEnd otransitionend',
2330
- transition : 'transitionend'
2331
- }
2332
-
2333
- for (var name in transEndEventNames) {
2334
- if (el.style[name] !== undefined) {
2335
- return { end: transEndEventNames[name] }
2336
- }
2337
- }
2338
-
2339
- return false // explicit for ie8 ( ._.)
2340
- }
2341
-
2342
- // http://blog.alexmaccaw.com/css-transitions
2343
- $.fn.emulateTransitionEnd = function (duration) {
2344
- var called = false
2345
- var $el = this
2346
- $(this).one('bsTransitionEnd', function () { called = true })
2347
- var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
2348
- setTimeout(callback, duration)
2349
- return this
2350
- }
2351
-
2352
- $(function () {
2353
- $.support.transition = transitionEnd()
2354
-
2355
- if (!$.support.transition) return
2356
-
2357
- $.event.special.bsTransitionEnd = {
2358
- bindType: $.support.transition.end,
2359
- delegateType: $.support.transition.end,
2360
- handle: function (e) {
2361
- if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
2362
- }
2363
- }
2364
- })
2365
-
2366
- }(jQuery);