mumuki-gobstones-board 1.20.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +150 -0
- data/Rakefile +33 -0
- data/app/assets/htmls/components/boom.png +0 -0
- data/app/assets/htmls/components/cell-dresser.html +57 -0
- data/app/assets/htmls/components/demo/board-demo.html +308 -0
- data/app/assets/htmls/components/gs-board.html +535 -0
- data/app/assets/htmls/components/gs-cell.html +192 -0
- data/app/assets/htmls/components/gs-stone.html +206 -0
- data/app/assets/htmls/components/key-tracker.html +53 -0
- data/app/assets/htmls/components/op_bolita_azul.svg +17 -0
- data/app/assets/htmls/components/op_bolita_negra.svg +17 -0
- data/app/assets/htmls/components/op_bolita_roja.svg +18 -0
- data/app/assets/htmls/components/op_bolita_verde.svg +17 -0
- data/app/assets/htmls/gs-board.html +1 -0
- data/app/assets/htmls/vendor/polymer-micro.html +827 -0
- data/app/assets/htmls/vendor/polymer-mini.html +2260 -0
- data/app/assets/htmls/vendor/polymer.html +5580 -0
- data/app/assets/javascripts/vendor/webcomponents.min.js +14 -0
- data/lib/gobstones/board/version.rb +5 -0
- data/lib/gobstones/board.rb +14 -0
- metadata +111 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e9455779809eec267bf2c156cb107df3cd36da55ba25c2cedae320ae116d4842
|
4
|
+
data.tar.gz: 31ace012e36ef7758ac16239f8847bedaab7c4743669085d874ab82f32a778d0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 899a0019cc1165fa5197780fe36a3b412b1fd76d4d04b0a674628e02085af0e89db2944c760953e0612060afabd58865d2ea80437579cdf815c8a8687c9f9d82
|
7
|
+
data.tar.gz: e724b257a05fce1fd6c5e29bcc91571de31a2050f77578484c94037706603d22d4a90c2fd6a269a570ede4eca9e4d4f3077020cc1885d646cc22b26da28d38bc
|
data/README.md
ADDED
@@ -0,0 +1,150 @@
|
|
1
|
+
# gs-board
|
2
|
+
|
3
|
+
Gobstones Board: A Polymer component that renders a board.
|
4
|
+
|
5
|
+
## install
|
6
|
+
|
7
|
+
```
|
8
|
+
npm install
|
9
|
+
npm install -g grunt-cli bower
|
10
|
+
bower install
|
11
|
+
gem install sass
|
12
|
+
```
|
13
|
+
|
14
|
+
## run
|
15
|
+
|
16
|
+
```
|
17
|
+
# build and start live demo
|
18
|
+
grunt
|
19
|
+
|
20
|
+
# just build
|
21
|
+
grunt dist
|
22
|
+
```
|
23
|
+
|
24
|
+
## usage
|
25
|
+
|
26
|
+
### install
|
27
|
+
```
|
28
|
+
bower install --save gobstones/gs-board
|
29
|
+
```
|
30
|
+
|
31
|
+
### one-file compiled version
|
32
|
+
It is bundled every time `grunt` runs. See `test.html` for an example.
|
33
|
+
|
34
|
+
### import
|
35
|
+
```html
|
36
|
+
<link rel="import" href="{BOWER_COMPONENTS}/gs-board/dist/components/gs-board.html">
|
37
|
+
```
|
38
|
+
|
39
|
+
### simple board (from GBB)
|
40
|
+
```html
|
41
|
+
<gs-board>
|
42
|
+
GBB/1.0
|
43
|
+
size 4 3
|
44
|
+
cell 1 2 Azul 0 Negro 0 Rojo 8 Verde 0
|
45
|
+
cell 3 2 Azul 2 Negro 0 Rojo 5 Verde 1
|
46
|
+
cell 2 1 Azul 0 Negro 6 Rojo 0 Verde 0
|
47
|
+
head 1 2
|
48
|
+
</gs-board>
|
49
|
+
```
|
50
|
+
|
51
|
+
### initial board (editable)
|
52
|
+
```html
|
53
|
+
<gs-board size='{ "x": 4, "y": 4 }' options='{ "editable": true }'></gs-board>
|
54
|
+
```
|
55
|
+
|
56
|
+
### final board (fixed)
|
57
|
+
```html
|
58
|
+
<template is="dom-if" if="{{finalState}}" restamp="true">
|
59
|
+
<gs-board table='{{finalState.table}}' header="{{finalState.header}}"></gs-board>
|
60
|
+
</template>
|
61
|
+
```
|
62
|
+
```
|
63
|
+
finalState.table = [[{}, { "red": 3 }], [{ "black": 1 }, {}]]
|
64
|
+
```
|
65
|
+
|
66
|
+
### setting header position
|
67
|
+
```html
|
68
|
+
<gs-board size='{ "x": 4, "y": 4 }' header='{ "x": 1, "y": 3 }'></gs-board>
|
69
|
+
```
|
70
|
+
|
71
|
+
### with attire
|
72
|
+
```html
|
73
|
+
<gs-board size='{ "x": 4, "y": 4 }' attire="{{attire}}"></gs-board>
|
74
|
+
```
|
75
|
+
|
76
|
+
### boom
|
77
|
+
```html
|
78
|
+
<gs-board boom></gs-board>
|
79
|
+
```
|
80
|
+
|
81
|
+
#### Example of attire definition:
|
82
|
+
```json
|
83
|
+
{
|
84
|
+
"enabled": true,
|
85
|
+
"rules": [
|
86
|
+
{
|
87
|
+
"when": { "blue": "*", "black": "+", "red": 4, "green": "*" },
|
88
|
+
"image": "https://cloud.githubusercontent.com/assets/1631752/19217961/ef2e0d4c-8dea-11e6-960d-69585778f89d.png"
|
89
|
+
},
|
90
|
+
{
|
91
|
+
"when": { "blue": 3, "black": 0, "red": 1, "green": 0 },
|
92
|
+
"text": "hi!"
|
93
|
+
},
|
94
|
+
{
|
95
|
+
"when": { "blue": 0, "black": 0, "red": 0, "green": 0 },
|
96
|
+
"image": "https://cloud.githubusercontent.com/assets/1631752/19217956/ef1d928c-8dea-11e6-8b53-8d2495cdd3e9.png"
|
97
|
+
},
|
98
|
+
{
|
99
|
+
"when": { "blue": 0, "black": 0, "red": 0, "green": 1 },
|
100
|
+
"image": "https://cloud.githubusercontent.com/assets/1631752/19217959/ef27e822-8dea-11e6-9bb0-57892593c9d8.png"
|
101
|
+
},
|
102
|
+
{
|
103
|
+
"when": { "blue": 1, "black": 0, "red": 0, "green": 0 },
|
104
|
+
"image": "https://cloud.githubusercontent.com/assets/1631752/19217958/ef245892-8dea-11e6-80f4-aeb5d1862b1c.png"
|
105
|
+
},
|
106
|
+
{
|
107
|
+
"when": { "blue": 0, "black": 1, "red": 0, "green": 0 },
|
108
|
+
"image": "https://cloud.githubusercontent.com/assets/1631752/19217957/ef20120a-8dea-11e6-825c-23e7773269b0.png"
|
109
|
+
},
|
110
|
+
{
|
111
|
+
"when": { "blue": 0, "black": 0, "red": 1, "green": 0, "head": true },
|
112
|
+
"image": "https://user-images.githubusercontent.com/1631752/33194059-c9794fb0-d0d5-11e7-81dc-65a0f7472a94.png"
|
113
|
+
},
|
114
|
+
{
|
115
|
+
"when": { "blue": 0, "black": 0, "red": 1, "green": 0 },
|
116
|
+
"image": "https://cloud.githubusercontent.com/assets/1631752/19217960/ef2ad3c0-8dea-11e6-8434-ff9152b76f3b.png"
|
117
|
+
}
|
118
|
+
],
|
119
|
+
"borders": {
|
120
|
+
"bottom": "https://user-images.githubusercontent.com/1631752/37176618-94629ef6-2325-11e8-9e11-6cf6846bbbc3.png",
|
121
|
+
"bottomLeft": "https://user-images.githubusercontent.com/1631752/37176647-9cb96b98-2325-11e8-9244-17e65f8236bc.png",
|
122
|
+
"bottomRight": "https://user-images.githubusercontent.com/1631752/37176659-a85c71b6-2325-11e8-8698-952cfbdf73f5.png",
|
123
|
+
"left": "https://user-images.githubusercontent.com/1631752/37176682-c09ae398-2325-11e8-90d6-d1793b8c20fd.png",
|
124
|
+
"right": "https://user-images.githubusercontent.com/1631752/37176696-c8628ea0-2325-11e8-9fb0-39805f2b810d.png",
|
125
|
+
"top": "https://user-images.githubusercontent.com/1631752/37176705-d5459ee6-2325-11e8-8100-23a4b89a064c.png",
|
126
|
+
"topLeft": "https://user-images.githubusercontent.com/1631752/37176714-dec70f54-2325-11e8-9589-4b3feaa21a2f.png",
|
127
|
+
"topRight": "https://user-images.githubusercontent.com/1631752/37176725-e747cbe6-2325-11e8-8c3b-873501ce0a18.png"
|
128
|
+
}
|
129
|
+
}
|
130
|
+
```
|
131
|
+
|
132
|
+
## considerations
|
133
|
+
- To update the board, don't mutate the properties directly. **You must use the `update(table, header)` method**.
|
134
|
+
|
135
|
+
## Gem wrapper
|
136
|
+
|
137
|
+
This module can also be deployed a ruby gem. `mumuki-gobstones-board` works with Ruby >= 2.3.1
|
138
|
+
|
139
|
+
```bash
|
140
|
+
cd gem
|
141
|
+
rake wrapper:wrap
|
142
|
+
bundle install
|
143
|
+
bundle exec rspec
|
144
|
+
```
|
145
|
+
|
146
|
+
## Tagging and releasing
|
147
|
+
|
148
|
+
```bash
|
149
|
+
./tag.sh
|
150
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rspec/core/rake_task"
|
3
|
+
|
4
|
+
RSpec::Core::RakeTask.new(:spec)
|
5
|
+
|
6
|
+
task :default => :spec
|
7
|
+
|
8
|
+
namespace :wrapper do
|
9
|
+
desc 'Wrap styles assets into this gem'
|
10
|
+
task wrap: :clean do
|
11
|
+
# readme
|
12
|
+
cp_r '../README.md', 'README.md'
|
13
|
+
|
14
|
+
# gs-board
|
15
|
+
cp_r '../dist/gs-board.html', 'app/assets/htmls'
|
16
|
+
cp_r '../dist/components', 'app/assets/htmls'
|
17
|
+
|
18
|
+
# polymer
|
19
|
+
cp_r '../bower_components/polymer/polymer.html', 'app/assets/htmls/vendor'
|
20
|
+
cp_r '../bower_components/polymer/polymer-mini.html', 'app/assets/htmls/vendor'
|
21
|
+
cp_r '../bower_components/polymer/polymer-micro.html', 'app/assets/htmls/vendor'
|
22
|
+
|
23
|
+
# webcomponents
|
24
|
+
cp_r '../bower_components/webcomponentsjs/webcomponents.min.js', 'app/assets/javascripts/vendor'
|
25
|
+
end
|
26
|
+
|
27
|
+
task :clean do
|
28
|
+
rm_rf 'app'
|
29
|
+
mkdir_p 'app/assets/htmls'
|
30
|
+
mkdir_p 'app/assets/htmls/vendor'
|
31
|
+
mkdir_p 'app/assets/javascripts/vendor'
|
32
|
+
end
|
33
|
+
end
|
Binary file
|
@@ -0,0 +1,57 @@
|
|
1
|
+
<dom-module id="cell-dresser">
|
2
|
+
<template>
|
3
|
+
<style>
|
4
|
+
|
5
|
+
|
6
|
+
/*# sourceMappingURL=style.css.map */
|
7
|
+
|
8
|
+
</style>
|
9
|
+
|
10
|
+
|
11
|
+
</template>
|
12
|
+
<script>
|
13
|
+
Polymer({
|
14
|
+
is: 'cell-dresser',
|
15
|
+
getRule: function(cell, isHeader, attire) {
|
16
|
+
if ((attire == null) || !attire.enabled) {
|
17
|
+
return;
|
18
|
+
}
|
19
|
+
return attire != null ? attire.rules.filter((function(_this) {
|
20
|
+
return function(rule) {
|
21
|
+
return _this._doesSatisfyRule(cell, isHeader, rule);
|
22
|
+
};
|
23
|
+
})(this))[0] : void 0;
|
24
|
+
},
|
25
|
+
_doesSatisfyRule: function(cell, isHeader, rule) {
|
26
|
+
var itSatisfies;
|
27
|
+
itSatisfies = (function(_this) {
|
28
|
+
return function(color) {
|
29
|
+
return _this._doesSatisfyQuantity(cell[color], rule.when[color]) && _this._doesSatisfyHeader(isHeader, rule.when.head);
|
30
|
+
};
|
31
|
+
})(this);
|
32
|
+
return ["red", "blue", "green", "black"].reduce((function(_this) {
|
33
|
+
return function(previousCondition, color) {
|
34
|
+
return previousCondition && itSatisfies(color);
|
35
|
+
};
|
36
|
+
})(this), true);
|
37
|
+
},
|
38
|
+
_doesSatisfyQuantity: function(quantity, expectedQuantity) {
|
39
|
+
if (quantity == null) {
|
40
|
+
quantity = 0;
|
41
|
+
}
|
42
|
+
switch (expectedQuantity) {
|
43
|
+
case "*":
|
44
|
+
return true;
|
45
|
+
case "+":
|
46
|
+
return quantity > 0;
|
47
|
+
default:
|
48
|
+
return quantity === expectedQuantity;
|
49
|
+
}
|
50
|
+
},
|
51
|
+
_doesSatisfyHeader: function(isHeader, expectedHeader) {
|
52
|
+
return (expectedHeader == null) || expectedHeader === isHeader;
|
53
|
+
}
|
54
|
+
});
|
55
|
+
|
56
|
+
</script>
|
57
|
+
</dom-module>
|
@@ -0,0 +1,308 @@
|
|
1
|
+
<dom-module id="board-demo">
|
2
|
+
<template>
|
3
|
+
<style>
|
4
|
+
|
5
|
+
|
6
|
+
/*# sourceMappingURL=style.css.map */
|
7
|
+
|
8
|
+
</style>
|
9
|
+
|
10
|
+
<div>
|
11
|
+
<h3>
|
12
|
+
with gbb:
|
13
|
+
</h3>
|
14
|
+
<gs-board>
|
15
|
+
GBB/1.0
|
16
|
+
size 4 3
|
17
|
+
cell 1 2 Azul 0 Negro 0 Rojo 8 Verde 0
|
18
|
+
cell 3 2 Azul 2 Negro 0 Rojo 5 Verde 1
|
19
|
+
cell 2 1 Azul 0 Negro 6 Rojo 0 Verde 0
|
20
|
+
head 1 2
|
21
|
+
</gs-board>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div>
|
25
|
+
<h3>
|
26
|
+
with boom:
|
27
|
+
</h3>
|
28
|
+
<gs-board boom></gs-board>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div>
|
32
|
+
<h3>
|
33
|
+
without header:
|
34
|
+
</h3>
|
35
|
+
<gs-board without-header>
|
36
|
+
GBB/1.0
|
37
|
+
size 4 3
|
38
|
+
cell 1 2 Azul 0 Negro 0 Rojo 8 Verde 0
|
39
|
+
cell 3 2 Azul 2 Negro 0 Rojo 5 Verde 1
|
40
|
+
cell 2 1 Azul 0 Negro 6 Rojo 0 Verde 0
|
41
|
+
head 1 2
|
42
|
+
</gs-board>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div>
|
46
|
+
<h3>
|
47
|
+
with gbb and text inside the attire:
|
48
|
+
</h3>
|
49
|
+
<gs-board attire='{{attire2}}'>
|
50
|
+
GBB/1.0
|
51
|
+
size 4 3
|
52
|
+
cell 1 2 Azul 0 Negro 0 Rojo 8 Verde 0
|
53
|
+
cell 3 2 Azul 3 Negro 0 Rojo 1 Verde 0
|
54
|
+
cell 2 1 Azul 0 Negro 6 Rojo 0 Verde 0
|
55
|
+
head 1 2
|
56
|
+
</gs-board>
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<!--
|
60
|
+
<div>
|
61
|
+
<gs-board attire-src="mines">
|
62
|
+
GBB/1.0
|
63
|
+
size 4 3
|
64
|
+
cell 1 2 Azul 0 Negro 0 Rojo 8 Verde 0
|
65
|
+
cell 3 2 Azul 2 Negro 0 Rojo 5 Verde 1
|
66
|
+
cell 2 1 Azul 0 Negro 6 Rojo 0 Verde 0
|
67
|
+
head 1 2
|
68
|
+
</gs-board>
|
69
|
+
</div>
|
70
|
+
-->
|
71
|
+
|
72
|
+
<div>
|
73
|
+
<h3>
|
74
|
+
with table:
|
75
|
+
</h3>
|
76
|
+
<gs-board table="{{model.table}}" options='{ "editable": false }'></gs-board>
|
77
|
+
</div>
|
78
|
+
<div>
|
79
|
+
<h3>
|
80
|
+
with attire:
|
81
|
+
</h3>
|
82
|
+
<gs-board size='{ "x": 4, "y": 4 }' options='{ "editable": false }' attire="{{attire2}}"></gs-board>
|
83
|
+
</div>
|
84
|
+
<div>
|
85
|
+
<h3>
|
86
|
+
with 3x5 size:
|
87
|
+
</h3>
|
88
|
+
<gs-board size='{ "x": 3, "y": 5 }' options='{ "editable": true }'></gs-board>
|
89
|
+
</div>
|
90
|
+
<div>
|
91
|
+
<h3>
|
92
|
+
with id and 2x2 size:
|
93
|
+
</h3>
|
94
|
+
<gs-board id="thing" size='{ "x": 2, "y": 2 }' options='{ "editable": true }'></gs-board>
|
95
|
+
</div>
|
96
|
+
<div>
|
97
|
+
<hr>
|
98
|
+
<gs-board table="{{modelWithAttire.table}}" options='{ "editable": false }' attire='{{attire}}'></gs-board>
|
99
|
+
<hr>
|
100
|
+
</div>
|
101
|
+
<div class="board-wrap-json">
|
102
|
+
<juicy-jsoneditor id="jsoneditor" style="height: 300px;" json="{{jsonModel}}"></juicy-jsoneditor>
|
103
|
+
</div>
|
104
|
+
|
105
|
+
</template>
|
106
|
+
<script>
|
107
|
+
var model, modelWithAttire;
|
108
|
+
|
109
|
+
model = {
|
110
|
+
table: [
|
111
|
+
[{}, {}, {}, {}], [{}, {}, {}, {}], [
|
112
|
+
{
|
113
|
+
black: 1
|
114
|
+
}, {
|
115
|
+
blue: 87493312
|
116
|
+
}, {
|
117
|
+
green: 2
|
118
|
+
}, {}
|
119
|
+
], [
|
120
|
+
{
|
121
|
+
red: 3,
|
122
|
+
black: 4
|
123
|
+
}, {}, {}, {}
|
124
|
+
]
|
125
|
+
]
|
126
|
+
};
|
127
|
+
|
128
|
+
modelWithAttire = {
|
129
|
+
table: [
|
130
|
+
[
|
131
|
+
{
|
132
|
+
green: 1
|
133
|
+
}, {}, {}, {
|
134
|
+
blue: 1
|
135
|
+
}
|
136
|
+
], [
|
137
|
+
{}, {
|
138
|
+
red: 4,
|
139
|
+
black: 1
|
140
|
+
}, {
|
141
|
+
red: 4,
|
142
|
+
black: 2
|
143
|
+
}, {}
|
144
|
+
], [
|
145
|
+
{}, {
|
146
|
+
red: 1
|
147
|
+
}, {
|
148
|
+
red: 4,
|
149
|
+
black: 3
|
150
|
+
}, {}
|
151
|
+
], [
|
152
|
+
{
|
153
|
+
red: 1
|
154
|
+
}, {}, {}, {
|
155
|
+
black: 1
|
156
|
+
}
|
157
|
+
]
|
158
|
+
]
|
159
|
+
};
|
160
|
+
|
161
|
+
Polymer({
|
162
|
+
is: 'board-demo',
|
163
|
+
properties: {
|
164
|
+
model: {
|
165
|
+
type: Object,
|
166
|
+
value: model,
|
167
|
+
notify: true
|
168
|
+
},
|
169
|
+
modelWithAttire: {
|
170
|
+
type: Object,
|
171
|
+
value: modelWithAttire,
|
172
|
+
notify: true
|
173
|
+
},
|
174
|
+
jsonModel: {
|
175
|
+
type: Object,
|
176
|
+
value: model
|
177
|
+
},
|
178
|
+
attire: {
|
179
|
+
type: Object
|
180
|
+
},
|
181
|
+
attire2: {
|
182
|
+
type: Object
|
183
|
+
}
|
184
|
+
},
|
185
|
+
ready: function() {
|
186
|
+
this.attire = {
|
187
|
+
"enabled": true,
|
188
|
+
"rules": [
|
189
|
+
{
|
190
|
+
"when": {
|
191
|
+
"blue": "*",
|
192
|
+
"black": "+",
|
193
|
+
"red": 4,
|
194
|
+
"green": "*"
|
195
|
+
},
|
196
|
+
"image": "https://cloud.githubusercontent.com/assets/1631752/19217961/ef2e0d4c-8dea-11e6-960d-69585778f89d.png"
|
197
|
+
}, {
|
198
|
+
"when": {
|
199
|
+
"blue": 0,
|
200
|
+
"black": 0,
|
201
|
+
"red": 0,
|
202
|
+
"green": 0
|
203
|
+
},
|
204
|
+
"image": "https://cloud.githubusercontent.com/assets/1631752/19217956/ef1d928c-8dea-11e6-8b53-8d2495cdd3e9.png"
|
205
|
+
}, {
|
206
|
+
"when": {
|
207
|
+
"blue": 0,
|
208
|
+
"black": 0,
|
209
|
+
"red": 0,
|
210
|
+
"green": 1
|
211
|
+
},
|
212
|
+
"image": "https://cloud.githubusercontent.com/assets/1631752/19217959/ef27e822-8dea-11e6-9bb0-57892593c9d8.png"
|
213
|
+
}, {
|
214
|
+
"when": {
|
215
|
+
"blue": 1,
|
216
|
+
"black": 0,
|
217
|
+
"red": 0,
|
218
|
+
"green": 0
|
219
|
+
},
|
220
|
+
"image": "https://cloud.githubusercontent.com/assets/1631752/19217958/ef245892-8dea-11e6-80f4-aeb5d1862b1c.png"
|
221
|
+
}, {
|
222
|
+
"when": {
|
223
|
+
"blue": 0,
|
224
|
+
"black": 1,
|
225
|
+
"red": 0,
|
226
|
+
"green": 0
|
227
|
+
},
|
228
|
+
"image": "https://cloud.githubusercontent.com/assets/1631752/19217957/ef20120a-8dea-11e6-825c-23e7773269b0.png"
|
229
|
+
}, {
|
230
|
+
"when": {
|
231
|
+
"blue": 0,
|
232
|
+
"black": 0,
|
233
|
+
"red": 1,
|
234
|
+
"green": 0,
|
235
|
+
"head": true
|
236
|
+
},
|
237
|
+
"image": "https://user-images.githubusercontent.com/1631752/33194059-c9794fb0-d0d5-11e7-81dc-65a0f7472a94.png"
|
238
|
+
}, {
|
239
|
+
"when": {
|
240
|
+
"blue": 0,
|
241
|
+
"black": 0,
|
242
|
+
"red": 1,
|
243
|
+
"green": 0
|
244
|
+
},
|
245
|
+
"image": "https://cloud.githubusercontent.com/assets/1631752/19217960/ef2ad3c0-8dea-11e6-8434-ff9152b76f3b.png"
|
246
|
+
}
|
247
|
+
],
|
248
|
+
"borders": {
|
249
|
+
"bottom": "https://user-images.githubusercontent.com/1631752/37176618-94629ef6-2325-11e8-9e11-6cf6846bbbc3.png",
|
250
|
+
"bottomLeft": "https://user-images.githubusercontent.com/1631752/37176647-9cb96b98-2325-11e8-9244-17e65f8236bc.png",
|
251
|
+
"bottomRight": "https://user-images.githubusercontent.com/1631752/37176659-a85c71b6-2325-11e8-8698-952cfbdf73f5.png",
|
252
|
+
"left": "https://user-images.githubusercontent.com/1631752/37176682-c09ae398-2325-11e8-90d6-d1793b8c20fd.png",
|
253
|
+
"right": "https://user-images.githubusercontent.com/1631752/37176696-c8628ea0-2325-11e8-9fb0-39805f2b810d.png",
|
254
|
+
"top": "https://user-images.githubusercontent.com/1631752/37176705-d5459ee6-2325-11e8-8100-23a4b89a064c.png",
|
255
|
+
"topLeft": "https://user-images.githubusercontent.com/1631752/37176714-dec70f54-2325-11e8-9589-4b3feaa21a2f.png",
|
256
|
+
"topRight": "https://user-images.githubusercontent.com/1631752/37176725-e747cbe6-2325-11e8-8c3b-873501ce0a18.png"
|
257
|
+
}
|
258
|
+
};
|
259
|
+
this.attire2 = {
|
260
|
+
"enabled": false,
|
261
|
+
"rules": [
|
262
|
+
{
|
263
|
+
"when": {
|
264
|
+
"blue": 3,
|
265
|
+
"black": 0,
|
266
|
+
"red": 1,
|
267
|
+
"green": 0
|
268
|
+
},
|
269
|
+
"text": "hey"
|
270
|
+
}, {
|
271
|
+
"when": {
|
272
|
+
"blue": "*",
|
273
|
+
"black": "*",
|
274
|
+
"red": "*",
|
275
|
+
"green": "*"
|
276
|
+
},
|
277
|
+
"image": "https://user-images.githubusercontent.com/677436/39197564-2d4b04e6-47bb-11e8-82f2-814a62dafdf6.png"
|
278
|
+
}
|
279
|
+
]
|
280
|
+
};
|
281
|
+
setTimeout((function(_this) {
|
282
|
+
return function() {
|
283
|
+
return _this.set("attire2.enabled", true);
|
284
|
+
};
|
285
|
+
})(this), 500);
|
286
|
+
return setInterval((function(_this) {
|
287
|
+
return function() {
|
288
|
+
return _this.set("attire.enabled", !_this.attire.enabled);
|
289
|
+
};
|
290
|
+
})(this), 2000);
|
291
|
+
},
|
292
|
+
listeners: {
|
293
|
+
'jsoneditor.change': '_jsonChange'
|
294
|
+
},
|
295
|
+
_jsonChange: function() {
|
296
|
+
return this.async(this._forceRender, 0);
|
297
|
+
},
|
298
|
+
_forceRender: function() {
|
299
|
+
this.model = null;
|
300
|
+
return this.async(this._setModel, 0);
|
301
|
+
},
|
302
|
+
_setModel: function() {
|
303
|
+
return this.model = model;
|
304
|
+
}
|
305
|
+
});
|
306
|
+
|
307
|
+
</script>
|
308
|
+
</dom-module>
|