batman-rails 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -69,11 +69,11 @@
69
69
  };
70
70
 
71
71
  RailsStorage.prototype.after('update', 'create', function(env, next) {
72
- var error, errorsArray, key, record, response, validationError, validationErrors, _i, _len, _ref;
72
+ var error, errorsArray, key, record, response, validationError, validationErrors, _i, _len;
73
73
  record = env.subject;
74
74
  error = env.error, response = env.response;
75
75
  if (error) {
76
- if (((_ref = error.request) != null ? _ref.get('status') : void 0) === 422) {
76
+ if (error instanceof Batman.StorageAdapter.UnprocessableRecordError) {
77
77
  try {
78
78
  validationErrors = this._errorsFrom422Response(response);
79
79
  } catch (extractionError) {
@@ -1,5 +1,3 @@
1
- (function() {
2
-
3
1
  /*!
4
2
  * Reqwest! A general purpose XHR connection manager
5
3
  * (c) Dustin Diaz 2011
@@ -374,13 +372,69 @@
374
372
  }
375
373
 
376
374
  return reqwest
377
- })
375
+ });
378
376
 
379
- ;
377
+ (function() {
378
+ var _ref, _ref1;
380
379
 
381
- var prefixes;
380
+ Batman.extend(Batman.DOM, {
381
+ querySelectorAll: (typeof window !== "undefined" && window !== null ? (_ref = window.document) != null ? _ref.querySelectorAll : void 0 : void 0) != null ? function(node, selector) {
382
+ return node.querySelectorAll(selector);
383
+ } : function() {
384
+ return Batman.developer.error("Please include either jQuery or a querySelectorAll polyfill, or set Batman.DOM.querySelectorAll to return an empty array.");
385
+ },
386
+ querySelector: (typeof window !== "undefined" && window !== null ? (_ref1 = window.document) != null ? _ref1.querySelector : void 0 : void 0) != null ? function(node, selector) {
387
+ return node.querySelector(selector);
388
+ } : function() {
389
+ return Batman.developer.error("Please include either jQuery or a querySelector polyfill, or set Batman.DOM.querySelector to an empty function.");
390
+ },
391
+ setInnerHTML: function(node, html) {
392
+ var child, childNodes, result, _i, _j, _len, _len1;
393
+ childNodes = (function() {
394
+ var _i, _len, _ref2, _results;
395
+ _ref2 = node.childNodes;
396
+ _results = [];
397
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
398
+ child = _ref2[_i];
399
+ _results.push(child);
400
+ }
401
+ return _results;
402
+ })();
403
+ for (_i = 0, _len = childNodes.length; _i < _len; _i++) {
404
+ child = childNodes[_i];
405
+ Batman.DOM.willRemoveNode(child);
406
+ }
407
+ result = node.innerHTML = html;
408
+ for (_j = 0, _len1 = childNodes.length; _j < _len1; _j++) {
409
+ child = childNodes[_j];
410
+ Batman.DOM.didRemoveNode(child);
411
+ }
412
+ return result;
413
+ },
414
+ removeNode: function(node) {
415
+ var _ref2;
416
+ Batman.DOM.willRemoveNode(node);
417
+ if ((_ref2 = node.parentNode) != null) {
418
+ _ref2.removeChild(node);
419
+ }
420
+ return Batman.DOM.didRemoveNode(node);
421
+ },
422
+ destroyNode: function(node) {
423
+ Batman.DOM.willDestroyNode(node);
424
+ Batman.DOM.removeNode(node);
425
+ return Batman.DOM.didDestroyNode(node);
426
+ },
427
+ appendChild: function(parent, child) {
428
+ Batman.DOM.willInsertNode(child);
429
+ parent.appendChild(child);
430
+ return Batman.DOM.didInsertNode(child);
431
+ }
432
+ });
382
433
 
383
- (typeof exports !== "undefined" && exports !== null ? exports : this).reqwest = typeof window !== "undefined" && window !== null ? window.reqwest : reqwest;
434
+ }).call(this);
435
+
436
+ (function() {
437
+ var prefixes;
384
438
 
385
439
  Batman.Request.prototype._parseResponseHeaders = function(xhr) {
386
440
  var headers;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: batman-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-23 00:00:00.000000000 Z
12
+ date: 2012-09-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
16
- requirement: &70281060430740 !ruby/object:Gem::Requirement
16
+ requirement: &70345619286860 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70281060430740
24
+ version_requirements: *70345619286860
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: thor
27
- requirement: &70281060430240 !ruby/object:Gem::Requirement
27
+ requirement: &70345619286360 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0.14'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70281060430240
35
+ version_requirements: *70345619286360
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
38
- requirement: &70281060429780 !ruby/object:Gem::Requirement
38
+ requirement: &70345619285900 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.0.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70281060429780
46
+ version_requirements: *70345619285900
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rails
49
- requirement: &70281060429280 !ruby/object:Gem::Requirement
49
+ requirement: &70345619285440 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 3.1.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70281060429280
57
+ version_requirements: *70345619285440
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: mocha
60
- requirement: &70281060428900 !ruby/object:Gem::Requirement
60
+ requirement: &70345619285060 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70281060428900
68
+ version_requirements: *70345619285060
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: sqlite3
71
- requirement: &70281060428440 !ruby/object:Gem::Requirement
71
+ requirement: &70345619284600 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70281060428440
79
+ version_requirements: *70345619284600
80
80
  description: Quickly get started with Batman.js in a Rails 3.1 app. Provides generators
81
81
  to get started and bundles in the latest version of Batman.js.
82
82
  email: