tao_on_rails 0.4.2 → 0.4.3
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 +4 -4
- data/dist/tao.js +55 -8
- data/lib/assets/javascripts/tao/component.coffee +2 -2
- data/lib/assets/javascripts/tao/module.coffee +30 -5
- data/lib/tao_on_rails/rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d309da59b2b2ea5952c511f4702ba742820de4e1
|
4
|
+
data.tar.gz: e0bded6341243ff51aca7036ac9c80cdb6d00ccd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 372be4e55958f14e566bc3febaffcbfee13d59f5426d3bda7c924988f0d6dc413ece7e1b72505babd2cd05ced003c9e5bffb84266e1eb18b9894185ddc51e2a1
|
7
|
+
data.tar.gz: 6d714d2b9cce76a7523abe3c9d89048b6e32efe2c83e5a698d30681dfcd7efcd25c2dc77eda248465681ca8dde046cb1a47b1e9d449248597376e059818fc898
|
data/dist/tao.js
CHANGED
@@ -27746,15 +27746,62 @@ return jQuery;
|
|
27746
27746
|
return this;
|
27747
27747
|
};
|
27748
27748
|
|
27749
|
-
|
27750
|
-
|
27751
|
-
|
27752
|
-
|
27749
|
+
TaoModule.prototype._properties = {};
|
27750
|
+
|
27751
|
+
TaoModule.get = function(propertyName, getMethod) {
|
27752
|
+
return Object.defineProperty(this.prototype, propertyName, {
|
27753
|
+
get: getMethod,
|
27754
|
+
configurable: true
|
27755
|
+
});
|
27756
|
+
};
|
27753
27757
|
|
27754
|
-
TaoModule.
|
27755
|
-
return this.
|
27758
|
+
TaoModule.set = function(propertyName, setMethod) {
|
27759
|
+
return Object.defineProperty(this.prototype, propertyName, {
|
27760
|
+
set: setMethod,
|
27761
|
+
configurable: true
|
27762
|
+
});
|
27763
|
+
};
|
27764
|
+
|
27765
|
+
TaoModule.property = function() {
|
27766
|
+
var i, names, options;
|
27767
|
+
names = 2 <= arguments.length ? slice.call(arguments, 0, i = arguments.length - 1) : (i = 0, []), options = arguments[i++];
|
27768
|
+
if (options == null) {
|
27769
|
+
options = {};
|
27770
|
+
}
|
27771
|
+
if (typeof options !== 'object') {
|
27772
|
+
names.push(options);
|
27773
|
+
options = {};
|
27774
|
+
}
|
27775
|
+
return names.forEach((function(_this) {
|
27776
|
+
return function(name) {
|
27777
|
+
_this.get(name, function() {
|
27778
|
+
var ref;
|
27779
|
+
return (ref = this._properties[name]) != null ? ref : options["default"];
|
27780
|
+
});
|
27781
|
+
return _this.set(name, function(val) {
|
27782
|
+
var name1;
|
27783
|
+
if (this._properties[name] === val) {
|
27784
|
+
return;
|
27785
|
+
}
|
27786
|
+
this._properties[name] = val;
|
27787
|
+
return typeof this[name1 = "_" + name + "Changed"] === "function" ? this[name1]() : void 0;
|
27788
|
+
});
|
27789
|
+
};
|
27790
|
+
})(this));
|
27756
27791
|
};
|
27757
27792
|
|
27793
|
+
function TaoModule(options) {
|
27794
|
+
var key, val;
|
27795
|
+
if (options == null) {
|
27796
|
+
options = {};
|
27797
|
+
}
|
27798
|
+
for (key in options) {
|
27799
|
+
val = options[key];
|
27800
|
+
this[key] = val;
|
27801
|
+
}
|
27802
|
+
this._init();
|
27803
|
+
}
|
27804
|
+
|
27758
27805
|
TaoModule.prototype._init = function() {};
|
27759
27806
|
|
27760
27807
|
TaoModule.prototype.on = function() {
|
@@ -30969,9 +31016,9 @@ var Deferred = void 0;
|
|
30969
31016
|
return this._disconnect();
|
30970
31017
|
};
|
30971
31018
|
|
30972
|
-
_Class.prototype.attributeChangedCallback = function(attrName
|
31019
|
+
_Class.prototype.attributeChangedCallback = function(attrName) {
|
30973
31020
|
var name1;
|
30974
|
-
return typeof this[name1 = "_" + (_.camelCase(attrName)) + "Changed"] === "function" ? this[name1](
|
31021
|
+
return typeof this[name1 = "_" + (_.camelCase(attrName)) + "Changed"] === "function" ? this[name1]() : void 0;
|
30975
31022
|
};
|
30976
31023
|
|
30977
31024
|
_Class.prototype.on = function() {
|
@@ -85,8 +85,8 @@ TaoComponentBasedOn = (superClass = 'HTMLElement') ->
|
|
85
85
|
@connected = false
|
86
86
|
@_disconnect()
|
87
87
|
|
88
|
-
attributeChangedCallback: (attrName
|
89
|
-
@["_#{_.camelCase attrName}Changed"]?(
|
88
|
+
attributeChangedCallback: (attrName) ->
|
89
|
+
@["_#{_.camelCase attrName}Changed"]?()
|
90
90
|
|
91
91
|
on: (args...) ->
|
92
92
|
$(@).on args...
|
@@ -20,14 +20,39 @@ class TaoModule
|
|
20
20
|
obj.included?.call(@)
|
21
21
|
@
|
22
22
|
|
23
|
-
|
24
|
-
@
|
25
|
-
|
23
|
+
@get: (propertyName, getMethod) ->
|
24
|
+
Object.defineProperty @prototype, propertyName,
|
25
|
+
get: getMethod
|
26
|
+
configurable: true
|
27
|
+
|
28
|
+
@set: (propertyName, setMethod) ->
|
29
|
+
Object.defineProperty @prototype, propertyName,
|
30
|
+
set: setMethod
|
31
|
+
configurable: true
|
32
|
+
|
33
|
+
@property: (names..., options = {}) ->
|
34
|
+
unless typeof options == 'object'
|
35
|
+
names.push(options)
|
36
|
+
options = {}
|
26
37
|
|
27
|
-
|
28
|
-
|
38
|
+
names.forEach (name) =>
|
39
|
+
@get name, ->
|
40
|
+
@_properties[name] ? options.default
|
41
|
+
@set name, (val) ->
|
42
|
+
return if @_properties[name] == val
|
43
|
+
@_properties[name] = val
|
44
|
+
@["_#{name}Changed"]?()
|
45
|
+
|
46
|
+
constructor: (options = {}) ->
|
47
|
+
@_properties = {}
|
48
|
+
|
49
|
+
if typeof options == 'object'
|
50
|
+
@[key] = val for key, val of options
|
51
|
+
|
52
|
+
@_init()
|
29
53
|
|
30
54
|
_init: ->
|
55
|
+
# to be implemented
|
31
56
|
|
32
57
|
on: (args...) ->
|
33
58
|
$(@).on args...
|