summaryrefslogtreecommitdiff
path: root/frontend/gamma
Unidiff
Diffstat (limited to 'frontend/gamma') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-affix.js140
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-alert.js122
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-button.js128
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-carousel.js208
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-collapse.js190
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-dropdown.js184
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-modal.js268
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-popover.js137
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-scrollspy.js185
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-tab.js167
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-tooltip.js310
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-transition.js83
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-typeahead.js346
-rw-r--r--frontend/gamma/js/JQTouch/extensions/jqt.actionsheet.js159
-rw-r--r--frontend/gamma/js/JQTouch/extensions/jqt.autotitles.js52
-rw-r--r--frontend/gamma/js/JQTouch/extensions/jqt.floaty.js96
-rw-r--r--frontend/gamma/js/JQTouch/extensions/jqt.location.js51
-rw-r--r--frontend/gamma/js/JQTouch/extensions/jqt.menusheet.js137
-rw-r--r--frontend/gamma/js/JQTouch/extensions/jqt.offline.js97
-rwxr-xr-xfrontend/gamma/js/JQTouch/extensions/jqt.themeswitcher.js123
-rw-r--r--frontend/gamma/js/JQTouch/jqtouch.js889
-rw-r--r--frontend/gamma/js/Zepto/ajax.js285
-rw-r--r--frontend/gamma/js/Zepto/assets.js21
-rw-r--r--frontend/gamma/js/Zepto/data.js67
-rw-r--r--frontend/gamma/js/Zepto/detect.js42
-rw-r--r--frontend/gamma/js/Zepto/event.js248
-rw-r--r--frontend/gamma/js/Zepto/form.js40
-rw-r--r--frontend/gamma/js/Zepto/fx.js102
-rw-r--r--frontend/gamma/js/Zepto/fx_methods.js71
-rw-r--r--frontend/gamma/js/Zepto/gesture.js35
-rw-r--r--frontend/gamma/js/Zepto/polyfill.js36
-rw-r--r--frontend/gamma/js/Zepto/selector.js81
-rw-r--r--frontend/gamma/js/Zepto/stack.js22
-rw-r--r--frontend/gamma/js/Zepto/touch.js113
-rw-r--r--frontend/gamma/js/Zepto/zepto.js751
35 files changed, 0 insertions, 5986 deletions
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-affix.js b/frontend/gamma/js/Bootstrap/bootstrap-affix.js
deleted file mode 100644
index 052ecad..0000000
--- a/frontend/gamma/js/Bootstrap/bootstrap-affix.js
+++ b/dev/null
@@ -1,140 +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-affix.js v2.2.2
26 * http://twitter.github.com/bootstrap/javascript.html#affix
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 /* AFFIX CLASS DEFINITION
50 * ====================== */
51
52 var Affix = function (element, options) {
53 this.options = $.extend({}, $.fn.affix.defaults, options)
54 this.$window = $(window)
55 .on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
56 .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
57 this.$element = $(element)
58 this.checkPosition()
59 }
60
61 Affix.prototype.checkPosition = function () {
62 if (!this.$element.is(':visible')) return
63
64 var scrollHeight = $(document).height()
65 , scrollTop = this.$window.scrollTop()
66 , position = this.$element.offset()
67 , offset = this.options.offset
68 , offsetBottom = offset.bottom
69 , offsetTop = offset.top
70 , reset = 'affix affix-top affix-bottom'
71 , affix
72
73 if (typeof offset != 'object') offsetBottom = offsetTop = offset
74 if (typeof offsetTop == 'function') offsetTop = offset.top()
75 if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
76
77 affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
78 false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
79 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
80 'top' : false
81
82 if (this.affixed === affix) return
83
84 this.affixed = affix
85 this.unpin = affix == 'bottom' ? position.top - scrollTop : null
86
87 this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
88 }
89
90
91 /* AFFIX PLUGIN DEFINITION
92 * ======================= */
93
94 var old = $.fn.affix
95
96 $.fn.affix = function (option) {
97 return this.each(function () {
98 var $this = $(this)
99 , data = $this.data('affix')
100 , options = typeof option == 'object' && option
101 if (!data) $this.data('affix', (data = new Affix(this, options)))
102 if (typeof option == 'string') data[option]()
103 })
104 }
105
106 $.fn.affix.Constructor = Affix
107
108 $.fn.affix.defaults = {
109 offset: 0
110 }
111
112
113 /* AFFIX NO CONFLICT
114 * ================= */
115
116 $.fn.affix.noConflict = function () {
117 $.fn.affix = old
118 return this
119 }
120
121
122 /* AFFIX DATA-API
123 * ============== */
124
125 $(window).on('load', function () {
126 $('[data-spy="affix"]').each(function () {
127 var $spy = $(this)
128 , data = $spy.data()
129
130 data.offset = data.offset || {}
131
132 data.offsetBottom && (data.offset.bottom = data.offsetBottom)
133 data.offsetTop && (data.offset.top = data.offsetTop)
134
135 $spy.affix(data)
136 })
137 })
138
139
140}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-alert.js b/frontend/gamma/js/Bootstrap/bootstrap-alert.js
deleted file mode 100644
index 63028f2..0000000
--- a/frontend/gamma/js/Bootstrap/bootstrap-alert.js
+++ b/dev/null
@@ -1,122 +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-alert.js v2.2.2
26 * http://twitter.github.com/bootstrap/javascript.html#alerts
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 /* ALERT CLASS DEFINITION
50 * ====================== */
51
52 var dismiss = '[data-dismiss="alert"]'
53 , Alert = function (el) {
54 $(el).on('click', dismiss, this.close)
55 }
56
57 Alert.prototype.close = function (e) {
58 var $this = $(this)
59 , selector = $this.attr('data-target')
60 , $parent
61
62 if (!selector) {
63 selector = $this.attr('href')
64 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
65 }
66
67 $parent = $(selector)
68
69 e && e.preventDefault()
70
71 $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
72
73 $parent.trigger(e = $.Event('close'))
74
75 if (e.isDefaultPrevented()) return
76
77 $parent.removeClass('in')
78
79 function removeElement() {
80 $parent
81 .trigger('closed')
82 .remove()
83 }
84
85 $.support.transition && $parent.hasClass('fade') ?
86 $parent.on($.support.transition.end, removeElement) :
87 removeElement()
88 }
89
90
91 /* ALERT PLUGIN DEFINITION
92 * ======================= */
93
94 var old = $.fn.alert
95
96 $.fn.alert = function (option) {
97 return this.each(function () {
98 var $this = $(this)
99 , data = $this.data('alert')
100 if (!data) $this.data('alert', (data = new Alert(this)))
101 if (typeof option == 'string') data[option].call($this)
102 })
103 }
104
105 $.fn.alert.Constructor = Alert
106
107
108 /* ALERT NO CONFLICT
109 * ================= */
110
111 $.fn.alert.noConflict = function () {
112 $.fn.alert = old
113 return this
114 }
115
116
117 /* ALERT DATA-API
118 * ============== */
119
120 $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
121
122}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-button.js b/frontend/gamma/js/Bootstrap/bootstrap-button.js
deleted file mode 100644
index 2c1226e..0000000
--- a/frontend/gamma/js/Bootstrap/bootstrap-button.js
+++ b/dev/null
@@ -1,128 +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-button.js v2.2.2
26 * http://twitter.github.com/bootstrap/javascript.html#buttons
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 /* BUTTON PUBLIC CLASS DEFINITION
50 * ============================== */
51
52 var Button = function (element, options) {
53 this.$element = $(element)
54 this.options = $.extend({}, $.fn.button.defaults, options)
55 }
56
57 Button.prototype.setState = function (state) {
58 var d = 'disabled'
59 , $el = this.$element
60 , data = $el.data()
61 , val = $el.is('input') ? 'val' : 'html'
62
63 state = state + 'Text'
64 data.resetText || $el.data('resetText', $el[val]())
65
66 $el[val](data[state] || this.options[state])
67
68 // push to event loop to allow forms to submit
69 setTimeout(function () {
70 state == 'loadingText' ?
71 $el.addClass(d).attr(d, d) :
72 $el.removeClass(d).removeAttr(d)
73 }, 0)
74 }
75
76 Button.prototype.toggle = function () {
77 var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
78
79 $parent && $parent
80 .find('.active')
81 .removeClass('active')
82
83 this.$element.toggleClass('active')
84 }
85
86
87 /* BUTTON PLUGIN DEFINITION
88 * ======================== */
89
90 var old = $.fn.button
91
92 $.fn.button = function (option) {
93 return this.each(function () {
94 var $this = $(this)
95 , data = $this.data('button')
96 , options = typeof option == 'object' && option
97 if (!data) $this.data('button', (data = new Button(this, options)))
98 if (option == 'toggle') data.toggle()
99 else if (option) data.setState(option)
100 })
101 }
102
103 $.fn.button.defaults = {
104 loadingText: 'loading...'
105 }
106
107 $.fn.button.Constructor = Button
108
109
110 /* BUTTON NO CONFLICT
111 * ================== */
112
113 $.fn.button.noConflict = function () {
114 $.fn.button = old
115 return this
116 }
117
118
119 /* BUTTON DATA-API
120 * =============== */
121
122 $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
123 var $btn = $(e.target)
124 if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
125 $btn.button('toggle')
126 })
127
128}(window.jQuery); \ No newline at end of file
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
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
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-dropdown.js b/frontend/gamma/js/Bootstrap/bootstrap-dropdown.js
deleted file mode 100644
index 3b77bb3..0000000
--- a/frontend/gamma/js/Bootstrap/bootstrap-dropdown.js
+++ b/dev/null
@@ -1,184 +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-dropdown.js v2.2.2
26 * http://twitter.github.com/bootstrap/javascript.html#dropdowns
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 /* DROPDOWN CLASS DEFINITION
50 * ========================= */
51
52 var toggle = '[data-toggle=dropdown]'
53 , Dropdown = function (element) {
54 var $el = $(element).on('click.dropdown.data-api', this.toggle)
55 $('html').on('click.dropdown.data-api', function () {
56 $el.parent().removeClass('open')
57 })
58 }
59
60 Dropdown.prototype = {
61
62 constructor: Dropdown
63
64 , toggle: function (e) {
65 var $this = $(this)
66 , $parent
67 , isActive
68
69 if ($this.is('.disabled, :disabled')) return
70
71 $parent = getParent($this)
72
73 isActive = $parent.hasClass('open')
74
75 clearMenus()
76
77 if (!isActive) {
78 $parent.toggleClass('open')
79 }
80
81 $this.focus()
82
83 return false
84 }
85
86 , keydown: function (e) {
87 var $this
88 , $items
89 , $active
90 , $parent
91 , isActive
92 , index
93
94 if (!/(38|40|27)/.test(e.keyCode)) return
95
96 $this = $(this)
97
98 e.preventDefault()
99 e.stopPropagation()
100
101 if ($this.is('.disabled, :disabled')) return
102
103 $parent = getParent($this)
104
105 isActive = $parent.hasClass('open')
106
107 if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
108
109 $items = $('[role=menu] li:not(.divider):visible a', $parent)
110
111 if (!$items.length) return
112
113 index = $items.index($items.filter(':focus'))
114
115 if (e.keyCode == 38 && index > 0) index-- // up
116 if (e.keyCode == 40 && index < $items.length - 1) index++ // down
117 if (!~index) index = 0
118
119 $items
120 .eq(index)
121 .focus()
122 }
123
124 }
125
126 function clearMenus() {
127 $(toggle).each(function () {
128 getParent($(this)).removeClass('open')
129 })
130 }
131
132 function getParent($this) {
133 var selector = $this.attr('data-target')
134 , $parent
135
136 if (!selector) {
137 selector = $this.attr('href')
138 selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
139 }
140
141 $parent = $(selector)
142 $parent.length || ($parent = $this.parent())
143
144 return $parent
145 }
146
147
148 /* DROPDOWN PLUGIN DEFINITION
149 * ========================== */
150
151 var old = $.fn.dropdown
152
153 $.fn.dropdown = function (option) {
154 return this.each(function () {
155 var $this = $(this)
156 , data = $this.data('dropdown')
157 if (!data) $this.data('dropdown', (data = new Dropdown(this)))
158 if (typeof option == 'string') data[option].call($this)
159 })
160 }
161
162 $.fn.dropdown.Constructor = Dropdown
163
164
165 /* DROPDOWN NO CONFLICT
166 * ==================== */
167
168 $.fn.dropdown.noConflict = function () {
169 $.fn.dropdown = old
170 return this
171 }
172
173
174 /* APPLY TO STANDARD DROPDOWN ELEMENTS
175 * =================================== */
176
177 $(document)
178 .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
179 .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
180 .on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() })
181 .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
182 .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
183
184}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-modal.js b/frontend/gamma/js/Bootstrap/bootstrap-modal.js
deleted file mode 100644
index fd7e337..0000000
--- a/frontend/gamma/js/Bootstrap/bootstrap-modal.js
+++ b/dev/null
@@ -1,268 +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-modal.js v2.2.2
26 * http://twitter.github.com/bootstrap/javascript.html#modals
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 /* MODAL CLASS DEFINITION
50 * ====================== */
51
52 var Modal = function (element, options) {
53 this.options = options
54 this.$element = $(element)
55 .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
56 this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
57 }
58
59 Modal.prototype = {
60
61 constructor: Modal
62
63 , toggle: function () {
64 return this[!this.isShown ? 'show' : 'hide']()
65 }
66
67 , show: function () {
68 var that = this
69 , e = $.Event('show')
70
71 this.$element.trigger(e)
72
73 if (this.isShown || e.isDefaultPrevented()) return
74
75 this.isShown = true
76
77 this.escape()
78
79 this.backdrop(function () {
80 var transition = $.support.transition && that.$element.hasClass('fade')
81
82 if (!that.$element.parent().length) {
83 that.$element.appendTo(document.body) //don't move modals dom position
84 }
85
86 that.$element
87 .show()
88
89 if (transition) {
90 that.$element[0].offsetWidth // force reflow
91 }
92
93 that.$element
94 .addClass('in')
95 .attr('aria-hidden', false)
96
97 that.enforceFocus()
98
99 transition ?
100 that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
101 that.$element.focus().trigger('shown')
102
103 })
104 }
105
106 , hide: function (e) {
107 e && e.preventDefault()
108
109 var that = this
110
111 e = $.Event('hide')
112
113 this.$element.trigger(e)
114
115 if (!this.isShown || e.isDefaultPrevented()) return
116
117 this.isShown = false
118
119 this.escape()
120
121 $(document).off('focusin.modal')
122
123 this.$element
124 .removeClass('in')
125 .attr('aria-hidden', true)
126
127 $.support.transition && this.$element.hasClass('fade') ?
128 this.hideWithTransition() :
129 this.hideModal()
130 }
131
132 , enforceFocus: function () {
133 var that = this
134 $(document).on('focusin.modal', function (e) {
135 if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
136 that.$element.focus()
137 }
138 })
139 }
140
141 , escape: function () {
142 var that = this
143 if (this.isShown && this.options.keyboard) {
144 this.$element.on('keyup.dismiss.modal', function ( e ) {
145 e.which == 27 && that.hide()
146 })
147 } else if (!this.isShown) {
148 this.$element.off('keyup.dismiss.modal')
149 }
150 }
151
152 , hideWithTransition: function () {
153 var that = this
154 , timeout = setTimeout(function () {
155 that.$element.off($.support.transition.end)
156 that.hideModal()
157 }, 500)
158
159 this.$element.one($.support.transition.end, function () {
160 clearTimeout(timeout)
161 that.hideModal()
162 })
163 }
164
165 , hideModal: function (that) {
166 this.$element
167 .hide()
168 .trigger('hidden')
169
170 this.backdrop()
171 }
172
173 , removeBackdrop: function () {
174 this.$backdrop.remove()
175 this.$backdrop = null
176 }
177
178 , backdrop: function (callback) {
179 var that = this
180 , animate = this.$element.hasClass('fade') ? 'fade' : ''
181
182 if (this.isShown && this.options.backdrop) {
183 var doAnimate = $.support.transition && animate
184
185 this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
186 .appendTo(document.body)
187
188 this.$backdrop.click(
189 this.options.backdrop == 'static' ?
190 $.proxy(this.$element[0].focus, this.$element[0])
191 : $.proxy(this.hide, this)
192 )
193
194 if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
195
196 this.$backdrop.addClass('in')
197
198 doAnimate ?
199 this.$backdrop.one($.support.transition.end, callback) :
200 callback()
201
202 } else if (!this.isShown && this.$backdrop) {
203 this.$backdrop.removeClass('in')
204
205 $.support.transition && this.$element.hasClass('fade')?
206 this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
207 this.removeBackdrop()
208
209 } else if (callback) {
210 callback()
211 }
212 }
213 }
214
215
216 /* MODAL PLUGIN DEFINITION
217 * ======================= */
218
219 var old = $.fn.modal
220
221 $.fn.modal = function (option) {
222 return this.each(function () {
223 var $this = $(this)
224 , data = $this.data('modal')
225 , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
226 if (!data) $this.data('modal', (data = new Modal(this, options)))
227 if (typeof option == 'string') data[option]()
228 else if (options.show) data.show()
229 })
230 }
231
232 $.fn.modal.defaults = {
233 backdrop: true
234 , keyboard: true
235 , show: true
236 }
237
238 $.fn.modal.Constructor = Modal
239
240
241 /* MODAL NO CONFLICT
242 * ================= */
243
244 $.fn.modal.noConflict = function () {
245 $.fn.modal = old
246 return this
247 }
248
249
250 /* MODAL DATA-API
251 * ============== */
252
253 $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
254 var $this = $(this)
255 , href = $this.attr('href')
256 , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
257 , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
258
259 e.preventDefault()
260
261 $target
262 .modal(option)
263 .one('hide', function () {
264 $this.focus()
265 })
266 })
267
268}(window.jQuery);
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-popover.js b/frontend/gamma/js/Bootstrap/bootstrap-popover.js
deleted file mode 100644
index 89e1edb..0000000
--- a/frontend/gamma/js/Bootstrap/bootstrap-popover.js
+++ b/dev/null
@@ -1,137 +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-popover.js v2.2.2
26 * http://twitter.github.com/bootstrap/javascript.html#popovers
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 /* POPOVER PUBLIC CLASS DEFINITION
50 * =============================== */
51
52 var Popover = function (element, options) {
53 this.init('popover', element, options)
54 }
55
56
57 /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
58 ========================================== */
59
60 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
61
62 constructor: Popover
63
64 , setContent: function () {
65 var $tip = this.tip()
66 , title = this.getTitle()
67 , content = this.getContent()
68
69 $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
70 $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
71
72 $tip.removeClass('fade top bottom left right in')
73 }
74
75 , hasContent: function () {
76 return this.getTitle() || this.getContent()
77 }
78
79 , getContent: function () {
80 var content
81 , $e = this.$element
82 , o = this.options
83
84 content = $e.attr('data-content')
85 || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
86
87 return content
88 }
89
90 , tip: function () {
91 if (!this.$tip) {
92 this.$tip = $(this.options.template)
93 }
94 return this.$tip
95 }
96
97 , destroy: function () {
98 this.hide().$element.off('.' + this.type).removeData(this.type)
99 }
100
101 })
102
103
104 /* POPOVER PLUGIN DEFINITION
105 * ======================= */
106
107 var old = $.fn.popover
108
109 $.fn.popover = function (option) {
110 return this.each(function () {
111 var $this = $(this)
112 , data = $this.data('popover')
113 , options = typeof option == 'object' && option
114 if (!data) $this.data('popover', (data = new Popover(this, options)))
115 if (typeof option == 'string') data[option]()
116 })
117 }
118
119 $.fn.popover.Constructor = Popover
120
121 $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
122 placement: 'right'
123 , trigger: 'click'
124 , content: ''
125 , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"></div></div></div>'
126 })
127
128
129 /* POPOVER NO CONFLICT
130 * =================== */
131
132 $.fn.popover.noConflict = function () {
133 $.fn.popover = old
134 return this
135 }
136
137}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-scrollspy.js b/frontend/gamma/js/Bootstrap/bootstrap-scrollspy.js
deleted file mode 100644
index 4366f26..0000000
--- a/frontend/gamma/js/Bootstrap/bootstrap-scrollspy.js
+++ b/dev/null
@@ -1,185 +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-scrollspy.js v2.2.2
26 * http://twitter.github.com/bootstrap/javascript.html#scrollspy
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 /* SCROLLSPY CLASS DEFINITION
50 * ========================== */
51
52 function ScrollSpy(element, options) {
53 var process = $.proxy(this.process, this)
54 , $element = $(element).is('body') ? $(window) : $(element)
55 , href
56 this.options = $.extend({}, $.fn.scrollspy.defaults, options)
57 this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
58 this.selector = (this.options.target
59 || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
60 || '') + ' .nav li > a'
61 this.$body = $('body')
62 this.refresh()
63 this.process()
64 }
65
66 ScrollSpy.prototype = {
67
68 constructor: ScrollSpy
69
70 , refresh: function () {
71 var self = this
72 , $targets
73
74 this.offsets = $([])
75 this.targets = $([])
76
77 $targets = this.$body
78 .find(this.selector)
79 .map(function () {
80 var $el = $(this)
81 , href = $el.data('target') || $el.attr('href')
82 , $href = /^#\w/.test(href) && $(href)
83 return ( $href
84 && $href.length
85 && [[ $href.position().top + self.$scrollElement.scrollTop(), href ]] ) || null
86 })
87 .sort(function (a, b) { return a[0] - b[0] })
88 .each(function () {
89 self.offsets.push(this[0])
90 self.targets.push(this[1])
91 })
92 }
93
94 , process: function () {
95 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
96 , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
97 , maxScroll = scrollHeight - this.$scrollElement.height()
98 , offsets = this.offsets
99 , targets = this.targets
100 , activeTarget = this.activeTarget
101 , i
102
103 if (scrollTop >= maxScroll) {
104 return activeTarget != (i = targets.last()[0])
105 && this.activate ( i )
106 }
107
108 for (i = offsets.length; i--;) {
109 activeTarget != targets[i]
110 && scrollTop >= offsets[i]
111 && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
112 && this.activate( targets[i] )
113 }
114 }
115
116 , activate: function (target) {
117 var active
118 , selector
119
120 this.activeTarget = target
121
122 $(this.selector)
123 .parent('.active')
124 .removeClass('active')
125
126 selector = this.selector
127 + '[data-target="' + target + '"],'
128 + this.selector + '[href="' + target + '"]'
129
130 active = $(selector)
131 .parent('li')
132 .addClass('active')
133
134 if (active.parent('.dropdown-menu').length) {
135 active = active.closest('li.dropdown').addClass('active')
136 }
137
138 active.trigger('activate')
139 }
140
141 }
142
143
144 /* SCROLLSPY PLUGIN DEFINITION
145 * =========================== */
146
147 var old = $.fn.scrollspy
148
149 $.fn.scrollspy = function (option) {
150 return this.each(function () {
151 var $this = $(this)
152 , data = $this.data('scrollspy')
153 , options = typeof option == 'object' && option
154 if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
155 if (typeof option == 'string') data[option]()
156 })
157 }
158
159 $.fn.scrollspy.Constructor = ScrollSpy
160
161 $.fn.scrollspy.defaults = {
162 offset: 10
163 }
164
165
166 /* SCROLLSPY NO CONFLICT
167 * ===================== */
168
169 $.fn.scrollspy.noConflict = function () {
170 $.fn.scrollspy = old
171 return this
172 }
173
174
175 /* SCROLLSPY DATA-API
176 * ================== */
177
178 $(window).on('load', function () {
179 $('[data-spy="scroll"]').each(function () {
180 var $spy = $(this)
181 $spy.scrollspy($spy.data())
182 })
183 })
184
185}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-tab.js b/frontend/gamma/js/Bootstrap/bootstrap-tab.js
deleted file mode 100644
index d7c7fc7..0000000
--- a/frontend/gamma/js/Bootstrap/bootstrap-tab.js
+++ b/dev/null
@@ -1,167 +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-tab.js v2.2.2
26 * http://twitter.github.com/bootstrap/javascript.html#tabs
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 /* TAB CLASS DEFINITION
50 * ==================== */
51
52 var Tab = function (element) {
53 this.element = $(element)
54 }
55
56 Tab.prototype = {
57
58 constructor: Tab
59
60 , show: function () {
61 var $this = this.element
62 , $ul = $this.closest('ul:not(.dropdown-menu)')
63 , selector = $this.attr('data-target')
64 , previous
65 , $target
66 , e
67
68 if (!selector) {
69 selector = $this.attr('href')
70 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
71 }
72
73 if ( $this.parent('li').hasClass('active') ) return
74
75 previous = $ul.find('.active:last a')[0]
76
77 e = $.Event('show', {
78 relatedTarget: previous
79 })
80
81 $this.trigger(e)
82
83 if (e.isDefaultPrevented()) return
84
85 $target = $(selector)
86
87 this.activate($this.parent('li'), $ul)
88 this.activate($target, $target.parent(), function () {
89 $this.trigger({
90 type: 'shown'
91 , relatedTarget: previous
92 })
93 })
94 }
95
96 , activate: function ( element, container, callback) {
97 var $active = container.find('> .active')
98 , transition = callback
99 && $.support.transition
100 && $active.hasClass('fade')
101
102 function next() {
103 $active
104 .removeClass('active')
105 .find('> .dropdown-menu > .active')
106 .removeClass('active')
107
108 element.addClass('active')
109
110 if (transition) {
111 element[0].offsetWidth // reflow for transition
112 element.addClass('in')
113 } else {
114 element.removeClass('fade')
115 }
116
117 if ( element.parent('.dropdown-menu') ) {
118 element.closest('li.dropdown').addClass('active')
119 }
120
121 callback && callback()
122 }
123
124 transition ?
125 $active.one($.support.transition.end, next) :
126 next()
127
128 $active.removeClass('in')
129 }
130 }
131
132
133 /* TAB PLUGIN DEFINITION
134 * ===================== */
135
136 var old = $.fn.tab
137
138 $.fn.tab = function ( option ) {
139 return this.each(function () {
140 var $this = $(this)
141 , data = $this.data('tab')
142 if (!data) $this.data('tab', (data = new Tab(this)))
143 if (typeof option == 'string') data[option]()
144 })
145 }
146
147 $.fn.tab.Constructor = Tab
148
149
150 /* TAB NO CONFLICT
151 * =============== */
152
153 $.fn.tab.noConflict = function () {
154 $.fn.tab = old
155 return this
156 }
157
158
159 /* TAB DATA-API
160 * ============ */
161
162 $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
163 e.preventDefault()
164 $(this).tab('show')
165 })
166
167}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-tooltip.js b/frontend/gamma/js/Bootstrap/bootstrap-tooltip.js
deleted file mode 100644
index bdcff7d..0000000
--- a/frontend/gamma/js/Bootstrap/bootstrap-tooltip.js
+++ b/dev/null
@@ -1,310 +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-tooltip.js v2.2.2
26 * http://twitter.github.com/bootstrap/javascript.html#tooltips
27 * Inspired by the original jQuery.tipsy by Jason Frame
28 * ===========================================================
29 * Copyright 2012 Twitter, Inc.
30 *
31 * Licensed under the Apache License, Version 2.0 (the "License");
32 * you may not use this file except in compliance with the License.
33 * You may obtain a copy of the License at
34 *
35 * http://www.apache.org/licenses/LICENSE-2.0
36 *
37 * Unless required by applicable law or agreed to in writing, software
38 * distributed under the License is distributed on an "AS IS" BASIS,
39 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
40 * See the License for the specific language governing permissions and
41 * limitations under the License.
42 * ========================================================== */
43
44
45!function ($) {
46
47 "use strict"; // jshint ;_;
48
49
50 /* TOOLTIP PUBLIC CLASS DEFINITION
51 * =============================== */
52
53 var Tooltip = function (element, options) {
54 this.init('tooltip', element, options)
55 }
56
57 Tooltip.prototype = {
58
59 constructor: Tooltip
60
61 , init: function (type, element, options) {
62 var eventIn
63 , eventOut
64
65 this.type = type
66 this.$element = $(element)
67 this.options = this.getOptions(options)
68 this.enabled = true
69
70 if (this.options.trigger == 'click') {
71 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
72 } else if (this.options.trigger != 'manual') {
73 eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
74 eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
75 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
76 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
77 }
78
79 this.options.selector ?
80 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
81 this.fixTitle()
82 }
83
84 , getOptions: function (options) {
85 options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
86
87 if (options.delay && typeof options.delay == 'number') {
88 options.delay = {
89 show: options.delay
90 , hide: options.delay
91 }
92 }
93
94 return options
95 }
96
97 , enter: function (e) {
98 var self = $(e.currentTarget)[this.type](this._options).data(this.type)
99
100 if (!self.options.delay || !self.options.delay.show) return self.show()
101
102 clearTimeout(this.timeout)
103 self.hoverState = 'in'
104 this.timeout = setTimeout(function() {
105 if (self.hoverState == 'in') self.show()
106 }, self.options.delay.show)
107 }
108
109 , leave: function (e) {
110 var self = $(e.currentTarget)[this.type](this._options).data(this.type)
111
112 if (this.timeout) clearTimeout(this.timeout)
113 if (!self.options.delay || !self.options.delay.hide) return self.hide()
114
115 self.hoverState = 'out'
116 this.timeout = setTimeout(function() {
117 if (self.hoverState == 'out') self.hide()
118 }, self.options.delay.hide)
119 }
120
121 , show: function () {
122 var $tip
123 , inside
124 , pos
125 , actualWidth
126 , actualHeight
127 , placement
128 , tp
129
130 if (this.hasContent() && this.enabled) {
131 $tip = this.tip()
132 this.setContent()
133
134 if (this.options.animation) {
135 $tip.addClass('fade')
136 }
137
138 placement = typeof this.options.placement == 'function' ?
139 this.options.placement.call(this, $tip[0], this.$element[0]) :
140 this.options.placement
141
142 inside = /in/.test(placement)
143
144 $tip
145 .detach()
146 .css({ top: 0, left: 0, display: 'block' })
147 .insertAfter(this.$element)
148
149 pos = this.getPosition(inside)
150
151 actualWidth = $tip[0].offsetWidth
152 actualHeight = $tip[0].offsetHeight
153
154 switch (inside ? placement.split(' ')[1] : placement) {
155 case 'bottom':
156 tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
157 break
158 case 'top':
159 tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
160 break
161 case 'left':
162 tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
163 break
164 case 'right':
165 tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
166 break
167 }
168
169 $tip
170 .offset(tp)
171 .addClass(placement)
172 .addClass('in')
173 }
174 }
175
176 , setContent: function () {
177 var $tip = this.tip()
178 , title = this.getTitle()
179
180 $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
181 $tip.removeClass('fade in top bottom left right')
182 }
183
184 , hide: function () {
185 var that = this
186 , $tip = this.tip()
187
188 $tip.removeClass('in')
189
190 function removeWithAnimation() {
191 var timeout = setTimeout(function () {
192 $tip.off($.support.transition.end).detach()
193 }, 500)
194
195 $tip.one($.support.transition.end, function () {
196 clearTimeout(timeout)
197 $tip.detach()
198 })
199 }
200
201 $.support.transition && this.$tip.hasClass('fade') ?
202 removeWithAnimation() :
203 $tip.detach()
204
205 return this
206 }
207
208 , fixTitle: function () {
209 var $e = this.$element
210 if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
211 $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
212 }
213 }
214
215 , hasContent: function () {
216 return this.getTitle()
217 }
218
219 , getPosition: function (inside) {
220 return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
221 width: this.$element[0].offsetWidth
222 , height: this.$element[0].offsetHeight
223 })
224 }
225
226 , getTitle: function () {
227 var title
228 , $e = this.$element
229 , o = this.options
230
231 title = $e.attr('data-original-title')
232 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
233
234 return title
235 }
236
237 , tip: function () {
238 return this.$tip = this.$tip || $(this.options.template)
239 }
240
241 , validate: function () {
242 if (!this.$element[0].parentNode) {
243 this.hide()
244 this.$element = null
245 this.options = null
246 }
247 }
248
249 , enable: function () {
250 this.enabled = true
251 }
252
253 , disable: function () {
254 this.enabled = false
255 }
256
257 , toggleEnabled: function () {
258 this.enabled = !this.enabled
259 }
260
261 , toggle: function (e) {
262 var self = $(e.currentTarget)[this.type](this._options).data(this.type)
263 self[self.tip().hasClass('in') ? 'hide' : 'show']()
264 }
265
266 , destroy: function () {
267 this.hide().$element.off('.' + this.type).removeData(this.type)
268 }
269
270 }
271
272
273 /* TOOLTIP PLUGIN DEFINITION
274 * ========================= */
275
276 var old = $.fn.tooltip
277
278 $.fn.tooltip = function ( option ) {
279 return this.each(function () {
280 var $this = $(this)
281 , data = $this.data('tooltip')
282 , options = typeof option == 'object' && option
283 if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
284 if (typeof option == 'string') data[option]()
285 })
286 }
287
288 $.fn.tooltip.Constructor = Tooltip
289
290 $.fn.tooltip.defaults = {
291 animation: true
292 , placement: 'top'
293 , selector: false
294 , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
295 , trigger: 'hover'
296 , title: ''
297 , delay: 0
298 , html: false
299 }
300
301
302 /* TOOLTIP NO CONFLICT
303 * =================== */
304
305 $.fn.tooltip.noConflict = function () {
306 $.fn.tooltip = old
307 return this
308 }
309
310}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-transition.js b/frontend/gamma/js/Bootstrap/bootstrap-transition.js
deleted file mode 100644
index 820d232..0000000
--- a/frontend/gamma/js/Bootstrap/bootstrap-transition.js
+++ b/dev/null
@@ -1,83 +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-transition.js v2.2.2
26 * http://twitter.github.com/bootstrap/javascript.html#transitions
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 /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
50 * ======================================================= */
51
52 $(function () {
53
54 $.support.transition = (function () {
55
56 var transitionEnd = (function () {
57
58 var el = document.createElement('bootstrap')
59 , transEndEventNames = {
60 'WebkitTransition' : 'webkitTransitionEnd'
61 , 'MozTransition' : 'transitionend'
62 , 'OTransition' : 'oTransitionEnd otransitionend'
63 , 'transition' : 'transitionend'
64 }
65 , name
66
67 for (name in transEndEventNames){
68 if (el.style[name] !== undefined) {
69 return transEndEventNames[name]
70 }
71 }
72
73 }())
74
75 return transitionEnd && {
76 end: transitionEnd
77 }
78
79 })()
80
81 })
82
83}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-typeahead.js b/frontend/gamma/js/Bootstrap/bootstrap-typeahead.js
deleted file mode 100644
index d3d8d32..0000000
--- a/frontend/gamma/js/Bootstrap/bootstrap-typeahead.js
+++ b/dev/null
@@ -1,346 +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-typeahead.js v2.2.2
26 * http://twitter.github.com/bootstrap/javascript.html#typeahead
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 /* TYPEAHEAD PUBLIC CLASS DEFINITION
50 * ================================= */
51
52 var Typeahead = function (element, options) {
53 this.$element = $(element)
54 this.options = $.extend({}, $.fn.typeahead.defaults, options)
55 this.matcher = this.options.matcher || this.matcher
56 this.sorter = this.options.sorter || this.sorter
57 this.highlighter = this.options.highlighter || this.highlighter
58 this.updater = this.options.updater || this.updater
59 this.source = this.options.source
60 this.$menu = $(this.options.menu)
61 this.shown = false
62 this.listen()
63 }
64
65 Typeahead.prototype = {
66
67 constructor: Typeahead
68
69 , select: function () {
70 var val = this.$menu.find('.active').attr('data-value')
71 this.$element
72 .val(this.updater(val))
73 .change()
74 return this.hide()
75 }
76
77 , updater: function (item) {
78 return item
79 }
80
81 , show: function () {
82 var pos = $.extend({}, this.$element.position(), {
83 height: this.$element[0].offsetHeight
84 })
85
86 this.$menu
87 .insertAfter(this.$element)
88 .css({
89 top: pos.top + pos.height
90 , left: pos.left
91 })
92 .show()
93
94 this.shown = true
95 return this
96 }
97
98 , hide: function () {
99 this.$menu.hide()
100 this.shown = false
101 return this
102 }
103
104 , lookup: function (event) {
105 var items
106
107 this.query = this.$element.val()
108
109 if (!this.query || this.query.length < this.options.minLength) {
110 return this.shown ? this.hide() : this
111 }
112
113 items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
114
115 return items ? this.process(items) : this
116 }
117
118 , process: function (items) {
119 var that = this
120
121 items = $.grep(items, function (item) {
122 return that.matcher(item)
123 })
124
125 items = this.sorter(items)
126
127 if (!items.length) {
128 return this.shown ? this.hide() : this
129 }
130
131 return this.render(items.slice(0, this.options.items)).show()
132 }
133
134 , matcher: function (item) {
135 return ~item.toLowerCase().indexOf(this.query.toLowerCase())
136 }
137
138 , sorter: function (items) {
139 var beginswith = []
140 , caseSensitive = []
141 , caseInsensitive = []
142 , item
143
144 while (item = items.shift()) {
145 if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
146 else if (~item.indexOf(this.query)) caseSensitive.push(item)
147 else caseInsensitive.push(item)
148 }
149
150 return beginswith.concat(caseSensitive, caseInsensitive)
151 }
152
153 , highlighter: function (item) {
154 var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
155 return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
156 return '<strong>' + match + '</strong>'
157 })
158 }
159
160 , render: function (items) {
161 var that = this
162
163 items = $(items).map(function (i, item) {
164 i = $(that.options.item).attr('data-value', item)
165 i.find('a').html(that.highlighter(item))
166 return i[0]
167 })
168
169 items.first().addClass('active')
170 this.$menu.html(items)
171 return this
172 }
173
174 , next: function (event) {
175 var active = this.$menu.find('.active').removeClass('active')
176 , next = active.next()
177
178 if (!next.length) {
179 next = $(this.$menu.find('li')[0])
180 }
181
182 next.addClass('active')
183 }
184
185 , prev: function (event) {
186 var active = this.$menu.find('.active').removeClass('active')
187 , prev = active.prev()
188
189 if (!prev.length) {
190 prev = this.$menu.find('li').last()
191 }
192
193 prev.addClass('active')
194 }
195
196 , listen: function () {
197 this.$element
198 .on('blur', $.proxy(this.blur, this))
199 .on('keypress', $.proxy(this.keypress, this))
200 .on('keyup', $.proxy(this.keyup, this))
201
202 if (this.eventSupported('keydown')) {
203 this.$element.on('keydown', $.proxy(this.keydown, this))
204 }
205
206 this.$menu
207 .on('click', $.proxy(this.click, this))
208 .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
209 }
210
211 , eventSupported: function(eventName) {
212 var isSupported = eventName in this.$element
213 if (!isSupported) {
214 this.$element.setAttribute(eventName, 'return;')
215 isSupported = typeof this.$element[eventName] === 'function'
216 }
217 return isSupported
218 }
219
220 , move: function (e) {
221 if (!this.shown) return
222
223 switch(e.keyCode) {
224 case 9: // tab
225 case 13: // enter
226 case 27: // escape
227 e.preventDefault()
228 break
229
230 case 38: // up arrow
231 e.preventDefault()
232 this.prev()
233 break
234
235 case 40: // down arrow
236 e.preventDefault()
237 this.next()
238 break
239 }
240
241 e.stopPropagation()
242 }
243
244 , keydown: function (e) {
245 this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27])
246 this.move(e)
247 }
248
249 , keypress: function (e) {
250 if (this.suppressKeyPressRepeat) return
251 this.move(e)
252 }
253
254 , keyup: function (e) {
255 switch(e.keyCode) {
256 case 40: // down arrow
257 case 38: // up arrow
258 case 16: // shift
259 case 17: // ctrl
260 case 18: // alt
261 break
262
263 case 9: // tab
264 case 13: // enter
265 if (!this.shown) return
266 this.select()
267 break
268
269 case 27: // escape
270 if (!this.shown) return
271 this.hide()
272 break
273
274 default:
275 this.lookup()
276 }
277
278 e.stopPropagation()
279 e.preventDefault()
280 }
281
282 , blur: function (e) {
283 var that = this
284 setTimeout(function () { that.hide() }, 150)
285 }
286
287 , click: function (e) {
288 e.stopPropagation()
289 e.preventDefault()
290 this.select()
291 }
292
293 , mouseenter: function (e) {
294 this.$menu.find('.active').removeClass('active')
295 $(e.currentTarget).addClass('active')
296 }
297
298 }
299
300
301 /* TYPEAHEAD PLUGIN DEFINITION
302 * =========================== */
303
304 var old = $.fn.typeahead
305
306 $.fn.typeahead = function (option) {
307 return this.each(function () {
308 var $this = $(this)
309 , data = $this.data('typeahead')
310 , options = typeof option == 'object' && option
311 if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
312 if (typeof option == 'string') data[option]()
313 })
314 }
315
316 $.fn.typeahead.defaults = {
317 source: []
318 , items: 8
319 , menu: '<ul class="typeahead dropdown-menu"></ul>'
320 , item: '<li><a href="#"></a></li>'
321 , minLength: 1
322 }
323
324 $.fn.typeahead.Constructor = Typeahead
325
326
327 /* TYPEAHEAD NO CONFLICT
328 * =================== */
329
330 $.fn.typeahead.noConflict = function () {
331 $.fn.typeahead = old
332 return this
333 }
334
335
336 /* TYPEAHEAD DATA-API
337 * ================== */
338
339 $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
340 var $this = $(this)
341 if ($this.data('typeahead')) return
342 e.preventDefault()
343 $this.typeahead($this.data())
344 })
345
346}(window.jQuery);
diff --git a/frontend/gamma/js/JQTouch/extensions/jqt.actionsheet.js b/frontend/gamma/js/JQTouch/extensions/jqt.actionsheet.js
deleted file mode 100644
index 2a5f8d1..0000000
--- a/frontend/gamma/js/JQTouch/extensions/jqt.actionsheet.js
+++ b/dev/null
@@ -1,159 +0,0 @@
1/*
2
3 _/ _/_/ _/_/_/_/_/ _/
4 _/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
5 _/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
6 _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
7 _/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
8 _/
9 _/
10
11 Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
12
13 (c) 2012 by jQTouch project members.
14 See LICENSE.txt for license.
15
16 Author: Thomas Yip
17*/
18
19/*
20
21 _/ _/_/ _/_/_/_/_/ _/
22 _/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
23 _/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
24 _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
25 _/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
26 _/
27 _/
28
29 Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
30
31 (c) 2012 by jQTouch project members.
32 See LICENSE.txt for license.
33
34 Author: Thomas Yip
35*/
36
37(function($) {
38 var src = $("head script").last().attr("src") || '';
39 var scriptpath = src.split('?')[0].split('/').slice(0, -1).join('/')+'/';
40 var csspath = scriptpath + 'jqt.actionsheet.css';
41 var link = $('<link href="' + csspath + '" rel="stylesheet">');
42 $('head').append($(link));
43
44 function hide(callback) {
45 var $target = $(this);
46 var data = $(this).data('actionsheet');
47 var $source = data.source;
48
49 var timeout;
50
51 function cleanup() {
52 clearTimeout(timeout);
53
54 $source.removeClass('transition');
55 $target.removeClass('inmotion transition');
56 !callback || callback.apply(this, arguments);
57 };
58 timeout = setTimeout(cleanup, 500);
59
60 if (data.shown) {
61 $(this).data('actionsheet', {});
62 $target.one('webkitTransitionEnd', cleanup);
63
64 $source.addClass('transition');
65 $target.removeClass('current').addClass('inmotion transition');
66 $('#jqt').removeClass('actionopened');
67 }
68 return $target;
69 }
70
71 function show(callback) {
72 var $target = $(this);
73 var data = $(this).data('actionsheet') || {};
74 if (!data.shown) {
75 var $source = $('#jqt .current:not(.actionsheet)');
76
77 $target.one('webkitTransitionEnd', function() {
78 $source.removeClass('transition');
79 $target.removeClass('inmotion transition');
80 !callback || callback.apply(this, arguments);
81 });
82
83 data.shown = true;
84 data.source = $source;
85 $(this).data('actionsheet', data);
86
87 $source.addClass('transition');
88 $target.addClass('inmotion transition');
89 $('#jqt').addClass('actionopened');
90 setTimeout(function() {
91 $target.addClass('current');
92 }, 50);
93 }
94 return $target;
95 }
96
97 var methods = {
98 init: function(options) {
99 $(this).addClass('actionsheet');
100 $(this).data({shown: false});
101 },
102 show: show,
103 hide: hide
104 };
105
106 $.fn.actionsheet = function(method) {
107 if (methods[method]) {
108 if ($(this).is('.actionsheet')) {
109 return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
110 } else {
111 var msg = 'Target is not a `actionsheet`. Action `' + method + '` is ignored.';
112 console.warn(msg);
113 }
114 } else if ( typeof method === 'object' || ! method ) {
115 return methods.init.apply(this, arguments);
116 } else {
117 $.error( 'Method ' + method + ' does not exist on jQuery.tooltip' );
118 }
119 };
120
121 if ($.jQTouch) {
122 $.jQTouch.addTapHandler({
123 name: 'open-actionsheet',
124 isSupported: function(e, params) {
125 return params.$el.is('.action');
126 },
127 fn: function(e, params) {
128 params.$el.removeClass('active');
129
130 var $target = $(params.hash);
131 $target.actionsheet('show');
132
133 return false;
134 }
135 });
136 $.jQTouch.addTapHandler({
137 name: 'follow-actionlink',
138 isSupported: function(e, params) {
139 if ($('#jqt').hasClass('actionopened')) {
140 return params.$el.is('.actionsheet a');
141 }
142 return false;
143 },
144 fn: function(e, params) {
145 params.$el.removeClass('active');
146
147 var $target = params.$el.closest('.actionsheet');
148 $target.actionsheet('hide', function() {
149 if (!params.$el.is('.dismiss')) {
150 params.$el.trigger('tap');
151 }
152 });
153 return false;
154 }
155 });
156 } else {
157 console.error('Extension `jqt.actionsheet` failed to load. jQT not found');
158 }
159})($);
diff --git a/frontend/gamma/js/JQTouch/extensions/jqt.autotitles.js b/frontend/gamma/js/JQTouch/extensions/jqt.autotitles.js
deleted file mode 100644
index 94f3d9b..0000000
--- a/frontend/gamma/js/JQTouch/extensions/jqt.autotitles.js
+++ b/dev/null
@@ -1,52 +0,0 @@
1/*
2
3 _/ _/_/ _/_/_/_/_/ _/
4 _/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
5 _/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
6 _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
7 _/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
8 _/
9 _/
10
11 Created by David Kaneda <http://www.davidkaneda.com>
12 Maintained by Thomas Yip <http://beedesk.com/>
13 Sponsored by Sencha Labs <http://www.sencha.com/>
14 Special thanks to Jonathan Stark <http://www.jonathanstark.com/>
15
16 Documentation and issue tracking on GitHub <http://github.com/senchalabs/jQTouch/>
17
18 (c) 2009-2011 Sencha Labs
19 jQTouch may be freely distributed under the MIT license.
20
21*/
22
23(function($) {
24 if ($.jQTouch)
25 {
26 $.jQTouch.addExtension(function AutoTitles(jQT){
27
28 var titleSelector='.toolbar h1';
29
30 $(function(){
31 $('#jqt').bind('pageAnimationStart', function(e, data){
32 if (data.direction === 'in'){
33 var $title = $(titleSelector, $(e.target));
34 var $ref = $(e.target).data('referrer');
35 if ($title.length && $ref && $title.text() === ''){
36 $title.html($ref.text());
37 }
38 }
39 });
40 });
41
42 function setTitleSelector(ts){
43 titleSelector=ts;
44 }
45
46 return {
47 setTitleSelector: setTitleSelector
48 };
49
50 });
51 }
52})($);
diff --git a/frontend/gamma/js/JQTouch/extensions/jqt.floaty.js b/frontend/gamma/js/JQTouch/extensions/jqt.floaty.js
deleted file mode 100644
index c7e4485..0000000
--- a/frontend/gamma/js/JQTouch/extensions/jqt.floaty.js
+++ b/dev/null
@@ -1,96 +0,0 @@
1/*
2
3 _/ _/_/ _/_/_/_/_/ _/
4 _/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
5 _/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
6 _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
7 _/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
8 _/
9 _/
10
11 Created by David Kaneda <http://www.davidkaneda.com>
12 Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
13
14 Special thanks to Jonathan Stark <http://jonathanstark.com/>
15 and pinch/zoom <http://www.pinchzoom.com/>
16
17 (c) 2009 by jQTouch project members.
18 See LICENSE.txt for license.
19
20*/
21
22(function($) {
23 if ($.jQTouch)
24 {
25 $.jQTouch.addExtension(function Floaty(jQT){
26
27 $.fn.makeFloaty = function(options){
28 var defaults = {
29 align: 'top',
30 spacing: 20,
31 time: '.3s'
32 };
33
34 var settings = $.extend({}, defaults, options);
35
36 settings.align = (settings.align == 'top') ? 'top' : 'bottom';
37
38 return this.each(function(){
39 var $el = $(this);
40
41 $el.css({
42 '-webkit-transition': 'top ' + settings.time + ' ease-in-out',
43 'display': 'block',
44 'min-height': '0 !important'
45 }).data('settings', settings);
46
47 $(document).scroll(function(){
48 if ($el.data('floatyVisible') === 'true')
49 {
50 $el.scrollFloaty();
51 }
52 });
53 $el.scrollFloaty();
54 });
55 };
56
57 $.fn.scrollFloaty = function(){
58
59
60 return this.each(function(){
61 var $el = $(this);
62 var settings = $el.data('settings'); // Settings not being set as object w/Zepto
63 var wHeight = $('html').attr('clientHeight'); // WRONG
64
65 var newY = window.pageYOffset +
66 ((settings.align == 'top') ?
67 settings.spacing : wHeight - settings.spacing - $el.get(0).offsetHeight);
68
69 $el.css('top', newY).data('floatyVisible', true);
70 });
71 };
72
73 $.fn.hideFloaty = function(){
74 return this.each(function(){
75 var $el = $(this);
76 var oh = $el.get(0).offsetHeight;
77
78 $el.css('top', -oh-10).data('floatyVisible', false);
79 });
80 };
81
82 $.fn.toggleFloaty = function(){
83 return this.each(function(){
84 var $el = $(this);
85 if ($el.data('floatyVisible') === 'true'){
86 $el.hideFloaty();
87 }
88 else
89 {
90 $el.scrollFloaty();
91 }
92 });
93 };
94 });
95 }
96})($); \ No newline at end of file
diff --git a/frontend/gamma/js/JQTouch/extensions/jqt.location.js b/frontend/gamma/js/JQTouch/extensions/jqt.location.js
deleted file mode 100644
index 9d53a1a..0000000
--- a/frontend/gamma/js/JQTouch/extensions/jqt.location.js
+++ b/dev/null
@@ -1,51 +0,0 @@
1(function($) {
2 if ($.jQTouch)
3 {
4 $.jQTouch.addExtension(function Location(){
5
6 var latitude, longitude, callback, callback2;
7
8 function updateLocation(fn, fn2) {
9 if (navigator.geolocation)
10 {
11 callback = fn;
12 callback2 = fn2;
13 navigator.geolocation.getCurrentPosition(savePosition, failResponse);
14 return true;
15 } else {
16 console.log('Device not capable of geo-location.');
17 fn(false);
18 return false;
19 }
20 }
21 function failResponse(error){
22 if (callback2) {
23 callback2(error);
24 }
25 }
26 function savePosition(position) {
27 latitude = position.coords.latitude;
28 longitude = position.coords.longitude;
29 if (callback) {
30 callback(getLocation());
31 }
32 }
33 function getLocation() {
34 if (latitude && longitude) {
35 return {
36 latitude: latitude,
37 longitude: longitude
38 };
39
40 } else {
41 console.log('No location available. Try calling updateLocation() first.');
42 return false;
43 }
44 }
45 return {
46 updateLocation: updateLocation,
47 getLocation: getLocation
48 };
49 });
50 }
51})($); \ No newline at end of file
diff --git a/frontend/gamma/js/JQTouch/extensions/jqt.menusheet.js b/frontend/gamma/js/JQTouch/extensions/jqt.menusheet.js
deleted file mode 100644
index 8d21aca..0000000
--- a/frontend/gamma/js/JQTouch/extensions/jqt.menusheet.js
+++ b/dev/null
@@ -1,137 +0,0 @@
1/*
2
3 _/ _/_/ _/_/_/_/_/ _/
4 _/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
5 _/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
6 _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
7 _/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
8 _/
9 _/
10
11 Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
12
13 (c) 2012 by jQTouch project members.
14 See LICENSE.txt for license.
15
16 Author: Thomas Yip
17*/
18
19(function($) {
20 var src = $("head script").last().attr("src") || '';
21 var scriptpath = src.split('?')[0].split('/').slice(0, -1).join('/')+'/';
22 var csspath = scriptpath + 'jqt.menusheet.css';
23 var link = $('<link href="' + csspath + '" rel="stylesheet">');
24 $('head').append($(link));
25
26 function hide(callback) {
27 var $target = $(this);
28 var data = $(this).data('menusheet');
29 if (data.shown) {
30 $(this).data('menusheet', {});
31 var $source = data.source;
32 $source.unbind('touchstart mousedown', data.closehandler);
33 $source.one('webkitTransitionEnd', function() {
34 $source.removeClass('inmotion transition in');
35 $target.removeClass('inmotion out');
36 !callback || callback.apply(this, arguments);
37 });
38
39 $source.addClass('inmotion transition in');
40 $target.addClass('inmotion out').removeClass('current');
41 $('#jqt').removeClass('menuopened');
42 }
43 return $target;
44 }
45
46 function show(callback) {
47 var $target = $(this);
48 var data = $(this).data('menusheet') || {};
49 if (!data.shown) {
50 var $source = $('#jqt .current:not(.menusheet)');
51 var closehandler = function() {
52 $target.menusheet('hide');
53 return false;
54 };
55
56 $source.one('webkitTransitionEnd', function() {
57 $source.one('touchstart mousedown', closehandler);
58 $source.removeClass('inmotion transition out');
59 $target.removeClass('inmotion in');
60 !callback || callback.apply(this, arguments);
61 });
62
63 data.shown = true;
64 data.closehandler = closehandler;
65 data.source = $source;
66 $(this).data('menusheet', data);
67
68 $source.addClass('inmotion transition out');
69 $target.addClass('current in');
70 $('#jqt').addClass('menuopened');
71 }
72 return $target;
73 }
74
75 var methods = {
76 init: function(options) {
77 $(this).addClass('menusheet');
78 $(this).data({shown: false});
79 },
80 show: show,
81 hide: hide
82 };
83
84 $.fn.menusheet = function(method) {
85 if (methods[method]) {
86 if ($(this).is('.menusheet')) {
87 return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
88 } else {
89 var msg = 'Target is not a `menusheet`. Action `' + method + '` is ignored.';
90 console.warn(msg);
91 }
92 } else if ( typeof method === 'object' || ! method ) {
93 return methods.init.apply(this, arguments);
94 } else {
95 $.error( 'Method ' + method + ' does not exist on jQuery.tooltip' );
96 }
97 };
98
99 if ($.jQTouch) {
100 $.jQTouch.addTapHandler({
101 name: 'open-menusheet',
102 isSupported: function(e, params) {
103 return params.$el.is('.menu');
104 },
105 fn: function(e, params) {
106 params.$el.removeClass('active');
107
108 var $target = $(params.hash);
109 $target.menusheet('show');
110
111 return false;
112 }
113 });
114 $.jQTouch.addTapHandler({
115 name: 'follow-menulink',
116 isSupported: function(e, params) {
117 if ($('#jqt').hasClass('menuopened')) {
118 return params.$el.is('.menusheet a');
119 }
120 return false;
121 },
122 fn: function(e, params) {
123 params.$el.removeClass('active');
124
125 var $target = params.$el.closest('.menusheet');
126 $target.menusheet('hide', function() {
127 if (!params.$el.is('.dismiss')) {
128 params.$el.trigger('tap');
129 }
130 });
131 return false;
132 }
133 });
134 } else {
135 console.error('Extension `jqt.menusheet` failed to load. jQT not found');
136 }
137})($);
diff --git a/frontend/gamma/js/JQTouch/extensions/jqt.offline.js b/frontend/gamma/js/JQTouch/extensions/jqt.offline.js
deleted file mode 100644
index b333a16..0000000
--- a/frontend/gamma/js/JQTouch/extensions/jqt.offline.js
+++ b/dev/null
@@ -1,97 +0,0 @@
1/*
2
3 _/ _/_/ _/_/_/_/_/ _/
4 _/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
5 _/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
6 _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
7 _/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
8 _/
9 _/
10
11 Created by David Kaneda <http://www.davidkaneda.com>
12 Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
13
14 Special thanks to Jonathan Stark <http://jonathanstark.com/>
15
16 Lots of this code is specifically derived from Jonathan's book,
17 "Building iPhone Apps with HTML, CSS, and JavaScript"
18
19 (c) 2009 by jQTouch project members.
20 See LICENSE.txt for license.
21
22*/
23
24(function($) {
25 if ($.jQTouch)
26 {
27 $.jQTouch.addExtension(function Offline(){
28
29 // Convenience array of status values
30 var cacheStatusValues = [];
31 cacheStatusValues[0] = 'uncached';
32 cacheStatusValues[1] = 'idle';
33 cacheStatusValues[2] = 'checking';
34 cacheStatusValues[3] = 'downloading';
35 cacheStatusValues[4] = 'updateready';
36 cacheStatusValues[5] = 'obsolete';
37
38 // Listeners for all possible events
39 var cache = window.applicationCache;
40 cache.addEventListener('cached', logEvent, false);
41 cache.addEventListener('checking', logEvent, false);
42 cache.addEventListener('downloading', logEvent, false);
43 cache.addEventListener('error', logEvent, false);
44 cache.addEventListener('noupdate', logEvent, false);
45 cache.addEventListener('obsolete', logEvent, false);
46 cache.addEventListener('progress', logEvent, false);
47 cache.addEventListener('updateready', logEvent, false);
48
49 // Log every event to the console
50 function logEvent(e) {
51 var online, status, type, message;
52 online = (isOnline()) ? 'yes' : 'no';
53 status = cacheStatusValues[cache.status];
54 type = e.type;
55 message = 'online: ' + online;
56 message+= ', event: ' + type;
57 message+= ', status: ' + status;
58 if (type == 'error' && navigator.onLine) {
59 message+= ' There was an unknown error, check your Cache Manifest.';
60 }
61 console.log(message);
62 }
63
64 function isOnline() {
65 return navigator.onLine;
66 }
67
68 if (!$('html').attr('manifest')) {
69 console.log('No Cache Manifest listed on the <html> tag.')
70 }
71
72 // Swap in newly download files when update is ready
73 cache.addEventListener('updateready', function(e){
74 // Don't perform "swap" if this is the first cache
75 if (cacheStatusValues[cache.status] != 'idle') {
76 cache.swapCache();
77 console.log('Swapped/updated the Cache Manifest.');
78 }
79 }
80 , false);
81
82 // These two functions check for updates to the manifest file
83 function checkForUpdates(){
84 cache.update();
85 }
86 function autoCheckForUpdates(){
87 setInterval(function(){cache.update()}, 10000);
88 }
89
90 return {
91 isOnline: isOnline,
92 checkForUpdates: checkForUpdates,
93 autoCheckForUpdates: autoCheckForUpdates
94 }
95 });
96 }
97})(jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/JQTouch/extensions/jqt.themeswitcher.js b/frontend/gamma/js/JQTouch/extensions/jqt.themeswitcher.js
deleted file mode 100755
index ef3a75d..0000000
--- a/frontend/gamma/js/JQTouch/extensions/jqt.themeswitcher.js
+++ b/dev/null
@@ -1,123 +0,0 @@
1/*
2
3 _/ _/_/ _/_/_/_/_/ _/
4 _/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
5 _/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
6 _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
7 _/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
8 _/
9 _/
10
11 Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
12
13 (c) 2011 by jQTouch project members.
14 See LICENSE.txt for license.
15
16*/
17
18(function($) {
19 if ($.jQTouch) {
20
21 var scriptpath = $("script").last().attr("src").split('?')[0].split('/').slice(0, -1).join('/')+'/';
22
23 $.jQTouch.addExtension(function ThemeSwitcher(jQT) {
24
25 var current,
26 link,
27 titles = {},
28 defaults = {
29 themeStyleSelector: 'link[rel="stylesheet"][title]',
30 themeIncluded: [
31 {title: 'jQTouch', href: scriptpath + '../themes/css/jqtouch.css'},
32 {title: 'Apple', href: scriptpath + '../themes/css/apple.css'},
33 {title: 'Vanilla', href: scriptpath + '../themes/css/vanilla.css'}
34
35 ]
36 },
37 options = $.extend({}, defaults, jQT.settings);
38
39 function setStyleState(item, title) {
40 var $item = $(item);
41
42 if ($item.attr('title') === title) {
43 item.disabled = false; // workaround for Firefox on Zepto
44 $item.removeAttr('disabled');
45 } else {
46 item.disabled = true; // workaround for Firefox on Zepto
47 $item.attr('disabled', true);
48 }
49 }
50
51 function initializeStyleState(item, title) {
52 // and, workaround for WebKit by initializing the 'disabled' attribute
53 if (!current) {
54 current = title;
55 }
56 setStyleState(item, current);
57 }
58
59 // public
60 function switchStyle(title) {
61 current = title;
62 $(options.themeStyleSelector).each(function(i, item) {
63 setStyleState(item, title);
64 });
65 }
66
67 // collect title names, from <head>
68 $(options.themeStyleSelector).each(function(i, item) {
69 var $item = $(item);
70 var title = $item.attr('title');
71
72 titles[title] = true;
73
74 initializeStyleState(item, title);
75 });
76
77 // add included theme
78 for (var i=0; i < options.themeIncluded.length; i++) {
79 var hash = options.themeIncluded[i];
80 if (!(hash.title in titles)) {
81 link = $('<link title="' + hash.title + '" href="' + hash.href + '" rel="stylesheet">');
82 $('head').append($(link));
83
84 titles[hash.title] = true;
85
86 initializeStyleState(link, hash.title);
87 }
88 }
89
90 if (options.themeSelectionSelector) {
91 // create UI items
92 for (var title in titles) {
93 var $item = $('<li><a href="#" data-title="' + title + '">' + title + '</a></li>');
94 $(options.themeSelectionSelector).append($item);
95 }
96
97 // bind to UI items
98 $(options.themeSelectionSelector).delegate('* > a', 'tap', function(e) {
99 e.preventDefault();
100 e.stopPropagation();
101
102 var $a = $(this).closest('a');
103 $a.removeClass('active');
104 switchStyle($a.attr('data-title'));
105
106 // poor-man simulation of radio button behaviour
107 $(options.themeSelectionSelector).find('a').removeClass('selected');
108 $a.addClass('selected');
109 });
110
111 // poor-man simulation of radio button behaviour
112 $(options.themeSelectionSelector).closest('#jqt > *').bind('pageAnimationEnd', function(e, data){
113 if (data.direction === 'in') {
114 $(options.themeSelectionSelector).find('a[data-title="' + current + '"]').addClass('selected');
115 }
116 });
117 }
118
119 return {switchStyle: switchStyle};
120
121 });
122 }
123})($);
diff --git a/frontend/gamma/js/JQTouch/jqtouch.js b/frontend/gamma/js/JQTouch/jqtouch.js
deleted file mode 100644
index bdc6d2e..0000000
--- a/frontend/gamma/js/JQTouch/jqtouch.js
+++ b/dev/null
@@ -1,889 +0,0 @@
1/*
2
3 _/ _/_/ _/_/_/_/_/ _/
4 _/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
5 _/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
6 _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
7 _/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
8 _/
9 _/
10
11 Created by David Kaneda <http://www.davidkaneda.com>
12 Maintained by Thomas Yip <http://beedesk.com/>
13 Sponsored by Sencha Labs <http://www.sencha.com/>
14 Special thanks to Jonathan Stark <http://www.jonathanstark.com/>
15
16 Documentation and issue tracking on GitHub <http://github.com/senchalabs/jQTouch/>
17
18 (c) 2009-2011 Sencha Labs
19 jQTouch may be freely distributed under the MIT license.
20
21*/
22(function() {
23
24 var fx;
25 if ('Zepto' in window) {
26 fx = window.Zepto;
27 fx.fn.prop = fx.fn.attr;
28
29 Event.prototype.isDefaultPrevented = function() {
30 return this.defaultPrevented;
31 };
32 } else if ('jQuery' in window) {
33 fx = window.jQuery;
34
35 // trick to get Zepto/touch.js to work for jQuery
36 window.Zepto = $;
37 } else {
38 throw('Either Zepto or jQuery is required but neither can be found.');
39 }
40
41 $.jQTouch = function(options) {
42 // Initialize internal jQT variables
43 var $ = fx,
44 $body,
45 $head=$('head'),
46 history=[],
47 newPageCount=0,
48 jQTSettings={},
49 $currentPage='',
50 orientation='portrait',
51 touchSelectors=[],
52 publicObj={},
53 tapBuffer=100, // High click delay = ~350, quickest animation (slide) = 250
54 extensions=$.jQTouch.prototype.extensions,
55 extTapHandlers=$.jQTouch.prototype.tapHandlers,
56 tapHandlers=[],
57 animations=[],
58 hairExtensions='',
59 defaults = {
60 addGlossToIcon: true,
61 backSelector: '.back, .cancel, .goback',
62 cacheGetRequests: true,
63 debug: true,
64 defaultAnimation: 'slideleft',
65 fixedViewport: true,
66 formSelector: 'form',
67 fullScreen: true,
68 fullScreenClass: 'fullscreen',
69 icon: null,
70 icon4: null, // available in iOS 4.2 and later.
71 preloadImages: false,
72 startupScreen: null,
73 statusBar: 'default', // other options: black-translucent, black
74 submitSelector: '.submit',
75 touchSelector: 'a, .touch',
76 trackScrollPositions: true,
77 useAnimations: true,
78 useFastTouch: true,
79 useTouchScroll: true,
80 animations: [ // highest to lowest priority
81 {name:'cubeleft', selector:'.cubeleft, .cube', is3d: true},
82 {name:'cuberight', selector:'.cuberight', is3d: true},
83 {name:'dissolve', selector:'.dissolve'},
84 {name:'fade', selector:'.fade'},
85 {name:'flipleft', selector:'.flipleft, .flip', is3d: true},
86 {name:'flipright', selector:'.flipright', is3d: true},
87 {name:'pop', selector:'.pop', is3d: true},
88 {name:'swapleft', selector:'.swap', is3d: true},
89 {name:'slidedown', selector:'.slidedown'},
90 {name:'slideright', selector:'.slideright'},
91 {name:'slideup', selector:'.slideup'},
92 {name:'slideleft', selector:'.slideleft, .slide, #jqt > * > ul li a'}
93 ]
94 }; // end defaults
95
96 function warn(message) {
97 if (window.console !== undefined && jQTSettings.debug === true) {
98 console.warn(message);
99 }
100 }
101 function addAnimation(animation) {
102 if (typeof(animation.selector) === 'string' && typeof(animation.name) === 'string') {
103 animations.push(animation);
104 }
105 }
106 function addTapHandler(tapHandler) {
107 if (typeof(tapHandler.name) === 'string'
108 && typeof(tapHandler.isSupported) === 'function'
109 && typeof(tapHandler.fn) === 'function') {
110
111 tapHandlers.push(tapHandler);
112 }
113 }
114 function addPageToHistory(page, animation) {
115 history.unshift({
116 page: page,
117 animation: animation,
118 hash: '#' + page.attr('id'),
119 id: page.attr('id')
120 });
121 }
122
123 // Unfortunately, we can not assume the "tap" event
124 // is being used for links, forms, etc.
125 function clickHandler(e) {
126 // Figure out whether to prevent default
127 var $el = $(e.target);
128
129 // Find the nearest tappable ancestor
130 if (!$el.is(touchSelectors.join(', '))) {
131 $el = $(e.target).closest(touchSelectors.join(', '));
132 }
133
134 // Prevent default if we found an internal link (relative or absolute)
135 if ($el && $el.attr('href') && !$el.isExternalLink()) {
136 warn('Need to prevent default click behavior');
137 e.preventDefault();
138 } else {
139 warn('No need to prevent default click behavior');
140 }
141
142 // Trigger a tap event if touchstart is not on the job
143 if ($.support.touch) {
144 warn('Not converting click to a tap event because touch handler is on the job');
145 } else {
146 warn('Converting click event to a tap event because touch handlers are not present or off');
147 $(e.target).trigger('tap', e);
148 }
149
150 }
151 function doNavigation(fromPage, toPage, animation, goingBack) {
152
153 goingBack = goingBack ? goingBack : false;
154
155 // Error check for target page
156 if (toPage === undefined || toPage.length === 0) {
157 $.fn.unselect();
158 warn('Target element is missing.');
159 return false;
160 }
161
162 // Error check for fromPage===toPage
163 if (toPage.hasClass('current')) {
164 $.fn.unselect();
165 warn('You are already on the page you are trying to navigate to.');
166 return false;
167 }
168
169 // Collapse the keyboard
170 $(':focus').trigger('blur');
171
172 fromPage.trigger('pageAnimationStart', { direction: 'out', back: goingBack });
173 toPage.trigger('pageAnimationStart', { direction: 'in', back: goingBack });
174
175 if ($.support.animationEvents && animation && jQTSettings.useAnimations) {
176 // Fail over to 2d animation if need be
177 if (!$.support.transform3d && animation.is3d) {
178 warn('Did not detect support for 3d animations, falling back to ' + jQTSettings.defaultAnimation);
179 animation.name = jQTSettings.defaultAnimation;
180 }
181
182 // Reverse animation if need be
183 var finalAnimationName = animation.name,
184 is3d = animation.is3d ? 'animating3d' : '';
185
186 if (goingBack) {
187 finalAnimationName = finalAnimationName.replace(/left|right|up|down|in|out/, reverseAnimation );
188 }
189
190 warn('finalAnimationName is ' + finalAnimationName);
191
192 // Bind internal "cleanup" callback
193 fromPage.bind('webkitAnimationEnd', navigationEndHandler);
194
195 // Trigger animations
196 $body.addClass('animating ' + is3d);
197
198 var lastScroll = window.pageYOffset;
199
200 // Position the incoming page so toolbar is at top of viewport regardless of scroll position on from page
201 if (jQTSettings.trackScrollPositions === true) {
202 toPage.css('top', window.pageYOffset - (toPage.data('lastScroll') || 0));
203 }
204
205 toPage.addClass(finalAnimationName + ' in current');
206 fromPage.removeClass('current').addClass(finalAnimationName + ' out inmotion');
207
208 if (jQTSettings.trackScrollPositions === true) {
209 fromPage.data('lastScroll', lastScroll);
210 $('.scroll', fromPage).each(function(){
211 $(this).data('lastScroll', this.scrollTop);
212 });
213 }
214 } else {
215 toPage.addClass('current in');
216 fromPage.removeClass('current');
217 navigationEndHandler();
218 }
219
220 // Housekeeping
221 $currentPage = toPage;
222 if (goingBack) {
223 history.shift();
224 } else {
225 addPageToHistory($currentPage, animation);
226 }
227 setHash($currentPage.attr('id'));
228
229 // Private navigationEnd callback
230 function navigationEndHandler(event) {
231 var bufferTime = tapBuffer;
232
233 if ($.support.animationEvents && animation && jQTSettings.useAnimations) {
234 fromPage.unbind('webkitAnimationEnd', navigationEndHandler);
235 fromPage.removeClass(finalAnimationName + ' out inmotion');
236 if (finalAnimationName) {
237 toPage.removeClass(finalAnimationName);
238 }
239 $body.removeClass('animating animating3d');
240 if (jQTSettings.trackScrollPositions === true) {
241 toPage.css('top', -toPage.data('lastScroll'));
242
243 // Have to make sure the scroll/style resets
244 // are outside the flow of this function.
245 setTimeout(function(){
246 toPage.css('top', 0);
247 window.scroll(0, toPage.data('lastScroll'));
248 $('.scroll', toPage).each(function(){
249 this.scrollTop = - $(this).data('lastScroll');
250 });
251 }, 0);
252 }
253 } else {
254 fromPage.removeClass(finalAnimationName + ' out inmotion');
255 if (finalAnimationName) {
256 toPage.removeClass(finalAnimationName);
257 }
258 bufferTime += 260;
259 }
260
261 // In class is intentionally delayed, as it is our ghost click hack
262 setTimeout(function(){
263 toPage.removeClass('in');
264 window.scroll(0,0);
265 }, bufferTime);
266
267 fromPage.unselect();
268
269 // Trigger custom events
270 toPage.trigger('pageAnimationEnd', {
271 direction:'in', animation: animation, back: goingBack
272 });
273 fromPage.trigger('pageAnimationEnd', {
274 direction:'out', animation: animation, back: goingBack
275 });
276 }
277
278 return true;
279 }
280 function reverseAnimation(animation) {
281 var opposites={
282 'up' : 'down',
283 'down' : 'up',
284 'left' : 'right',
285 'right' : 'left',
286 'in' : 'out',
287 'out' : 'in'
288 };
289
290 return opposites[animation] || animation;
291 }
292 function getOrientation() {
293 return orientation;
294 }
295 function goBack() {
296
297 // Error checking
298 if (history.length < 1 ) {
299 warn('History is empty.');
300 }
301
302 if (history.length === 1 ) {
303 warn('You are on the first panel.');
304 window.history.go(-1);
305 }
306
307 var from = history[0],
308 to = history[1];
309
310 if (doNavigation(from.page, to.page, from.animation, true)) {
311 return publicObj;
312 } else {
313 warn('Could not go back.');
314 return false;
315 }
316
317 }
318 function goTo(toPage, animation) {
319
320 var fromPage = history[0].page;
321
322 if (typeof animation === 'string') {
323 for (var i=0, max=animations.length; i < max; i++) {
324 if (animations[i].name === animation) {
325 animation = animations[i];
326 break;
327 }
328 }
329 }
330
331 if (typeof toPage === 'string') {
332 var nextPage = $(toPage);
333
334 if (nextPage.length < 1) {
335 showPageByHref(toPage, {
336 animation: animation
337 });
338 return;
339 } else {
340 toPage = nextPage;
341 }
342 }
343 if (doNavigation(fromPage, toPage, animation)) {
344 return publicObj;
345 } else {
346 warn('Could not animate pages.');
347 return false;
348 }
349 }
350 function hashChangeHandler(e) {
351 if (location.hash === history[0].hash) {
352 warn('We are on the right panel');
353 return true;
354 } else if (location.hash === '') {
355 goBack();
356 return true;
357 } else {
358 if( (history[1] && location.hash === history[1].hash) ) {
359 goBack();
360 return true;
361 } else {
362 // Lastly, just try going to the ID...
363 warn('Could not find ID in history, just forwarding to DOM element.');
364 goTo($(location.hash), jQTSettings.defaultAnimation);
365 }
366 }
367 }
368 function init(options) {
369 jQTSettings = $.extend({}, defaults, options);
370
371 // Preload images
372 if (jQTSettings.preloadImages) {
373 for (var i = jQTSettings.preloadImages.length - 1; i >= 0; i--) {
374 (new Image()).src = jQTSettings.preloadImages[i];
375 }
376 }
377
378 // Set appropriate icon (retina display available in iOS 4.2 and later.)
379 var precomposed = (jQTSettings.addGlossToIcon) ? '' : '-precomposed';
380 if (jQTSettings.icon) {
381 hairExtensions += '<link rel="apple-touch-icon' + precomposed + '" href="' + jQTSettings.icon + '" />';
382 }
383 if (jQTSettings.icon4) {
384 hairExtensions += '<link rel="apple-touch-icon' + precomposed + '" sizes="114x114" href="' + jQTSettings.icon4 + '" />';
385 }
386 // Set startup screen
387 if (jQTSettings.startupScreen) {
388 hairExtensions += '<link rel="apple-touch-startup-image" href="' + jQTSettings.startupScreen + '" />';
389 }
390
391 // Set viewport
392 if (jQTSettings.fixedViewport) {
393 hairExtensions += '<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>';
394 }
395
396 // Set full-screen
397 if (jQTSettings.fullScreen) {
398 hairExtensions += '<meta name="apple-mobile-web-app-capable" content="yes" />';
399 if (jQTSettings.statusBar) {
400 hairExtensions += '<meta name="apple-mobile-web-app-status-bar-style" content="' + jQTSettings.statusBar + '" />';
401 }
402 }
403
404 // Attach hair extensions
405 if (hairExtensions) {
406 $head.prepend(hairExtensions);
407 }
408 }
409
410 function getAnimation(el) {
411 var animation;
412
413 for (var i=0, max=animations.length; i < max; i++) {
414 if (el.is(animations[i].selector)) {
415 animation = animations[i];
416 break;
417 }
418 }
419
420 if (!animation) {
421 warn('Animation could not be found. Using ' + jQTSettings.defaultAnimation + '.');
422 animation = jQTSettings.defaultAnimation;
423 }
424 return animation;
425 }
426
427 function insertPages(nodes, animation) {
428
429 var targetPage = null;
430
431 // Call dom.createElement element directly instead of relying on $(nodes),
432 // to work around: https://github.com/madrobby/zepto/issues/312
433 var div = document.createElement('div');
434 div.innerHTML = nodes;
435
436 $(div).children().each(function(index, node) {
437 var $node = $(this);
438 if (!$node.attr('id')) {
439 $node.attr('id', 'page-' + (++newPageCount));
440 }
441
442 // Remove any existing instance
443 $('#' + $node.attr('id')).remove();
444
445 $body.append($node);
446 $body.trigger('pageInserted', {page: $node});
447
448 if ($node.hasClass('current') || !targetPage) {
449 targetPage = $node;
450 }
451 });
452 if (targetPage !== null) {
453 goTo(targetPage, animation);
454 return targetPage;
455 } else {
456 return false;
457 }
458 }
459
460 function orientationChangeHandler() {
461 $body.css('minHeight', 1000);
462 scrollTo(0,0);
463 var bodyHeight = window.innerHeight;
464 $body.css('minHeight', bodyHeight);
465
466 orientation = Math.abs(window.orientation) == 90 ? 'landscape' : 'portrait';
467 $body.removeClass('portrait landscape').addClass(orientation).trigger('turn', {orientation: orientation});
468 }
469 function setHash(hash) {
470 // Sanitize
471 location.hash = '#' + hash.replace(/^#/, '');
472 }
473 function showPageByHref(href, options) {
474
475 var defaults = {
476 data: null,
477 method: 'GET',
478 animation: null,
479 callback: null,
480 $referrer: null
481 };
482
483 var settings = $.extend({}, defaults, options);
484
485 if (href != '#') {
486 $.ajax({
487 url: href,
488 data: settings.data,
489 type: settings.method,
490 success: function (data) {
491 var firstPage = insertPages(data, settings.animation);
492 if (firstPage) {
493 if (settings.method == 'GET' && jQTSettings.cacheGetRequests === true && settings.$referrer) {
494 settings.$referrer.attr('href', '#' + firstPage.attr('id'));
495 }
496 if (settings.callback) {
497 settings.callback(true);
498 }
499 }
500 },
501 error: function (data) {
502 if (settings.$referrer) {
503 settings.$referrer.unselect();
504 }
505 if (settings.callback) {
506 settings.callback(false);
507 }
508 }
509 });
510 } else if (settings.$referrer) {
511 settings.$referrer.unselect();
512 }
513 }
514 function submitHandler(e, callback) {
515
516 $(':focus').trigger('blur');
517
518 e.preventDefault();
519
520 var $form = (typeof(e)==='string') ? $(e).eq(0) : (e.target ? $(e.target) : $(e));
521
522 if ($form.length && $form.is(jQTSettings.formSelector) && $form.attr('action')) {
523 showPageByHref($form.attr('action'), {
524 data: $form.serialize(),
525 method: $form.attr('method') || "POST",
526 animation: getAnimation($form),
527 callback: callback
528 });
529 return false;
530 }
531 return true;
532 }
533 function submitParentForm($el) {
534
535 var $form = $el.closest('form');
536 if ($form.length === 0) {
537 warn('No parent form found');
538 } else {
539 warn('About to submit parent form');
540 $form.trigger('submit');
541 return false;
542 }
543 return true;
544 }
545 function supportForTransform3d() {
546
547 var head, body, style, div, result;
548
549 head = document.getElementsByTagName('head')[0];
550 body = document.body;
551
552 style = document.createElement('style');
553 style.textContent = '@media (transform-3d),(-o-transform-3d),(-moz-transform-3d),(-webkit-transform-3d){#jqt-3dtest{height:3px}}';
554
555 div = document.createElement('div');
556 div.id = 'jqt-3dtest';
557
558 // Add to the page
559 head.appendChild(style);
560 body.appendChild(div);
561
562 // Check the result
563 result = div.offsetHeight === 3;
564
565 // Clean up
566 style.parentNode.removeChild(style);
567 div.parentNode.removeChild(div);
568
569 // Pass back result
570 warn('Support for 3d transforms: ' + result);
571 return result;
572 }
573 function supportIOS5() {
574 var support = false;
575 var REGEX_IOS_VERSION = /OS (\d+)(_\d+)* like Mac OS X/i;
576
577 var agentString = window.navigator.userAgent;
578 if (REGEX_IOS_VERSION.test(agentString)) {
579 support = (REGEX_IOS_VERSION.exec(agentString)[1] >= 5);
580 }
581 return support;
582 }
583 function touchStartHandler(e){
584
585 var $el = $(e.target),
586 selectors = touchSelectors.join(', ');
587
588 // Find the nearest tappable ancestor
589 if (!$el.is(selectors)) {
590 $el = $el.closest(selectors);
591 }
592
593 // Make sure we have a tappable element
594 if ($el.length && $el.attr('href')) {
595 $el.addClass('active');
596 }
597
598 // Remove our active class if we move
599 $el.on($.support.touch ? 'touchmove' : 'mousemove', function(){
600 $el.removeClass('active');
601 });
602
603 $el.on('touchend', function(){
604 $el.unbind('touchmove mousemove');
605 });
606
607 }
608 function tapHandler(e){
609
610 if (e.isDefaultPrevented()) {
611 return true;
612 }
613
614 // Grab the target element
615 var $el = $(e.target);
616
617 // Find the nearest tappable ancestor
618 if (!$el.is(touchSelectors.join(', '))) {
619 $el = $el.closest(touchSelectors.join(', '));
620 }
621
622 // Make sure we have a tappable element
623 if (!$el.length || !$el.attr('href')) {
624 warn('Could not find a link related to tapped element');
625 return true;
626 }
627
628 // Init some vars
629 var target = $el.attr('target'),
630 hash = $el.prop('hash'),
631 href = $el.attr('href');
632
633 var params = {
634 e: e,
635 $el: $el,
636 target: target,
637 hash: hash,
638 href: href,
639 jQTSettings: jQTSettings
640 };
641
642 // Loop thru all handlers
643 for (var i=0, len=tapHandlers.length; i<len; i++) {
644 var handler = tapHandlers[i];
645 var supported = handler.isSupported(e, params);
646 if (supported) {
647 var flag = handler.fn(e, params);
648 return flag;
649 }
650 }
651 }
652 function addDefaultTapHandlers() {
653 addTapHandler({
654 name: 'external-link',
655 isSupported: function(e, params) {
656 return params.$el.isExternalLink();
657 },
658 fn: function(e, params) {
659 params.$el.unselect();
660 return true;
661 }
662 });
663 addTapHandler({
664 name: 'back-selector',
665 isSupported: function(e, params) {
666 return params.$el.is(params.jQTSettings.backSelector);
667 },
668 fn: function(e, params) {
669 // User clicked or tapped a back button
670 goBack(params.hash);
671 }
672 });
673 addTapHandler({
674 name: 'submit-selector',
675 isSupported: function(e, params) {
676 return params.$el.is(params.jQTSettings.submitSelector);
677 },
678 fn: function(e, params) {
679 // User clicked or tapped a submit element
680 submitParentForm(params.$el);
681 }
682 });
683 addTapHandler({
684 name: 'webapp',
685 isSupported: function(e, params) {
686 return params.target === '_webapp';
687 },
688 fn: function(e, params) {
689 // User clicked or tapped an internal link, fullscreen mode
690 window.location = params.href;
691 return false;
692 }
693 });
694 addTapHandler({
695 name: 'no-op',
696 isSupported: function(e, params) {
697 return params.href === '#';
698 },
699 fn: function(e, params) {
700 // Allow tap on item with no href
701 params.$el.unselect();
702 return true;
703 }
704 });
705 addTapHandler({
706 name: 'standard',
707 isSupported: function(e, params) {
708 return params.hash && params.hash !== '#';
709 },
710 fn: function(e, params) {
711 var animation = getAnimation(params.$el);
712 // Internal href
713 params.$el.addClass('active');
714 goTo(
715 $(params.hash).data('referrer', params.$el),
716 animation,
717 params.$el.hasClass('reverse')
718 );
719 return false;
720 }
721 });
722 addTapHandler({
723 name: 'external',
724 isSupported: function(e, params) {
725 return true;
726 },
727 fn: function(e, params) {
728 var animation = getAnimation(params.$el);
729
730 // External href
731 params.$el.addClass('loading active');
732 showPageByHref(params.$el.attr('href'), {
733 animation: animation,
734 callback: function() {
735 params.$el.removeClass('loading');
736 setTimeout($.fn.unselect, 250, params.$el);
737 },
738 $referrer: params.$el
739 });
740 return false;
741 }
742 });
743 };
744
745 // Get the party started
746 init(options);
747
748 // Document ready stuff
749 $(document).ready(function RUMBLE() {
750 // Store some properties in a support object
751 if (!$.support) $.support = {};
752 $.support.animationEvents = (typeof window.WebKitAnimationEvent != 'undefined');
753 $.support.touch = (typeof window.TouchEvent != 'undefined') && (window.navigator.userAgent.indexOf('Mobile') > -1) && jQTSettings.useFastTouch;
754 $.support.transform3d = supportForTransform3d();
755 $.support.ios5 = supportIOS5();
756
757 if (!$.support.touch) {
758 warn('This device does not support touch interaction, or it has been deactivated by the developer. Some features might be unavailable.');
759 }
760 if (!$.support.transform3d) {
761 warn('This device does not support 3d animation. 2d animations will be used instead.');
762 }
763
764 // Define public jQuery functions
765 $.fn.isExternalLink = function() {
766 var $el = $(this);
767 return ($el.attr('target') == '_blank' || $el.attr('rel') == 'external' || $el.is('a[href^="http://maps.google.com"], a[href^="mailto:"], a[href^="tel:"], a[href^="javascript:"], a[href*="youtube.com/v"], a[href*="youtube.com/watch"]'));
768 };
769 $.fn.makeActive = function() {
770 return $(this).addClass('active');
771 };
772 $.fn.unselect = function(obj) {
773 if (obj) {
774 obj.removeClass('active');
775 } else {
776 $('.active').removeClass('active');
777 }
778 };
779
780 // Add extensions
781 for (var i=0, max=extensions.length; i < max; i++) {
782 var fn = extensions[i];
783 if ($.isFunction(fn)) {
784 $.extend(publicObj, fn(publicObj));
785 }
786 }
787
788 // Add extensions tapHandlers
789 for (var i=0, max=extTapHandlers.length; i < max; i++) {
790 addTapHandler(extTapHandlers[i]);
791 }
792 // Add default tapHandlers
793 addDefaultTapHandlers();
794
795 // Add animations
796 for (var j=0, max_anims=defaults.animations.length; j < max_anims; j++) {
797 var animation = defaults.animations[j];
798 if(jQTSettings[animation.name + 'Selector'] !== undefined){
799 animation.selector = jQTSettings[animation.name + 'Selector'];
800 }
801 addAnimation(animation);
802 }
803
804 // Create an array of stuff that needs touch event handling
805 touchSelectors.push(jQTSettings.touchSelector);
806 touchSelectors.push(jQTSettings.backSelector);
807 touchSelectors.push(jQTSettings.submitSelector);
808 $(touchSelectors.join(', ')).css('-webkit-touch-callout', 'none');
809
810 // Make sure we have a jqt element
811 $body = $('#jqt');
812 var anatomy_lessons = [];
813
814 if ($body.length === 0) {
815 warn('Could not find an element with the id "jqt", so the body id has been set to "jqt". If you are having any problems, wrapping your panels in a div with the id "jqt" might help.');
816 $body = $(document.body).attr('id', 'jqt');
817 }
818
819 // Add some specific css if need be
820 if ($.support.transform3d) {
821 anatomy_lessons.push('supports3d');
822 }
823 if ($.support.ios5 && jQTSettings.useTouchScroll) {
824 anatomy_lessons.push('touchscroll');
825 }
826
827 if (jQTSettings.fullScreenClass && window.navigator.standalone === true) {
828 anatomy_lessons.push(jQTSettings.fullScreenClass, jQTSettings.statusBar);
829 }
830
831 // Bind events
832
833 $body
834 .addClass(anatomy_lessons.join(' '))
835 .bind('click', clickHandler)
836 .bind('orientationchange', orientationChangeHandler)
837 .bind('submit', submitHandler)
838 .bind('tap', tapHandler)
839 .bind( $.support.touch ? 'touchstart' : 'mousedown', touchStartHandler)
840 .trigger('orientationchange');
841
842 $(window).bind('hashchange', hashChangeHandler);
843
844 var startHash = location.hash;
845
846 // Determine what the initial view should be
847 if ($('#jqt > .current').length === 0) {
848 $currentPage = $('#jqt > *:first-child').addClass('current');
849 } else {
850 $currentPage = $('#jqt > .current');
851 }
852
853 setHash($currentPage.attr('id'));
854 addPageToHistory($currentPage);
855
856 if ($(startHash).length === 1) {
857 goTo(startHash);
858 }
859 });
860
861 // Expose public methods and properties
862 publicObj = {
863 addAnimation: addAnimation,
864 animations: animations,
865 getOrientation: getOrientation,
866 goBack: goBack,
867 insertPages: insertPages,
868 goTo: goTo,
869 history: history,
870 settings: jQTSettings,
871 submitForm: submitHandler
872 };
873 return publicObj;
874 };
875
876 $.jQTouch.prototype.extensions = [];
877 $.jQTouch.prototype.tapHandlers = [];
878
879 // Extensions directly manipulate the jQTouch object, before it's initialized.
880 $.jQTouch.addExtension = function(extension) {
881 $.jQTouch.prototype.extensions.push(extension);
882 };
883
884 // Experimental tap hanlders that can bypass default jQTouch tap handling
885 $.jQTouch.addTapHandler = function(extension) {
886 $.jQTouch.prototype.tapHandlers.push(extension);
887 };
888
889})(); // Double closure, ALL THE WAY ACROSS THE SKY
diff --git a/frontend/gamma/js/Zepto/ajax.js b/frontend/gamma/js/Zepto/ajax.js
deleted file mode 100644
index f4da150..0000000
--- a/frontend/gamma/js/Zepto/ajax.js
+++ b/dev/null
@@ -1,285 +0,0 @@
1// Zepto.js
2// (c) 2010-2012 Thomas Fuchs
3// Zepto.js may be freely distributed under the MIT license.
4
5;(function($){
6 var jsonpID = 0,
7 isObject = $.isObject,
8 document = window.document,
9 key,
10 name,
11 rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
12 scriptTypeRE = /^(?:text|application)\/javascript/i,
13 xmlTypeRE = /^(?:text|application)\/xml/i,
14 jsonType = 'application/json',
15 htmlType = 'text/html',
16 blankRE = /^\s*$/
17
18 // trigger a custom event and return false if it was cancelled
19 function triggerAndReturn(context, eventName, data) {
20 var event = $.Event(eventName)
21 $(context).trigger(event, data)
22 return !event.defaultPrevented
23 }
24
25 // trigger an Ajax "global" event
26 function triggerGlobal(settings, context, eventName, data) {
27 if (settings.global) return triggerAndReturn(context || document, eventName, data)
28 }
29
30 // Number of active Ajax requests
31 $.active = 0
32
33 function ajaxStart(settings) {
34 if (settings.global && $.active++ === 0) triggerGlobal(settings, null, 'ajaxStart')
35 }
36 function ajaxStop(settings) {
37 if (settings.global && !(--$.active)) triggerGlobal(settings, null, 'ajaxStop')
38 }
39
40 // triggers an extra global event "ajaxBeforeSend" that's like "ajaxSend" but cancelable
41 function ajaxBeforeSend(xhr, settings) {
42 var context = settings.context
43 if (settings.beforeSend.call(context, xhr, settings) === false ||
44 triggerGlobal(settings, context, 'ajaxBeforeSend', [xhr, settings]) === false)
45 return false
46
47 triggerGlobal(settings, context, 'ajaxSend', [xhr, settings])
48 }
49 function ajaxSuccess(data, xhr, settings) {
50 var context = settings.context, status = 'success'
51 settings.success.call(context, data, status, xhr)
52 triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data])
53 ajaxComplete(status, xhr, settings)
54 }
55 // type: "timeout", "error", "abort", "parsererror"
56 function ajaxError(error, type, xhr, settings) {
57 var context = settings.context
58 settings.error.call(context, xhr, type, error)
59 triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error])
60 ajaxComplete(type, xhr, settings)
61 }
62 // status: "success", "notmodified", "error", "timeout", "abort", "parsererror"
63 function ajaxComplete(status, xhr, settings) {
64 var context = settings.context
65 settings.complete.call(context, xhr, status)
66 triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings])
67 ajaxStop(settings)
68 }
69
70 // Empty function, used as default callback
71 function empty() {}
72
73 $.ajaxJSONP = function(options){
74 if (!('type' in options)) return $.ajax(options)
75
76 var callbackName = 'jsonp' + (++jsonpID),
77 script = document.createElement('script'),
78 abort = function(){
79 $(script).remove()
80 if (callbackName in window) window[callbackName] = empty
81 ajaxComplete('abort', xhr, options)
82 },
83 xhr = { abort: abort }, abortTimeout
84
85 if (options.error) script.onerror = function() {
86 xhr.abort()
87 options.error()
88 }
89
90 window[callbackName] = function(data){
91 clearTimeout(abortTimeout)
92 $(script).remove()
93 delete window[callbackName]
94 ajaxSuccess(data, xhr, options)
95 }
96
97 serializeData(options)
98 script.src = options.url.replace(/=\?/, '=' + callbackName)
99 $('head').append(script)
100
101 if (options.timeout > 0) abortTimeout = setTimeout(function(){
102 xhr.abort()
103 ajaxComplete('timeout', xhr, options)
104 }, options.timeout)
105
106 return xhr
107 }
108
109 $.ajaxSettings = {
110 // Default type of request
111 type: 'GET',
112 // Callback that is executed before request
113 beforeSend: empty,
114 // Callback that is executed if the request succeeds
115 success: empty,
116 // Callback that is executed the the server drops error
117 error: empty,
118 // Callback that is executed on request complete (both: error and success)
119 complete: empty,
120 // The context for the callbacks
121 context: null,
122 // Whether to trigger "global" Ajax events
123 global: true,
124 // Transport
125 xhr: function () {
126 return new window.XMLHttpRequest()
127 },
128 // MIME types mapping
129 accepts: {
130 script: 'text/javascript, application/javascript',
131 json: jsonType,
132 xml: 'application/xml, text/xml',
133 html: htmlType,
134 text: 'text/plain'
135 },
136 // Whether the request is to another domain
137 crossDomain: false,
138 // Default timeout
139 timeout: 0,
140 // Whether data should be serialized to string
141 processData: true
142 }
143
144 function mimeToDataType(mime) {
145 return mime && ( mime == htmlType ? 'html' :
146 mime == jsonType ? 'json' :
147 scriptTypeRE.test(mime) ? 'script' :
148 xmlTypeRE.test(mime) && 'xml' ) || 'text'
149 }
150
151 function appendQuery(url, query) {
152 return (url + '&' + query).replace(/[&?]{1,2}/, '?')
153 }
154
155 // serialize payload and append it to the URL for GET requests
156 function serializeData(options) {
157 if (options.processData && isObject(options.data))
158 options.data = $.param(options.data, options.traditional)
159 if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))
160 options.url = appendQuery(options.url, options.data)
161 }
162
163 $.ajax = function(options){
164 var settings = $.extend({}, options || {})
165 for (key in $.ajaxSettings) if (settings[key] === undefined) settings[key] = $.ajaxSettings[key]
166
167 ajaxStart(settings)
168
169 if (!settings.crossDomain) settings.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(settings.url) &&
170 RegExp.$2 != window.location.host
171
172 var dataType = settings.dataType, hasPlaceholder = /=\?/.test(settings.url)
173 if (dataType == 'jsonp' || hasPlaceholder) {
174 if (!hasPlaceholder) settings.url = appendQuery(settings.url, 'callback=?')
175 return $.ajaxJSONP(settings)
176 }
177
178 if (!settings.url) settings.url = window.location.toString()
179 serializeData(settings)
180
181 var mime = settings.accepts[dataType],
182 baseHeaders = { },
183 protocol = /^([\w-]+:)\/\//.test(settings.url) ? RegExp.$1 : window.location.protocol,
184 xhr = $.ajaxSettings.xhr(), abortTimeout
185
186 if (!settings.crossDomain) baseHeaders['X-Requested-With'] = 'XMLHttpRequest'
187 if (mime) {
188 baseHeaders['Accept'] = mime
189 if (mime.indexOf(',') > -1) mime = mime.split(',', 2)[0]
190 xhr.overrideMimeType && xhr.overrideMimeType(mime)
191 }
192 if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() != 'GET'))
193 baseHeaders['Content-Type'] = (settings.contentType || 'application/x-www-form-urlencoded')
194 settings.headers = $.extend(baseHeaders, settings.headers || {})
195
196 xhr.onreadystatechange = function(){
197 if (xhr.readyState == 4) {
198 xhr.onreadystatechange = empty;
199 clearTimeout(abortTimeout)
200 var result, error = false
201 if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) {
202 dataType = dataType || mimeToDataType(xhr.getResponseHeader('content-type'))
203 result = xhr.responseText
204
205 try {
206 if (dataType == 'script') (1,eval)(result)
207 else if (dataType == 'xml') result = xhr.responseXML
208 else if (dataType == 'json') result = blankRE.test(result) ? null : $.parseJSON(result)
209 } catch (e) { error = e }
210
211 if (error) ajaxError(error, 'parsererror', xhr, settings)
212 else ajaxSuccess(result, xhr, settings)
213 } else {
214 ajaxError(null, xhr.status ? 'error' : 'abort', xhr, settings)
215 }
216 }
217 }
218
219 var async = 'async' in settings ? settings.async : true
220 xhr.open(settings.type, settings.url, async)
221
222 for (name in settings.headers) xhr.setRequestHeader(name, settings.headers[name])
223
224 if (ajaxBeforeSend(xhr, settings) === false) {
225 xhr.abort()
226 return false
227 }
228
229 if (settings.timeout > 0) abortTimeout = setTimeout(function(){
230 xhr.onreadystatechange = empty
231 xhr.abort()
232 ajaxError(null, 'timeout', xhr, settings)
233 }, settings.timeout)
234
235 // avoid sending empty string (#319)
236 xhr.send(settings.data ? settings.data : null)
237 return xhr
238 }
239
240 $.get = function(url, success){ return $.ajax({ url: url, success: success }) }
241
242 $.post = function(url, data, success, dataType){
243 if ($.isFunction(data)) dataType = dataType || success, success = data, data = null
244 return $.ajax({ type: 'POST', url: url, data: data, success: success, dataType: dataType })
245 }
246
247 $.getJSON = function(url, success){
248 return $.ajax({ url: url, success: success, dataType: 'json' })
249 }
250
251 $.fn.load = function(url, success){
252 if (!this.length) return this
253 var self = this, parts = url.split(/\s/), selector
254 if (parts.length > 1) url = parts[0], selector = parts[1]
255 $.get(url, function(response){
256 self.html(selector ?
257 $('<div>').html(response.replace(rscript, "")).find(selector)
258 : response)
259 success && success.apply(self, arguments)
260 })
261 return this
262 }
263
264 var escape = encodeURIComponent
265
266 function serialize(params, obj, traditional, scope){
267 var array = $.isArray(obj)
268 $.each(obj, function(key, value) {
269 if (scope) key = traditional ? scope : scope + '[' + (array ? '' : key) + ']'
270 // handle data in serializeArray() format
271 if (!scope && array) params.add(value.name, value.value)
272 // recurse into nested objects
273 else if (traditional ? $.isArray(value) : isObject(value))
274 serialize(params, value, traditional, key)
275 else params.add(key, value)
276 })
277 }
278
279 $.param = function(obj, traditional){
280 var params = []
281 params.add = function(k, v){ this.push(escape(k) + '=' + escape(v)) }
282 serialize(params, obj, traditional)
283 return params.join('&').replace(/%20/g, '+')
284 }
285})(Zepto)
diff --git a/frontend/gamma/js/Zepto/assets.js b/frontend/gamma/js/Zepto/assets.js
deleted file mode 100644
index b5a5712..0000000
--- a/frontend/gamma/js/Zepto/assets.js
+++ b/dev/null
@@ -1,21 +0,0 @@
1// Zepto.js
2// (c) 2010-2012 Thomas Fuchs
3// Zepto.js may be freely distributed under the MIT license.
4
5;(function($){
6 var cache = [], timeout
7
8 $.fn.remove = function(){
9 return this.each(function(){
10 if(this.parentNode){
11 if(this.tagName === 'IMG'){
12 cache.push(this)
13 this.src = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='
14 if (timeout) clearTimeout(timeout)
15 timeout = setTimeout(function(){ cache = [] }, 60000)
16 }
17 this.parentNode.removeChild(this)
18 }
19 })
20 }
21})(Zepto)
diff --git a/frontend/gamma/js/Zepto/data.js b/frontend/gamma/js/Zepto/data.js
deleted file mode 100644
index b4c289f..0000000
--- a/frontend/gamma/js/Zepto/data.js
+++ b/dev/null
@@ -1,67 +0,0 @@
1// Zepto.js
2// (c) 2010-2012 Thomas Fuchs
3// Zepto.js may be freely distributed under the MIT license.
4
5// The following code is heavily inspired by jQuery's $.fn.data()
6
7;(function($) {
8 var data = {}, dataAttr = $.fn.data, camelize = $.camelCase,
9 exp = $.expando = 'Zepto' + (+new Date())
10
11 // Get value from node:
12 // 1. first try key as given,
13 // 2. then try camelized key,
14 // 3. fall back to reading "data-*" attribute.
15 function getData(node, name) {
16 var id = node[exp], store = id && data[id]
17 if (name === undefined) return store || setData(node)
18 else {
19 if (store) {
20 if (name in store) return store[name]
21 var camelName = camelize(name)
22 if (camelName in store) return store[camelName]
23 }
24 return dataAttr.call($(node), name)
25 }
26 }
27
28 // Store value under camelized key on node
29 function setData(node, name, value) {
30 var id = node[exp] || (node[exp] = ++$.uuid),
31 store = data[id] || (data[id] = attributeData(node))
32 if (name !== undefined) store[camelize(name)] = value
33 return store
34 }
35
36 // Read all "data-*" attributes from a node
37 function attributeData(node) {
38 var store = {}
39 $.each(node.attributes, function(i, attr){
40 if (attr.name.indexOf('data-') == 0)
41 store[camelize(attr.name.replace('data-', ''))] =
42 $.zepto.deserializeValue(attr.value)
43 })
44 return store
45 }
46
47 $.fn.data = function(name, value) {
48 return value === undefined ?
49 // set multiple values via object
50 $.isPlainObject(name) ?
51 this.each(function(i, node){
52 $.each(name, function(key, value){ setData(node, key, value) })
53 }) :
54 // get value from first element
55 this.length == 0 ? undefined : getData(this[0], name) :
56 // set value on all elements
57 this.each(function(){ setData(this, name, value) })
58 }
59
60 $.fn.removeData = function(names) {
61 if (typeof names == 'string') names = names.split(/\s+/)
62 return this.each(function(){
63 var id = this[exp], store = id && data[id]
64 if (store) $.each(names, function(){ delete store[camelize(this)] })
65 })
66 }
67})(Zepto)
diff --git a/frontend/gamma/js/Zepto/detect.js b/frontend/gamma/js/Zepto/detect.js
deleted file mode 100644
index 22c0386..0000000
--- a/frontend/gamma/js/Zepto/detect.js
+++ b/dev/null
@@ -1,42 +0,0 @@
1// Zepto.js
2// (c) 2010-2012 Thomas Fuchs
3// Zepto.js may be freely distributed under the MIT license.
4
5;(function($){
6 function detect(ua){
7 var os = this.os = {}, browser = this.browser = {},
8 webkit = ua.match(/WebKit\/([\d.]+)/),
9 android = ua.match(/(Android)\s+([\d.]+)/),
10 ipad = ua.match(/(iPad).*OS\s([\d_]+)/),
11 iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/),
12 webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),
13 touchpad = webos && ua.match(/TouchPad/),
14 kindle = ua.match(/Kindle\/([\d.]+)/),
15 silk = ua.match(/Silk\/([\d._]+)/),
16 blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/),
17 chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/)
18
19 // todo clean this up with a better OS/browser
20 // separation. we need to discern between multiple
21 // browsers on android, and decide if kindle fire in
22 // silk mode is android or not
23
24 if (browser.webkit = !!webkit) browser.version = webkit[1]
25
26 if (android) os.android = true, os.version = android[2]
27 if (iphone) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.')
28 if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.')
29 if (webos) os.webos = true, os.version = webos[2]
30 if (touchpad) os.touchpad = true
31 if (blackberry) os.blackberry = true, os.version = blackberry[2]
32 if (kindle) os.kindle = true, os.version = kindle[1]
33 if (silk) browser.silk = true, browser.version = silk[1]
34 if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true
35 if (chrome) browser.chrome = true, browser.version = chrome[1]
36 }
37
38 detect.call($, navigator.userAgent)
39 // make available to unit tests
40 $.__detect = detect
41
42})(Zepto)
diff --git a/frontend/gamma/js/Zepto/event.js b/frontend/gamma/js/Zepto/event.js
deleted file mode 100644
index b40af22..0000000
--- a/frontend/gamma/js/Zepto/event.js
+++ b/dev/null
@@ -1,248 +0,0 @@
1// Zepto.js
2// (c) 2010-2012 Thomas Fuchs
3// Zepto.js may be freely distributed under the MIT license.
4
5;(function($){
6 var $$ = $.zepto.qsa, handlers = {}, _zid = 1, specialEvents={},
7 hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' }
8
9 specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = 'MouseEvents'
10
11 function zid(element) {
12 return element._zid || (element._zid = _zid++)
13 }
14 function findHandlers(element, event, fn, selector) {
15 event = parse(event)
16 if (event.ns) var matcher = matcherFor(event.ns)
17 return (handlers[zid(element)] || []).filter(function(handler) {
18 return handler
19 && (!event.e || handler.e == event.e)
20 && (!event.ns || matcher.test(handler.ns))
21 && (!fn || zid(handler.fn) === zid(fn))
22 && (!selector || handler.sel == selector)
23 })
24 }
25 function parse(event) {
26 var parts = ('' + event).split('.')
27 return {e: parts[0], ns: parts.slice(1).sort().join(' ')}
28 }
29 function matcherFor(ns) {
30 return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)')
31 }
32
33 function eachEvent(events, fn, iterator){
34 if ($.isObject(events)) $.each(events, iterator)
35 else events.split(/\s/).forEach(function(type){ iterator(type, fn) })
36 }
37
38 function eventCapture(handler, captureSetting) {
39 return handler.del &&
40 (handler.e == 'focus' || handler.e == 'blur') ||
41 !!captureSetting
42 }
43
44 function realEvent(type) {
45 return hover[type] || type
46 }
47
48 function add(element, events, fn, selector, getDelegate, capture){
49 var id = zid(element), set = (handlers[id] || (handlers[id] = []))
50 eachEvent(events, fn, function(event, fn){
51 var handler = parse(event)
52 handler.fn = fn
53 handler.sel = selector
54 // emulate mouseenter, mouseleave
55 if (handler.e in hover) fn = function(e){
56 var related = e.relatedTarget
57 if (!related || (related !== this && !$.contains(this, related)))
58 return handler.fn.apply(this, arguments)
59 }
60 handler.del = getDelegate && getDelegate(fn, event)
61 var callback = handler.del || fn
62 handler.proxy = function (e) {
63 var result = callback.apply(element, [e].concat(e.data))
64 if (result === false) e.preventDefault(), e.stopPropagation()
65 return result
66 }
67 handler.i = set.length
68 set.push(handler)
69 element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture))
70 })
71 }
72 function remove(element, events, fn, selector, capture){
73 var id = zid(element)
74 eachEvent(events || '', fn, function(event, fn){
75 findHandlers(element, event, fn, selector).forEach(function(handler){
76 delete handlers[id][handler.i]
77 element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture))
78 })
79 })
80 }
81
82 $.event = { add: add, remove: remove }
83
84 $.proxy = function(fn, context) {
85 if ($.isFunction(fn)) {
86 var proxyFn = function(){ return fn.apply(context, arguments) }
87 proxyFn._zid = zid(fn)
88 return proxyFn
89 } else if (typeof context == 'string') {
90 return $.proxy(fn[context], fn)
91 } else {
92 throw new TypeError("expected function")
93 }
94 }
95
96 $.fn.bind = function(event, callback){
97 return this.each(function(){
98 add(this, event, callback)
99 })
100 }
101 $.fn.unbind = function(event, callback){
102 return this.each(function(){
103 remove(this, event, callback)
104 })
105 }
106 $.fn.one = function(event, callback){
107 return this.each(function(i, element){
108 add(this, event, callback, null, function(fn, type){
109 return function(){
110 var result = fn.apply(element, arguments)
111 remove(element, type, fn)
112 return result
113 }
114 })
115 })
116 }
117
118 var returnTrue = function(){return true},
119 returnFalse = function(){return false},
120 ignoreProperties = /^([A-Z]|layer[XY]$)/,
121 eventMethods = {
122 preventDefault: 'isDefaultPrevented',
123 stopImmediatePropagation: 'isImmediatePropagationStopped',
124 stopPropagation: 'isPropagationStopped'
125 }
126 function createProxy(event) {
127 var key, proxy = { originalEvent: event }
128 for (key in event)
129 if (!ignoreProperties.test(key) && event[key] !== undefined) proxy[key] = event[key]
130
131 $.each(eventMethods, function(name, predicate) {
132 proxy[name] = function(){
133 this[predicate] = returnTrue
134 return event[name].apply(event, arguments)
135 }
136 proxy[predicate] = returnFalse
137 })
138 return proxy
139 }
140
141 // emulates the 'defaultPrevented' property for browsers that have none
142 function fix(event) {
143 if (!('defaultPrevented' in event)) {
144 event.defaultPrevented = false
145 var prevent = event.preventDefault
146 event.preventDefault = function() {
147 this.defaultPrevented = true
148 prevent.call(this)
149 }
150 }
151 }
152
153 $.fn.delegate = function(selector, event, callback){
154 return this.each(function(i, element){
155 add(element, event, callback, selector, function(fn){
156 return function(e){
157 var evt, match = $(e.target).closest(selector, element).get(0)
158 if (match) {
159 evt = $.extend(createProxy(e), {currentTarget: match, liveFired: element})
160 return fn.apply(match, [evt].concat([].slice.call(arguments, 1)))
161 }
162 }
163 })
164 })
165 }
166 $.fn.undelegate = function(selector, event, callback){
167 return this.each(function(){
168 remove(this, event, callback, selector)
169 })
170 }
171
172 $.fn.live = function(event, callback){
173 $(document.body).delegate(this.selector, event, callback)
174 return this
175 }
176 $.fn.die = function(event, callback){
177 $(document.body).undelegate(this.selector, event, callback)
178 return this
179 }
180
181 $.fn.on = function(event, selector, callback){
182 return !selector || $.isFunction(selector) ?
183 this.bind(event, selector || callback) : this.delegate(selector, event, callback)
184 }
185 $.fn.off = function(event, selector, callback){
186 return !selector || $.isFunction(selector) ?
187 this.unbind(event, selector || callback) : this.undelegate(selector, event, callback)
188 }
189
190 $.fn.trigger = function(event, data){
191 if (typeof event == 'string' || $.isPlainObject(event)) event = $.Event(event)
192 fix(event)
193 event.data = data
194 return this.each(function(){
195 // items in the collection might not be DOM elements
196 // (todo: possibly support events on plain old objects)
197 if('dispatchEvent' in this) this.dispatchEvent(event)
198 })
199 }
200
201 // triggers event handlers on current element just as if an event occurred,
202 // doesn't trigger an actual event, doesn't bubble
203 $.fn.triggerHandler = function(event, data){
204 var e, result
205 this.each(function(i, element){
206 e = createProxy(typeof event == 'string' ? $.Event(event) : event)
207 e.data = data
208 e.target = element
209 $.each(findHandlers(element, event.type || event), function(i, handler){
210 result = handler.proxy(e)
211 if (e.isImmediatePropagationStopped()) return false
212 })
213 })
214 return result
215 }
216
217 // shortcut methods for `.bind(event, fn)` for each event type
218 ;('focusin focusout load resize scroll unload click dblclick '+
219 'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+
220 'change select keydown keypress keyup error').split(' ').forEach(function(event) {
221 $.fn[event] = function(callback) {
222 return callback ?
223 this.bind(event, callback) :
224 this.trigger(event)
225 }
226 })
227
228 ;['focus', 'blur'].forEach(function(name) {
229 $.fn[name] = function(callback) {
230 if (callback) this.bind(name, callback)
231 else this.each(function(){
232 try { this[name]() }
233 catch(e) {}
234 })
235 return this
236 }
237 })
238
239 $.Event = function(type, props) {
240 if (typeof type != 'string') props = type, type = props.type
241 var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true
242 if (props) for (var name in props) (name == 'bubbles') ? (bubbles = !!props[name]) : (event[name] = props[name])
243 event.initEvent(type, bubbles, true, null, null, null, null, null, null, null, null, null, null, null, null)
244 event.isDefaultPrevented = function(){ return this.defaultPrevented }
245 return event
246 }
247
248})(Zepto)
diff --git a/frontend/gamma/js/Zepto/form.js b/frontend/gamma/js/Zepto/form.js
deleted file mode 100644
index 4d562a6..0000000
--- a/frontend/gamma/js/Zepto/form.js
+++ b/dev/null
@@ -1,40 +0,0 @@
1// Zepto.js
2// (c) 2010-2012 Thomas Fuchs
3// Zepto.js may be freely distributed under the MIT license.
4
5;(function ($) {
6 $.fn.serializeArray = function () {
7 var result = [], el
8 $( Array.prototype.slice.call(this.get(0).elements) ).each(function () {
9 el = $(this)
10 var type = el.attr('type')
11 if (this.nodeName.toLowerCase() != 'fieldset' &&
12 !this.disabled && type != 'submit' && type != 'reset' && type != 'button' &&
13 ((type != 'radio' && type != 'checkbox') || this.checked))
14 result.push({
15 name: el.attr('name'),
16 value: el.val()
17 })
18 })
19 return result
20 }
21
22 $.fn.serialize = function () {
23 var result = []
24 this.serializeArray().forEach(function (elm) {
25 result.push( encodeURIComponent(elm.name) + '=' + encodeURIComponent(elm.value) )
26 })
27 return result.join('&')
28 }
29
30 $.fn.submit = function (callback) {
31 if (callback) this.bind('submit', callback)
32 else if (this.length) {
33 var event = $.Event('submit')
34 this.eq(0).trigger(event)
35 if (!event.defaultPrevented) this.get(0).submit()
36 }
37 return this
38 }
39
40})(Zepto)
diff --git a/frontend/gamma/js/Zepto/fx.js b/frontend/gamma/js/Zepto/fx.js
deleted file mode 100644
index 575449a..0000000
--- a/frontend/gamma/js/Zepto/fx.js
+++ b/dev/null
@@ -1,102 +0,0 @@
1// Zepto.js
2// (c) 2010-2012 Thomas Fuchs
3// Zepto.js may be freely distributed under the MIT license.
4
5;(function($, undefined){
6 var prefix = '', eventPrefix, endEventName, endAnimationName,
7 vendors = { Webkit: 'webkit', Moz: '', O: 'o', ms: 'MS' },
8 document = window.document, testEl = document.createElement('div'),
9 supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,
10 transform,
11 transitionProperty, transitionDuration, transitionTiming,
12 animationName, animationDuration, animationTiming,
13 cssReset = {}
14
15 function dasherize(str) { return downcase(str.replace(/([a-z])([A-Z])/, '$1-$2')) }
16 function downcase(str) { return str.toLowerCase() }
17 function normalizeEvent(name) { return eventPrefix ? eventPrefix + name : downcase(name) }
18
19 $.each(vendors, function(vendor, event){
20 if (testEl.style[vendor + 'TransitionProperty'] !== undefined) {
21 prefix = '-' + downcase(vendor) + '-'
22 eventPrefix = event
23 return false
24 }
25 })
26
27 transform = prefix + 'transform'
28 cssReset[transitionProperty = prefix + 'transition-property'] =
29 cssReset[transitionDuration = prefix + 'transition-duration'] =
30 cssReset[transitionTiming = prefix + 'transition-timing-function'] =
31 cssReset[animationName = prefix + 'animation-name'] =
32 cssReset[animationDuration = prefix + 'animation-duration'] =
33 cssReset[animationTiming = prefix + 'animation-timing-function'] = ''
34
35 $.fx = {
36 off: (eventPrefix === undefined && testEl.style.transitionProperty === undefined),
37 speeds: { _default: 400, fast: 200, slow: 600 },
38 cssPrefix: prefix,
39 transitionEnd: normalizeEvent('TransitionEnd'),
40 animationEnd: normalizeEvent('AnimationEnd')
41 }
42
43 $.fn.animate = function(properties, duration, ease, callback){
44 if ($.isObject(duration))
45 ease = duration.easing, callback = duration.complete, duration = duration.duration
46 if (duration) duration = (typeof duration == 'number' ? duration :
47 ($.fx.speeds[duration] || $.fx.speeds._default)) / 1000
48 return this.anim(properties, duration, ease, callback)
49 }
50
51 $.fn.anim = function(properties, duration, ease, callback){
52 var key, cssValues = {}, cssProperties, transforms = '',
53 that = this, wrappedCallback, endEvent = $.fx.transitionEnd
54
55 if (duration === undefined) duration = 0.4
56 if ($.fx.off) duration = 0
57
58 if (typeof properties == 'string') {
59 // keyframe animation
60 cssValues[animationName] = properties
61 cssValues[animationDuration] = duration + 's'
62 cssValues[animationTiming] = (ease || 'linear')
63 endEvent = $.fx.animationEnd
64 } else {
65 cssProperties = []
66 // CSS transitions
67 for (key in properties)
68 if (supportedTransforms.test(key)) transforms += key + '(' + properties[key] + ') '
69 else cssValues[key] = properties[key], cssProperties.push(dasherize(key))
70
71 if (transforms) cssValues[transform] = transforms, cssProperties.push(transform)
72 if (duration > 0 && typeof properties === 'object') {
73 cssValues[transitionProperty] = cssProperties.join(', ')
74 cssValues[transitionDuration] = duration + 's'
75 cssValues[transitionTiming] = (ease || 'linear')
76 }
77 }
78
79 wrappedCallback = function(event){
80 if (typeof event !== 'undefined') {
81 if (event.target !== event.currentTarget) return // makes sure the event didn't bubble from "below"
82 $(event.target).unbind(endEvent, arguments.callee)
83 }
84 $(this).css(cssReset)
85 callback && callback.call(this)
86 }
87 if (duration > 0) this.bind(endEvent, wrappedCallback)
88
89 // trigger page reflow so new elements can animate
90 this.size() && this.get(0).clientLeft
91
92 this.css(cssValues)
93
94 if (duration <= 0) setTimeout(function() {
95 that.each(function(){ wrappedCallback.call(this) })
96 }, 0)
97
98 return this
99 }
100
101 testEl = null
102})(Zepto)
diff --git a/frontend/gamma/js/Zepto/fx_methods.js b/frontend/gamma/js/Zepto/fx_methods.js
deleted file mode 100644
index 23daf6e..0000000
--- a/frontend/gamma/js/Zepto/fx_methods.js
+++ b/dev/null
@@ -1,71 +0,0 @@
1// Zepto.js
2// (c) 2010-2012 Thomas Fuchs
3// Zepto.js may be freely distributed under the MIT license.
4
5;(function($, undefined){
6 var document = window.document, docElem = document.documentElement,
7 origShow = $.fn.show, origHide = $.fn.hide, origToggle = $.fn.toggle
8
9 function anim(el, speed, opacity, scale, callback) {
10 if (typeof speed == 'function' && !callback) callback = speed, speed = undefined
11 var props = { opacity: opacity }
12 if (scale) {
13 props.scale = scale
14 el.css($.fx.cssPrefix + 'transform-origin', '0 0')
15 }
16 return el.animate(props, speed, null, callback)
17 }
18
19 function hide(el, speed, scale, callback) {
20 return anim(el, speed, 0, scale, function(){
21 origHide.call($(this))
22 callback && callback.call(this)
23 })
24 }
25
26 $.fn.show = function(speed, callback) {
27 origShow.call(this)
28 if (speed === undefined) speed = 0
29 else this.css('opacity', 0)
30 return anim(this, speed, 1, '1,1', callback)
31 }
32
33 $.fn.hide = function(speed, callback) {
34 if (speed === undefined) return origHide.call(this)
35 else return hide(this, speed, '0,0', callback)
36 }
37
38 $.fn.toggle = function(speed, callback) {
39 if (speed === undefined || typeof speed == 'boolean')
40 return origToggle.call(this, speed)
41 else return this.each(function(){
42 var el = $(this)
43 el[el.css('display') == 'none' ? 'show' : 'hide'](speed, callback)
44 })
45 }
46
47 $.fn.fadeTo = function(speed, opacity, callback) {
48 return anim(this, speed, opacity, null, callback)
49 }
50
51 $.fn.fadeIn = function(speed, callback) {
52 var target = this.css('opacity')
53 if (target > 0) this.css('opacity', 0)
54 else target = 1
55 return origShow.call(this).fadeTo(speed, target, callback)
56 }
57
58 $.fn.fadeOut = function(speed, callback) {
59 return hide(this, speed, null, callback)
60 }
61
62 $.fn.fadeToggle = function(speed, callback) {
63 return this.each(function(){
64 var el = $(this)
65 el[
66 (el.css('opacity') == 0 || el.css('display') == 'none') ? 'fadeIn' : 'fadeOut'
67 ](speed, callback)
68 })
69 }
70
71})(Zepto)
diff --git a/frontend/gamma/js/Zepto/gesture.js b/frontend/gamma/js/Zepto/gesture.js
deleted file mode 100644
index 035455b..0000000
--- a/frontend/gamma/js/Zepto/gesture.js
+++ b/dev/null
@@ -1,35 +0,0 @@
1// Zepto.js
2// (c) 2010-2012 Thomas Fuchs
3// Zepto.js may be freely distributed under the MIT license.
4
5;(function($){
6 if ($.os.ios) {
7 var gesture = {}, gestureTimeout
8
9 function parentIfText(node){
10 return 'tagName' in node ? node : node.parentNode
11 }
12
13 $(document).bind('gesturestart', function(e){
14 var now = Date.now(), delta = now - (gesture.last || now)
15 gesture.target = parentIfText(e.target)
16 gestureTimeout && clearTimeout(gestureTimeout)
17 gesture.e1 = e.scale
18 gesture.last = now
19 }).bind('gesturechange', function(e){
20 gesture.e2 = e.scale
21 }).bind('gestureend', function(e){
22 if (gesture.e2 > 0) {
23 Math.abs(gesture.e1 - gesture.e2) != 0 && $(gesture.target).trigger('pinch') &&
24 $(gesture.target).trigger('pinch' + (gesture.e1 - gesture.e2 > 0 ? 'In' : 'Out'))
25 gesture.e1 = gesture.e2 = gesture.last = 0
26 } else if ('last' in gesture) {
27 gesture = {}
28 }
29 })
30
31 ;['pinch', 'pinchIn', 'pinchOut'].forEach(function(m){
32 $.fn[m] = function(callback){ return this.bind(m, callback) }
33 })
34 }
35})(Zepto)
diff --git a/frontend/gamma/js/Zepto/polyfill.js b/frontend/gamma/js/Zepto/polyfill.js
deleted file mode 100644
index 933d1f8..0000000
--- a/frontend/gamma/js/Zepto/polyfill.js
+++ b/dev/null
@@ -1,36 +0,0 @@
1// Zepto.js
2// (c) 2010-2012 Thomas Fuchs
3// Zepto.js may be freely distributed under the MIT license.
4
5;(function(undefined){
6 if (String.prototype.trim === undefined) // fix for iOS 3.2
7 String.prototype.trim = function(){ return this.replace(/^\s+/, '').replace(/\s+$/, '') }
8
9 // For iOS 3.x
10 // from https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/reduce
11 if (Array.prototype.reduce === undefined)
12 Array.prototype.reduce = function(fun){
13 if(this === void 0 || this === null) throw new TypeError()
14 var t = Object(this), len = t.length >>> 0, k = 0, accumulator
15 if(typeof fun != 'function') throw new TypeError()
16 if(len == 0 && arguments.length == 1) throw new TypeError()
17
18 if(arguments.length >= 2)
19 accumulator = arguments[1]
20 else
21 do{
22 if(k in t){
23 accumulator = t[k++]
24 break
25 }
26 if(++k >= len) throw new TypeError()
27 } while (true)
28
29 while (k < len){
30 if(k in t) accumulator = fun.call(undefined, accumulator, t[k], k, t)
31 k++
32 }
33 return accumulator
34 }
35
36})()
diff --git a/frontend/gamma/js/Zepto/selector.js b/frontend/gamma/js/Zepto/selector.js
deleted file mode 100644
index c0b035a..0000000
--- a/frontend/gamma/js/Zepto/selector.js
+++ b/dev/null
@@ -1,81 +0,0 @@
1;(function($){
2 var zepto = $.zepto, oldQsa = zepto.qsa, oldMatches = zepto.matches
3
4 function visible(elem){
5 elem = $(elem)
6 return !!(elem.width() || elem.height()) && elem.css("display") !== "none"
7 }
8
9 // Implements a subset from:
10 // http://api.jquery.com/category/selectors/jquery-selector-extensions/
11 //
12 // Each filter function receives the current index, all nodes in the
13 // considered set, and a value if there were parentheses. The value
14 // of `this` is the node currently being considered. The function returns the
15 // resulting node(s), null, or undefined.
16 //
17 // Complex selectors are not supported:
18 // li:has(label:contains("foo")) + li:has(label:contains("bar"))
19 // ul.inner:first > li
20 var filters = $.expr[':'] = {
21 visible: function(){ if (visible(this)) return this },
22 hidden: function(){ if (!visible(this)) return this },
23 selected: function(){ if (this.selected) return this },
24 checked: function(){ if (this.checked) return this },
25 parent: function(){ return this.parentNode },
26 first: function(idx){ if (idx === 0) return this },
27 last: function(idx, nodes){ if (idx === nodes.length - 1) return this },
28 eq: function(idx, _, value){ if (idx === value) return this },
29 contains: function(idx, _, text){ if ($(this).text().indexOf(text) > -1) return this },
30 has: function(idx, _, sel){ if (zepto.qsa(this, sel).length) return this }
31 }
32
33 var filterRe = new RegExp('(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*'),
34 childRe = /^\s*>/,
35 classTag = 'Zepto' + (+new Date())
36
37 function process(sel, fn) {
38 // quote the hash in `a[href^=#]` expression
39 sel = sel.replace(/=#\]/g, '="#"]')
40 var filter, arg, match = filterRe.exec(sel)
41 if (match && match[2] in filters) {
42 var filter = filters[match[2]], arg = match[3]
43 sel = match[1]
44 if (arg) {
45 var num = Number(arg)
46 if (isNaN(num)) arg = arg.replace(/^["']|["']$/g, '')
47 else arg = num
48 }
49 }
50 return fn(sel, filter, arg)
51 }
52
53 zepto.qsa = function(node, selector) {
54 return process(selector, function(sel, filter, arg){
55 try {
56 var taggedParent
57 if (!sel && filter) sel = '*'
58 else if (childRe.test(sel))
59 // support "> *" child queries by tagging the parent node with a
60 // unique class and prepending that classname onto the selector
61 taggedParent = $(node).addClass(classTag), sel = '.'+classTag+' '+sel
62
63 var nodes = oldQsa(node, sel)
64 } catch(e) {
65 console.error('error performing selector: %o', selector)
66 throw e
67 } finally {
68 if (taggedParent) taggedParent.removeClass(classTag)
69 }
70 return !filter ? nodes :
71 zepto.uniq($.map(nodes, function(n, i){ return filter.call(n, i, nodes, arg) }))
72 })
73 }
74
75 zepto.matches = function(node, selector){
76 return process(selector, function(sel, filter, arg){
77 return (!sel || oldMatches(node, sel)) &&
78 (!filter || filter.call(node, null, arg) === node)
79 })
80 }
81})(Zepto)
diff --git a/frontend/gamma/js/Zepto/stack.js b/frontend/gamma/js/Zepto/stack.js
deleted file mode 100644
index c995285..0000000
--- a/frontend/gamma/js/Zepto/stack.js
+++ b/dev/null
@@ -1,22 +0,0 @@
1// Zepto.js
2// (c) 2010-2012 Thomas Fuchs
3// Zepto.js may be freely distributed under the MIT license.
4
5;(function($){
6 $.fn.end = function(){
7 return this.prevObject || $()
8 }
9
10 $.fn.andSelf = function(){
11 return this.add(this.prevObject || $())
12 }
13
14 'filter,add,not,eq,first,last,find,closest,parents,parent,children,siblings'.split(',').forEach(function(property){
15 var fn = $.fn[property]
16 $.fn[property] = function(){
17 var ret = fn.apply(this, arguments)
18 ret.prevObject = this
19 return ret
20 }
21 })
22})(Zepto)
diff --git a/frontend/gamma/js/Zepto/touch.js b/frontend/gamma/js/Zepto/touch.js
deleted file mode 100644
index af109b9..0000000
--- a/frontend/gamma/js/Zepto/touch.js
+++ b/dev/null
@@ -1,113 +0,0 @@
1// Zepto.js
2// (c) 2010-2012 Thomas Fuchs
3// Zepto.js may be freely distributed under the MIT license.
4
5;(function($){
6 var touch = {},
7 touchTimeout, tapTimeout, swipeTimeout,
8 longTapDelay = 750, longTapTimeout
9
10 function parentIfText(node) {
11 return 'tagName' in node ? node : node.parentNode
12 }
13
14 function swipeDirection(x1, x2, y1, y2) {
15 var xDelta = Math.abs(x1 - x2), yDelta = Math.abs(y1 - y2)
16 return xDelta >= yDelta ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down')
17 }
18
19 function longTap() {
20 longTapTimeout = null
21 if (touch.last) {
22 touch.el.trigger('longTap')
23 touch = {}
24 }
25 }
26
27 function cancelLongTap() {
28 if (longTapTimeout) clearTimeout(longTapTimeout)
29 longTapTimeout = null
30 }
31
32 function cancelAll() {
33 if (touchTimeout) clearTimeout(touchTimeout)
34 if (tapTimeout) clearTimeout(tapTimeout)
35 if (swipeTimeout) clearTimeout(swipeTimeout)
36 if (longTapTimeout) clearTimeout(longTapTimeout)
37 touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null
38 touch = {}
39 }
40
41 $(document).ready(function(){
42 var now, delta
43
44 $(document.body)
45 .bind('touchstart', function(e){
46 now = Date.now()
47 delta = now - (touch.last || now)
48 touch.el = $(parentIfText(e.touches[0].target))
49 touchTimeout && clearTimeout(touchTimeout)
50 touch.x1 = e.touches[0].pageX
51 touch.y1 = e.touches[0].pageY
52 if (delta > 0 && delta <= 250) touch.isDoubleTap = true
53 touch.last = now
54 longTapTimeout = setTimeout(longTap, longTapDelay)
55 })
56 .bind('touchmove', function(e){
57 cancelLongTap()
58 touch.x2 = e.touches[0].pageX
59 touch.y2 = e.touches[0].pageY
60 })
61 .bind('touchend', function(e){
62 cancelLongTap()
63
64 // swipe
65 if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) ||
66 (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30))
67
68 swipeTimeout = setTimeout(function() {
69 touch.el.trigger('swipe')
70 touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2)))
71 touch = {}
72 }, 0)
73
74 // normal tap
75 else if ('last' in touch)
76
77 // delay by one tick so we can cancel the 'tap' event if 'scroll' fires
78 // ('tap' fires before 'scroll')
79 tapTimeout = setTimeout(function() {
80
81 // trigger universal 'tap' with the option to cancelTouch()
82 // (cancelTouch cancels processing of single vs double taps for faster 'tap' response)
83 var event = $.Event('tap')
84 event.cancelTouch = cancelAll
85 touch.el.trigger(event)
86
87 // trigger double tap immediately
88 if (touch.isDoubleTap) {
89 touch.el.trigger('doubleTap')
90 touch = {}
91 }
92
93 // trigger single tap after 250ms of inactivity
94 else {
95 touchTimeout = setTimeout(function(){
96 touchTimeout = null
97 touch.el.trigger('singleTap')
98 touch = {}
99 }, 250)
100 }
101
102 }, 0)
103
104 })
105 .bind('touchcancel', cancelAll)
106
107 $(window).bind('scroll', cancelAll)
108 })
109
110 ;['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(m){
111 $.fn[m] = function(callback){ return this.bind(m, callback) }
112 })
113})(Zepto)
diff --git a/frontend/gamma/js/Zepto/zepto.js b/frontend/gamma/js/Zepto/zepto.js
deleted file mode 100644
index e67b3a2..0000000
--- a/frontend/gamma/js/Zepto/zepto.js
+++ b/dev/null
@@ -1,751 +0,0 @@
1// Zepto.js
2// (c) 2010-2012 Thomas Fuchs
3// Zepto.js may be freely distributed under the MIT license.
4
5var Zepto = (function() {
6 var undefined, key, $, classList, emptyArray = [], slice = emptyArray.slice, filter = emptyArray.filter,
7 document = window.document,
8 elementDisplay = {}, classCache = {},
9 getComputedStyle = document.defaultView.getComputedStyle,
10 cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 },
11 fragmentRE = /^\s*<(\w+|!)[^>]*>/,
12 tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
13 rootNodeRE = /^(?:body|html)$/i,
14
15 // special attributes that should be get/set via method calls
16 methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'],
17
18 adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ],
19 table = document.createElement('table'),
20 tableRow = document.createElement('tr'),
21 containers = {
22 'tr': document.createElement('tbody'),
23 'tbody': table, 'thead': table, 'tfoot': table,
24 'td': tableRow, 'th': tableRow,
25 '*': document.createElement('div')
26 },
27 readyRE = /complete|loaded|interactive/,
28 classSelectorRE = /^\.([\w-]+)$/,
29 idSelectorRE = /^#([\w-]*)$/,
30 tagSelectorRE = /^[\w-]+$/,
31 toString = {}.toString,
32 zepto = {},
33 camelize, uniq,
34 tempParent = document.createElement('div')
35
36 zepto.matches = function(element, selector) {
37 if (!element || element.nodeType !== 1) return false
38 var matchesSelector = element.webkitMatchesSelector || element.mozMatchesSelector ||
39 element.oMatchesSelector || element.matchesSelector
40 if (matchesSelector) return matchesSelector.call(element, selector)
41 // fall back to performing a selector:
42 var match, parent = element.parentNode, temp = !parent
43 if (temp) (parent = tempParent).appendChild(element)
44 match = ~zepto.qsa(parent, selector).indexOf(element)
45 temp && tempParent.removeChild(element)
46 return match
47 }
48
49 function isFunction(value) { return toString.call(value) == "[object Function]" }
50 function isObject(value) { return value instanceof Object }
51 function isPlainObject(value) {
52 return isObject(value) && value != window && value.__proto__ == Object.prototype
53 }
54 function isArray(value) { return value instanceof Array }
55 function likeArray(obj) { return typeof obj.length == 'number' }
56
57 function compact(array) { return filter.call(array, function(item){ return item != null }) }
58 function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array }
59 camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) }
60 function dasherize(str) {
61 return str.replace(/::/g, '/')
62 .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
63 .replace(/([a-z\d])([A-Z])/g, '$1_$2')
64 .replace(/_/g, '-')
65 .toLowerCase()
66 }
67 uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) }
68
69 function classRE(name) {
70 return name in classCache ?
71 classCache[name] : (classCache[name] = new RegExp('(^|\\s)' + name + '(\\s|$)'))
72 }
73
74 function maybeAddPx(name, value) {
75 return (typeof value == "number" && !cssNumber[dasherize(name)]) ? value + "px" : value
76 }
77
78 function defaultDisplay(nodeName) {
79 var element, display
80 if (!elementDisplay[nodeName]) {
81 element = document.createElement(nodeName)
82 document.body.appendChild(element)
83 display = getComputedStyle(element, '').getPropertyValue("display")
84 element.parentNode.removeChild(element)
85 display == "none" && (display = "block")
86 elementDisplay[nodeName] = display
87 }
88 return elementDisplay[nodeName]
89 }
90
91 function children(element) {
92 return 'children' in element ?
93 slice.call(element.children) :
94 $.map(element.childNodes, function(node){ if (node.nodeType == 1) return node })
95 }
96
97 // `$.zepto.fragment` takes a html string and an optional tag name
98 // to generate DOM nodes nodes from the given html string.
99 // The generated DOM nodes are returned as an array.
100 // This function can be overriden in plugins for example to make
101 // it compatible with browsers that don't support the DOM fully.
102 zepto.fragment = function(html, name, properties) {
103 if (html.replace) html = html.replace(tagExpanderRE, "<$1></$2>")
104 if (name === undefined) name = fragmentRE.test(html) && RegExp.$1
105 if (!(name in containers)) name = '*'
106
107 var nodes, dom, container = containers[name]
108 container.innerHTML = '' + html
109 dom = $.each(slice.call(container.childNodes), function(){
110 container.removeChild(this)
111 })
112 if (isPlainObject(properties)) {
113 nodes = $(dom)
114 $.each(properties, function(key, value) {
115 if (methodAttributes.indexOf(key) > -1) nodes[key](value)
116 else nodes.attr(key, value)
117 })
118 }
119 return dom
120 }
121
122 // `$.zepto.Z` swaps out the prototype of the given `dom` array
123 // of nodes with `$.fn` and thus supplying all the Zepto functions
124 // to the array. Note that `__proto__` is not supported on Internet
125 // Explorer. This method can be overriden in plugins.
126 zepto.Z = function(dom, selector) {
127 dom = dom || []
128 dom.__proto__ = arguments.callee.prototype
129 dom.selector = selector || ''
130 return dom
131 }
132
133 // `$.zepto.isZ` should return `true` if the given object is a Zepto
134 // collection. This method can be overriden in plugins.
135 zepto.isZ = function(object) {
136 return object instanceof zepto.Z
137 }
138
139 // `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and
140 // takes a CSS selector and an optional context (and handles various
141 // special cases).
142 // This method can be overriden in plugins.
143 zepto.init = function(selector, context) {
144 // If nothing given, return an empty Zepto collection
145 if (!selector) return zepto.Z()
146 // If a function is given, call it when the DOM is ready
147 else if (isFunction(selector)) return $(document).ready(selector)
148 // If a Zepto collection is given, juts return it
149 else if (zepto.isZ(selector)) return selector
150 else {
151 var dom
152 // normalize array if an array of nodes is given
153 if (isArray(selector)) dom = compact(selector)
154 // Wrap DOM nodes. If a plain object is given, duplicate it.
155 else if (isObject(selector))
156 dom = [isPlainObject(selector) ? $.extend({}, selector) : selector], selector = null
157 // If it's a html fragment, create nodes from it
158 else if (fragmentRE.test(selector))
159 dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null
160 // If there's a context, create a collection on that context first, and select
161 // nodes from there
162 else if (context !== undefined) return $(context).find(selector)
163 // And last but no least, if it's a CSS selector, use it to select nodes.
164 else dom = zepto.qsa(document, selector)
165 // create a new Zepto collection from the nodes found
166 return zepto.Z(dom, selector)
167 }
168 }
169
170 // `$` will be the base `Zepto` object. When calling this
171 // function just call `$.zepto.init, which makes the implementation
172 // details of selecting nodes and creating Zepto collections
173 // patchable in plugins.
174 $ = function(selector, context){
175 return zepto.init(selector, context)
176 }
177
178 function extend(target, source, deep) {
179 for (key in source)
180 if (deep && isPlainObject(source[key])) {
181 if (!isPlainObject(target[key])) target[key] = {}
182 extend(target[key], source[key], deep)
183 }
184 else if (source[key] !== undefined) target[key] = source[key]
185 }
186
187 // Copy all but undefined properties from one or more
188 // objects to the `target` object.
189 $.extend = function(target){
190 var deep, args = slice.call(arguments, 1)
191 if (typeof target == 'boolean') {
192 deep = target
193 target = args.shift()
194 }
195 args.forEach(function(arg){ extend(target, arg, deep) })
196 return target
197 }
198
199 // `$.zepto.qsa` is Zepto's CSS selector implementation which
200 // uses `document.querySelectorAll` and optimizes for some special cases, like `#id`.
201 // This method can be overriden in plugins.
202 zepto.qsa = function(element, selector){
203 var found
204 return (element === document && idSelectorRE.test(selector)) ?
205 ( (found = element.getElementById(RegExp.$1)) ? [found] : [] ) :
206 (element.nodeType !== 1 && element.nodeType !== 9) ? [] :
207 slice.call(
208 classSelectorRE.test(selector) ? element.getElementsByClassName(RegExp.$1) :
209 tagSelectorRE.test(selector) ? element.getElementsByTagName(selector) :
210 element.querySelectorAll(selector)
211 )
212 }
213
214 function filtered(nodes, selector) {
215 return selector === undefined ? $(nodes) : $(nodes).filter(selector)
216 }
217
218 $.contains = function(parent, node) {
219 return parent !== node && parent.contains(node)
220 }
221
222 function funcArg(context, arg, idx, payload) {
223 return isFunction(arg) ? arg.call(context, idx, payload) : arg
224 }
225
226 function setAttribute(node, name, value) {
227 value == null ? node.removeAttribute(name) : node.setAttribute(name, value)
228 }
229
230 // access className property while respecting SVGAnimatedString
231 function className(node, value){
232 var klass = node.className,
233 svg = klass && klass.baseVal !== undefined
234
235 if (value === undefined) return svg ? klass.baseVal : klass
236 svg ? (klass.baseVal = value) : (node.className = value)
237 }
238
239 // "true" => true
240 // "false" => false
241 // "null" => null
242 // "42" => 42
243 // "42.5" => 42.5
244 // JSON => parse if valid
245 // String => self
246 function deserializeValue(value) {
247 var num
248 try {
249 return value ?
250 value == "true" ||
251 ( value == "false" ? false :
252 value == "null" ? null :
253 !isNaN(num = Number(value)) ? num :
254 /^[\[\{]/.test(value) ? $.parseJSON(value) :
255 value )
256 : value
257 } catch(e) {
258 return value
259 }
260 }
261
262 $.isFunction = isFunction
263 $.isObject = isObject
264 $.isArray = isArray
265 $.isPlainObject = isPlainObject
266
267 $.inArray = function(elem, array, i){
268 return emptyArray.indexOf.call(array, elem, i)
269 }
270
271 $.camelCase = camelize
272 $.trim = function(str) { return str.trim() }
273
274 // plugin compatibility
275 $.uuid = 0
276 $.support = { }
277 $.expr = { }
278
279 $.map = function(elements, callback){
280 var value, values = [], i, key
281 if (likeArray(elements))
282 for (i = 0; i < elements.length; i++) {
283 value = callback(elements[i], i)
284 if (value != null) values.push(value)
285 }
286 else
287 for (key in elements) {
288 value = callback(elements[key], key)
289 if (value != null) values.push(value)
290 }
291 return flatten(values)
292 }
293
294 $.each = function(elements, callback){
295 var i, key
296 if (likeArray(elements)) {
297 for (i = 0; i < elements.length; i++)
298 if (callback.call(elements[i], i, elements[i]) === false) return elements
299 } else {
300 for (key in elements)
301 if (callback.call(elements[key], key, elements[key]) === false) return elements
302 }
303
304 return elements
305 }
306
307 $.grep = function(elements, callback){
308 return filter.call(elements, callback)
309 }
310
311 if (window.JSON) $.parseJSON = JSON.parse
312
313 // Define methods that will be available on all
314 // Zepto collections
315 $.fn = {
316 // Because a collection acts like an array
317 // copy over these useful array functions.
318 forEach: emptyArray.forEach,
319 reduce: emptyArray.reduce,
320 push: emptyArray.push,
321 sort: emptyArray.sort,
322 indexOf: emptyArray.indexOf,
323 concat: emptyArray.concat,
324
325 // `map` and `slice` in the jQuery API work differently
326 // from their array counterparts
327 map: function(fn){
328 return $($.map(this, function(el, i){ return fn.call(el, i, el) }))
329 },
330 slice: function(){
331 return $(slice.apply(this, arguments))
332 },
333
334 ready: function(callback){
335 if (readyRE.test(document.readyState)) callback($)
336 else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false)
337 return this
338 },
339 get: function(idx){
340 return idx === undefined ? slice.call(this) : this[idx]
341 },
342 toArray: function(){ return this.get() },
343 size: function(){
344 return this.length
345 },
346 remove: function(){
347 return this.each(function(){
348 if (this.parentNode != null)
349 this.parentNode.removeChild(this)
350 })
351 },
352 each: function(callback){
353 emptyArray.every.call(this, function(el, idx){
354 return callback.call(el, idx, el) !== false
355 })
356 return this
357 },
358 filter: function(selector){
359 if (isFunction(selector)) return this.not(this.not(selector))
360 return $(filter.call(this, function(element){
361 return zepto.matches(element, selector)
362 }))
363 },
364 add: function(selector,context){
365 return $(uniq(this.concat($(selector,context))))
366 },
367 is: function(selector){
368 return this.length > 0 && zepto.matches(this[0], selector)
369 },
370 not: function(selector){
371 var nodes=[]
372 if (isFunction(selector) && selector.call !== undefined)
373 this.each(function(idx){
374 if (!selector.call(this,idx)) nodes.push(this)
375 })
376 else {
377 var excludes = typeof selector == 'string' ? this.filter(selector) :
378 (likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector)
379 this.forEach(function(el){
380 if (excludes.indexOf(el) < 0) nodes.push(el)
381 })
382 }
383 return $(nodes)
384 },
385 has: function(selector){
386 return this.filter(function(){
387 return isObject(selector) ?
388 $.contains(this, selector) :
389 $(this).find(selector).size()
390 })
391 },
392 eq: function(idx){
393 return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1)
394 },
395 first: function(){
396 var el = this[0]
397 return el && !isObject(el) ? el : $(el)
398 },
399 last: function(){
400 var el = this[this.length - 1]
401 return el && !isObject(el) ? el : $(el)
402 },
403 find: function(selector){
404 var result
405 if (this.length == 1) result = $(zepto.qsa(this[0], selector))
406 else result = this.map(function(){ return zepto.qsa(this, selector) })
407 return result
408 },
409 closest: function(selector, context){
410 var node = this[0]
411 while (node && !zepto.matches(node, selector))
412 node = node !== context && node !== document && node.parentNode
413 return $(node)
414 },
415 parents: function(selector){
416 var ancestors = [], nodes = this
417 while (nodes.length > 0)
418 nodes = $.map(nodes, function(node){
419 if ((node = node.parentNode) && node !== document && ancestors.indexOf(node) < 0) {
420 ancestors.push(node)
421 return node
422 }
423 })
424 return filtered(ancestors, selector)
425 },
426 parent: function(selector){
427 return filtered(uniq(this.pluck('parentNode')), selector)
428 },
429 children: function(selector){
430 return filtered(this.map(function(){ return children(this) }), selector)
431 },
432 contents: function() {
433 return this.map(function() { return slice.call(this.childNodes) })
434 },
435 siblings: function(selector){
436 return filtered(this.map(function(i, el){
437 return filter.call(children(el.parentNode), function(child){ return child!==el })
438 }), selector)
439 },
440 empty: function(){
441 return this.each(function(){ this.innerHTML = '' })
442 },
443 // `pluck` is borrowed from Prototype.js
444 pluck: function(property){
445 return $.map(this, function(el){ return el[property] })
446 },
447 show: function(){
448 return this.each(function(){
449 this.style.display == "none" && (this.style.display = null)
450 if (getComputedStyle(this, '').getPropertyValue("display") == "none")
451 this.style.display = defaultDisplay(this.nodeName)
452 })
453 },
454 replaceWith: function(newContent){
455 return this.before(newContent).remove()
456 },
457 wrap: function(structure){
458 var func = isFunction(structure)
459 if (this[0] && !func)
460 var dom = $(structure).get(0),
461 clone = dom.parentNode || this.length > 1
462
463 return this.each(function(index){
464 $(this).wrapAll(
465 func ? structure.call(this, index) :
466 clone ? dom.cloneNode(true) : dom
467 )
468 })
469 },
470 wrapAll: function(structure){
471 if (this[0]) {
472 $(this[0]).before(structure = $(structure))
473 var children
474 // drill down to the inmost element
475 while ((children = structure.children()).length) structure = children.first()
476 $(structure).append(this)
477 }
478 return this
479 },
480 wrapInner: function(structure){
481 var func = isFunction(structure)
482 return this.each(function(index){
483 var self = $(this), contents = self.contents(),
484 dom = func ? structure.call(this, index) : structure
485 contents.length ? contents.wrapAll(dom) : self.append(dom)
486 })
487 },
488 unwrap: function(){
489 this.parent().each(function(){
490 $(this).replaceWith($(this).children())
491 })
492 return this
493 },
494 clone: function(){
495 return this.map(function(){ return this.cloneNode(true) })
496 },
497 hide: function(){
498 return this.css("display", "none")
499 },
500 toggle: function(setting){
501 return this.each(function(){
502 var el = $(this)
503 ;(setting === undefined ? el.css("display") == "none" : setting) ? el.show() : el.hide()
504 })
505 },
506 prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') },
507 next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') },
508 html: function(html){
509 return html === undefined ?
510 (this.length > 0 ? this[0].innerHTML : null) :
511 this.each(function(idx){
512 var originHtml = this.innerHTML
513 $(this).empty().append( funcArg(this, html, idx, originHtml) )
514 })
515 },
516 text: function(text){
517 return text === undefined ?
518 (this.length > 0 ? this[0].textContent : null) :
519 this.each(function(){ this.textContent = text })
520 },
521 attr: function(name, value){
522 var result
523 return (typeof name == 'string' && value === undefined) ?
524 (this.length == 0 || this[0].nodeType !== 1 ? undefined :
525 (name == 'value' && this[0].nodeName == 'INPUT') ? this.val() :
526 (!(result = this[0].getAttribute(name)) && name in this[0]) ? this[0][name] : result
527 ) :
528 this.each(function(idx){
529 if (this.nodeType !== 1) return
530 if (isObject(name)) for (key in name) setAttribute(this, key, name[key])
531 else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name)))
532 })
533 },
534 removeAttr: function(name){
535 return this.each(function(){ this.nodeType === 1 && setAttribute(this, name) })
536 },
537 prop: function(name, value){
538 return (value === undefined) ?
539 (this[0] && this[0][name]) :
540 this.each(function(idx){
541 this[name] = funcArg(this, value, idx, this[name])
542 })
543 },
544 data: function(name, value){
545 var data = this.attr('data-' + dasherize(name), value)
546 return data !== null ? deserializeValue(data) : undefined
547 },
548 val: function(value){
549 return (value === undefined) ?
550 (this[0] && (this[0].multiple ?
551 $(this[0]).find('option').filter(function(o){ return this.selected }).pluck('value') :
552 this[0].value)
553 ) :
554 this.each(function(idx){
555 this.value = funcArg(this, value, idx, this.value)
556 })
557 },
558 offset: function(coordinates){
559 if (coordinates) return this.each(function(index){
560 var $this = $(this),
561 coords = funcArg(this, coordinates, index, $this.offset()),
562 parentOffset = $this.offsetParent().offset(),
563 props = {
564 top: coords.top - parentOffset.top,
565 left: coords.left - parentOffset.left
566 }
567
568 if ($this.css('position') == 'static') props['position'] = 'relative'
569 $this.css(props)
570 })
571 if (this.length==0) return null
572 var obj = this[0].getBoundingClientRect()
573 return {
574 left: obj.left + window.pageXOffset,
575 top: obj.top + window.pageYOffset,
576 width: obj.width,
577 height: obj.height
578 }
579 },
580 css: function(property, value){
581 if (arguments.length < 2 && typeof property == 'string')
582 return this[0] && (this[0].style[camelize(property)] || getComputedStyle(this[0], '').getPropertyValue(property))
583
584 var css = ''
585 for (key in property)
586 if (!property[key] && property[key] !== 0)
587 this.each(function(){ this.style.removeProperty(dasherize(key)) })
588 else
589 css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';'
590
591 if (typeof property == 'string')
592 if (!value && value !== 0)
593 this.each(function(){ this.style.removeProperty(dasherize(property)) })
594 else
595 css = dasherize(property) + ":" + maybeAddPx(property, value)
596
597 return this.each(function(){ this.style.cssText += ';' + css })
598 },
599 index: function(element){
600 return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0])
601 },
602 hasClass: function(name){
603 return emptyArray.some.call(this, function(el){
604 return this.test(className(el))
605 }, classRE(name))
606 },
607 addClass: function(name){
608 return this.each(function(idx){
609 classList = []
610 var cls = className(this), newName = funcArg(this, name, idx, cls)
611 newName.split(/\s+/g).forEach(function(klass){
612 if (!$(this).hasClass(klass)) classList.push(klass)
613 }, this)
614 classList.length && className(this, cls + (cls ? " " : "") + classList.join(" "))
615 })
616 },
617 removeClass: function(name){
618 return this.each(function(idx){
619 if (name === undefined) return className(this, '')
620 classList = className(this)
621 funcArg(this, name, idx, classList).split(/\s+/g).forEach(function(klass){
622 classList = classList.replace(classRE(klass), " ")
623 })
624 className(this, classList.trim())
625 })
626 },
627 toggleClass: function(name, when){
628 return this.each(function(idx){
629 var newName = funcArg(this, name, idx, className(this))
630 ;(when === undefined ? !$(this).hasClass(newName) : when) ?
631 $(this).addClass(newName) : $(this).removeClass(newName)
632 })
633 },
634 scrollTop: function(){
635 if (!this.length) return
636 return ('scrollTop' in this[0]) ? this[0].scrollTop : this[0].scrollY
637 },
638 position: function() {
639 if (!this.length) return
640
641 var elem = this[0],
642 // Get *real* offsetParent
643 offsetParent = this.offsetParent(),
644 // Get correct offsets
645 offset = this.offset(),
646 parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset()
647
648 // Subtract element margins
649 // note: when an element has margin: auto the offsetLeft and marginLeft
650 // are the same in Safari causing offset.left to incorrectly be 0
651 offset.top -= parseFloat( $(elem).css('margin-top') ) || 0
652 offset.left -= parseFloat( $(elem).css('margin-left') ) || 0
653
654 // Add offsetParent borders
655 parentOffset.top += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0
656 parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0
657
658 // Subtract the two offsets
659 return {
660 top: offset.top - parentOffset.top,
661 left: offset.left - parentOffset.left
662 }
663 },
664 offsetParent: function() {
665 return this.map(function(){
666 var parent = this.offsetParent || document.body
667 while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css("position") == "static")
668 parent = parent.offsetParent
669 return parent
670 })
671 }
672 }
673
674 // for now
675 $.fn.detach = $.fn.remove
676
677 // Generate the `width` and `height` functions
678 ;['width', 'height'].forEach(function(dimension){
679 $.fn[dimension] = function(value){
680 var offset, Dimension = dimension.replace(/./, function(m){ return m[0].toUpperCase() })
681 if (value === undefined) return this[0] == window ? window['inner' + Dimension] :
682 this[0] == document ? document.documentElement['offset' + Dimension] :
683 (offset = this.offset()) && offset[dimension]
684 else return this.each(function(idx){
685 var el = $(this)
686 el.css(dimension, funcArg(this, value, idx, el[dimension]()))
687 })
688 }
689 })
690
691 function traverseNode(node, fun) {
692 fun(node)
693 for (var key in node.childNodes) traverseNode(node.childNodes[key], fun)
694 }
695
696 // Generate the `after`, `prepend`, `before`, `append`,
697 // `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods.
698 adjacencyOperators.forEach(function(operator, operatorIndex) {
699 var inside = operatorIndex % 2 //=> prepend, append
700
701 $.fn[operator] = function(){
702 // arguments can be nodes, arrays of nodes, Zepto objects and HTML strings
703 var nodes = $.map(arguments, function(n){ return isObject(n) ? n : zepto.fragment(n) }),
704 parent, copyByClone = this.length > 1
705 if (nodes.length < 1) return this
706
707 return this.each(function(_, target){
708 parent = inside ? target : target.parentNode
709
710 // convert all methods to a "before" operation
711 target = operatorIndex == 0 ? target.nextSibling :
712 operatorIndex == 1 ? target.firstChild :
713 operatorIndex == 2 ? target :
714 null
715
716 nodes.forEach(function(node){
717 if (copyByClone) node = node.cloneNode(true)
718 else if (!parent) return $(node).remove()
719
720 traverseNode(parent.insertBefore(node, target), function(el){
721 if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' &&
722 (!el.type || el.type === 'text/javascript') && !el.src)
723 window['eval'].call(window, el.innerHTML)
724 })
725 })
726 })
727 }
728
729 // after => insertAfter
730 // prepend => prependTo
731 // before => insertBefore
732 // append => appendTo
733 $.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){
734 $(html)[operator](this)
735 return this
736 }
737 })
738
739 zepto.Z.prototype = $.fn
740
741 // Export internal API functions in the `$.zepto` namespace
742 zepto.uniq = uniq
743 zepto.deserializeValue = deserializeValue
744 $.zepto = zepto
745
746 return $
747})()
748
749// If `$` is not yet defined, point it to `Zepto`
750window.Zepto = Zepto
751'$' in window || (window.$ = Zepto)