transistor 0.1.10 → 0.1.11
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1641a3740232c97ce8ac3901f5306f58282646d
|
4
|
+
data.tar.gz: c0f4cbd489f54a6b2f6718d28a292533a6fd70c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81585516570999a3c5b3f2b31b6f7e881e064f30d955ba1a1037b19a43562439f5f6d5fb0d789c5ee7c578e9d787098ab689cb2fe19bef6131de6a61c625cf63
|
7
|
+
data.tar.gz: bdf0f286f2d7209f262e1ff279e06ce91b4bea74337a90bf4de6ce70c74fb157e9cddaf4a0a10457b6a41dcf5c454c78e3b8cf158095d5327d69b711ebece21d
|
data/Gemfile.lock
CHANGED
@@ -1 +1 @@
|
|
1
|
-
if(window.Transistor===undefined){window.Transistor={}}(function(
|
1
|
+
if(window.Transistor===undefined){window.Transistor={}}(function(k){var q=(function(){return function(h){var l,n,g,o,e,r,b,f,i,p;l=h.backbone;n=h.underscore;g=h.channel;o=h.radio;e=h.control;r=(function(){return{}}());b=new l.Collection();b.on('change',function(a,c){var d=n.clone(a.attributes),j=a.id;if(c.from_radiotower===undefined){if(!e){throw"BackboneCollection is not mutable by user. The model with id "+a.id+" has been changed";}else{delete d.id;e.update(g,j,d)}}});f={add:b.add,remove:b.remove,reset:b.reset,set:b.set};i={add:function(a){e.insert(g,a)},remove:function(a){e.remove(g,a.id)},set:function(a){e.set(g,a)}};i.reset=i.set;(function(d){var j=true,m=function(c){d[c]=(function(a){return function(){if(j){if(!e){throw"BackboneCollection is not mutable by user.";}else{i[a].apply(i,arguments)}}else{return f[a].apply(b,arguments)}}}(c))};f.asPublic=function(a){j=false;a();j=true};m('add');m('remove');m('reset');m('set')}(b));p=k.Binder({set:function(d){f.asPublic(function(){var a=[],c;for(c=0;c<d.length;c+=1){a.push(new l.Model(d[c]))}b.set(a)})},insert:function(a){f.asPublic(function(){b.add(new l.Model(a))})},update:function(c,d){f.asPublic(function(){var a=b.get(c);a.clear({silent:true});a.set(d,{from_radiotower:true})})},remove:function(c){f.asPublic(function(){var a=b.get(c);b.remove(a)})}});o.tune(g,p);return b}}());if(k.Backbone===undefined){k.Backbone={}}k.Backbone.Collection=q}(window.Transistor));
|
@@ -22,15 +22,17 @@ if (window.Transistor === undefined) {
|
|
22
22
|
}());
|
23
23
|
|
24
24
|
backbone_collection = new Backbone.Collection();
|
25
|
-
backbone_collection.on('change', function (model) {
|
25
|
+
backbone_collection.on('change', function (model, options) {
|
26
26
|
var entry = U.clone(model.attributes),
|
27
27
|
id = model.id;
|
28
28
|
|
29
|
-
if (
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
if (options.from_radiotower === undefined) {
|
30
|
+
if (!control) {
|
31
|
+
throw "BackboneCollection is not mutable by user. The model with id "+model.id+" has been changed";
|
32
|
+
} else {
|
33
|
+
delete entry.id;
|
34
|
+
control.update(channel, id, entry);
|
35
|
+
}
|
34
36
|
}
|
35
37
|
});
|
36
38
|
|
@@ -99,7 +101,7 @@ if (window.Transistor === undefined) {
|
|
99
101
|
collection_interface.asPublic(function () {
|
100
102
|
var model = backbone_collection.get(id);
|
101
103
|
model.clear({silent: true});
|
102
|
-
model.set(entry, {
|
104
|
+
model.set(entry, {from_radiotower: true});
|
103
105
|
});
|
104
106
|
},
|
105
107
|
remove: function (id) {
|
@@ -22,15 +22,17 @@ if (window.Transistor === undefined) {
|
|
22
22
|
}());
|
23
23
|
|
24
24
|
backbone_collection = new Backbone.Collection();
|
25
|
-
backbone_collection.on('change', function (model) {
|
25
|
+
backbone_collection.on('change', function (model, options) {
|
26
26
|
var entry = U.clone(model.attributes),
|
27
27
|
id = model.id;
|
28
28
|
|
29
|
-
if (
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
if (options.from_radiotower === undefined) {
|
30
|
+
if (!control) {
|
31
|
+
throw "BackboneCollection is not mutable by user. The model with id "+model.id+" has been changed";
|
32
|
+
} else {
|
33
|
+
delete entry.id;
|
34
|
+
control.update(channel, id, entry);
|
35
|
+
}
|
34
36
|
}
|
35
37
|
});
|
36
38
|
|
@@ -99,7 +101,7 @@ if (window.Transistor === undefined) {
|
|
99
101
|
collection_interface.asPublic(function () {
|
100
102
|
var model = backbone_collection.get(id);
|
101
103
|
model.clear({silent: true});
|
102
|
-
model.set(entry, {
|
104
|
+
model.set(entry, {from_radiotower: true});
|
103
105
|
});
|
104
106
|
},
|
105
107
|
remove: function (id) {
|
@@ -22,15 +22,17 @@ if (window.Transistor === undefined) {
|
|
22
22
|
}());
|
23
23
|
|
24
24
|
backbone_collection = new Backbone.Collection();
|
25
|
-
backbone_collection.on('change', function (model) {
|
25
|
+
backbone_collection.on('change', function (model, options) {
|
26
26
|
var entry = U.clone(model.attributes),
|
27
27
|
id = model.id;
|
28
28
|
|
29
|
-
if (
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
if (options.from_radiotower === undefined) {
|
30
|
+
if (!control) {
|
31
|
+
throw "BackboneCollection is not mutable by user. The model with id "+model.id+" has been changed";
|
32
|
+
} else {
|
33
|
+
delete entry.id;
|
34
|
+
control.update(channel, id, entry);
|
35
|
+
}
|
34
36
|
}
|
35
37
|
});
|
36
38
|
|
@@ -99,7 +101,7 @@ if (window.Transistor === undefined) {
|
|
99
101
|
collection_interface.asPublic(function () {
|
100
102
|
var model = backbone_collection.get(id);
|
101
103
|
model.clear({silent: true});
|
102
|
-
model.set(entry, {
|
104
|
+
model.set(entry, {from_radiotower: true});
|
103
105
|
});
|
104
106
|
},
|
105
107
|
remove: function (id) {
|
data/transistor.gemspec
CHANGED