flashgrid-ext 1.1.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +0 -7
- data/flashgrid-ext.gemspec +2 -2
- data/lib/flashgrid/ext/version.rb +1 -1
- data/vendor/assets/javascripts/calendar.js +5207 -5207
- data/vendor/assets/javascripts/chart.js +1747 -1747
- data/vendor/assets/javascripts/moment.js +1 -7762
- data/vendor/assets/stylesheets/aside.css.scss +6 -9
- data/vendor/assets/stylesheets/calendar.css.scss +37 -37
- data/vendor/assets/stylesheets/editor.css.scss +14 -14
- metadata +8 -15
- data/vendor/assets/javascripts/animate.js +0 -82
- data/vendor/assets/javascripts/carousel.js +0 -196
- data/vendor/assets/javascripts/hoverdown.js +0 -93
- data/vendor/assets/javascripts/scrollspy.js +0 -144
- data/vendor/assets/stylesheets/animate.css.scss +0 -2319
- data/vendor/assets/stylesheets/carousel.css.scss +0 -153
- data/vendor/assets/stylesheets/sort.css.scss +0 -31
@@ -101,8 +101,9 @@
|
|
101
101
|
input[type="submit"].aside-footer-btn {
|
102
102
|
-webkit-appearance: none;
|
103
103
|
-moz-appearance: none;
|
104
|
-
border: none;
|
105
104
|
background: transparent;
|
105
|
+
border: none;
|
106
|
+
border-radius: 0;
|
106
107
|
-moz-box-sizing: border-box;
|
107
108
|
box-sizing: border-box;
|
108
109
|
color: rgba(0,153,255,1);
|
@@ -126,17 +127,13 @@ input[type="submit"].aside-footer-btn[disabled] {
|
|
126
127
|
color: rgba(158,171,179,1);
|
127
128
|
cursor: not-allowed;
|
128
129
|
}
|
129
|
-
.aside-footer-btn
|
130
|
-
input[type="submit"].aside-footer-btn
|
130
|
+
.aside-footer-dual > .aside-footer-btn,
|
131
|
+
.aside-footer-dual > input[type="submit"].aside-footer-btn {
|
131
132
|
border-right: 1px solid rgba(217,222,225,1);
|
132
|
-
border-bottom-right-radius: 0;
|
133
|
-
width: 50%;
|
134
|
-
}
|
135
|
-
.aside-footer-btn-right,
|
136
|
-
input[type="submit"].aside-footer-btn-right {
|
137
|
-
border-bottom-left-radius: 0;
|
138
133
|
width: 50%;
|
139
134
|
}
|
135
|
+
.aside-footer-dual > .aside-footer-btn:last-child,
|
136
|
+
.aside-footer-dual > input[type="submit"].aside-footer-btn:last-child { border-right: none; }
|
140
137
|
|
141
138
|
/* #Media Queries
|
142
139
|
================================================== */
|
@@ -54,15 +54,15 @@
|
|
54
54
|
margin: 0;
|
55
55
|
white-space: nowrap;
|
56
56
|
}
|
57
|
-
.calendar-header-space
|
58
|
-
.calendar-header .calendar-button
|
57
|
+
.calendar-header-space { padding-left: 10px; }
|
58
|
+
.calendar-header .calendar-button { margin-right: -1px; }
|
59
59
|
.calendar-header .calendar-corner-right,
|
60
|
-
.calendar-header .ui-corner-right
|
60
|
+
.calendar-header .ui-corner-right { margin-right: 0; }
|
61
61
|
.calendar-header .calendar-state-hover,
|
62
|
-
.calendar-header .ui-state-hover
|
63
|
-
.calendar-header .calendar-state-down
|
62
|
+
.calendar-header .ui-state-hover { z-index: 2; }
|
63
|
+
.calendar-header .calendar-state-down { z-index: 3; }
|
64
64
|
.calendar-header .calendar-state-active,
|
65
|
-
.calendar-header .ui-state-active
|
65
|
+
.calendar-header .ui-state-active { z-index: 4; }
|
66
66
|
|
67
67
|
/* #Calendar Content
|
68
68
|
================================================== */
|
@@ -78,9 +78,9 @@
|
|
78
78
|
/* #Calendar Cell Style
|
79
79
|
================================================== */
|
80
80
|
.calendar-widget-header,
|
81
|
-
.calendar-widget-content
|
82
|
-
.calendar-state-highlight
|
83
|
-
.calendar-state-highlight .calendar-day-number
|
81
|
+
.calendar-widget-content { border: 1px solid rgba(217,222,225,1); }
|
82
|
+
.calendar-state-highlight { background: rgba(58,144,216,0.10); }
|
83
|
+
.calendar-state-highlight .calendar-day-number { font-weight: 500; }
|
84
84
|
.calendar-cell-overlay {
|
85
85
|
background: rgba(58,144,216,1);
|
86
86
|
opacity: 0.3;
|
@@ -90,12 +90,12 @@
|
|
90
90
|
/* #Calendar Buttons
|
91
91
|
================================================== */
|
92
92
|
.calendar-state-default.calendar-corner-left {
|
93
|
-
border-top-left-radius: 2px;
|
94
93
|
border-bottom-left-radius: 2px;
|
94
|
+
border-top-left-radius: 2px;
|
95
95
|
}
|
96
96
|
.calendar-state-default.calendar-corner-right {
|
97
|
-
border-top-right-radius: 2px;
|
98
97
|
border-bottom-right-radius: 2px;
|
98
|
+
border-top-right-radius: 2px;
|
99
99
|
}
|
100
100
|
.calendar-button {
|
101
101
|
-webkit-appearance: none;
|
@@ -136,9 +136,9 @@
|
|
136
136
|
|
137
137
|
/* #Calendar Global Event Styles
|
138
138
|
================================================== */
|
139
|
-
.calendar-event-container > *
|
139
|
+
.calendar-event-container > * { z-index: 8; }
|
140
140
|
.calendar-event-container > .ui-draggable-dragging,
|
141
|
-
.calendar-event-container > .ui-resizable-resizing
|
141
|
+
.calendar-event-container > .ui-resizable-resizing { z-index: 9; }
|
142
142
|
.calendar-event {
|
143
143
|
background: rgba(236,238,241,1);
|
144
144
|
border: 1px solid rgba(217,222,225,1);
|
@@ -154,7 +154,7 @@
|
|
154
154
|
}
|
155
155
|
.calendar-rtl .calendar-event { text-align: right; }
|
156
156
|
a.calendar-event,
|
157
|
-
.calendar-event-draggable
|
157
|
+
.calendar-event-draggable { cursor: pointer; }
|
158
158
|
.calendar-event-inner {
|
159
159
|
overflow-x: hidden;
|
160
160
|
text-overflow: ellipsis;
|
@@ -176,15 +176,15 @@ a.calendar-event,
|
|
176
176
|
}
|
177
177
|
.calendar-ltr .calendar-event-hori.calendar-event-start,
|
178
178
|
.calendar-rtl .calendar-event-hori.calendar-event-end {
|
179
|
-
border-left-width: 1px;
|
180
|
-
border-top-left-radius: 2px;
|
181
179
|
border-bottom-left-radius: 2px;
|
180
|
+
border-top-left-radius: 2px;
|
181
|
+
border-left-width: 1px;
|
182
182
|
}
|
183
183
|
.calendar-ltr .calendar-event-hori.calendar-event-end,
|
184
184
|
.calendar-rtl .calendar-event-hori.calendar-event-start {
|
185
|
-
border-right-width: 1px;
|
186
|
-
border-top-right-radius: 2px;
|
187
185
|
border-bottom-right-radius: 2px;
|
186
|
+
border-top-right-radius: 2px;
|
187
|
+
border-right-width: 1px;
|
188
188
|
}
|
189
189
|
.calendar-event-hori .ui-resizable-e {
|
190
190
|
cursor: e-resize;
|
@@ -204,15 +204,15 @@ a.calendar-event,
|
|
204
204
|
|
205
205
|
/* #Calendar Reusable Separate-border Table
|
206
206
|
================================================== */
|
207
|
-
table.calendar-border-separate
|
207
|
+
table.calendar-border-separate { border-collapse: separate; }
|
208
208
|
.calendar-border-separate th,
|
209
|
-
.calendar-border-separate td
|
209
|
+
.calendar-border-separate td { border-width: 1px 0 0 1px; }
|
210
210
|
.calendar-border-separate th.calendar-last,
|
211
|
-
.calendar-border-separate td.calendar-last
|
211
|
+
.calendar-border-separate td.calendar-last { border-right-width: 1px; }
|
212
212
|
.calendar-border-separate tr.calendar-last th,
|
213
|
-
.calendar-border-separate tr.calendar-last td
|
213
|
+
.calendar-border-separate tr.calendar-last td { border-bottom-width: 1px; }
|
214
214
|
.calendar-border-separate tbody tr.calendar-first td,
|
215
|
-
.calendar-border-separate tbody tr.calendar-first th
|
215
|
+
.calendar-border-separate tbody tr.calendar-first th { border-top-width: 0; }
|
216
216
|
|
217
217
|
/* #Calendar Month View, Basic Week View, Basic Day View
|
218
218
|
================================================== */
|
@@ -276,10 +276,10 @@ table.calendar-border-separate { border-collapse: separate; }
|
|
276
276
|
white-space: nowrap;
|
277
277
|
width: 50px;
|
278
278
|
}
|
279
|
-
.calendar-agenda .calendar-day-content
|
279
|
+
.calendar-agenda .calendar-day-content { padding: 2px; }
|
280
280
|
.calendar-agenda-days .calendar-agenda-axis { border-right-width: 1px; }
|
281
|
-
.calendar-agenda-days .calendar-col0
|
282
|
-
.calendar-agenda-allday th
|
281
|
+
.calendar-agenda-days .calendar-col0 { border-left-width: 0; }
|
282
|
+
.calendar-agenda-allday th { border-width: 0 1px; }
|
283
283
|
.calendar-agenda-allday .calendar-day-content {
|
284
284
|
min-height: 34px;
|
285
285
|
height: 34px;
|
@@ -294,25 +294,25 @@ table.calendar-border-separate { border-collapse: separate; }
|
|
294
294
|
border-width: 1px 0 0;
|
295
295
|
background: none;
|
296
296
|
}
|
297
|
-
.calendar-agenda-slots td div
|
297
|
+
.calendar-agenda-slots td div { height: 20px; }
|
298
298
|
.calendar-agenda-slots tr.calendar-slot0 th,
|
299
|
-
.calendar-agenda-slots tr.calendar-slot0 td
|
299
|
+
.calendar-agenda-slots tr.calendar-slot0 td { border-top-width: 0; }
|
300
300
|
.calendar-agenda-slots tr.calendar-minor th,
|
301
|
-
.calendar-agenda-slots tr.calendar-minor td
|
302
|
-
.calendar-agenda-slots tr.calendar-minor th.ui-widget-header
|
301
|
+
.calendar-agenda-slots tr.calendar-minor td { border-top-style: dotted; }
|
302
|
+
.calendar-agenda-slots tr.calendar-minor th.ui-widget-header { *border-top-style: solid; }
|
303
303
|
|
304
304
|
/* #Calendar Vertical Events
|
305
305
|
================================================== */
|
306
306
|
.calendar-event-vert { border-width: 0 1px; }
|
307
307
|
.calendar-event-vert.calendar-event-start {
|
308
|
-
border-top-width: 1px;
|
309
|
-
border-top-left-radius: 2px;
|
310
308
|
border-top-right-radius: 2px;
|
309
|
+
border-top-left-radius: 2px;
|
310
|
+
border-top-width: 1px;
|
311
311
|
}
|
312
312
|
.calendar-event-vert.calendar-event-end {
|
313
|
-
border-bottom-width: 1px;
|
314
|
-
border-bottom-left-radius: 2px;
|
315
313
|
border-bottom-right-radius: 2px;
|
314
|
+
border-bottom-left-radius: 2px;
|
315
|
+
border-bottom-width: 1px;
|
316
316
|
}
|
317
317
|
.calendar-event-vert .calendar-event-time {
|
318
318
|
color: rgba(58,144,216,1);
|
@@ -357,11 +357,11 @@ table.calendar-border-separate { border-collapse: separate; }
|
|
357
357
|
}
|
358
358
|
}
|
359
359
|
@media only screen and (max-width: 767px) {
|
360
|
-
.calendar-header td
|
360
|
+
.calendar-header td { padding: 15px 0 7px 0; }
|
361
361
|
.calendar-header-left,
|
362
|
-
.calendar-button-today
|
362
|
+
.calendar-button-today { display: none !important; }
|
363
363
|
.calendar-header-center,
|
364
|
-
.calendar-header-right
|
364
|
+
.calendar-header-right { display: block; }
|
365
365
|
.calendar-header-right {
|
366
366
|
margin: -15px 0 10px 0;
|
367
367
|
text-align: center;
|
@@ -19,7 +19,7 @@
|
|
19
19
|
|
20
20
|
/* #Editor
|
21
21
|
================================================== */
|
22
|
-
.editor-canvas
|
22
|
+
.editor-canvas { border: 1px solid rgba(217,222,225,1); }
|
23
23
|
.editor-canvas .dropdown-menu { min-width: 90px; }
|
24
24
|
.editor-canvas .dropdown-menu li a.checked i { visibility: visible; }
|
25
25
|
.editor-canvas .dropdown-menu li a i {
|
@@ -135,9 +135,9 @@
|
|
135
135
|
font-size: 12px;
|
136
136
|
line-height: 18px;
|
137
137
|
}
|
138
|
-
.editor-help-dialog .editor-shortcut-layout
|
139
|
-
.editor-help-dialog .editor-shortcut-layout td
|
140
|
-
.editor-help-dialog .editor-shortcut
|
138
|
+
.editor-help-dialog .editor-shortcut-layout { width: 100%; }
|
139
|
+
.editor-help-dialog .editor-shortcut-layout td { vertical-align: top; }
|
140
|
+
.editor-help-dialog .editor-shortcut { margin-top: 5px;}
|
141
141
|
.editor-help-dialog .editor-shortcut th {
|
142
142
|
color: rgba(71,74,84,1);
|
143
143
|
font-size: 13px;
|
@@ -157,8 +157,8 @@
|
|
157
157
|
|
158
158
|
/* #Editor Popover
|
159
159
|
================================================== */
|
160
|
-
.editor-popover .popover
|
161
|
-
.editor-popover .popover .arrow
|
160
|
+
.editor-popover .popover { max-width: none; }
|
161
|
+
.editor-popover .popover .arrow { left: 20px; }
|
162
162
|
.editor-popover .popover .popover-content { padding: 5px; }
|
163
163
|
.editor-popover .popover .popover-content .btn-group + .btn-group { margin-left: 5px; }
|
164
164
|
.editor-popover .popover .popover-content a {
|
@@ -197,8 +197,8 @@
|
|
197
197
|
width: 17px;
|
198
198
|
}
|
199
199
|
.editor-color-palette .editor-color-btn:hover { border: 1px solid rgba(71,74,84,1); }
|
200
|
-
.editor-color .dropdown-menu
|
201
|
-
.editor-color .dropdown-menu .btn-group
|
200
|
+
.editor-color .dropdown-menu { min-width: 290px; }
|
201
|
+
.editor-color .dropdown-menu .btn-group { margin: 0; }
|
202
202
|
.editor-color .dropdown-menu .btn-group .editor-palette-title {
|
203
203
|
border-bottom: 1px solid rgba(0,0,0,0.1);
|
204
204
|
font-size: 12px;
|
@@ -258,8 +258,8 @@
|
|
258
258
|
resize: none;
|
259
259
|
width: 100%;
|
260
260
|
}
|
261
|
-
.editor-canvas.codeview .editor-editable
|
262
|
-
.editor-canvas.codeview .editor-codable
|
261
|
+
.editor-canvas.codeview .editor-editable { display: none; }
|
262
|
+
.editor-canvas.codeview .editor-codable { display: block; }
|
263
263
|
|
264
264
|
/* #Editor Toolbar
|
265
265
|
================================================== */
|
@@ -269,7 +269,7 @@
|
|
269
269
|
margin: 0;
|
270
270
|
padding: 1px 0;
|
271
271
|
}
|
272
|
-
.editor-toolbar > .btn-group
|
272
|
+
.editor-toolbar > .btn-group { margin: 2px 2px 2px 3px; }
|
273
273
|
.editor-toolbar > .btn-group > .btn { height: 32px; }
|
274
274
|
.editor-toolbar > .btn-group > .btn.active {
|
275
275
|
background: rgba(71,74,84,1);
|
@@ -318,14 +318,14 @@
|
|
318
318
|
|
319
319
|
/* #Editor Style
|
320
320
|
================================================== */
|
321
|
-
.editor-style a
|
321
|
+
.editor-style a { cursor: pointer; }
|
322
322
|
.editor-style h1,
|
323
323
|
.editor-style h2,
|
324
324
|
.editor-style h3,
|
325
325
|
.editor-style h4,
|
326
326
|
.editor-style h5,
|
327
327
|
.editor-style h6,
|
328
|
-
.editor-style blockquote
|
328
|
+
.editor-style blockquote { margin: 0; }
|
329
329
|
.editor-style a:hover h1,
|
330
330
|
.editor-style a:hover h2,
|
331
331
|
.editor-style a:hover h3,
|
@@ -348,4 +348,4 @@
|
|
348
348
|
z-index: 1050;
|
349
349
|
}
|
350
350
|
.editor-canvas.fullscreen .editor-resizebar { display: none; }
|
351
|
-
.editor-canvas.fullscreen .editor-editable
|
351
|
+
.editor-canvas.fullscreen .editor-editable { background: rgba(255,255,255,1); }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flashgrid-ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.5'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
description: Flashgrid Ext. is an extention of useful and cool javascripts for Flashgrid
|
42
42
|
framework.
|
43
43
|
email:
|
@@ -54,24 +54,17 @@ files:
|
|
54
54
|
- flashgrid-ext.gemspec
|
55
55
|
- lib/flashgrid/ext.rb
|
56
56
|
- lib/flashgrid/ext/version.rb
|
57
|
-
- vendor/assets/javascripts/animate.js
|
58
57
|
- vendor/assets/javascripts/calendar.js
|
59
|
-
- vendor/assets/javascripts/carousel.js
|
60
58
|
- vendor/assets/javascripts/chart.js
|
61
59
|
- vendor/assets/javascripts/editor.js
|
62
|
-
- vendor/assets/javascripts/hoverdown.js
|
63
60
|
- vendor/assets/javascripts/input_mask.js
|
64
61
|
- vendor/assets/javascripts/moment.js
|
65
|
-
- vendor/assets/javascripts/scrollspy.js
|
66
62
|
- vendor/assets/javascripts/sort.js
|
67
63
|
- vendor/assets/javascripts/time_ago.js
|
68
64
|
- vendor/assets/javascripts/typeahead.js
|
69
|
-
- vendor/assets/stylesheets/animate.css.scss
|
70
65
|
- vendor/assets/stylesheets/aside.css.scss
|
71
66
|
- vendor/assets/stylesheets/calendar.css.scss
|
72
|
-
- vendor/assets/stylesheets/carousel.css.scss
|
73
67
|
- vendor/assets/stylesheets/editor.css.scss
|
74
|
-
- vendor/assets/stylesheets/sort.css.scss
|
75
68
|
- vendor/assets/stylesheets/typeahead.css.scss
|
76
69
|
homepage: http://flashgrid-ext.drexed.com
|
77
70
|
licenses:
|
@@ -1,82 +0,0 @@
|
|
1
|
-
(function ($, window, document, undefined) {
|
2
|
-
|
3
|
-
// Function-level strict mode syntax
|
4
|
-
'use strict';
|
5
|
-
|
6
|
-
$.fn.animateCSS = function (effect, delay, callback) {
|
7
|
-
|
8
|
-
// Return this to maintain chainability
|
9
|
-
return this.each(function () {
|
10
|
-
|
11
|
-
// Cache $(this) for speed and compression
|
12
|
-
var $this = $(this),
|
13
|
-
transitionEnd = "webkitAnimationEnd oanimationend msAnimationEnd animationend",
|
14
|
-
animated = "animated",
|
15
|
-
visibility = "visibility",
|
16
|
-
visible = "visible",
|
17
|
-
hidden = "hidden";
|
18
|
-
|
19
|
-
// Create a function we can call later
|
20
|
-
function run() {
|
21
|
-
|
22
|
-
// Add the animation effect with classes
|
23
|
-
$this.addClass( animated + " " + effect);
|
24
|
-
|
25
|
-
// Check if the elemenr has been hidden to start with
|
26
|
-
if ($this.css( visibility ) === hidden) {
|
27
|
-
|
28
|
-
// If it has, show it (after the class has been added)
|
29
|
-
$this.css( visibility, visible);
|
30
|
-
|
31
|
-
}
|
32
|
-
|
33
|
-
// If the element is hidden
|
34
|
-
if ($this.is(":" + hidden)) {
|
35
|
-
|
36
|
-
// Show it
|
37
|
-
$this.show();
|
38
|
-
|
39
|
-
}
|
40
|
-
|
41
|
-
// Event triggered when the animation has finished
|
42
|
-
$this.bind( transitionEnd, function () {
|
43
|
-
|
44
|
-
// Remove the classes so they can be added again later
|
45
|
-
$this.removeClass(animated + " " + effect);
|
46
|
-
|
47
|
-
// Add a callback event
|
48
|
-
if (typeof callback === "function") {
|
49
|
-
|
50
|
-
// Execute the callback
|
51
|
-
callback.call(this);
|
52
|
-
|
53
|
-
// Unbind the event handlers
|
54
|
-
$this.unbind( transitionEnd );
|
55
|
-
|
56
|
-
}
|
57
|
-
|
58
|
-
});
|
59
|
-
|
60
|
-
}
|
61
|
-
|
62
|
-
// Check if delay exists or if it"s a callback
|
63
|
-
if (!delay || typeof delay === "function") {
|
64
|
-
|
65
|
-
// If it"s a callback, move it to callback so we can call it later
|
66
|
-
callback = delay;
|
67
|
-
|
68
|
-
// Run the animation (without delay)
|
69
|
-
run();
|
70
|
-
|
71
|
-
} else {
|
72
|
-
|
73
|
-
// Start a counter so we can delay the animation if required
|
74
|
-
setTimeout( run, delay );
|
75
|
-
|
76
|
-
}
|
77
|
-
|
78
|
-
});
|
79
|
-
|
80
|
-
};
|
81
|
-
|
82
|
-
})(jQuery, window, document);
|
@@ -1,196 +0,0 @@
|
|
1
|
-
+function ($) {
|
2
|
-
'use strict';
|
3
|
-
|
4
|
-
// CAROUSEL CLASS DEFINITION
|
5
|
-
// =========================
|
6
|
-
|
7
|
-
var Carousel = function (element, options) {
|
8
|
-
this.$element = $(element)
|
9
|
-
this.$indicators = this.$element.find('.carousel-indicators')
|
10
|
-
this.options = options
|
11
|
-
this.paused =
|
12
|
-
this.sliding =
|
13
|
-
this.interval =
|
14
|
-
this.$active =
|
15
|
-
this.$items = null
|
16
|
-
|
17
|
-
this.options.pause == 'hover' && this.$element
|
18
|
-
.on('mouseenter', $.proxy(this.pause, this))
|
19
|
-
.on('mouseleave', $.proxy(this.cycle, this))
|
20
|
-
}
|
21
|
-
|
22
|
-
Carousel.DEFAULTS = {
|
23
|
-
interval: 5000,
|
24
|
-
pause: 'hover',
|
25
|
-
wrap: true
|
26
|
-
}
|
27
|
-
|
28
|
-
Carousel.prototype.cycle = function (e) {
|
29
|
-
e || (this.paused = false)
|
30
|
-
|
31
|
-
this.interval && clearInterval(this.interval)
|
32
|
-
|
33
|
-
this.options.interval
|
34
|
-
&& !this.paused
|
35
|
-
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
36
|
-
|
37
|
-
return this
|
38
|
-
}
|
39
|
-
|
40
|
-
Carousel.prototype.getActiveIndex = function () {
|
41
|
-
this.$active = this.$element.find('.item.active')
|
42
|
-
this.$items = this.$active.parent().children('.item')
|
43
|
-
|
44
|
-
return this.$items.index(this.$active)
|
45
|
-
}
|
46
|
-
|
47
|
-
Carousel.prototype.to = function (pos) {
|
48
|
-
var that = this
|
49
|
-
var activeIndex = this.getActiveIndex()
|
50
|
-
|
51
|
-
if (pos > (this.$items.length - 1) || pos < 0) return
|
52
|
-
|
53
|
-
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
|
54
|
-
if (activeIndex == pos) return this.pause().cycle()
|
55
|
-
|
56
|
-
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
57
|
-
}
|
58
|
-
|
59
|
-
Carousel.prototype.pause = function (e) {
|
60
|
-
e || (this.paused = true)
|
61
|
-
|
62
|
-
if (this.$element.find('.next, .prev').length && $.support.transition) {
|
63
|
-
this.$element.trigger($.support.transition.end)
|
64
|
-
this.cycle(true)
|
65
|
-
}
|
66
|
-
|
67
|
-
this.interval = clearInterval(this.interval)
|
68
|
-
|
69
|
-
return this
|
70
|
-
}
|
71
|
-
|
72
|
-
Carousel.prototype.next = function () {
|
73
|
-
if (this.sliding) return
|
74
|
-
return this.slide('next')
|
75
|
-
}
|
76
|
-
|
77
|
-
Carousel.prototype.prev = function () {
|
78
|
-
if (this.sliding) return
|
79
|
-
return this.slide('prev')
|
80
|
-
}
|
81
|
-
|
82
|
-
Carousel.prototype.slide = function (type, next) {
|
83
|
-
var $active = this.$element.find('.item.active')
|
84
|
-
var $next = next || $active[type]()
|
85
|
-
var isCycling = this.interval
|
86
|
-
var direction = type == 'next' ? 'left' : 'right'
|
87
|
-
var fallback = type == 'next' ? 'first' : 'last'
|
88
|
-
var that = this
|
89
|
-
|
90
|
-
if (!$next.length) {
|
91
|
-
if (!this.options.wrap) return
|
92
|
-
$next = this.$element.find('.item')[fallback]()
|
93
|
-
}
|
94
|
-
|
95
|
-
if ($next.hasClass('active')) return this.sliding = false
|
96
|
-
|
97
|
-
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
|
98
|
-
this.$element.trigger(e)
|
99
|
-
if (e.isDefaultPrevented()) return
|
100
|
-
|
101
|
-
this.sliding = true
|
102
|
-
|
103
|
-
isCycling && this.pause()
|
104
|
-
|
105
|
-
if (this.$indicators.length) {
|
106
|
-
this.$indicators.find('.active').removeClass('active')
|
107
|
-
this.$element.one('slid.bs.carousel', function () {
|
108
|
-
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
|
109
|
-
$nextIndicator && $nextIndicator.addClass('active')
|
110
|
-
})
|
111
|
-
}
|
112
|
-
|
113
|
-
if ($.support.transition && this.$element.hasClass('slide')) {
|
114
|
-
$next.addClass(type)
|
115
|
-
$next[0].offsetWidth // force reflow
|
116
|
-
$active.addClass(direction)
|
117
|
-
$next.addClass(direction)
|
118
|
-
$active
|
119
|
-
.one($.support.transition.end, function () {
|
120
|
-
$next.removeClass([type, direction].join(' ')).addClass('active')
|
121
|
-
$active.removeClass(['active', direction].join(' '))
|
122
|
-
that.sliding = false
|
123
|
-
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
|
124
|
-
})
|
125
|
-
.emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
|
126
|
-
} else {
|
127
|
-
$active.removeClass('active')
|
128
|
-
$next.addClass('active')
|
129
|
-
this.sliding = false
|
130
|
-
this.$element.trigger('slid.bs.carousel')
|
131
|
-
}
|
132
|
-
|
133
|
-
isCycling && this.cycle()
|
134
|
-
|
135
|
-
return this
|
136
|
-
}
|
137
|
-
|
138
|
-
|
139
|
-
// CAROUSEL PLUGIN DEFINITION
|
140
|
-
// ==========================
|
141
|
-
|
142
|
-
var old = $.fn.carousel
|
143
|
-
|
144
|
-
$.fn.carousel = function (option) {
|
145
|
-
return this.each(function () {
|
146
|
-
var $this = $(this)
|
147
|
-
var data = $this.data('bs.carousel')
|
148
|
-
var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
149
|
-
var action = typeof option == 'string' ? option : options.slide
|
150
|
-
|
151
|
-
if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
|
152
|
-
if (typeof option == 'number') data.to(option)
|
153
|
-
else if (action) data[action]()
|
154
|
-
else if (options.interval) data.pause().cycle()
|
155
|
-
})
|
156
|
-
}
|
157
|
-
|
158
|
-
$.fn.carousel.Constructor = Carousel
|
159
|
-
|
160
|
-
|
161
|
-
// CAROUSEL NO CONFLICT
|
162
|
-
// ====================
|
163
|
-
|
164
|
-
$.fn.carousel.noConflict = function () {
|
165
|
-
$.fn.carousel = old
|
166
|
-
return this
|
167
|
-
}
|
168
|
-
|
169
|
-
|
170
|
-
// CAROUSEL DATA-API
|
171
|
-
// =================
|
172
|
-
|
173
|
-
$(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
|
174
|
-
var $this = $(this), href
|
175
|
-
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
176
|
-
var options = $.extend({}, $target.data(), $this.data())
|
177
|
-
var slideIndex = $this.attr('data-slide-to')
|
178
|
-
if (slideIndex) options.interval = false
|
179
|
-
|
180
|
-
$target.carousel(options)
|
181
|
-
|
182
|
-
if (slideIndex = $this.attr('data-slide-to')) {
|
183
|
-
$target.data('bs.carousel').to(slideIndex)
|
184
|
-
}
|
185
|
-
|
186
|
-
e.preventDefault()
|
187
|
-
})
|
188
|
-
|
189
|
-
$(window).on('load', function () {
|
190
|
-
$('[data-ride="carousel"]').each(function () {
|
191
|
-
var $carousel = $(this)
|
192
|
-
$carousel.carousel($carousel.data())
|
193
|
-
})
|
194
|
-
})
|
195
|
-
|
196
|
-
}(jQuery);
|