batman-rails 0.15.1 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/batman-rails/version.rb +2 -2
- data/lib/generators/batman/controller_generator.rb +4 -2
- data/lib/generators/batman/html_generator.rb +1 -16
- data/lib/generators/batman/view_generator.rb +19 -2
- data/lib/templates/batman/html/new.html +2 -0
- data/lib/templates/batman/view.coffee +6 -6
- data/vendor.sh +6 -0
- data/vendor/assets/javascripts/batman/batman.jquery.js +72 -65
- data/vendor/assets/javascripts/batman/batman.js +112 -37
- metadata +33 -43
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c6d9f5784fb624b33cfc0fd816b35413adde6361
|
4
|
+
data.tar.gz: 566e6f53b7a884ae120eea7027273027b7c71d57
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 581d3be867c30b4202bd8973ba425913b6105a0eb434517280910e4d1a384d264cd3f4c0cef5c759ee65d644b117e119d6e0655a5d6f11485280f8deb763b81d
|
7
|
+
data.tar.gz: 78a085fd37fb5024ac2af04676ecf62bd318a6c5657ced16bd66d8587c362faadd34fcadb27a7ab64fd21dd39a9662a4da842e6cadafde08c85aec6b4b63524f
|
data/lib/batman-rails/version.rb
CHANGED
@@ -12,12 +12,14 @@ module Batman
|
|
12
12
|
with_app_name do
|
13
13
|
template "batman/controller.coffee", "#{app_path}/controllers/#{file_name.downcase}_controller.js.coffee"
|
14
14
|
generate "batman:html #{plural_name} #{action_names} #{app_name_flag}"
|
15
|
-
generate "batman:view #{plural_name} #{app_name_flag}"
|
15
|
+
generate "batman:view #{plural_name} #{action_names} #{app_name_flag}"
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
def action_names
|
20
|
-
|
20
|
+
return if actions.length == 0
|
21
|
+
view_action_names = actions - %w[create update destroy]
|
22
|
+
view_action_names.join(' ')
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
@@ -8,21 +8,6 @@ module Batman
|
|
8
8
|
desc "This generator creates a the HTML files needed for a Batman.Controller"
|
9
9
|
argument :actions, :type => :array, :default => [], :banner => "action action"
|
10
10
|
|
11
|
-
|
12
|
-
RESERVED_JS_WORDS = %w{
|
13
|
-
break case catch continue debugger default delete do else finally for
|
14
|
-
function if in instanceof new return switch this throw try typeof var void while with
|
15
|
-
}
|
16
|
-
|
17
|
-
def validate_no_reserved_words
|
18
|
-
actions.each do |action|
|
19
|
-
if RESERVED_JS_WORDS.include? action
|
20
|
-
raise Thor::Error, "The name '#{action}' is reserved by javascript " <<
|
21
|
-
"Please choose an alternative action name and run this generator again."
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
11
|
def create_directory
|
27
12
|
with_app_name do
|
28
13
|
empty_directory "#{app_path}/html/#{plural_name.downcase}"
|
@@ -31,7 +16,7 @@ module Batman
|
|
31
16
|
|
32
17
|
def create_files
|
33
18
|
with_app_name do
|
34
|
-
|
19
|
+
actions.each do |file|
|
35
20
|
template "batman/html/#{file}.html", "#{app_path}/html/#{plural_name.downcase}/#{file}.html"
|
36
21
|
end
|
37
22
|
end
|
@@ -8,11 +8,28 @@ module Batman
|
|
8
8
|
desc "This generator creates a Batman.View"
|
9
9
|
argument :actions, :type => :array, :default => [], :banner => "action action"
|
10
10
|
|
11
|
-
def
|
11
|
+
def create_directory
|
12
|
+
return if actions.length == 0
|
13
|
+
|
14
|
+
with_app_name do
|
15
|
+
empty_directory "#{app_path}/views/#{plural_name.downcase}"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def create_files
|
12
20
|
with_app_name do
|
13
|
-
|
21
|
+
if actions.length == 0
|
22
|
+
@file = "#{file_name}_view".downcase
|
23
|
+
template "batman/view.coffee", "#{app_path}/views/#{@file}.js.coffee"
|
24
|
+
else
|
25
|
+
actions.each do |file|
|
26
|
+
@file = "#{plural_name}_#{file}_view".downcase
|
27
|
+
template "batman/view.coffee", "#{app_path}/views/#{plural_name.downcase}/#{@file}.js.coffee"
|
28
|
+
end
|
29
|
+
end
|
14
30
|
end
|
15
31
|
end
|
32
|
+
|
16
33
|
end
|
17
34
|
end
|
18
35
|
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
class <%= js_application_name %>.<%=
|
2
|
-
|
3
|
-
|
4
|
-
class <%= js_application_name %>.<%= file_name.camelize %><%= action.camelize %>View extends <%= js_application_name %>.<%= file_name.camelize %>View
|
5
|
-
|
6
|
-
<% end -%>
|
1
|
+
class <%= js_application_name %>.<%= @file.camelize %> extends Batman.View
|
2
|
+
viewDidAppear: ->
|
3
|
+
# Your node is in the DOM and ready to accept instructions (aka jQuery)
|
7
4
|
|
5
|
+
# buttonWasClicked: (node, event, view) ->
|
6
|
+
# You can put all of your event handlers in this view file. You can access
|
7
|
+
# data by using `view.lookupKeypath('someData')` or `@controller`.
|
data/vendor.sh
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
cd ~/Code/batman/batman
|
3
|
+
cake build
|
4
|
+
|
5
|
+
cp ~/Code/batman/batman/lib/batman.{js,jquery.js} ~/Code/batman/batman-rails/vendor/assets/javascripts/batman/
|
6
|
+
cp ~/Code/batman/batman/lib/extras/batman.rails.js ~/Code/batman/batman-rails/vendor/assets/javascripts/batman/
|
@@ -13,6 +13,13 @@
|
|
13
13
|
Batman.DOM.cleanupNode(node);
|
14
14
|
jQuery(node).remove();
|
15
15
|
},
|
16
|
+
containsNode: function(parent, child) {
|
17
|
+
if (!child) {
|
18
|
+
child = parent;
|
19
|
+
parent = document.body;
|
20
|
+
}
|
21
|
+
return $.contains(parent, child);
|
22
|
+
},
|
16
23
|
textContent: function(node) {
|
17
24
|
return jQuery(node).text();
|
18
25
|
},
|
@@ -30,74 +37,74 @@
|
|
30
37
|
}
|
31
38
|
});
|
32
39
|
|
33
|
-
Batman.Request.prototype
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
40
|
+
Batman.extend(Batman.Request.prototype, {
|
41
|
+
_parseResponseHeaders: function(xhr) {
|
42
|
+
var headers;
|
43
|
+
return headers = xhr.getAllResponseHeaders().split('\n').reduce(function(acc, header) {
|
44
|
+
var key, matches, value;
|
45
|
+
if (matches = header.match(/([^:]*):\s*(.*)/)) {
|
46
|
+
key = matches[1];
|
47
|
+
value = matches[2];
|
48
|
+
acc[key] = value;
|
49
|
+
}
|
50
|
+
return acc;
|
51
|
+
}, {});
|
52
|
+
},
|
53
|
+
_prepareOptions: function(data) {
|
54
|
+
var options, _ref,
|
55
|
+
_this = this;
|
56
|
+
options = {
|
57
|
+
url: this.get('url'),
|
58
|
+
type: this.get('method'),
|
59
|
+
dataType: this.get('type'),
|
60
|
+
data: data || this.get('data'),
|
61
|
+
username: this.get('username'),
|
62
|
+
password: this.get('password'),
|
63
|
+
headers: this.get('headers'),
|
64
|
+
beforeSend: function() {
|
65
|
+
return _this.fire('loading');
|
66
|
+
},
|
67
|
+
success: function(response, textStatus, xhr) {
|
68
|
+
_this.mixin({
|
69
|
+
xhr: xhr,
|
70
|
+
status: xhr.status,
|
71
|
+
response: response,
|
72
|
+
responseHeaders: _this._parseResponseHeaders(xhr)
|
73
|
+
});
|
74
|
+
return _this.fire('success', response);
|
75
|
+
},
|
76
|
+
error: function(xhr, status, error) {
|
77
|
+
_this.mixin({
|
78
|
+
xhr: xhr,
|
79
|
+
status: xhr.status,
|
80
|
+
response: xhr.responseText,
|
81
|
+
responseHeaders: _this._parseResponseHeaders(xhr)
|
82
|
+
});
|
83
|
+
xhr.request = _this;
|
84
|
+
return _this.fire('error', xhr);
|
85
|
+
},
|
86
|
+
complete: function() {
|
87
|
+
return _this.fire('loaded');
|
88
|
+
}
|
89
|
+
};
|
90
|
+
if ((_ref = this.get('method')) === 'PUT' || _ref === 'POST') {
|
91
|
+
if (!this.hasFileUploads()) {
|
92
|
+
options.contentType = this.get('contentType');
|
93
|
+
if (typeof options.data === 'object') {
|
94
|
+
options.processData = false;
|
95
|
+
options.data = Batman.URI.queryFromParams(options.data);
|
96
|
+
}
|
97
|
+
} else {
|
98
|
+
options.contentType = false;
|
87
99
|
options.processData = false;
|
88
|
-
options.data =
|
100
|
+
options.data = this.constructor.objectToFormData(options.data);
|
89
101
|
}
|
90
|
-
} else {
|
91
|
-
options.contentType = false;
|
92
|
-
options.processData = false;
|
93
|
-
options.data = this.constructor.objectToFormData(options.data);
|
94
102
|
}
|
103
|
+
return options;
|
104
|
+
},
|
105
|
+
send: function(data) {
|
106
|
+
return jQuery.ajax(this._prepareOptions(data));
|
95
107
|
}
|
96
|
-
|
97
|
-
};
|
98
|
-
|
99
|
-
Batman.Request.prototype.send = function(data) {
|
100
|
-
return jQuery.ajax(this._prepareOptions(data));
|
101
|
-
};
|
108
|
+
});
|
102
109
|
|
103
110
|
}).call(this);
|
@@ -16,9 +16,10 @@
|
|
16
16
|
|
17
17
|
Batman.config = {
|
18
18
|
pathToApp: '/',
|
19
|
+
usePushState: true,
|
19
20
|
pathToHTML: 'html',
|
20
21
|
fetchRemoteHTML: true,
|
21
|
-
|
22
|
+
cacheViews: false,
|
22
23
|
minificationErrors: true,
|
23
24
|
protectFromCSRF: false
|
24
25
|
};
|
@@ -1269,8 +1270,6 @@
|
|
1269
1270
|
}).call(this);
|
1270
1271
|
|
1271
1272
|
(function() {
|
1272
|
-
var __slice = [].slice;
|
1273
|
-
|
1274
1273
|
Batman.Enumerable = {
|
1275
1274
|
isEnumerable: true,
|
1276
1275
|
map: function(f, ctx) {
|
@@ -1288,7 +1287,7 @@
|
|
1288
1287
|
var result;
|
1289
1288
|
result = [];
|
1290
1289
|
this.forEach(function(item) {
|
1291
|
-
return result.push(
|
1290
|
+
return result.push(Batman.get(item, key));
|
1292
1291
|
});
|
1293
1292
|
return result;
|
1294
1293
|
},
|
@@ -1315,38 +1314,36 @@
|
|
1315
1314
|
return result;
|
1316
1315
|
},
|
1317
1316
|
reduce: function(f, accumulator) {
|
1318
|
-
var
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
} else {
|
1324
|
-
initialValuePassed = false;
|
1325
|
-
}
|
1326
|
-
this.forEach(function() {
|
1317
|
+
var index, initialValuePassed,
|
1318
|
+
_this = this;
|
1319
|
+
index = 0;
|
1320
|
+
initialValuePassed = accumulator != null;
|
1321
|
+
this.forEach(function(element, value) {
|
1327
1322
|
if (!initialValuePassed) {
|
1328
|
-
accumulator =
|
1323
|
+
accumulator = element;
|
1329
1324
|
initialValuePassed = true;
|
1330
1325
|
return;
|
1331
1326
|
}
|
1332
|
-
|
1327
|
+
accumulator = f(accumulator, element, value, index, self);
|
1328
|
+
return index++;
|
1333
1329
|
});
|
1334
1330
|
return accumulator;
|
1335
1331
|
},
|
1336
1332
|
filter: function(f) {
|
1337
|
-
var result, wrap
|
1333
|
+
var result, wrap,
|
1334
|
+
_this = this;
|
1338
1335
|
result = new this.constructor;
|
1339
1336
|
if (result.add) {
|
1340
|
-
wrap = function(result, element) {
|
1341
|
-
if (f(element)) {
|
1337
|
+
wrap = function(result, element, value) {
|
1338
|
+
if (f(element, value, _this)) {
|
1342
1339
|
result.add(element);
|
1343
1340
|
}
|
1344
1341
|
return result;
|
1345
1342
|
};
|
1346
1343
|
} else if (result.set) {
|
1347
|
-
wrap = function(result,
|
1348
|
-
if (f(
|
1349
|
-
result.set(
|
1344
|
+
wrap = function(result, element, value) {
|
1345
|
+
if (f(element, value, _this)) {
|
1346
|
+
result.set(element, value);
|
1350
1347
|
}
|
1351
1348
|
return result;
|
1352
1349
|
};
|
@@ -1354,8 +1351,8 @@
|
|
1354
1351
|
if (!result.push) {
|
1355
1352
|
result = [];
|
1356
1353
|
}
|
1357
|
-
wrap = function(result, element) {
|
1358
|
-
if (f(element)) {
|
1354
|
+
wrap = function(result, element, value) {
|
1355
|
+
if (f(element, value, _this)) {
|
1359
1356
|
result.push(element);
|
1360
1357
|
}
|
1361
1358
|
return result;
|
@@ -1363,6 +1360,23 @@
|
|
1363
1360
|
}
|
1364
1361
|
return this.reduce(wrap, result);
|
1365
1362
|
},
|
1363
|
+
count: function(f, ctx) {
|
1364
|
+
var count,
|
1365
|
+
_this = this;
|
1366
|
+
if (ctx == null) {
|
1367
|
+
ctx = Batman.container;
|
1368
|
+
}
|
1369
|
+
if (!f) {
|
1370
|
+
return this.length;
|
1371
|
+
}
|
1372
|
+
count = 0;
|
1373
|
+
this.forEach(function(element, value) {
|
1374
|
+
if (f.call(ctx, element, value, _this)) {
|
1375
|
+
return count++;
|
1376
|
+
}
|
1377
|
+
});
|
1378
|
+
return count;
|
1379
|
+
},
|
1366
1380
|
inGroupsOf: function(groupSize) {
|
1367
1381
|
var current, i, result;
|
1368
1382
|
result = [];
|
@@ -2526,6 +2540,8 @@
|
|
2526
2540
|
}).call(this);
|
2527
2541
|
|
2528
2542
|
(function() {
|
2543
|
+
var methodName, platformMethods, _i, _len;
|
2544
|
+
|
2529
2545
|
Batman.DOM = {
|
2530
2546
|
textInputTypes: ['text', 'search', 'tel', 'url', 'email', 'password'],
|
2531
2547
|
scrollIntoView: function(elementID) {
|
@@ -2655,6 +2671,15 @@
|
|
2655
2671
|
}
|
2656
2672
|
};
|
2657
2673
|
|
2674
|
+
platformMethods = ['querySelector', 'querySelectorAll', 'setInnerHTML', 'containsNode', 'destroyNode', 'textContent'];
|
2675
|
+
|
2676
|
+
for (_i = 0, _len = platformMethods.length; _i < _len; _i++) {
|
2677
|
+
methodName = platformMethods[_i];
|
2678
|
+
Batman.DOM[methodName] = function() {
|
2679
|
+
return Batman.developer.error("Please include a platform adapter to define " + methodName + ".");
|
2680
|
+
};
|
2681
|
+
}
|
2682
|
+
|
2658
2683
|
}).call(this);
|
2659
2684
|
|
2660
2685
|
(function() {
|
@@ -2802,17 +2827,22 @@
|
|
2802
2827
|
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
2803
2828
|
|
2804
2829
|
Batman.DOM.events = {
|
2805
|
-
click: function(node, callback, view, eventName) {
|
2830
|
+
click: function(node, callback, view, eventName, preventDefault) {
|
2806
2831
|
if (eventName == null) {
|
2807
2832
|
eventName = 'click';
|
2808
2833
|
}
|
2834
|
+
if (preventDefault == null) {
|
2835
|
+
preventDefault = true;
|
2836
|
+
}
|
2809
2837
|
Batman.DOM.addEventListener(node, eventName, function() {
|
2810
2838
|
var args, event;
|
2811
2839
|
event = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
|
2812
2840
|
if (event.metaKey || event.ctrlKey || event.button === 1) {
|
2813
2841
|
return;
|
2814
2842
|
}
|
2815
|
-
|
2843
|
+
if (preventDefault) {
|
2844
|
+
Batman.DOM.preventDefault(event);
|
2845
|
+
}
|
2816
2846
|
if (!Batman.DOM.eventIsAllowed(eventName, event)) {
|
2817
2847
|
return;
|
2818
2848
|
}
|
@@ -2983,6 +3013,9 @@
|
|
2983
3013
|
},
|
2984
3014
|
formfor: function(definition) {
|
2985
3015
|
return new Batman.DOM.FormBinding(definition);
|
3016
|
+
},
|
3017
|
+
style: function(definition) {
|
3018
|
+
return new Batman.DOM.StyleAttributeBinding(definition);
|
2986
3019
|
}
|
2987
3020
|
};
|
2988
3021
|
|
@@ -5025,12 +5058,13 @@
|
|
5025
5058
|
|
5026
5059
|
RenderCache.prototype.viewForOptions = function(options) {
|
5027
5060
|
var _this = this;
|
5028
|
-
if (options.cache
|
5061
|
+
if (Batman.config.cacheViews || options.cache || options.viewClass.prototype.cache) {
|
5062
|
+
return this.getOrSet(options, function() {
|
5063
|
+
return _this._newViewFromOptions(Batman.extend({}, options));
|
5064
|
+
});
|
5065
|
+
} else {
|
5029
5066
|
return this._newViewFromOptions(options);
|
5030
5067
|
}
|
5031
|
-
return this.getOrSet(options, function() {
|
5032
|
-
return _this._newViewFromOptions(Batman.extend({}, options));
|
5033
|
-
});
|
5034
5068
|
};
|
5035
5069
|
|
5036
5070
|
RenderCache.prototype._newViewFromOptions = function(options) {
|
@@ -10732,7 +10766,7 @@
|
|
10732
10766
|
if (!this.get('node')) {
|
10733
10767
|
return;
|
10734
10768
|
}
|
10735
|
-
isInDOM =
|
10769
|
+
isInDOM = Batman.DOM.containsNode(parentNode);
|
10736
10770
|
if (isInDOM) {
|
10737
10771
|
this.propagateToSubviews('viewWillAppear');
|
10738
10772
|
}
|
@@ -10752,7 +10786,7 @@
|
|
10752
10786
|
View.prototype.removeFromParentNode = function() {
|
10753
10787
|
var isInDOM, node, _ref, _ref1, _ref2;
|
10754
10788
|
node = this.get('node');
|
10755
|
-
isInDOM = (_ref = this.wasInDOM) != null ? _ref :
|
10789
|
+
isInDOM = (_ref = this.wasInDOM) != null ? _ref : Batman.DOM.containsNode(node);
|
10756
10790
|
if (isInDOM) {
|
10757
10791
|
this.propagateToSubviews('viewWillDisappear');
|
10758
10792
|
}
|
@@ -10797,7 +10831,8 @@
|
|
10797
10831
|
|
10798
10832
|
View.accessor('html', {
|
10799
10833
|
get: function() {
|
10800
|
-
var source
|
10834
|
+
var handler, property, source,
|
10835
|
+
_this = this;
|
10801
10836
|
if (this.html != null) {
|
10802
10837
|
return this.html;
|
10803
10838
|
}
|
@@ -10805,7 +10840,18 @@
|
|
10805
10840
|
return;
|
10806
10841
|
}
|
10807
10842
|
source = Batman.Navigator.normalizePath(source);
|
10808
|
-
|
10843
|
+
this.html = this.constructor.store.get(source);
|
10844
|
+
if (this.html == null) {
|
10845
|
+
property = this.property('html');
|
10846
|
+
handler = function(html) {
|
10847
|
+
if (html != null) {
|
10848
|
+
_this.set('html', html);
|
10849
|
+
}
|
10850
|
+
return property.removeHandler(handler);
|
10851
|
+
};
|
10852
|
+
property.addHandler(handler);
|
10853
|
+
}
|
10854
|
+
return this.html;
|
10809
10855
|
},
|
10810
10856
|
set: function(key, html) {
|
10811
10857
|
this.destroyBindings();
|
@@ -10901,7 +10947,7 @@
|
|
10901
10947
|
}
|
10902
10948
|
this.fire('destroy');
|
10903
10949
|
if (this.node) {
|
10904
|
-
this.wasInDOM =
|
10950
|
+
this.wasInDOM = Batman.DOM.containsNode(this.node);
|
10905
10951
|
Batman.DOM.destroyNode(this.node);
|
10906
10952
|
}
|
10907
10953
|
this.forget();
|
@@ -11045,7 +11091,7 @@
|
|
11045
11091
|
|
11046
11092
|
__extends(AbstractBinding, _super);
|
11047
11093
|
|
11048
|
-
keypath_rx = /(^|,)\s*(?:(true|false)|("[^"]*")|(\{[^\}]*\})|(([0-9]+[a-zA-Z\_\-]|[a-zA-Z])[\w\-\.\?\!\+]*))\s*(?=$|,)/g;
|
11094
|
+
keypath_rx = /(^|,)\s*(?:(true|false)|("[^"]*")|(\{[^\}]*\})|(([0-9\_\-]+[a-zA-Z\_\-]|[a-zA-Z])[\w\-\.\?\!\+]*))\s*(?=$|,)/g;
|
11049
11095
|
|
11050
11096
|
get_dot_rx = /(?:\]\.)(.+?)(?=[\[\.]|\s*\||$)/;
|
11051
11097
|
|
@@ -12583,6 +12629,12 @@
|
|
12583
12629
|
};
|
12584
12630
|
|
12585
12631
|
IteratorView.prototype._beginAppendItems = function() {
|
12632
|
+
var viewClassName;
|
12633
|
+
if (!this.iterationViewClass && (viewClassName = this.prototypeNode.getAttribute('data-view'))) {
|
12634
|
+
this.iterationViewClass = this.lookupKeypath(viewClassName);
|
12635
|
+
this.prototypeNode.removeAttribute('data-view');
|
12636
|
+
}
|
12637
|
+
this.iterationViewClass || (this.iterationViewClass = Batman.IterationView);
|
12586
12638
|
this.fragment = document.createDocumentFragment();
|
12587
12639
|
this.appendedViews = [];
|
12588
12640
|
return this.get('node');
|
@@ -12590,7 +12642,7 @@
|
|
12590
12642
|
|
12591
12643
|
IteratorView.prototype._insertItem = function(item, targetIndex) {
|
12592
12644
|
var iterationView;
|
12593
|
-
iterationView = new
|
12645
|
+
iterationView = new this.iterationViewClass({
|
12594
12646
|
node: this.prototypeNode.cloneNode(true),
|
12595
12647
|
parentNode: this.fragment
|
12596
12648
|
});
|
@@ -12607,7 +12659,7 @@
|
|
12607
12659
|
|
12608
12660
|
IteratorView.prototype._finishAppendItems = function() {
|
12609
12661
|
var index, isInDOM, sibling, subview, _i, _j, _k, _len, _len1, _ref1, _ref2, _ref3, _ref4;
|
12610
|
-
isInDOM =
|
12662
|
+
isInDOM = Batman.DOM.containsNode(this.node);
|
12611
12663
|
if (isInDOM) {
|
12612
12664
|
_ref1 = this.appendedViews;
|
12613
12665
|
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
@@ -12762,6 +12814,29 @@
|
|
12762
12814
|
|
12763
12815
|
}).call(this);
|
12764
12816
|
|
12817
|
+
(function() {
|
12818
|
+
var _ref,
|
12819
|
+
__hasProp = {}.hasOwnProperty,
|
12820
|
+
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
12821
|
+
|
12822
|
+
Batman.DOM.StyleAttributeBinding = (function(_super) {
|
12823
|
+
__extends(StyleAttributeBinding, _super);
|
12824
|
+
|
12825
|
+
function StyleAttributeBinding() {
|
12826
|
+
_ref = StyleAttributeBinding.__super__.constructor.apply(this, arguments);
|
12827
|
+
return _ref;
|
12828
|
+
}
|
12829
|
+
|
12830
|
+
StyleAttributeBinding.prototype.dataChange = function(value) {
|
12831
|
+
return this.node.style[Batman.Filters.camelize(this.attributeName, true)] = value;
|
12832
|
+
};
|
12833
|
+
|
12834
|
+
return StyleAttributeBinding;
|
12835
|
+
|
12836
|
+
})(Batman.DOM.NodeAttributeBinding);
|
12837
|
+
|
12838
|
+
}).call(this);
|
12839
|
+
|
12765
12840
|
(function() {
|
12766
12841
|
var isEmptyDataObject;
|
12767
12842
|
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: batman-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 0.15.1
|
4
|
+
version: 0.15.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Nick Small
|
@@ -15,85 +14,75 @@ cert_chain: []
|
|
15
14
|
date: 2013-08-18 00:00:00.000000000 Z
|
16
15
|
dependencies:
|
17
16
|
- !ruby/object:Gem::Dependency
|
18
|
-
|
17
|
+
name: railties
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
19
|
requirements:
|
20
|
-
- -
|
20
|
+
- - '>='
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '3.2'
|
23
|
-
none: false
|
24
|
-
name: railties
|
25
23
|
type: :runtime
|
26
24
|
prerelease: false
|
27
|
-
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
28
26
|
requirements:
|
29
|
-
- -
|
27
|
+
- - '>='
|
30
28
|
- !ruby/object:Gem::Version
|
31
29
|
version: '3.2'
|
32
|
-
none: false
|
33
30
|
- !ruby/object:Gem::Dependency
|
34
|
-
|
31
|
+
name: bundler
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
35
33
|
requirements:
|
36
|
-
- -
|
34
|
+
- - '>='
|
37
35
|
- !ruby/object:Gem::Version
|
38
36
|
version: '0'
|
39
|
-
none: false
|
40
|
-
name: bundler
|
41
37
|
type: :development
|
42
38
|
prerelease: false
|
43
|
-
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
40
|
requirements:
|
45
|
-
- -
|
41
|
+
- - '>='
|
46
42
|
- !ruby/object:Gem::Version
|
47
43
|
version: '0'
|
48
|
-
none: false
|
49
44
|
- !ruby/object:Gem::Dependency
|
50
|
-
|
45
|
+
name: rails
|
46
|
+
requirement: !ruby/object:Gem::Requirement
|
51
47
|
requirements:
|
52
|
-
- -
|
48
|
+
- - '>='
|
53
49
|
- !ruby/object:Gem::Version
|
54
50
|
version: '0'
|
55
|
-
none: false
|
56
|
-
name: rails
|
57
51
|
type: :development
|
58
52
|
prerelease: false
|
59
|
-
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
60
54
|
requirements:
|
61
|
-
- -
|
55
|
+
- - '>='
|
62
56
|
- !ruby/object:Gem::Version
|
63
57
|
version: '0'
|
64
|
-
none: false
|
65
58
|
- !ruby/object:Gem::Dependency
|
66
|
-
|
59
|
+
name: mocha
|
60
|
+
requirement: !ruby/object:Gem::Requirement
|
67
61
|
requirements:
|
68
|
-
- -
|
62
|
+
- - '>='
|
69
63
|
- !ruby/object:Gem::Version
|
70
64
|
version: '0'
|
71
|
-
none: false
|
72
|
-
name: mocha
|
73
65
|
type: :development
|
74
66
|
prerelease: false
|
75
|
-
|
67
|
+
version_requirements: !ruby/object:Gem::Requirement
|
76
68
|
requirements:
|
77
|
-
- -
|
69
|
+
- - '>='
|
78
70
|
- !ruby/object:Gem::Version
|
79
71
|
version: '0'
|
80
|
-
none: false
|
81
72
|
- !ruby/object:Gem::Dependency
|
82
|
-
|
73
|
+
name: sqlite3
|
74
|
+
requirement: !ruby/object:Gem::Requirement
|
83
75
|
requirements:
|
84
|
-
- -
|
76
|
+
- - '>='
|
85
77
|
- !ruby/object:Gem::Version
|
86
78
|
version: '0'
|
87
|
-
none: false
|
88
|
-
name: sqlite3
|
89
79
|
type: :development
|
90
80
|
prerelease: false
|
91
|
-
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
82
|
requirements:
|
93
|
-
- -
|
83
|
+
- - '>='
|
94
84
|
- !ruby/object:Gem::Version
|
95
85
|
version: '0'
|
96
|
-
none: false
|
97
86
|
description: Quickly get started with batman.js in a Rails app. Provides generators
|
98
87
|
to get started and bundles in the latest version of batman.js.
|
99
88
|
email:
|
@@ -123,6 +112,7 @@ files:
|
|
123
112
|
- lib/templates/batman/html/edit.html
|
124
113
|
- lib/templates/batman/html/index.html
|
125
114
|
- lib/templates/batman/html/main_index.html
|
115
|
+
- lib/templates/batman/html/new.html
|
126
116
|
- lib/templates/batman/html/show.html
|
127
117
|
- lib/templates/batman/main_controller.coffee
|
128
118
|
- lib/templates/batman/model.coffee
|
@@ -185,6 +175,7 @@ files:
|
|
185
175
|
- test/sample/vendor/plugins/.gitkeep
|
186
176
|
- test/test_helper.rb
|
187
177
|
- test/view_generator_test.rb
|
178
|
+
- vendor.sh
|
188
179
|
- vendor/assets/images/batman/bullet.png
|
189
180
|
- vendor/assets/images/batman/content-bg-fade.png
|
190
181
|
- vendor/assets/images/batman/content-bg.png
|
@@ -197,27 +188,26 @@ files:
|
|
197
188
|
- vendor/assets/javascripts/batman/es5-shim.js
|
198
189
|
homepage: https://github.com/Shopify/batman-rails
|
199
190
|
licenses: []
|
191
|
+
metadata: {}
|
200
192
|
post_install_message:
|
201
193
|
rdoc_options: []
|
202
194
|
require_paths:
|
203
195
|
- lib
|
204
196
|
required_ruby_version: !ruby/object:Gem::Requirement
|
205
197
|
requirements:
|
206
|
-
- -
|
198
|
+
- - '>='
|
207
199
|
- !ruby/object:Gem::Version
|
208
200
|
version: '0'
|
209
|
-
none: false
|
210
201
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
211
202
|
requirements:
|
212
|
-
- -
|
203
|
+
- - '>='
|
213
204
|
- !ruby/object:Gem::Version
|
214
205
|
version: '0'
|
215
|
-
none: false
|
216
206
|
requirements: []
|
217
207
|
rubyforge_project:
|
218
|
-
rubygems_version:
|
208
|
+
rubygems_version: 2.0.7
|
219
209
|
signing_key:
|
220
|
-
specification_version:
|
210
|
+
specification_version: 4
|
221
211
|
summary: Use batman.js with Rails
|
222
212
|
test_files:
|
223
213
|
- test/app_generator_test.rb
|