summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Bootstrap/bootstrap-carousel.js
Unidiff
Diffstat (limited to 'frontend/gamma/js/Bootstrap/bootstrap-carousel.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-carousel.js208
1 files changed, 0 insertions, 208 deletions
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-carousel.js b/frontend/gamma/js/Bootstrap/bootstrap-carousel.js
deleted file mode 100644
index e127bc7..0000000
--- a/frontend/gamma/js/Bootstrap/bootstrap-carousel.js
+++ b/dev/null
@@ -1,208 +0,0 @@
1/*
2
3Copyright 2008-2013 Clipperz Srl
4
5This file is part of Clipperz, the online password manager.
6For further information about its features and functionalities please
7refer to http://www.clipperz.com.
8
9* Clipperz is free software: you can redistribute it and/or modify it
10 under the terms of the GNU Affero General Public License as published
11 by the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14* Clipperz is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 See the GNU Affero General Public License for more details.
18
19* You should have received a copy of the GNU Affero General Public
20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
21
22*/
23
24/* ==========================================================
25 * bootstrap-carousel.js v2.2.2
26 * http://twitter.github.com/bootstrap/javascript.html#carousel
27 * ==========================================================
28 * Copyright 2012 Twitter, Inc.
29 *
30 * Licensed under the Apache License, Version 2.0 (the "License");
31 * you may not use this file except in compliance with the License.
32 * You may obtain a copy of the License at
33 *
34 * http://www.apache.org/licenses/LICENSE-2.0
35 *
36 * Unless required by applicable law or agreed to in writing, software
37 * distributed under the License is distributed on an "AS IS" BASIS,
38 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39 * See the License for the specific language governing permissions and
40 * limitations under the License.
41 * ========================================================== */
42
43
44!function ($) {
45
46 "use strict"; // jshint ;_;
47
48
49 /* CAROUSEL CLASS DEFINITION
50 * ========================= */
51
52 var Carousel = function (element, options) {
53 this.$element = $(element)
54 this.options = options
55 this.options.pause == 'hover' && this.$element
56 .on('mouseenter', $.proxy(this.pause, this))
57 .on('mouseleave', $.proxy(this.cycle, this))
58 }
59
60 Carousel.prototype = {
61
62 cycle: function (e) {
63 if (!e) this.paused = false
64 this.options.interval
65 && !this.paused
66 && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
67 return this
68 }
69
70 , to: function (pos) {
71 var $active = this.$element.find('.item.active')
72 , children = $active.parent().children()
73 , activePos = children.index($active)
74 , that = this
75
76 if (pos > (children.length - 1) || pos < 0) return
77
78 if (this.sliding) {
79 return this.$element.one('slid', function () {
80 that.to(pos)
81 })
82 }
83
84 if (activePos == pos) {
85 return this.pause().cycle()
86 }
87
88 return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
89 }
90
91 , pause: function (e) {
92 if (!e) this.paused = true
93 if (this.$element.find('.next, .prev').length && $.support.transition.end) {
94 this.$element.trigger($.support.transition.end)
95 this.cycle()
96 }
97 clearInterval(this.interval)
98 this.interval = null
99 return this
100 }
101
102 , next: function () {
103 if (this.sliding) return
104 return this.slide('next')
105 }
106
107 , prev: function () {
108 if (this.sliding) return
109 return this.slide('prev')
110 }
111
112 , slide: function (type, next) {
113 var $active = this.$element.find('.item.active')
114 , $next = next || $active[type]()
115 , isCycling = this.interval
116 , direction = type == 'next' ? 'left' : 'right'
117 , fallback = type == 'next' ? 'first' : 'last'
118 , that = this
119 , e
120
121 this.sliding = true
122
123 isCycling && this.pause()
124
125 $next = $next.length ? $next : this.$element.find('.item')[fallback]()
126
127 e = $.Event('slide', {
128 relatedTarget: $next[0]
129 })
130
131 if ($next.hasClass('active')) return
132
133 if ($.support.transition && this.$element.hasClass('slide')) {
134 this.$element.trigger(e)
135 if (e.isDefaultPrevented()) return
136 $next.addClass(type)
137 $next[0].offsetWidth // force reflow
138 $active.addClass(direction)
139 $next.addClass(direction)
140 this.$element.one($.support.transition.end, function () {
141 $next.removeClass([type, direction].join(' ')).addClass('active')
142 $active.removeClass(['active', direction].join(' '))
143 that.sliding = false
144 setTimeout(function () { that.$element.trigger('slid') }, 0)
145 })
146 } else {
147 this.$element.trigger(e)
148 if (e.isDefaultPrevented()) return
149 $active.removeClass('active')
150 $next.addClass('active')
151 this.sliding = false
152 this.$element.trigger('slid')
153 }
154
155 isCycling && this.cycle()
156
157 return this
158 }
159
160 }
161
162
163 /* CAROUSEL PLUGIN DEFINITION
164 * ========================== */
165
166 var old = $.fn.carousel
167
168 $.fn.carousel = function (option) {
169 return this.each(function () {
170 var $this = $(this)
171 , data = $this.data('carousel')
172 , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
173 , action = typeof option == 'string' ? option : options.slide
174 if (!data) $this.data('carousel', (data = new Carousel(this, options)))
175 if (typeof option == 'number') data.to(option)
176 else if (action) data[action]()
177 else if (options.interval) data.cycle()
178 })
179 }
180
181 $.fn.carousel.defaults = {
182 interval: 5000
183 , pause: 'hover'
184 }
185
186 $.fn.carousel.Constructor = Carousel
187
188
189 /* CAROUSEL NO CONFLICT
190 * ==================== */
191
192 $.fn.carousel.noConflict = function () {
193 $.fn.carousel = old
194 return this
195 }
196
197 /* CAROUSEL DATA-API
198 * ================= */
199
200 $(document).on('click.carousel.data-api', '[data-slide]', function (e) {
201 var $this = $(this), href
202 , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
203 , options = $.extend({}, $target.data(), $this.data())
204 $target.carousel(options)
205 e.preventDefault()
206 })
207
208}(window.jQuery); \ No newline at end of file