tao_on_rails 0.4.4 → 0.5.0
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 +24 -22
- data/lib/assets/javascripts/tao/application.coffee +3 -3
- data/lib/assets/javascripts/tao/component.coffee +9 -9
- data/lib/assets/javascripts/tao/module.coffee +10 -10
- data/lib/assets/javascripts/tao/page.coffee +1 -1
- data/lib/tao_on_rails/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97072384321842b0296230ccebbb6ac422930d74
|
4
|
+
data.tar.gz: f5bff7b878000d5fb9254e14ccc1d4b68c6ffa94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ced456663bc4e5af9756daaa06abb0f4b9379d91ac3f88b3711c54e1b78f8ec34d7b75339f6c94f443fadee900c16ca0a0981fb0449ae54e1976fd1fe424253e
|
7
|
+
data.tar.gz: 4aa051dcf5cc7855f5802c6998cb4b3ff0f3f720b27fa180a7520ea30e06d02480730074f6048d33255b970234554f50acce56e6bcf63ee001b6c664acc827f9
|
data/dist/tao.js
CHANGED
@@ -27746,21 +27746,21 @@ return jQuery;
|
|
27746
27746
|
return this;
|
27747
27747
|
};
|
27748
27748
|
|
27749
|
-
TaoModule.get = function(
|
27750
|
-
return Object.defineProperty(this.prototype,
|
27749
|
+
TaoModule.get = function(attributeName, getMethod) {
|
27750
|
+
return Object.defineProperty(this.prototype, attributeName, {
|
27751
27751
|
get: getMethod,
|
27752
27752
|
configurable: true
|
27753
27753
|
});
|
27754
27754
|
};
|
27755
27755
|
|
27756
|
-
TaoModule.set = function(
|
27757
|
-
return Object.defineProperty(this.prototype,
|
27756
|
+
TaoModule.set = function(attributeName, setMethod) {
|
27757
|
+
return Object.defineProperty(this.prototype, attributeName, {
|
27758
27758
|
set: setMethod,
|
27759
27759
|
configurable: true
|
27760
27760
|
});
|
27761
27761
|
};
|
27762
27762
|
|
27763
|
-
TaoModule.
|
27763
|
+
TaoModule.attribute = function() {
|
27764
27764
|
var i, names, options;
|
27765
27765
|
names = 2 <= arguments.length ? slice.call(arguments, 0, i = arguments.length - 1) : (i = 0, []), options = arguments[i++];
|
27766
27766
|
if (options == null) {
|
@@ -27774,14 +27774,14 @@ return jQuery;
|
|
27774
27774
|
return function(name) {
|
27775
27775
|
_this.get(name, function() {
|
27776
27776
|
var ref;
|
27777
|
-
return (ref = this.
|
27777
|
+
return (ref = this._attributes[name]) != null ? ref : options["default"];
|
27778
27778
|
});
|
27779
27779
|
return _this.set(name, function(val) {
|
27780
27780
|
var name1;
|
27781
|
-
if (this.
|
27781
|
+
if (this._attributes[name] === val) {
|
27782
27782
|
return;
|
27783
27783
|
}
|
27784
|
-
this.
|
27784
|
+
this._attributes[name] = val;
|
27785
27785
|
return typeof this[name1 = "_" + name + "Changed"] === "function" ? this[name1]() : void 0;
|
27786
27786
|
});
|
27787
27787
|
};
|
@@ -27793,7 +27793,7 @@ return jQuery;
|
|
27793
27793
|
if (options == null) {
|
27794
27794
|
options = {};
|
27795
27795
|
}
|
27796
|
-
this.
|
27796
|
+
this._attributes = {};
|
27797
27797
|
if (typeof options === 'object') {
|
27798
27798
|
for (key in options) {
|
27799
27799
|
val = options[key];
|
@@ -27874,7 +27874,9 @@ return jQuery;
|
|
27874
27874
|
};
|
27875
27875
|
|
27876
27876
|
TaoApplication.prototype._initI18n = function() {
|
27877
|
-
|
27877
|
+
if (I18n && this.locale) {
|
27878
|
+
return I18n.locale = this.locale;
|
27879
|
+
}
|
27878
27880
|
};
|
27879
27881
|
|
27880
27882
|
TaoApplication.prototype._initIcons = function($page) {
|
@@ -27930,12 +27932,12 @@ return jQuery;
|
|
27930
27932
|
};
|
27931
27933
|
})(this)).on('turbolinks:render', (function(_this) {
|
27932
27934
|
return function(e) {
|
27933
|
-
return _this.trigger('page-render', [$('body > .page')]);
|
27935
|
+
return _this.trigger('page-render', [$('body > .tao-page')]);
|
27934
27936
|
};
|
27935
27937
|
})(this)).on('turbolinks:load', (function(_this) {
|
27936
27938
|
return function(e) {
|
27937
27939
|
var $page;
|
27938
|
-
$page = $('body > .page');
|
27940
|
+
$page = $('body > .tao-page');
|
27939
27941
|
if (!($page.length > 0)) {
|
27940
27942
|
return;
|
27941
27943
|
}
|
@@ -30930,21 +30932,21 @@ var Deferred = void 0;
|
|
30930
30932
|
return this;
|
30931
30933
|
};
|
30932
30934
|
|
30933
|
-
_Class.get = function(
|
30934
|
-
return Object.defineProperty(this.prototype,
|
30935
|
+
_Class.get = function(attributeName, getMethod) {
|
30936
|
+
return Object.defineProperty(this.prototype, attributeName, {
|
30935
30937
|
get: getMethod,
|
30936
30938
|
configurable: true
|
30937
30939
|
});
|
30938
30940
|
};
|
30939
30941
|
|
30940
|
-
_Class.set = function(
|
30941
|
-
return Object.defineProperty(this.prototype,
|
30942
|
+
_Class.set = function(attributeName, setMethod) {
|
30943
|
+
return Object.defineProperty(this.prototype, attributeName, {
|
30942
30944
|
set: setMethod,
|
30943
30945
|
configurable: true
|
30944
30946
|
});
|
30945
30947
|
};
|
30946
30948
|
|
30947
|
-
_Class.
|
30949
|
+
_Class.attribute = function() {
|
30948
30950
|
var i, names, options;
|
30949
30951
|
names = 2 <= arguments.length ? slice.call(arguments, 0, i = arguments.length - 1) : (i = 0, []), options = arguments[i++];
|
30950
30952
|
if (options == null) {
|
@@ -31029,25 +31031,25 @@ var Deferred = void 0;
|
|
31029
31031
|
_Class.prototype.on = function() {
|
31030
31032
|
var args, ref;
|
31031
31033
|
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
|
31032
|
-
return (ref =
|
31034
|
+
return (ref = this.jq).on.apply(ref, args);
|
31033
31035
|
};
|
31034
31036
|
|
31035
31037
|
_Class.prototype.off = function() {
|
31036
31038
|
var args, ref;
|
31037
31039
|
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
|
31038
|
-
return (ref =
|
31040
|
+
return (ref = this.jq).off.apply(ref, args);
|
31039
31041
|
};
|
31040
31042
|
|
31041
31043
|
_Class.prototype.trigger = function() {
|
31042
31044
|
var args, ref;
|
31043
31045
|
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
|
31044
|
-
return (ref =
|
31046
|
+
return (ref = this.jq).triggerHandler.apply(ref, args);
|
31045
31047
|
};
|
31046
31048
|
|
31047
31049
|
_Class.prototype.one = function() {
|
31048
31050
|
var args, ref;
|
31049
31051
|
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
|
31050
|
-
return (ref =
|
31052
|
+
return (ref = this.jq).one.apply(ref, args);
|
31051
31053
|
};
|
31052
31054
|
|
31053
31055
|
_Class.prototype._init = function() {};
|
@@ -31080,7 +31082,7 @@ var Deferred = void 0;
|
|
31080
31082
|
return TaoPage.__super__.constructor.apply(this, arguments);
|
31081
31083
|
}
|
31082
31084
|
|
31083
|
-
TaoPage.
|
31085
|
+
TaoPage.attribute('layout');
|
31084
31086
|
|
31085
31087
|
TaoPage.prototype.prepareCache = function() {
|
31086
31088
|
return $(this).find('.tao-component').each((function(_this) {
|
@@ -21,7 +21,7 @@ class TaoApplication extends TaoModule
|
|
21
21
|
$(@).removeClass 'disabled'
|
22
22
|
|
23
23
|
_initI18n: ->
|
24
|
-
I18n
|
24
|
+
I18n.locale = @locale if I18n && @locale
|
25
25
|
|
26
26
|
_initIcons: ($page) ->
|
27
27
|
$icons = $page.siblings('#tao-icons')
|
@@ -57,10 +57,10 @@ class TaoApplication extends TaoModule
|
|
57
57
|
@trigger 'before-page-render', [$ e.originalEvent?.data.newBody]
|
58
58
|
|
59
59
|
.on 'turbolinks:render', (e) =>
|
60
|
-
@trigger 'page-render', [$('body > .page')]
|
60
|
+
@trigger 'page-render', [$('body > .tao-page')]
|
61
61
|
|
62
62
|
.on 'turbolinks:load', (e) =>
|
63
|
-
$page = $ 'body > .page'
|
63
|
+
$page = $ 'body > .tao-page'
|
64
64
|
return unless $page.length > 0
|
65
65
|
@_initIcons $page
|
66
66
|
@_initPage $page
|
@@ -28,17 +28,17 @@ TaoComponentBasedOn = (superClass = 'HTMLElement') ->
|
|
28
28
|
obj.included?.call(@)
|
29
29
|
@
|
30
30
|
|
31
|
-
@get: (
|
32
|
-
Object.defineProperty @prototype,
|
31
|
+
@get: (attributeName, getMethod) ->
|
32
|
+
Object.defineProperty @prototype, attributeName,
|
33
33
|
get: getMethod
|
34
34
|
configurable: true
|
35
35
|
|
36
|
-
@set: (
|
37
|
-
Object.defineProperty @prototype,
|
36
|
+
@set: (attributeName, setMethod) ->
|
37
|
+
Object.defineProperty @prototype, attributeName,
|
38
38
|
set: setMethod
|
39
39
|
configurable: true
|
40
40
|
|
41
|
-
@
|
41
|
+
@attribute: (names..., options = {}) ->
|
42
42
|
unless typeof options == 'object'
|
43
43
|
names.push(options)
|
44
44
|
options = {}
|
@@ -92,16 +92,16 @@ TaoComponentBasedOn = (superClass = 'HTMLElement') ->
|
|
92
92
|
@["_#{_.camelCase attrName}Changed"]?()
|
93
93
|
|
94
94
|
on: (args...) ->
|
95
|
-
|
95
|
+
@jq.on args...
|
96
96
|
|
97
97
|
off: (args...) ->
|
98
|
-
|
98
|
+
@jq.off args...
|
99
99
|
|
100
100
|
trigger: (args...) ->
|
101
|
-
|
101
|
+
@jq.triggerHandler(args...)
|
102
102
|
|
103
103
|
one: (args...) ->
|
104
|
-
|
104
|
+
@jq.one args...
|
105
105
|
|
106
106
|
_init: ->
|
107
107
|
# to be implemented
|
@@ -20,32 +20,32 @@ class TaoModule
|
|
20
20
|
obj.included?.call(@)
|
21
21
|
@
|
22
22
|
|
23
|
-
@get: (
|
24
|
-
Object.defineProperty @prototype,
|
23
|
+
@get: (attributeName, getMethod) ->
|
24
|
+
Object.defineProperty @prototype, attributeName,
|
25
25
|
get: getMethod
|
26
26
|
configurable: true
|
27
27
|
|
28
|
-
@set: (
|
29
|
-
Object.defineProperty @prototype,
|
28
|
+
@set: (attributeName, setMethod) ->
|
29
|
+
Object.defineProperty @prototype, attributeName,
|
30
30
|
set: setMethod
|
31
31
|
configurable: true
|
32
32
|
|
33
|
-
@
|
33
|
+
@attribute: (names..., options = {}) ->
|
34
34
|
unless typeof options == 'object'
|
35
35
|
names.push(options)
|
36
36
|
options = {}
|
37
37
|
|
38
38
|
names.forEach (name) =>
|
39
39
|
@get name, ->
|
40
|
-
@
|
40
|
+
@_attributes[name] ? options.default
|
41
41
|
@set name, (val) ->
|
42
|
-
return if @
|
43
|
-
@
|
42
|
+
return if @_attributes[name] == val
|
43
|
+
@_attributes[name] = val
|
44
44
|
@["_#{name}Changed"]?()
|
45
45
|
|
46
46
|
constructor: (options = {}) ->
|
47
|
-
@
|
48
|
-
|
47
|
+
@_attributes = {}
|
48
|
+
|
49
49
|
if typeof options == 'object'
|
50
50
|
@[key] = val for key, val of options
|
51
51
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tao_on_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Siyuan Liu
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-12-
|
12
|
+
date: 2016-12-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: turbolinks
|