Diffstat (limited to 'frontend/gamma/js/Zepto/form.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Zepto/form.js | 40 |
1 files changed, 0 insertions, 40 deletions
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) | ||