')).parent().data('animated', false);
74 |
75 | if ($element.data('animated') !== false)
76 | $div.addClass('switch-animate').data('animated', true);
77 |
78 | $div
79 | .append($switchLeft)
80 | .append($label)
81 | .append($switchRight);
82 |
83 | $element.find('>div').addClass(
84 | $element.find('input').is(':checked') ? 'switch-on' : 'switch-off'
85 | );
86 |
87 | if ($element.find('input').is(':disabled'))
88 | $(this).addClass('deactivate');
89 |
90 | var changeStatus = function ($this) {
91 | $this.siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
92 | };
93 |
94 | $element.on('keydown', function (e) {
95 | if (e.keyCode === 32) {
96 | e.stopImmediatePropagation();
97 | e.preventDefault();
98 | changeStatus($(e.target).find('span:first'));
99 | }
100 | });
101 |
102 | $switchLeft.on('click', function (e) {
103 | changeStatus($(this));
104 | });
105 |
106 | $switchRight.on('click', function (e) {
107 | changeStatus($(this));
108 | });
109 |
110 | $element.find('input').on('change', function (e) {
111 | var $this = $(this)
112 | , $element = $this.parent()
113 | , thisState = $this.is(':checked')
114 | , state = $element.is('.switch-off');
115 |
116 | e.preventDefault();
117 |
118 | $element.css('left', '');
119 |
120 | if (state === thisState) {
121 |
122 | if (thisState)
123 | $element.removeClass('switch-off').addClass('switch-on');
124 | else $element.removeClass('switch-on').addClass('switch-off');
125 |
126 | if ($element.data('animated') !== false)
127 | $element.addClass("switch-animate");
128 |
129 | $element.parent().trigger('switch-change', {'el': $this, 'value': thisState})
130 | }
131 | });
132 |
133 | $element.find('label').on('mousedown touchstart', function (e) {
134 | var $this = $(this);
135 | moving = false;
136 |
137 | e.preventDefault();
138 | e.stopImmediatePropagation();
139 |
140 | $this.closest('div').removeClass('switch-animate');
141 |
142 | if ($this.closest('.has-switch').is('.deactivate'))
143 | $this.unbind('click');
144 | else {
145 | $this.on('mousemove touchmove', function (e) {
146 | var $element = $(this).closest('.switch')
147 | , relativeX = (e.pageX || e.originalEvent.targetTouches[0].pageX) - $element.offset().left
148 | , percent = (relativeX / $element.width()) * 100
149 | , left = 25
150 | , right = 75;
151 |
152 | moving = true;
153 |
154 | if (percent < left)
155 | percent = left;
156 | else if (percent > right)
157 | percent = right;
158 |
159 | $element.find('>div').css('left', (percent - right) + "%")
160 | });
161 |
162 | $this.on('click touchend', function (e) {
163 | var $this = $(this)
164 | , $target = $(e.target)
165 | , $myCheckBox = $target.siblings('input');
166 |
167 | e.stopImmediatePropagation();
168 | e.preventDefault();
169 |
170 | $this.unbind('mouseleave');
171 |
172 | if (moving)
173 | $myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25));
174 | else $myCheckBox.prop("checked", !$myCheckBox.is(":checked"));
175 |
176 | moving = false;
177 | $myCheckBox.trigger('change');
178 | });
179 |
180 | $this.on('mouseleave', function (e) {
181 | var $this = $(this)
182 | , $myCheckBox = $this.siblings('input');
183 |
184 | e.preventDefault();
185 | e.stopImmediatePropagation();
186 |
187 | $this.unbind('mouseleave');
188 | $this.trigger('mouseup');
189 |
190 | $myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25)).trigger('change');
191 | });
192 |
193 | $this.on('mouseup', function (e) {
194 | e.stopImmediatePropagation();
195 | e.preventDefault();
196 |
197 | $(this).unbind('mousemove');
198 | });
199 | }
200 | });
201 | }
202 | );
203 | },
204 | toggleActivation: function () {
205 | $(this).toggleClass('deactivate');
206 | },
207 | isActive: function () {
208 | return !$(this).hasClass('deactivate');
209 | },
210 | setActive: function (active) {
211 | if (active)
212 | $(this).removeClass('deactivate');
213 | else $(this).addClass('deactivate');
214 | },
215 | toggleState: function (skipOnChange) {
216 | var $input = $(this).find('input:checkbox');
217 | $input.prop('checked', !$input.is(':checked')).trigger('change', skipOnChange);
218 | },
219 | setState: function (value, skipOnChange) {
220 | $(this).find('input:checkbox').prop('checked', value).trigger('change', skipOnChange);
221 | },
222 | status: function () {
223 | return $(this).find('input:checkbox').is(':checked');
224 | },
225 | destroy: function () {
226 | var $div = $(this).find('div')
227 | , $checkbox;
228 |
229 | $div.find(':not(input:checkbox)').remove();
230 |
231 | $checkbox = $div.children();
232 | $checkbox.unwrap().unwrap();
233 |
234 | $checkbox.unbind('change');
235 |
236 | return $checkbox;
237 | }
238 | };
239 |
240 | if (methods[method])
241 | return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
242 | else if (typeof method === 'object' || !method)
243 | return methods.init.apply(this, arguments);
244 | else
245 | $.error('Method ' + method + ' does not exist!');
246 | };
247 | }(jQuery);
248 |
249 |
250 |
--------------------------------------------------------------------------------
/static/sass/fbt/_fresh-bootstrap-table.scss:
--------------------------------------------------------------------------------
1 | .fresh-table{
2 | background-color: $white-color;
3 | border-radius: $border-radius-extreme;
4 | color: $black-font;
5 |
6 | .btn{
7 | border-radius: $btn-round-radius !important;
8 | }
9 |
10 | a{
11 | color: $default-color;
12 |
13 | &:hover,
14 | &:focus{
15 | color: $default-states-color;
16 | }
17 | }
18 |
19 | input[type="radio"],
20 | input[type="checkbox"]{
21 | margin: 4px 5px 0 0;
22 | }
23 |
24 | .fixed-table-toolbar{
25 | border-radius: $border-radius-extreme $border-radius-extreme 0 0;
26 | padding: 10px 10px;
27 | color: $black-font;
28 |
29 | .dropdown-menu{
30 | overflow: visible;
31 | }
32 |
33 | .pull-right{
34 | .btn{
35 | margin-right: 5px;
36 | }
37 | }
38 |
39 | .pull-left{
40 | .btn{
41 | margin-left: 5px;
42 | }
43 | }
44 |
45 | .columns{
46 | label{
47 | padding: 4px 15px;
48 | padding: 4px 15px;
49 | color: #FFF;
50 | text-transform: uppercase;
51 | font-weight: bold;
52 | font-size: 12px;
53 | }
54 |
55 | ul > li:first-child{
56 | label{
57 | padding-top: 10px;
58 | }
59 | }
60 |
61 | ul > li:last-child{
62 | label{
63 | padding-bottom: 10px;
64 | }
65 | }
66 | }
67 |
68 | &:after{
69 | display: table;
70 | content: "";
71 | clear: both;
72 | }
73 | }
74 |
75 | &.toolbar-color-blue{
76 | .fixed-table-toolbar{
77 | @include card-radial-gradient ($icon-blue-color-top, $icon-blue-color-bottom);
78 | }
79 | }
80 |
81 | &.toolbar-color-azure{
82 | .fixed-table-toolbar{
83 | @include card-radial-gradient ($icon-azure-color-top, $icon-azure-color-bottom);
84 | }
85 | }
86 |
87 | &.toolbar-color-green{
88 | .fixed-table-toolbar{
89 | @include card-radial-gradient ($icon-green-color-top, $icon-green-color-bottom);
90 | }
91 | }
92 | &.toolbar-color-orange{
93 | .fixed-table-toolbar{
94 | @include card-radial-gradient ($icon-orange-color-top, $icon-orange-color-bottom);
95 | }
96 | }
97 | &.toolbar-color-red{
98 | .fixed-table-toolbar{
99 | @include card-radial-gradient ($icon-red-color-top, $icon-red-color-bottom);
100 | }
101 | }
102 |
103 |
104 | .fixed-table-pagination{
105 | margin: 0 10px;
106 |
107 | &:after{
108 | display: table;
109 | content: "";
110 | clear: both;
111 | }
112 |
113 | .dropup .dropdown-menu{
114 | margin-top: auto;
115 | margin-bottom: 10px;
116 | }
117 |
118 | div.pagination,
119 | .pagination-detail{
120 | margin-top: 15px;
121 | margin-bottom: 15px;
122 | }
123 | }
124 |
125 | .bootstrap-table .table tbody > tr > td:first-child,{
126 | padding-left: 18px !important;
127 | }
128 |
129 | .bootstrap-table .table thead > tr > th:first-child{
130 | padding-left: 10px !important;
131 | }
132 |
133 | .table > thead > tr > th,
134 | .table > tbody > tr > th,
135 | .table > tfoot > tr > th{
136 | border-color: $light-gray;
137 | }
138 |
139 | .table{
140 | > thead > tr > td,
141 | > tbody > tr >td,
142 | > tfoot > tr >td{
143 | border-color: rgba(220, 220, 220, 0.15);
144 | }
145 |
146 | &.table-striped > thead > tr > td,
147 | &.table-striped > tbody > tr >td,
148 | &.table-striped > tfoot > tr >td{
149 | border: none;
150 | }
151 |
152 | }
153 |
154 | .pagination > li > a,
155 | .pagination > li > span,
156 | .pagination > li:first-child > a,
157 | .pagination > li:first-child > span,
158 | .pagination > li:last-child > a,
159 | .pagination > li:last-child > span{
160 | border-radius: 20px;
161 | margin: 0 2px;
162 | background-color: transparent;
163 | min-width: 36px;
164 | height: 36px;
165 | font-weight: bold;
166 | text-align: center;
167 | line-height: 20px;
168 |
169 | border-width: 2px;
170 | color: $default-color;
171 | border-color: transparent;
172 |
173 | @include opacity(.7);
174 |
175 | &:hover{
176 | color: $default-states-color;
177 | border-color: $default-states-color;
178 | @include opacity(1);
179 | }
180 | }
181 |
182 | .pagination > li.active > a,
183 | .pagination > li.active > span,
184 | .pagination > li.active > a:hover,
185 | .pagination > li.active > span:hover,
186 | .pagination > li.active > a:focus,
187 | .pagination > li.active > span:focus {
188 | color: $default-states-color;
189 | border-color: $default-color;
190 | background-color: transparent;
191 | @include opacity(1);
192 | }
193 |
194 | &[class*="full-color-"],
195 | &[class*="toolbar-color-"]{
196 | .table-hover > tbody > tr:hover {
197 | background-color: rgba(255, 255, 255, .20);
198 | }
199 |
200 | .fixed-table-toolbar{
201 | .btn{
202 | @include btn-styles($light-white, $white-states-color);
203 | }
204 | }
205 |
206 | .form-control{
207 | border-color: $light-white;
208 | background-color: transparent;
209 | color: $white-color;
210 |
211 | &:focus{
212 | border-color: $white-color;
213 | background-color: rgba(255,255,255,.15);
214 | }
215 |
216 | &::-moz-placeholder{
217 | @include placeholder($light-white,1);
218 | }
219 | &:-moz-placeholder{
220 | @include placeholder($light-white,1);
221 | }
222 | &::-webkit-input-placeholder{
223 | @include placeholder($light-white,1);
224 | }
225 | &:-ms-input-placeholder{
226 | @include placeholder($light-white,1);
227 | }
228 | }
229 |
230 | }
231 |
232 | &[class*="full-color-"]{
233 | .table td{
234 | a{
235 | color: $light-white;
236 |
237 | &:hover,
238 | &:focus{
239 | color: $white-color;
240 | }
241 | }
242 | }
243 |
244 | .btn{
245 | @include btn-styles($light-white, $white-states-color);
246 | }
247 |
248 | .fixed-table-toolbar{
249 | background: none !important;
250 | border-color: rgba(255,255,255,.15);
251 | color: $white-color;
252 | }
253 | .fixed-table-header,
254 | .fixed-table-body{
255 | color: $white-color;
256 | }
257 |
258 | .table-striped > tbody > tr:nth-of-type(odd) {
259 | background-color: rgba(255, 255, 255, .15);
260 |
261 | &:hover{
262 | background-color: rgba(255,255,255,.25);
263 | }
264 | }
265 |
266 | .table > thead > tr > th,
267 | .table > tbody > tr > th,
268 | .table > tfoot > tr > th{
269 | border-color: rgba(255,255,255, .15);
270 | }
271 |
272 | .fixed-table-pagination{
273 | color: $white-color;
274 |
275 | }
276 |
277 | .pagination > li > a,
278 | .pagination > li > span,
279 | .pagination > li:first-child > a,
280 | .pagination > li:first-child > span,
281 | .pagination > li:last-child > a,
282 | .pagination > li:last-child > span{
283 | color: $light-white;
284 |
285 | &:hover{
286 | color: $white-color;
287 | border-color: $light-white;
288 | @include opacity(1);
289 | }
290 | }
291 |
292 | .pagination > li.active > a,
293 | .pagination > li.active > span,
294 | .pagination > li.active > a:hover,
295 | .pagination > li.active > span:hover,
296 | .pagination > li.active > a:focus,
297 | .pagination > li.active > span:focus {
298 | color: $white-color;
299 | border-color: $white-color;
300 | }
301 |
302 |
303 | }
304 |
305 | .fixed-table-container{
306 | border: none;
307 |
308 | thead th{
309 | border-left: 0;
310 |
311 | .th-inner{
312 | padding: 20px 8px 0;
313 | }
314 | }
315 |
316 | tbody td{
317 | border-left: 0;
318 | }
319 | }
320 |
321 | &.full-color-blue{
322 | @include card-radial-gradient ($icon-blue-color-top, $icon-blue-color-bottom);
323 | }
324 |
325 | &.full-color-azure{
326 | @include card-radial-gradient ($icon-azure-color-top, $icon-azure-color-bottom);
327 | }
328 |
329 | &.full-color-green{
330 | @include card-radial-gradient ($icon-green-color-top, $icon-green-color-bottom);
331 | }
332 | &.full-color-orange{
333 | @include card-radial-gradient ($icon-orange-color-top, $icon-orange-color-bottom);
334 | }
335 | &.full-color-red{
336 | @include card-radial-gradient ($icon-red-color-top, $icon-red-color-bottom);
337 | }
338 |
339 |
340 | .table-action{
341 | padding: 0 3px;
342 | }
343 |
344 | .bootstrap-table{
345 |
346 | .table{
347 | > thead > tr > th{
348 | border-bottom-width: 1px;
349 | font-size: 12px;
350 | font-weight: $font-weight-bold;
351 | text-transform: uppercase;
352 | }
353 |
354 | .radio,
355 | .checkbox{
356 | margin-top: 0;
357 | margin-bottom: 0;
358 | padding: 0;
359 | width: 15px;
360 | }
361 | > tfoot > tr > th,
362 | > thead > tr > td,
363 | > tbody > tr > td,
364 | > tfoot > tr > td{
365 | padding: 12px 8px !important;
366 | vertical-align: middle;
367 | }
368 |
369 |
370 | > tbody > tr{
371 | position: relative;
372 |
373 | &:hover{
374 | .td-actions .btn{
375 | @include opacity(1);
376 | }
377 | }
378 | }
379 | }
380 | }
381 |
382 | &.full-screen-table{
383 | border-radius: 0;
384 |
385 | .fixed-table-toolbar{
386 | border-radius: 0;
387 | }
388 | }
389 |
390 | .fa{
391 | min-width: 18px;
392 | }
393 |
394 | }
--------------------------------------------------------------------------------
/static/css/demo.css:
--------------------------------------------------------------------------------
1 | body{
2 | background: #938982; /* Old browsers */
3 | background: url('../img/bg.jpg');
4 | background-size: cover;
5 | height: 100vh;
6 |
7 | background-attachment: fixed;
8 | background-size: 100% 100%;
9 |
10 | }
11 |
12 | .fresh-table{
13 | margin-top: 45px;
14 | box-shadow: -15px 27px 69px rgba(0,0,0,.30);
15 | margin-bottom: 50px;
16 | }
17 | .fresh-table.full-screen-table{
18 | margin-top: 0;
19 | }
20 |
21 | .description{
22 | margin-top: 60px;
23 | text-align: center;
24 | }
25 | .description-footer{
26 | margin-bottom: 20px;
27 | }
28 |
29 | .ct-heart{
30 | color: #F74933;
31 | }
32 | .description-footer p{
33 | text-align: center;
34 | color: #eeeeee;
35 | margin-top: 100px;
36 | }
37 | .description-footer a{
38 | color: #FFFFFF;
39 | }
40 |
41 | .description-footer .social-area{
42 | margin: 0 auto;
43 | }
44 | .description-footer > div{
45 | display: inline-block;
46 | }
47 |
48 | h2{
49 | font-size: 28px;
50 | }
51 | h1{
52 | font-size: 38px;
53 | }
54 | h1 small{
55 | color: #EEE;
56 | }
57 | /* For demo purpose */
58 |
59 |
60 | .fixed-plugin{
61 | position: absolute;
62 | top: 150px;
63 | right: 0;
64 | width: 64px;
65 | background: rgba(0,0,0,.3);
66 | z-index: 1031;
67 | border-radius: 8px 0 0 8px;
68 | text-align: center;
69 | }
70 | .fixed-plugin .fa-cog{
71 | color: #FFFFFF;
72 | padding: 10px;
73 | border-radius: 0 0 6px 6px;
74 | }
75 | .fixed-plugin .dropdown-menu{
76 | right: 80px;
77 | left: auto;
78 | width: 260px;
79 | border-radius: 10px;
80 | }
81 | .fixed-plugin .dropdown-menu:after, .fixed-plugin .dropdown-menu:before{
82 | right: 10px;
83 | margin-left: auto;
84 | left: auto;
85 | }
86 | .fixed-plugin .fa-circle-thin{
87 | color: #FFFFFF;
88 | }
89 | .fixed-plugin .active .fa-circle-thin{
90 | color: #00bbff;
91 | }
92 |
93 | .footer-dropdown{
94 | top: -120px !important;
95 | }
96 |
97 | .footer-dropdown:before, .footer-dropdown:after{
98 | top: 300px !important;
99 | }
100 |
101 | .fixed-plugin .dropdown-menu > .active > a,
102 | .fixed-plugin .dropdown-menu > .active > a:hover,
103 | .fixed-plugin .dropdown-menu > .active > a:focus{
104 | color: #777777;
105 | text-align: center;
106 | }
107 |
108 | .fixed-plugin img{
109 | border-radius: 6px;
110 | width: 230px;
111 | max-height: 175px;
112 | margin: 0 auto;
113 | }
114 |
115 | .fixed-plugin .btn:hover{
116 | color: #FFFFFF;
117 | }
118 | .fixed-plugin .badge{
119 | border: 3px solid #FFFFFF;
120 | border-radius: 50%;
121 | cursor: pointer;
122 | display: inline-block;
123 | height: 23px;
124 | margin-right: 5px;
125 | position: relative;
126 | width: 23px;
127 | }
128 | .fixed-plugin .badge.active,
129 | .fixed-plugin .badge:hover{
130 | border-color: #00bbff;
131 | }
132 |
133 | .fixed-plugin .badge-white{
134 | background-color: #FFFFFF;
135 | }
136 | .fixed-plugin .badge-blue{
137 | background-color: #4087ea;
138 | }
139 | .fixed-plugin .badge-azure{
140 | background-color: #36AFEC;
141 | }
142 | .fixed-plugin .badge-green{
143 | background-color: #53A319;
144 | }
145 | .fixed-plugin .badge-orange{
146 | background-color: #ffb33b;
147 | }
148 |
149 | .fixed-plugin .badge-red{
150 | background-color: #ED362C;
151 | }
152 | .fixed-plugin h5{
153 | font-size: 14px;
154 | margin: 10px;
155 | }
156 | .fixed-plugin .dropdown-menu li{
157 | display: block;
158 | padding: 5px 10px;
159 | }
160 |
161 | .fixed-plugin li.adjustments-line,
162 | .fixed-plugin li.header-title{
163 | width: 100%;
164 | height: 50px;
165 | min-height: inherit;
166 | }
167 |
168 | .fixed-plugin li.header-title{
169 | height: 30px;
170 | line-height: 40px;
171 | font-size: 12px;
172 | font-weight: 600;
173 | text-transform: uppercase;
174 | padding: 0 15px;
175 | }
176 |
177 | .fixed-plugin .adjustments-line p{
178 | float: left;
179 | display: inline-block;
180 | margin-bottom: 0;
181 | font-size: 1em;
182 | }
183 | .fixed-plugin .adjustments-line .switch{
184 | float: right;
185 | }
186 | .fixed-plugin .dropdown-menu > li.adjustments-line > a{
187 | padding-right: 0;
188 | padding-left: 0;
189 | border-bottom: 1px solid #ddd;
190 | margin-left: 10px;
191 | margin-right: 10px;
192 | }
193 | .fixed-plugin .dropdown-menu > li > a.img-holder{
194 | font-size: 16px;
195 | text-align: center;
196 | border-radius: 10px;
197 | background-color: #FFF;
198 | border: 1px solid #e4e4e4;
199 | padding-left: 0;
200 | padding-right: 0;
201 | opacity: 1;
202 | cursor: pointer;
203 | }
204 |
205 | .fixed-plugin .dropdown-menu > li > a.switch-trigger:hover,
206 | .fixed-plugin .dropdown-menu > li > a.switch-trigger:focus{
207 | background-color: transparent;
208 | }
209 | .fixed-plugin .dropdown-menu > .active > a.img-holder,
210 | .fixed-plugin .dropdown-menu > .active > a.img-holder{
211 | border-color: #00bbff;
212 | background-color: #FFFFFF;
213 | }
214 |
215 | .fixed-plugin .dropdown-menu > li > a img{
216 | margin-top: auto;
217 | }
218 |
219 | .dropdown-menu > li > a:hover,
220 | .dropdown-menu > li > a:focus{
221 | opacity: 1;
222 | }
223 |
224 |
225 | /* ============================================================
226 | * bootstrapSwitch v1.3 by Larentis Mattia @spiritualGuru
227 | * http://www.larentis.eu/switch/
228 | * ============================================================
229 | * Licensed under the Apache License, Version 2.0
230 | * http://www.apache.org/licenses/LICENSE-2.0
231 | * ============================================================ */
232 |
233 | .has-switch {
234 | border-radius: 30px;
235 | cursor: pointer;
236 | display: inline-block;
237 | line-height: 1.72222;
238 | overflow: hidden;
239 | position: relative;
240 | text-align: left;
241 | width: 60px;
242 | -webkit-user-select: none;
243 | -moz-user-select: none;
244 | -ms-user-select: none;
245 | -o-user-select: none;
246 | user-select: none;
247 | /* this code is for fixing safari bug with hidden overflow for border-radius */
248 | -webkit-mask: url("../img/mask.png") 0 0 no-repeat;
249 | -webkit-mask-size: 60px 24px;
250 | mask: url("../img/mask.png") 0 0 no-repeat;
251 | }
252 |
253 | .has-switch.deactivate {
254 | opacity: 0.5;
255 | filter: alpha(opacity=50);
256 | cursor: default !important;
257 | }
258 |
259 | .has-switch.deactivate label,
260 | .has-switch.deactivate span {
261 | cursor: default !important;
262 | }
263 |
264 | .has-switch > div {
265 | position: relative;
266 | top: 0;
267 | width: 100px;
268 | }
269 |
270 | .has-switch > div.switch-animate {
271 | -webkit-transition: left 0.25s ease-out;
272 | transition: left 0.25s ease-out;
273 | }
274 |
275 | .has-switch > div.switch-off {
276 | left: -35px;
277 | }
278 |
279 | .has-switch > div.switch-on {
280 | left: 0;
281 | }
282 |
283 | .has-switch > div label {
284 | background-color: #FFFFFF;
285 | background: white;
286 | background: -moz-linear-gradient(top, white 0%, #f1f1f2 100%);
287 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, white), color-stop(100%, #f1f1f2));
288 | background: -webkit-linear-gradient(top, white 0%, #f1f1f2 100%);
289 | background: -o-linear-gradient(top, white 0%, #f1f1f2 100%);
290 | background: -ms-linear-gradient(top, white 0%, #f1f1f2 100%);
291 | background: linear-gradient(to bottom, white 0%, #f1f1f2 100%);
292 | box-shadow: 0 1px 1px #FFFFFF inset, 0 1px 1px rgba(0, 0, 0, 0.25);
293 | cursor: pointer;
294 | }
295 |
296 | .has-switch input[type=checkbox] {
297 | display: none;
298 | }
299 |
300 | .has-switch span {
301 | /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) inset; */
302 | cursor: pointer;
303 | float: left;
304 | font-size: 11px;
305 | font-weight: bold;
306 | height: 24px;
307 | line-height: 15px;
308 | margin: 0;
309 | padding-bottom: 6px;
310 | padding-top: 5px;
311 | position: relative;
312 | text-align: center;
313 | text-indent: -10px;
314 | width: 50%;
315 | z-index: 1;
316 | -webkit-transition: 0.25s ease-out;
317 | transition: 0.25s ease-out;
318 | }
319 |
320 | .has-switch span.switch-left {
321 | background-color: #474657;
322 | border-left: 1px solid transparent;
323 | border-radius: 30px 0 0 30px;
324 | color: #FFFFFF;
325 | }
326 |
327 | .has-switch .switch-off span.switch-left {
328 | background-color: #DDDDDD;
329 | }
330 |
331 | .has-switch span.switch-right {
332 | border-radius: 0 30px 30px 0;
333 | background-color: #474657;
334 | color: #ffffff;
335 | text-indent: 1px;
336 | }
337 |
338 | .has-switch .switch-off span.switch-right {
339 | background-color: #DDDDDD;
340 | }
341 |
342 | .has-switch label {
343 | border-radius: 12px;
344 | float: left;
345 | height: 22px;
346 | margin: 1px -13px;
347 | padding: 0;
348 | position: relative;
349 | transition: all 0.25s ease-out 0s;
350 | vertical-align: middle;
351 | width: 22px;
352 | z-index: 100;
353 | -webkit-transition: 0.25s ease-out;
354 | transition: 0.25s ease-out;
355 | }
356 |
357 | .has-switch .switch-on .fa-check:before {
358 | margin-left: 10px;
359 | }
360 |
361 | .has-switch:hover .switch-on label {
362 | margin: 1px -17px;
363 | width: 26px;
364 | }
365 |
366 | .has-switch:hover .switch-off label {
367 | margin: 1px -13px;
368 | width: 26px;
369 | }
370 |
371 |
372 | .logo-container{
373 | left: 50px;
374 | position: absolute;
375 | top: 20px;
376 | z-index: 3;
377 | }
378 | .logo-container.full-screen-table-demo{
379 | left: 13px;
380 | top: 10px;
381 | }
382 |
383 | .logo-container .logo{
384 | overflow: hidden;
385 | border-radius: 50%;
386 | border: 1px solid #333333;
387 | width: 60px;
388 | float: left;
389 | }
390 | .logo-container .brand{
391 | font-size: 18px;
392 | color: #FFFFFF;
393 | line-height: 20px;
394 | font-family: "Helvetica Neue",Helvetica,Arial, sans-serif;
395 | float: left;
396 | margin-left: 10px;
397 | margin-top: 10px;
398 | width: 60px
399 | }
400 |
401 |
402 |
403 | @media (min-width: 768px){
404 | .dropdown .dropdown-menu{
405 | -webkit-transform: translateY(-50%);
406 | -moz-transform: translateY(-50%);
407 | -o-transform: translateY(-50%);
408 | -ms-transform: translateY(-50%);
409 | transform: translateY(-50%);
410 | top: 27px;
411 | opacity: 0;
412 |
413 | transform-origin: 0 0;
414 | }
415 | .dropdown.open .dropdown-menu{
416 | opacity: 1;
417 |
418 | -webkit-transform: translateY(-50%);
419 | -moz-transform: translateY(-50%);
420 | -o-transform: translateY(-50%);
421 | -ms-transform: translateY(-50%);
422 | transform: translateY(-50%);
423 |
424 | transform-origin: 0 0;
425 | }
426 |
427 | .fixed-plugin .dropdown-menu:before,
428 | .fixed-plugin .dropdown-menu:after{
429 | content: "";
430 | display: inline-block;
431 | position: absolute;
432 | top: 50%;
433 | width: 16px;
434 | transform: translateY(-50%);
435 | -webkit-transform: translateY(-50%);
436 | -moz-transform: translateY(-50%);
437 |
438 | }
439 | .fixed-plugin .dropdown-menu:before{
440 | border-bottom: 16px solid rgba(0, 0, 0, 0);
441 | border-left: 16px solid rgba(0,0,0,0.2);
442 | border-top: 16px solid rgba(0,0,0,0);
443 | right: -16px;
444 | }
445 |
446 | .fixed-plugin .dropdown-menu:after{
447 | border-bottom: 16px solid rgba(0, 0, 0, 0);
448 | border-left: 16px solid #FFFFFF;
449 | border-top: 16px solid rgba(0,0,0,0);
450 | right: -15px;
451 | }
452 |
453 | }
454 |
455 | @media (max-width: 767px){
456 | .fixed-plugin .dropdown-menu{
457 | right: 60px;
458 | width: 220px;
459 | }
460 | .fixed-plugin .dropdown-menu li{
461 | width: 100%;
462 | }
463 | .fixed-plugin .adjustments-line .switch{
464 | float: left;
465 | margin: 0 10px;
466 | }
467 | .fixed-plugin li.adjustments-line{
468 | height: 80px;
469 | }
470 | .dropdown .dropdown-menu{
471 | top: -100px;
472 | }
473 | .fixed-plugin{
474 | top: 80px;
475 | right: 0px;
476 | }
477 |
478 | fixed-plugin img {
479 | max-width: 190px
480 | }
481 |
482 | .description {
483 | margin-top: 130px;
484 | }
485 | }
486 |
487 |
488 |
--------------------------------------------------------------------------------
/GsmEvil.py:
--------------------------------------------------------------------------------
1 | """
2 | About: This program shows you sender number, receiver number, sms text, sending time of cellphones around you.
3 |
4 | Disclaimer:-
5 | This program was made to understand how GSM network works. Not for bad hacking !
6 | We are not responsible for any illegal activity !
7 |
8 | About:-
9 | Author: sheryar (ninjhacks)
10 | Created on : 19/09/2019
11 | Program : GsmEvil
12 | Version : 2.0.0
13 | """
14 |
15 | import pyshark
16 | from optparse import OptionParser
17 | import os, sys
18 | from flask import Flask, render_template, request
19 | from flask_socketio import SocketIO, emit
20 | from threading import Thread, Event
21 | import sqlite3
22 | from datetime import datetime
23 | import logging
24 |
25 | grgsm = "off"
26 | gsm_sniffer = "off"
27 | imsi_sniffer = "off"
28 | sms_sniffer = "off"
29 | sql_conn = None
30 | lac = ""
31 | ci = ""
32 | imsi_id = 0
33 | imsi_live_db = {}
34 | sms_id = 0
35 | text = ""
36 | sender = ""
37 | receiver = ""
38 | time = ""
39 |
40 | class GsmSniffer():
41 |
42 | def sniffer():
43 | while True:
44 | if gsm_sniffer == "on":
45 | capture = pyshark.LiveCapture(interface='lo', bpf_filter='port 4729 and not icmp and udp')
46 | for packet in capture:
47 | if sms_sniffer == "off":
48 | if imsi_sniffer == "off":
49 | gsm_sniffer == "off"
50 | layer = packet.highest_layer
51 | if layer == "GSM_SMS":
52 | if sms_sniffer == "on":
53 | SmsEvil().get_sms(packet)
54 | elif layer == "GSM_A.CCCH":
55 | if imsi_sniffer == "on":
56 | ImsiEvil().get_imsi(packet)
57 | return gsm_sniffer
58 |
59 |
60 | class ImsiEvil:
61 |
62 | def sql_db(self):
63 | self.sql_conn = sqlite3.connect('database/imsi.db')
64 | self.sql_conn.execute('CREATE TABLE IF NOT EXISTS imsi_data(id INTEGER PRIMARY KEY, imsi TEXT, tmsi TEXT, mcc INTEGER, mnc INTEGER, lac INTEGER, ci INTEGER, date_time timestamp)')
65 |
66 | def save_data(self):
67 | date_time = datetime.now().strftime("%H:%M:%S %Y-%m-%d")
68 | self.sql_conn.execute('INSERT INTO imsi_data(imsi, tmsi, mcc, mnc, lac, ci, date_time) VALUES ( ?, ?, ?, ?, ?, ?, ?)',(self.imsi, self.tmsi, self.mcc, self.mnc, lac, ci, date_time))
69 | self.sql_conn.commit()
70 | self.max_id = self.sql_conn.execute('SELECT max(id) FROM imsi_data')
71 | self.imsi_id = self.max_id.fetchone()[0]
72 |
73 | def get_data(self):
74 | self.sql_db()
75 | self.cur = self.sql_conn.cursor()
76 | self.cur.execute('SELECT * FROM imsi_data WHERE imsi=' + self.imsi)
77 | self.data = self.cur.fetchall()
78 |
79 | def get_all_data(self):
80 | self.sql_db()
81 | self.cur = self.sql_conn.cursor()
82 | self.cur.execute('SELECT * FROM imsi_data')
83 | data = self.cur.fetchall()
84 | return data
85 |
86 | def update_data(self, id_, tmsi):
87 | self.sql_conn.execute('UPDATE imsi_data SET tmsi = ?, date_time = ? WHERE id= ?',(tmsi, id_, datetime.now().strftime("%H:%M:%S %Y-%m-%d")))
88 | self.sql_conn.commit()
89 |
90 | def filter_imsi(self):
91 | global imsi_id
92 | self.sql_db()
93 | self.get_data()
94 | data = self.data
95 | if data:
96 | data = self.data[0]
97 | if(self.imsi != data[1]):
98 | self.save_data()
99 | else:
100 | if (self.tmsi != data[2]) & (self.tmsi != ''): #Check if tmsi is different than update in file db
101 | self.update_data(data[0],self.tmsi)
102 | else:
103 | self.save_data()
104 |
105 | if self.imsi in imsi_live_db:
106 | if imsi_live_db[self.imsi]['tmsi'] != self.tmsi: #Check if tmsi is different than update in live db
107 | imsi_live_db[self.imsi]['tmsi'] = self.tmsi
108 | else:
109 | imsi_live_db[self.imsi] = {"id" : self.imsi_id,"tmsi" : self.tmsi, "mcc" : self.mcc, "mnc" : self.mnc}
110 | self.output()
111 |
112 | def get_imsi(self, packet):
113 | global ci, lac, imsi_id, imsi_live_db
114 | if packet[4].layer_name == 'gsm_a.ccch':
115 | gsm_a_ccch = packet[4]
116 | if hasattr(gsm_a_ccch, "gsm_a_bssmap_cell_ci"):
117 | ci = int(gsm_a_ccch.gsm_a_bssmap_cell_ci, 16)
118 | lac = int(gsm_a_ccch.gsm_a_lac, 16)
119 | elif hasattr(gsm_a_ccch, 'e212.imsi'):
120 | self.imsi = gsm_a_ccch.e212_imsi #[-11:-1]
121 | self.mcc = gsm_a_ccch.e212_mcc
122 | self.mnc = gsm_a_ccch.e212_mnc
123 | if hasattr(gsm_a_ccch,'gsm_a_rr_tmsi_ptmsi'):
124 | self.tmsi = gsm_a_ccch.gsm_a_rr_tmsi_ptmsi
125 | elif hasattr(gsm_a_ccch,'gsm_a_tmsi'):
126 | self.tmsi = gsm_a_ccch.gsm_a_tmsi
127 | else:
128 | self.tmsi = ''
129 | self.filter_imsi()
130 | elif packet[6].layer_name == 'gsm_a.ccch':
131 | gsm_a_ccch = packet[6]
132 | if hasattr(gsm_a_ccch, "gsm_a_bssmap_cell_ci"):
133 | ci = int(gsm_a_ccch.gsm_a_bssmap_cell_ci, 16)
134 | lac = int(gsm_a_ccch.gsm_a_lac, 16)
135 |
136 | def output(self):
137 | data = {0 : str(imsi_live_db[self.imsi]["id"]), 1 : self.imsi, 2 : imsi_live_db[self.imsi]["tmsi"], 3 : self.mcc, 4 : self.mnc, 5 : lac, 6 : ci, 7 : datetime.now().strftime("%H:%M:%S %Y-%m-%d")}
138 | print(data)
139 | socketio.emit('imsi',data)
140 | print("\033[0;37;48m {:3s}\033[0;31;48m; \033[0;37;48m {:16s} \033[0;31;48m; \033[0;37;48m {:12s}\033[0;31;48m; \033[0;37;48m\033[0;37;48m {:5s} \033[0;31;48m;\033[0;37;48m {:4s}\033[0;31;48m; \033[0;37;48m {:5} \033[0;31;48m; \033[0;37;48m {:6} \033[0;31;48m;".format(str(imsi_live_db[self.imsi]["id"]), self.imsi, imsi_live_db[self.imsi]["tmsi"], self.mcc, self.mnc, lac, ci))
141 | print ("\033[0;31;48m................................................................................")
142 |
143 | class SmsEvil:
144 |
145 | def sql_db(self):
146 | self.sql_conn = sqlite3.connect('database/sms.db')
147 | self.sql_conn.execute('CREATE TABLE IF NOT EXISTS sms_data(id INTEGER PRIMARY KEY, text TEXT, sender TEXT, receiver TEXT , date_time timestamp)')
148 |
149 | def get_all_data(self):
150 | self.sql_db()
151 | self.cur = self.sql_conn.cursor()
152 | self.cur.execute('SELECT * FROM sms_data')
153 | data = self.cur.fetchall()
154 | return data
155 |
156 | def save_data(self):
157 | self.sql_conn.execute('INSERT INTO sms_data(text, sender, receiver, date_time) VALUES ( ?, ?, ?, ?)',(self.text, self.sender, self.receiver, self.time + " " + self.date))
158 | self.sql_conn.commit()
159 | self.max_id = self.sql_conn.execute('SELECT max(id) FROM sms_data')
160 | self.sms_id = self.max_id.fetchone()[0]
161 |
162 | def output(self):
163 | self.sql_db()
164 | self.save_data()
165 | data = {0 : self.sms_id, 1 : self.text, 2 : self.sender, 3 : self.receiver, 4 : datetime.now().strftime("%H:%M:%S %Y-%m-%d")}
166 | print(data)
167 | socketio.emit('sms', data)
168 |
169 | def get_sms(self, packet):
170 | gsm_sms = packet.gsm_sms
171 | if hasattr(gsm_sms, 'sms_text'):
172 | self.time = packet.gsm_sms.scts_hour + ":" + packet.gsm_sms.scts_minutes + ":" + packet.gsm_sms.scts_seconds
173 | self.date = packet.gsm_sms.scts_day + "/" + packet.gsm_sms.scts_month + "/" + packet.gsm_sms.scts_year
174 | self.sender = packet.gsm_sms.tp_oa
175 | self.receiver = packet[6].gsm_a_dtap_cld_party_bcd_num
176 | self.text = packet.gsm_sms.sms_text
177 | self.output()
178 |
179 | def header():
180 | os.system('clear')
181 | title = '''
182 | ▄██████▄ ▄████████ ▄▄▄▄███▄▄▄▄ ▄████████ ▄█ █▄ ▄█ ▄█
183 | ███ ███ ███ ███ ▄██▀▀▀███▀▀▀██▄ ███ ███ ███ ███ ███ ███
184 | ███ █▀ ███ █▀ ███ ███ ███ ███ █▀ ███ ███ ███▌ ███
185 | ▄███ ███ ███ ███ ███ ▄███▄▄▄ ███ ███ ███▌ ███
186 | ▀▀███ ████▄ ▀███████████ ███ ███ ███ ▀▀███▀▀▀ ███ ███ ███▌ ███
187 | ███ ███ ███ ███ ███ ███ ███ █▄ ███ ███ ███ ███
188 | ███ ███ ▄█ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███▌ ▄
189 | ████████▀ ▄████████▀ ▀█ ███ █▀ ██████████ ▀██████▀ █▀ █████▄▄██
190 | ▀
191 | ☠️ Ɠ丂爪 丂几丨千千乇尺 ☠️
192 | --------------------------------------------------------------------------------
193 |
194 | About:-
195 | Author: sheryar (ninjhacks)
196 | Version : 2.0.0
197 |
198 | Disclaimer:-
199 | This program was made to understand how GSM network works.
200 | Not for bad hacking !
201 | We are not responsible for any illegal activity !
202 |
203 | --------------------------------------------------------------------------------
204 | '''
205 | print ("\033[0;31;48m" + title)
206 |
207 | if __name__ == "__main__":
208 | parser = OptionParser(usage="%prog: [options]")
209 | parser.add_option("-i", "--iface", dest="iface", default="lo", help="Interface (default : lo)")
210 | parser.add_option("-p", "--port", dest="port", default="80", type="int", help="Port (default : 80)")
211 | parser.add_option( "--host", dest="host", default="localhost", help="Host (default : localhost)")
212 | (options, args) = parser.parse_args()
213 |
214 | app = Flask(__name__)
215 | app.config['SECRET_KEY'] = 'secret!'
216 | app.config['COMPRESSOR_STATIC_PREFIX'] = 'static'
217 | app.static_folder = 'static'
218 | app.logger.disabled = True
219 | log = logging.getLogger('werkzeug')
220 | log.disabled = True
221 | socketio = SocketIO(app)
222 |
223 | @app.route('/')
224 | def home():
225 | return render_template('home.html')
226 |
227 | @app.route('/sms/')
228 | def sms():
229 | return render_template('sms.html')
230 |
231 | @app.route('/imsi/')
232 | def imsi():
233 | return render_template('imsi.html')
234 |
235 | @socketio.on('sms_sniffer')
236 | def handel_sms_event(json):
237 | global gsm_sniffer, sms_sniffer
238 | if json == "on" and sms_sniffer != "on":
239 | sms_sniffer = "on"
240 | print("sms sniffer started")
241 | if gsm_sniffer == 'off':
242 | gsm_sniffer = "on"
243 | elif json == "off" and sms_sniffer != "off":
244 | sms_sniffer = "off"
245 | print("sms sniffer stoped")
246 | socketio.emit('sniffers', {'imsi_sniffer' : imsi_sniffer, 'sms_sniffer' : sms_sniffer})
247 | return gsm_sniffer, sms_sniffer
248 |
249 | @socketio.on('imsi_sniffer')
250 | def handel_imsi_event(json):
251 | global gsm_sniffer, imsi_sniffer
252 | if json == "on" and imsi_sniffer != "on":
253 | imsi_sniffer = "on"
254 | print('imsi sniffer started')
255 | if gsm_sniffer == "off":
256 | gsm_sniffer = "on"
257 | elif json == "off" and imsi_sniffer != "off":
258 | imsi_sniffer = "off"
259 | print('imsi sniffer stoped')
260 | socketio.emit('sniffers', {'imsi_sniffer' : imsi_sniffer, 'sms_sniffer' : sms_sniffer})
261 | return gsm_sniffer, imsi_sniffer
262 |
263 | @socketio.on('sms_data')
264 | def handel_sms_data_event(json):
265 | socketio.emit('sniffers', {'imsi_sniffer' : imsi_sniffer, 'sms_sniffer' : sms_sniffer})
266 | smsEvil = SmsEvil()
267 | sms_data = smsEvil.get_all_data()
268 | socketio.emit('sms_data', sms_data)
269 |
270 | @socketio.on('imsi_data')
271 | def handel_imsi_data_event(json):
272 | socketio.emit('sniffers', {'imsi_sniffer' : imsi_sniffer, 'sms_sniffer' : sms_sniffer})
273 | imsiEvil = ImsiEvil()
274 | imsi_data = imsiEvil.get_all_data()
275 | socketio.emit('imsi_data', imsi_data)
276 |
277 | def server():
278 | app.run(host=options.host, port=options.port, threaded=True)
279 |
280 | if __name__ == "__main__":
281 | server_thread = Thread(target=server)
282 | server_thread.start()
283 | header()
284 | try:
285 | GsmSniffer.sniffer()
286 | except KeyboardInterrupt:
287 | print('Interrupted')
288 | try:
289 | print('GsmEvil 2 closed!')
290 | os._exit(0)
291 | except SystemExit:
292 | print('GsmEvil 2 closed!')
293 | sys.exit(0)
294 |
--------------------------------------------------------------------------------
/static/js/demo/jquery.sharrre.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Sharrre.com - Make your sharing widget!
3 | * Version: beta 1.3.5
4 | * Author: Julien Hany
5 | * License: MIT http://en.wikipedia.org/wiki/MIT_License or GPLv2 http://en.wikipedia.org/wiki/GNU_General_Public_License
6 | */
7 |
8 | ;(function ( $, window, document, undefined ) {
9 |
10 | /* Defaults
11 | ================================================== */
12 | var pluginName = 'sharrre',
13 | defaults = {
14 | className: 'sharrre',
15 | share: {
16 | googlePlus: false,
17 | facebook: false,
18 | twitter: false,
19 | digg: false,
20 | delicious: false,
21 | stumbleupon: false,
22 | linkedin: false,
23 | pinterest: false
24 | },
25 | shareTotal: 0,
26 | template: '',
27 | title: '',
28 | url: document.location.href,
29 | text: document.title,
30 | urlCurl: 'sharrre.php', //PHP script for google plus...
31 | count: {}, //counter by social network
32 | total: 0, //total of sharing
33 | shorterTotal: true, //show total by k or M when number is to big
34 | enableHover: true, //disable if you want to personalize hover event with callback
35 | enableCounter: true, //disable if you just want use buttons
36 | enableTracking: false, //tracking with google analitycs
37 | hover: function(){}, //personalize hover event with this callback function
38 | hide: function(){}, //personalize hide event with this callback function
39 | click: function(){}, //personalize click event with this callback function
40 | render: function(){}, //personalize render event with this callback function
41 | buttons: { //settings for buttons
42 | googlePlus : { //http://www.google.com/webmasters/+1/button/
43 | url: '', //if you need to personnalize button url
44 | urlCount: false, //if you want to use personnalize button url on global counter
45 | size: 'medium',
46 | lang: 'en-US',
47 | annotation: ''
48 | },
49 | facebook: { //http://developers.facebook.com/docs/reference/plugins/like/
50 | url: '', //if you need to personalize url button
51 | urlCount: false, //if you want to use personnalize button url on global counter
52 | action: 'like',
53 | layout: 'button_count',
54 | width: '',
55 | send: 'false',
56 | faces: 'false',
57 | colorscheme: '',
58 | font: '',
59 | lang: 'en_US'
60 | },
61 | twitter: { //http://twitter.com/about/resources/tweetbutton
62 | url: '', //if you need to personalize url button
63 | urlCount: false, //if you want to use personnalize button url on global counter
64 | count: 'horizontal',
65 | hashtags: '',
66 | via: '',
67 | related: '',
68 | lang: 'en'
69 | },
70 | digg: { //http://about.digg.com/downloads/button/smart
71 | url: '', //if you need to personalize url button
72 | urlCount: false, //if you want to use personnalize button url on global counter
73 | type: 'DiggCompact'
74 | },
75 | delicious: {
76 | url: '', //if you need to personalize url button
77 | urlCount: false, //if you want to use personnalize button url on global counter
78 | size: 'medium' //medium or tall
79 | },
80 | stumbleupon: { //http://www.stumbleupon.com/badges/
81 | url: '', //if you need to personalize url button
82 | urlCount: false, //if you want to use personnalize button url on global counter
83 | layout: '1'
84 | },
85 | linkedin: { //http://developer.linkedin.com/plugins/share-button
86 | url: '', //if you need to personalize url button
87 | urlCount: false, //if you want to use personnalize button url on global counter
88 | counter: ''
89 | },
90 | pinterest: { //http://pinterest.com/about/goodies/
91 | url: '', //if you need to personalize url button
92 | media: '',
93 | description: '',
94 | layout: 'horizontal'
95 | }
96 | }
97 | },
98 | /* Json URL to get count number
99 | ================================================== */
100 | urlJson = {
101 | googlePlus: "",
102 |
103 | //new FQL method by Sire
104 | facebook: "https://graph.facebook.com/fql?q=SELECT%20url,%20normalized_url,%20share_count,%20like_count,%20comment_count,%20total_count,commentsbox_count,%20comments_fbid,%20click_count%20FROM%20link_stat%20WHERE%20url=%27{url}%27&callback=?",
105 | //old method facebook: "http://graph.facebook.com/?id={url}&callback=?",
106 | //facebook : "http://api.ak.facebook.com/restserver.php?v=1.0&method=links.getStats&urls={url}&format=json"
107 |
108 | twitter: "http://cdn.api.twitter.com/1/urls/count.json?url={url}&callback=?",
109 | digg: "http://services.digg.com/2.0/story.getInfo?links={url}&type=javascript&callback=?",
110 | delicious: 'http://feeds.delicious.com/v2/json/urlinfo/data?url={url}&callback=?',
111 | //stumbleupon: "http://www.stumbleupon.com/services/1.01/badge.getinfo?url={url}&format=jsonp&callback=?",
112 | stumbleupon: "",
113 | linkedin: "http://www.linkedin.com/countserv/count/share?format=jsonp&url={url}&callback=?",
114 | pinterest: "http://api.pinterest.com/v1/urls/count.json?url={url}&callback=?"
115 | },
116 | /* Load share buttons asynchronously
117 | ================================================== */
118 | loadButton = {
119 | googlePlus : function(self){
120 | var sett = self.options.buttons.googlePlus;
121 | //$(self.element).find('.buttons').append('
');
122 | $(self.element).find('.buttons').append('
');
123 | window.___gcfg = {
124 | lang: self.options.buttons.googlePlus.lang
125 | };
126 | var loading = 0;
127 | if(typeof gapi === 'undefined' && loading == 0){
128 | loading = 1;
129 | (function() {
130 | var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
131 | po.src = '//apis.google.com/js/plusone.js';
132 | var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
133 | })();
134 | }
135 | else{
136 | gapi.plusone.go();
137 | }
138 | },
139 | facebook : function(self){
140 | var sett = self.options.buttons.facebook;
141 | $(self.element).find('.buttons').append('
');
142 | var loading = 0;
143 | if(typeof FB === 'undefined' && loading == 0){
144 | loading = 1;
145 | (function(d, s, id) {
146 | var js, fjs = d.getElementsByTagName(s)[0];
147 | if (d.getElementById(id)) {return;}
148 | js = d.createElement(s); js.id = id;
149 | js.src = '//connect.facebook.net/'+sett.lang+'/all.js#xfbml=1';
150 | fjs.parentNode.insertBefore(js, fjs);
151 | }(document, 'script', 'facebook-jssdk'));
152 | }
153 | else{
154 | FB.XFBML.parse();
155 | }
156 | },
157 | twitter : function(self){
158 | var sett = self.options.buttons.twitter;
159 | $(self.element).find('.buttons').append('');
160 | var loading = 0;
161 | if(typeof twttr === 'undefined' && loading == 0){
162 | loading = 1;
163 | (function() {
164 | var twitterScriptTag = document.createElement('script');
165 | twitterScriptTag.type = 'text/javascript';
166 | twitterScriptTag.async = true;
167 | twitterScriptTag.src = '//platform.twitter.com/widgets.js';
168 | var s = document.getElementsByTagName('script')[0];
169 | s.parentNode.insertBefore(twitterScriptTag, s);
170 | })();
171 | }
172 | else{
173 | $.ajax({ url: '//platform.twitter.com/widgets.js', dataType: 'script', cache:true}); //http://stackoverflow.com/q/6536108
174 | }
175 | },
176 | digg : function(self){
177 | var sett = self.options.buttons.digg;
178 | $(self.element).find('.buttons').append('
');
179 | var loading = 0;
180 | if(typeof __DBW === 'undefined' && loading == 0){
181 | loading = 1;
182 | (function() {
183 | var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];
184 | s.type = 'text/javascript';
185 | s.async = true;
186 | s.src = '//widgets.digg.com/buttons.js';
187 | s1.parentNode.insertBefore(s, s1);
188 | })();
189 | }
190 | },
191 | delicious : function(self){
192 | if(self.options.buttons.delicious.size == 'tall'){//tall
193 | var css = 'width:50px;',
194 | cssCount = 'height:35px;width:50px;font-size:15px;line-height:35px;',
195 | cssShare = 'height:18px;line-height:18px;margin-top:3px;';
196 | }
197 | else{//medium
198 | var css = 'width:93px;',
199 | cssCount = 'float:right;padding:0 3px;height:20px;width:26px;line-height:20px;',
200 | cssShare = 'float:left;height:20px;line-height:20px;';
201 | }
202 | var count = self.shorterTotal(self.options.count.delicious);
203 | if(typeof count === "undefined"){
204 | count = 0;
205 | }
206 | $(self.element).find('.buttons').append(
207 | '
');
211 |
212 | $(self.element).find('.delicious').on('click', function(){
213 | self.openPopup('delicious');
214 | });
215 | },
216 | stumbleupon : function(self){
217 | var sett = self.options.buttons.stumbleupon;
218 | $(self.element).find('.buttons').append('
');
219 | var loading = 0;
220 | if(typeof STMBLPN === 'undefined' && loading == 0){
221 | loading = 1;
222 | (function() {
223 | var li = document.createElement('script');li.type = 'text/javascript';li.async = true;
224 | li.src = '//platform.stumbleupon.com/1/widgets.js';
225 | var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(li, s);
226 | })();
227 | s = window.setTimeout(function(){
228 | if(typeof STMBLPN !== 'undefined'){
229 | STMBLPN.processWidgets();
230 | clearInterval(s);
231 | }
232 | },500);
233 | }
234 | else{
235 | STMBLPN.processWidgets();
236 | }
237 | },
238 | linkedin : function(self){
239 | var sett = self.options.buttons.linkedin;
240 | $(self.element).find('.buttons').append('
');
241 | var loading = 0;
242 | if(typeof window.IN === 'undefined' && loading == 0){
243 | loading = 1;
244 | (function() {
245 | var li = document.createElement('script');li.type = 'text/javascript';li.async = true;
246 | li.src = '//platform.linkedin.com/in.js';
247 | var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(li, s);
248 | })();
249 | }
250 | else{
251 | window.IN.init();
252 | }
253 | },
254 | pinterest : function(self){
255 | var sett = self.options.buttons.pinterest;
256 | $(self.element).find('.buttons').append('
');
257 |
258 | (function() {
259 | var li = document.createElement('script');li.type = 'text/javascript';li.async = true;
260 | li.src = '//assets.pinterest.com/js/pinit.js';
261 | var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(li, s);
262 | })();
263 | }
264 | },
265 | /* Tracking for Google Analytics
266 | ================================================== */
267 | tracking = {
268 | googlePlus: function(){},
269 | facebook: function(){
270 | //console.log('facebook');
271 | fb = window.setInterval(function(){
272 | if (typeof FB !== 'undefined') {
273 | FB.Event.subscribe('edge.create', function(targetUrl) {
274 | _gaq.push(['_trackSocial', 'facebook', 'like', targetUrl]);
275 | });
276 | FB.Event.subscribe('edge.remove', function(targetUrl) {
277 | _gaq.push(['_trackSocial', 'facebook', 'unlike', targetUrl]);
278 | });
279 | FB.Event.subscribe('message.send', function(targetUrl) {
280 | _gaq.push(['_trackSocial', 'facebook', 'send', targetUrl]);
281 | });
282 | //console.log('ok');
283 | clearInterval(fb);
284 | }
285 | },1000);
286 | },
287 | twitter: function(){
288 | //console.log('twitter');
289 | tw = window.setInterval(function(){
290 | if (typeof twttr !== 'undefined') {
291 | twttr.events.bind('tweet', function(event) {
292 | if (event) {
293 | _gaq.push(['_trackSocial', 'twitter', 'tweet']);
294 | }
295 | });
296 | //console.log('ok');
297 | clearInterval(tw);
298 | }
299 | },1000);
300 | },
301 | digg: function(){
302 | //if somenone find a solution, mail me !
303 | /*$(this.element).find('.digg').on('click', function(){
304 | _gaq.push(['_trackSocial', 'digg', 'add']);
305 | });*/
306 | },
307 | delicious: function(){},
308 | stumbleupon: function(){},
309 | linkedin: function(){
310 | function LinkedInShare() {
311 | _gaq.push(['_trackSocial', 'linkedin', 'share']);
312 | }
313 | },
314 | pinterest: function(){
315 | //if somenone find a solution, mail me !
316 | }
317 | },
318 | /* Popup for each social network
319 | ================================================== */
320 | popup = {
321 | googlePlus: function(opt){
322 | window.open("https://plus.google.com/share?hl="+opt.buttons.googlePlus.lang+"&url="+encodeURIComponent((opt.buttons.googlePlus.url !== '' ? opt.buttons.googlePlus.url : opt.url)), "", "toolbar=0, status=0, width=900, height=500");
323 | },
324 | facebook: function(opt){
325 | window.open("http://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent((opt.buttons.facebook.url !== '' ? opt.buttons.facebook.url : opt.url))+"&t="+opt.text+"", "", "toolbar=0, status=0, width=900, height=500");
326 | },
327 | twitter: function(opt){
328 | window.open("https://twitter.com/intent/tweet?text="+encodeURIComponent(opt.text)+"&url="+encodeURIComponent((opt.buttons.twitter.url !== '' ? opt.buttons.twitter.url : opt.url))+(opt.buttons.twitter.via !== '' ? '&via='+opt.buttons.twitter.via : ''), "", "toolbar=0, status=0, width=650, height=360");
329 | },
330 | digg: function(opt){
331 | window.open("http://digg.com/tools/diggthis/submit?url="+encodeURIComponent((opt.buttons.digg.url !== '' ? opt.buttons.digg.url : opt.url))+"&title="+opt.text+"&related=true&style=true", "", "toolbar=0, status=0, width=650, height=360");
332 | },
333 | delicious: function(opt){
334 | window.open('http://www.delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent((opt.buttons.delicious.url !== '' ? opt.buttons.delicious.url : opt.url))+'&title='+opt.text, 'delicious', 'toolbar=no,width=550,height=550');
335 | },
336 | stumbleupon: function(opt){
337 | window.open('http://www.stumbleupon.com/badge/?url='+encodeURIComponent((opt.buttons.stumbleupon.url !== '' ? opt.buttons.stumbleupon.url : opt.url)), 'stumbleupon', 'toolbar=no,width=550,height=550');
338 | },
339 | linkedin: function(opt){
340 | window.open('https://www.linkedin.com/cws/share?url='+encodeURIComponent((opt.buttons.linkedin.url !== '' ? opt.buttons.linkedin.url : opt.url))+'&token=&isFramed=true', 'linkedin', 'toolbar=no,width=550,height=550');
341 | },
342 | pinterest: function(opt){
343 | window.open('http://pinterest.com/pin/create/button/?url='+encodeURIComponent((opt.buttons.pinterest.url !== '' ? opt.buttons.pinterest.url : opt.url))+'&media='+encodeURIComponent(opt.buttons.pinterest.media)+'&description='+opt.buttons.pinterest.description, 'pinterest', 'toolbar=no,width=700,height=300');
344 | }
345 | };
346 |
347 | /* Plugin constructor
348 | ================================================== */
349 | function Plugin( element, options ) {
350 | this.element = element;
351 |
352 | this.options = $.extend( true, {}, defaults, options);
353 | this.options.share = options.share; //simple solution to allow order of buttons
354 |
355 | this._defaults = defaults;
356 | this._name = pluginName;
357 |
358 | this.init();
359 | };
360 |
361 | /* Initialization method
362 | ================================================== */
363 | Plugin.prototype.init = function () {
364 | var self = this;
365 | if(this.options.urlCurl !== ''){
366 | urlJson.googlePlus = this.options.urlCurl + '?url={url}&type=googlePlus'; // PHP script for GooglePlus...
367 | urlJson.stumbleupon = this.options.urlCurl + '?url={url}&type=stumbleupon'; // PHP script for Stumbleupon...
368 | }
369 | $(this.element).addClass(this.options.className); //add class
370 |
371 | //HTML5 Custom data
372 | if(typeof $(this.element).data('title') !== 'undefined'){
373 | this.options.title = $(this.element).attr('data-title');
374 | }
375 | if(typeof $(this.element).data('url') !== 'undefined'){
376 | this.options.url = $(this.element).data('url');
377 | }
378 | if(typeof $(this.element).data('text') !== 'undefined'){
379 | this.options.text = $(this.element).data('text');
380 | }
381 |
382 | //how many social website have been selected
383 | $.each(this.options.share, function(name, val) {
384 | if(val === true){
385 | self.options.shareTotal ++;
386 | }
387 | });
388 |
389 | if(self.options.enableCounter === true){ //if for some reason you don't need counter
390 | //get count of social share that have been selected
391 | $.each(this.options.share, function(name, val) {
392 | if(val === true){
393 | //self.getSocialJson(name);
394 | try {
395 | self.getSocialJson(name);
396 | } catch(e){
397 | }
398 | }
399 | });
400 | }
401 | else if(self.options.template !== ''){ //for personalized button (with template)
402 | this.options.render(this, this.options);
403 | }
404 | else{ // if you want to use official button like example 3 or 5
405 | this.loadButtons();
406 | }
407 |
408 | //add hover event
409 | $(this.element).hover(function(){
410 | //load social button if enable and 1 time
411 | if($(this).find('.buttons').length === 0 && self.options.enableHover === true){
412 | self.loadButtons();
413 | }
414 | self.options.hover(self, self.options);
415 | }, function(){
416 | self.options.hide(self, self.options);
417 | });
418 |
419 | //click event
420 | $(this.element).click(function(){
421 | self.options.click(self, self.options);
422 | return false;
423 | });
424 | };
425 |
426 | /* loadButtons methode
427 | ================================================== */
428 | Plugin.prototype.loadButtons = function () {
429 | var self = this;
430 | $(this.element).append('
');
431 | $.each(self.options.share, function(name, val) {
432 | if(val == true){
433 | loadButton[name](self);
434 | if(self.options.enableTracking === true){ //add tracking
435 | tracking[name]();
436 | }
437 | }
438 | });
439 | };
440 |
441 | /* getSocialJson methode
442 | ================================================== */
443 | Plugin.prototype.getSocialJson = function (name) {
444 | var self = this,
445 | count = 0,
446 | url = urlJson[name].replace('{url}', encodeURIComponent(this.options.url));
447 | if(this.options.buttons[name].urlCount === true && this.options.buttons[name].url !== ''){
448 | url = urlJson[name].replace('{url}', this.options.buttons[name].url);
449 | }
450 | //console.log('name : ' + name + ' - url : '+url); //debug
451 | if(url != '' && self.options.urlCurl !== ''){ //urlCurl = '' if you don't want to used PHP script but used social button
452 | $.getJSON(url, function(json){
453 | if(typeof json.count !== "undefined"){ //GooglePlus, Stumbleupon, Twitter, Pinterest and Digg
454 | var temp = json.count + '';
455 | temp = temp.replace('\u00c2\u00a0', ''); //remove google plus special chars
456 | count += parseInt(temp, 10);
457 | }
458 | //get the FB total count (shares, likes and more)
459 | else if(json.data && json.data.length > 0 && typeof json.data[0].total_count !== "undefined"){ //Facebook total count
460 | count += parseInt(json.data[0].total_count, 10);
461 | }
462 | else if(typeof json[0] !== "undefined"){ //Delicious
463 | count += parseInt(json[0].total_posts, 10);
464 | }
465 | else if(typeof json[0] !== "undefined"){ //Stumbleupon
466 | }
467 | self.options.count[name] = count;
468 | self.options.total += count;
469 | self.renderer();
470 | self.rendererPerso();
471 | //console.log(json); //debug
472 | })
473 | .error(function() {
474 | self.options.count[name] = 0;
475 | self.rendererPerso();
476 | });
477 | }
478 | else{
479 | self.renderer();
480 | self.options.count[name] = 0;
481 | self.rendererPerso();
482 | }
483 | };
484 |
485 | /* launch render methode
486 | ================================================== */
487 | Plugin.prototype.rendererPerso = function () {
488 | //check if this is the last social website to launch render
489 | var shareCount = 0;
490 | for (e in this.options.count) { shareCount++; }
491 | if(shareCount === this.options.shareTotal){
492 | this.options.render(this, this.options);
493 | }
494 | };
495 |
496 | /* render methode
497 | ================================================== */
498 | Plugin.prototype.renderer = function () {
499 | var total = this.options.total,
500 | template = this.options.template;
501 | if(this.options.shorterTotal === true){ //format number like 1.2k or 5M
502 | total = this.shorterTotal(total);
503 | }
504 |
505 | if(template !== ''){ //if there is a template
506 | template = template.replace('{total}', total);
507 | $(this.element).html(template);
508 | }
509 | else{ //template by defaults
510 | $(this.element).html(
511 | '
'
514 | );
515 | }
516 | };
517 |
518 | /* format total numbers like 1.2k or 5M
519 | ================================================== */
520 | Plugin.prototype.shorterTotal = function (num) {
521 | if (num >= 1e6){
522 | num = (num / 1e6).toFixed(2) + "M"
523 | } else if (num >= 1e3){
524 | num = (num / 1e3).toFixed(1) + "k"
525 | }
526 | return num;
527 | };
528 |
529 | /* Methode for open popup
530 | ================================================== */
531 | Plugin.prototype.openPopup = function (site) {
532 | popup[site](this.options); //open
533 | if(this.options.enableTracking === true){ //tracking!
534 | var tracking = {
535 | googlePlus: {site: 'Google', action: '+1'},
536 | facebook: {site: 'facebook', action: 'like'},
537 | twitter: {site: 'twitter', action: 'tweet'},
538 | digg: {site: 'digg', action: 'add'},
539 | delicious: {site: 'delicious', action: 'add'},
540 | stumbleupon: {site: 'stumbleupon', action: 'add'},
541 | linkedin: {site: 'linkedin', action: 'share'},
542 | pinterest: {site: 'pinterest', action: 'pin'}
543 | };
544 | _gaq.push(['_trackSocial', tracking[site].site, tracking[site].action]);
545 | }
546 | };
547 |
548 | /* Methode for add +1 to a counter
549 | ================================================== */
550 | Plugin.prototype.simulateClick = function () {
551 | var html = $(this.element).html();
552 | $(this.element).html(html.replace(this.options.total, this.options.total+1));
553 | };
554 |
555 | /* Methode for add +1 to a counter
556 | ================================================== */
557 | Plugin.prototype.update = function (url, text) {
558 | if(url !== ''){
559 | this.options.url = url;
560 | }
561 | if(text !== ''){
562 | this.options.text = text;
563 | }
564 | };
565 |
566 | /* A really lightweight plugin wrapper around the constructor, preventing against multiple instantiations
567 | ================================================== */
568 | $.fn[pluginName] = function ( options ) {
569 | var args = arguments;
570 | if (options === undefined || typeof options === 'object') {
571 | return this.each(function () {
572 | if (!$.data(this, 'plugin_' + pluginName)) {
573 | $.data(this, 'plugin_' + pluginName, new Plugin( this, options ));
574 | }
575 | });
576 | } else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
577 | return this.each(function () {
578 | var instance = $.data(this, 'plugin_' + pluginName);
579 | if (instance instanceof Plugin && typeof instance[options] === 'function') {
580 | instance[options].apply( instance, Array.prototype.slice.call( args, 1 ) );
581 | }
582 | });
583 | }
584 | };
585 | })(jQuery, window, document);
586 |
--------------------------------------------------------------------------------
/static/js/bootstrap.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap v3.3.2 (http://getbootstrap.com)
3 | * Copyright 2011-2015 Twitter, Inc.
4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5 | */
6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.2",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.2",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.2",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a(this.options.trigger).filter('[href="#'+b.id+'"], [data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.2",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0,trigger:'[data-toggle="collapse"]'},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":a.extend({},e.data(),{trigger:this});c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=c(d),f={relatedTarget:this};e.hasClass("open")&&(e.trigger(b=a.Event("hide.bs.dropdown",f)),b.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f)))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.2",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('
').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(b){if(/(38|40|27|32)/.test(b.which)&&!/input|textarea/i.test(b.target.tagName)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var e=c(d),g=e.hasClass("open");if(!g&&27!=b.which||g&&27==b.which)return 27==b.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.divider):visible a",i=e.find('[role="menu"]'+h+', [role="listbox"]'+h);if(i.length){var j=i.index(b.target);38==b.which&&j>0&&j--,40==b.which&&j
').prependTo(this.$element).on("click.dismiss.bs.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.options.backdrop&&this.adjustBackdrop(),this.adjustDialog()},c.prototype.adjustBackdrop=function(){this.$backdrop.css("height",0).css("height",this.$element[0].scrollHeight)},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){this.bodyIsOverflowing=document.body.scrollHeight>document.documentElement.clientHeight,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||"destroy"!=b)&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};c.VERSION="3.3.2",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c&&c.$tip&&c.$tip.is(":visible")?void(c.hoverState="in"):(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.options.container?a(this.options.container):this.$element.parent(),p=this.getPosition(o);h="bottom"==h&&k.bottom+m>p.bottom?"top":"top"==h&&k.top-m
p.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.width&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type)})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||"destroy"!=b)&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.2",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},c.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){var e=a.proxy(this.process,this);this.$body=a("body"),this.$scrollElement=a(a(c).is("body")?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.2",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b="offset",c=0;a.isWindow(this.$scrollElement[0])||(b="position",c=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var d=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+c,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){d.offsets.push(this[0]),d.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.2",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()
7 | }var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.2",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=a("body").height();"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
--------------------------------------------------------------------------------