summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Bootstrap/bootstrap-collapse.js
Unidiff
Diffstat (limited to 'frontend/gamma/js/Bootstrap/bootstrap-collapse.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-collapse.js190
1 files changed, 0 insertions, 190 deletions
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-collapse.js b/frontend/gamma/js/Bootstrap/bootstrap-collapse.js
deleted file mode 100644
index 31b7168..0000000
--- a/frontend/gamma/js/Bootstrap/bootstrap-collapse.js
+++ b/dev/null
@@ -1,190 +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-collapse.js v2.2.2
26 * http://twitter.github.com/bootstrap/javascript.html#collapse
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 /* COLLAPSE PUBLIC CLASS DEFINITION
50 * ================================ */
51
52 var Collapse = function (element, options) {
53 this.$element = $(element)
54 this.options = $.extend({}, $.fn.collapse.defaults, options)
55
56 if (this.options.parent) {
57 this.$parent = $(this.options.parent)
58 }
59
60 this.options.toggle && this.toggle()
61 }
62
63 Collapse.prototype = {
64
65 constructor: Collapse
66
67 , dimension: function () {
68 var hasWidth = this.$element.hasClass('width')
69 return hasWidth ? 'width' : 'height'
70 }
71
72 , show: function () {
73 var dimension
74 , scroll
75 , actives
76 , hasData
77
78 if (this.transitioning) return
79
80 dimension = this.dimension()
81 scroll = $.camelCase(['scroll', dimension].join('-'))
82 actives = this.$parent && this.$parent.find('> .accordion-group > .in')
83
84 if (actives && actives.length) {
85 hasData = actives.data('collapse')
86 if (hasData && hasData.transitioning) return
87 actives.collapse('hide')
88 hasData || actives.data('collapse', null)
89 }
90
91 this.$element[dimension](0)
92 this.transition('addClass', $.Event('show'), 'shown')
93 $.support.transition && this.$element[dimension](this.$element[0][scroll])
94 }
95
96 , hide: function () {
97 var dimension
98 if (this.transitioning) return
99 dimension = this.dimension()
100 this.reset(this.$element[dimension]())
101 this.transition('removeClass', $.Event('hide'), 'hidden')
102 this.$element[dimension](0)
103 }
104
105 , reset: function (size) {
106 var dimension = this.dimension()
107
108 this.$element
109 .removeClass('collapse')
110 [dimension](size || 'auto')
111 [0].offsetWidth
112
113 this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
114
115 return this
116 }
117
118 , transition: function (method, startEvent, completeEvent) {
119 var that = this
120 , complete = function () {
121 if (startEvent.type == 'show') that.reset()
122 that.transitioning = 0
123 that.$element.trigger(completeEvent)
124 }
125
126 this.$element.trigger(startEvent)
127
128 if (startEvent.isDefaultPrevented()) return
129
130 this.transitioning = 1
131
132 this.$element[method]('in')
133
134 $.support.transition && this.$element.hasClass('collapse') ?
135 this.$element.one($.support.transition.end, complete) :
136 complete()
137 }
138
139 , toggle: function () {
140 this[this.$element.hasClass('in') ? 'hide' : 'show']()
141 }
142
143 }
144
145
146 /* COLLAPSE PLUGIN DEFINITION
147 * ========================== */
148
149 var old = $.fn.collapse
150
151 $.fn.collapse = function (option) {
152 return this.each(function () {
153 var $this = $(this)
154 , data = $this.data('collapse')
155 , options = typeof option == 'object' && option
156 if (!data) $this.data('collapse', (data = new Collapse(this, options)))
157 if (typeof option == 'string') data[option]()
158 })
159 }
160
161 $.fn.collapse.defaults = {
162 toggle: true
163 }
164
165 $.fn.collapse.Constructor = Collapse
166
167
168 /* COLLAPSE NO CONFLICT
169 * ==================== */
170
171 $.fn.collapse.noConflict = function () {
172 $.fn.collapse = old
173 return this
174 }
175
176
177 /* COLLAPSE DATA-API
178 * ================= */
179
180 $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
181 var $this = $(this), href
182 , target = $this.attr('data-target')
183 || e.preventDefault()
184 || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
185 , option = $(target).data('collapse') ? 'toggle' : $this.data()
186 $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
187 $(target).collapse(option)
188 })
189
190}(window.jQuery); \ No newline at end of file