zepto-for-rails 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d769eaa9db1b6c5581bf3d3c3a757b6a0e0021c7
4
- data.tar.gz: d2727544b79feb13b5e695e5ad8f881f3c4b8271
3
+ metadata.gz: 601bdc47c445fb855abdc57e538c434792ebba6b
4
+ data.tar.gz: b83e1736819b17c777084540a9a1ce776f290a83
5
5
  SHA512:
6
- metadata.gz: 8c392996be690e6acf5c04da7f5ed38cb2c50dfdafe19cd061fd39f839d59831139e13e7335fe272cb5aee63a15f929d968cf75d8d73709ced59e294215e9a55
7
- data.tar.gz: 2872e5a3156a94abe80489a3a3c5c55e4b16ed7c01ca3c28cd6f6d0c688a970042d547c032f89400548f54a6ff14dc710045f7083c8db9f578bfae2028159319
6
+ metadata.gz: 535a21ca3161817850d82c05179dc63a10cf011183cf084e41ea7a6fb8f85d7240bdfc7bc420a6e81ea2ac0c55fde3c49eaa72654eade8b3f9015ebca894f617
7
+ data.tar.gz: 02207d549c3dbefb5038903185dc2eedd6661ad18be83594cc719c468c3629bda9997f05bbf00ced3532b95d94c81ec916d8a5a25a7e78d16cc115850d704d56
@@ -1,5 +1,5 @@
1
1
  module Zepto
2
2
  module Rails
3
- VERSION = '0.1'
3
+ VERSION = '0.2'
4
4
  end
5
5
  end
@@ -1,4 +1,4 @@
1
- /* Zepto v1.1.2 - zepto event ajax form ie - zeptojs.com/license */
1
+ /* Zepto v1.1.3 - zepto event ajax form ie - zeptojs.com/license */
2
2
 
3
3
 
4
4
  var Zepto = (function() {
@@ -25,8 +25,6 @@ var Zepto = (function() {
25
25
  '*': document.createElement('div')
26
26
  },
27
27
  readyRE = /complete|loaded|interactive/,
28
- classSelectorRE = /^\.([\w-]+)$/,
29
- idSelectorRE = /^#([\w-]*)$/,
30
28
  simpleSelectorRE = /^[\w-]*$/,
31
29
  class2type = {},
32
30
  toString = class2type.toString,
@@ -46,7 +44,9 @@ var Zepto = (function() {
46
44
  'usemap': 'useMap',
47
45
  'frameborder': 'frameBorder',
48
46
  'contenteditable': 'contentEditable'
49
- }
47
+ },
48
+ isArray = Array.isArray ||
49
+ function(object){ return object instanceof Array }
50
50
 
51
51
  zepto.matches = function(element, selector) {
52
52
  if (!selector || !element || element.nodeType !== 1) return false
@@ -73,7 +73,6 @@ var Zepto = (function() {
73
73
  function isPlainObject(obj) {
74
74
  return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype
75
75
  }
76
- function isArray(value) { return value instanceof Array }
77
76
  function likeArray(obj) { return typeof obj.length == 'number' }
78
77
 
79
78
  function compact(array) { return filter.call(array, function(item){ return item != null }) }
@@ -865,7 +864,7 @@ window.Zepto = Zepto
865
864
  window.$ === undefined && (window.$ = Zepto)
866
865
 
867
866
  ;(function($){
868
- var $$ = $.zepto.qsa, _zid = 1, undefined,
867
+ var _zid = 1, undefined,
869
868
  slice = Array.prototype.slice,
870
869
  isFunction = $.isFunction,
871
870
  isString = function(obj){ return typeof obj == 'string' },
@@ -1248,7 +1247,7 @@ window.$ === undefined && (window.$ = Zepto)
1248
1247
  responseData = arguments
1249
1248
  }
1250
1249
 
1251
- script.src = options.url.replace(/=\?/, '=' + callbackName)
1250
+ script.src = options.url.replace(/\?(.+)=\?/, '?$1=' + callbackName)
1252
1251
  document.head.appendChild(script)
1253
1252
 
1254
1253
  if (options.timeout > 0) abortTimeout = setTimeout(function(){
@@ -1331,7 +1330,7 @@ window.$ === undefined && (window.$ = Zepto)
1331
1330
  serializeData(settings)
1332
1331
  if (settings.cache === false) settings.url = appendQuery(settings.url, '_=' + Date.now())
1333
1332
 
1334
- var dataType = settings.dataType, hasPlaceholder = /=\?/.test(settings.url)
1333
+ var dataType = settings.dataType, hasPlaceholder = /\?.+=\?/.test(settings.url)
1335
1334
  if (dataType == 'jsonp' || hasPlaceholder) {
1336
1335
  if (!hasPlaceholder)
1337
1336
  settings.url = appendQuery(settings.url,
@@ -1411,26 +1410,27 @@ window.$ === undefined && (window.$ = Zepto)
1411
1410
 
1412
1411
  // handle optional data/success arguments
1413
1412
  function parseArguments(url, data, success, dataType) {
1414
- var hasData = !$.isFunction(data)
1413
+ if ($.isFunction(data)) dataType = success, success = data, data = undefined
1414
+ if (!$.isFunction(success)) dataType = success, success = undefined
1415
1415
  return {
1416
- url: url,
1417
- data: hasData ? data : undefined,
1418
- success: !hasData ? data : $.isFunction(success) ? success : undefined,
1419
- dataType: hasData ? dataType || success : success
1416
+ url: url
1417
+ , data: data
1418
+ , success: success
1419
+ , dataType: dataType
1420
1420
  }
1421
1421
  }
1422
1422
 
1423
- $.get = function(url, data, success, dataType){
1423
+ $.get = function(/* url, data, success, dataType */){
1424
1424
  return $.ajax(parseArguments.apply(null, arguments))
1425
1425
  }
1426
1426
 
1427
- $.post = function(url, data, success, dataType){
1427
+ $.post = function(/* url, data, success, dataType */){
1428
1428
  var options = parseArguments.apply(null, arguments)
1429
1429
  options.type = 'POST'
1430
1430
  return $.ajax(options)
1431
1431
  }
1432
1432
 
1433
- $.getJSON = function(url, data, success){
1433
+ $.getJSON = function(/* url, data, success */){
1434
1434
  var options = parseArguments.apply(null, arguments)
1435
1435
  options.dataType = 'json'
1436
1436
  return $.ajax(options)
@@ -1547,4 +1547,4 @@ window.$ === undefined && (window.$ = Zepto)
1547
1547
  }
1548
1548
  }
1549
1549
  }
1550
- })(Zepto)
1550
+ })(Zepto)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zepto-for-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Vermaas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-13 00:00:00.000000000 Z
11
+ date: 2014-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  version: '0'
61
61
  requirements: []
62
62
  rubyforge_project:
63
- rubygems_version: 2.1.11
63
+ rubygems_version: 2.2.2
64
64
  signing_key:
65
65
  specification_version: 4
66
66
  summary: Zepto.js for the rails asset pipeline