ende 0.1.8 → 0.1.9
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/lib/assets/javascripts/widgets/viewer/main.js.coffee +42 -41
- data/lib/ende/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: 728dddca0551ce2521fdc12aed9b1c13e74ed4ca
|
4
|
+
data.tar.gz: 950f7a7b513e054456e9fdd33acc4b8c6ae8619c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08b028d1bb21acef7143fff8359aff74b12edc3cc7f27eb485faeb4a72feb7d77e4bde5e7a5baa9a7a56cfee038ec70a1d9e0984370073f162f1c08dd9c237c7
|
7
|
+
data.tar.gz: bc6e065ba70c206b4e95ada1c5397dcaca2b7c68bdaae99ec0cb3202b5451ad9d8d1c414e981b1c96a2bd05dc1d0d83ae0a6021a70a68ab6cc5a5a8574dbe611
|
@@ -52,7 +52,7 @@ define ['./states/index', './presenters/default', '/assets/jquery/inview.js'], (
|
|
52
52
|
viewed: (event, in_view, horizontal, vertical) ->
|
53
53
|
boo[if in_view then 'pride' else 'shame'] event.target
|
54
54
|
|
55
|
-
version: '0.1.
|
55
|
+
version: '0.1.1'
|
56
56
|
|
57
57
|
# TODO better separation of concerns
|
58
58
|
# TODO Current remote page that is beign displayed
|
@@ -84,6 +84,46 @@ define ['./states/index', './presenters/default', '/assets/jquery/inview.js'], (
|
|
84
84
|
for { _widget: widget } in @sandbox._children
|
85
85
|
widget.scope_to? child_scope
|
86
86
|
|
87
|
+
@repopulate()
|
88
|
+
@sandbox.emit "viewer.#{@identifier}.scope_changed", @scope
|
89
|
+
|
90
|
+
repopulate: ->
|
91
|
+
if @load?
|
92
|
+
@load.stop()
|
93
|
+
@load = null
|
94
|
+
|
95
|
+
# TODO store spinner instance, instead of creating a new one every time
|
96
|
+
@load = @sandbox.ui.loader @$el.find '.results .items' unless @load?
|
97
|
+
|
98
|
+
viewer = @presentation.viewer
|
99
|
+
viewer.items = []
|
100
|
+
presented_ids = []
|
101
|
+
|
102
|
+
# TODO generalise this filtering option
|
103
|
+
presented = #for item in selected
|
104
|
+
# if @scope?.scope.data.by_type_id
|
105
|
+
# querier = item.models.by_type_id.apply item.models, @scope.scope.data.by_type_id
|
106
|
+
# else
|
107
|
+
# querier = item.models
|
108
|
+
|
109
|
+
# TODO make scope.all method use scope too!
|
110
|
+
@scope.fetch null, (records) ->
|
111
|
+
_.map records, @ # TODO make scope.all method use scope too!
|
112
|
+
|
113
|
+
for record in records
|
114
|
+
viewer.items.push record if presented_ids.indexOf(record._id) == -1
|
115
|
+
|
116
|
+
presented_ids = _.union presented_ids, _.pluck(records, '_id')
|
117
|
+
|
118
|
+
$.when(presented...).then =>
|
119
|
+
boo.initialize @$el.find '.results .items'
|
120
|
+
presented_ids = []
|
121
|
+
|
122
|
+
if @load?
|
123
|
+
@load.stop()
|
124
|
+
@load = null
|
125
|
+
|
126
|
+
|
87
127
|
populate: (handlers) ->
|
88
128
|
# Initialize dependencies
|
89
129
|
@scope.all (records) =>
|
@@ -109,13 +149,6 @@ define ['./states/index', './presenters/default', '/assets/jquery/inview.js'], (
|
|
109
149
|
unfolding:
|
110
150
|
back : 'hide'
|
111
151
|
|
112
|
-
drawing.style (i, node) ->
|
113
|
-
value = node.getAttribute 'style'
|
114
|
-
value = value.replace /fill:(.*?);/, 'fill: black;'
|
115
|
-
value = value.replace /stroke:(.*?);/, 'stroke: white;'
|
116
|
-
node.setAttribute 'style', value
|
117
|
-
, 100
|
118
|
-
|
119
152
|
@handles 'click', 'back', '.back'
|
120
153
|
|
121
154
|
initialize: (options) ->
|
@@ -125,7 +158,6 @@ define ['./states/index', './presenters/default', '/assets/jquery/inview.js'], (
|
|
125
158
|
# TODO import core extensions in another place
|
126
159
|
@scope = model = @sandbox.models[options.resource]
|
127
160
|
cssify = @sandbox.util.inflector.cssify
|
128
|
-
loader = @sandbox.ui.loader
|
129
161
|
@sandbox.on "viewer.#{@identifier}.scope", @scope_to, @
|
130
162
|
|
131
163
|
# Extend presentation
|
@@ -149,37 +181,6 @@ define ['./states/index', './presenters/default', '/assets/jquery/inview.js'], (
|
|
149
181
|
clicked: (event, models) =>
|
150
182
|
@select models.item
|
151
183
|
|
152
|
-
list:
|
153
|
-
changed: (change, selection) =>
|
154
|
-
# TODO store spinner instance, instead of creating a new one every time
|
155
|
-
@load = loader @$el.find '.results .items' unless @load?
|
156
|
-
|
157
|
-
stabilized: (selected) =>
|
158
|
-
if @load
|
159
|
-
@load.stop()
|
160
|
-
@load = null
|
161
|
-
|
162
|
-
viewer = @presentation.viewer
|
163
|
-
viewer.items = []
|
164
|
-
presented_ids = []
|
165
|
-
|
166
|
-
# TODO generalise this filtering option
|
167
|
-
presented = for item in selected
|
168
|
-
if @scope?.scope.data.by_type_id
|
169
|
-
querier = item.models.by_type_id.apply item.models, @scope.scope.data.by_type_id
|
170
|
-
else
|
171
|
-
querier = item.models
|
172
|
-
|
173
|
-
querier.all (records) =>
|
174
|
-
for record in records
|
175
|
-
viewer.items.push record if presented_ids.indexOf(record._id) == -1
|
176
|
-
|
177
|
-
presented_ids = _.union presented_ids, _.pluck(records, '_id')
|
178
|
-
|
179
|
-
$.when(presented...).then =>
|
180
|
-
boo.initialize @$el.find '.results .items'
|
181
|
-
presented_ids = []
|
182
|
-
|
183
184
|
presenter.handlers = handlers
|
184
185
|
|
185
186
|
custom_default_template and templates[options.model] = custom_default_template
|
@@ -190,7 +191,7 @@ define ['./states/index', './presenters/default', '/assets/jquery/inview.js'], (
|
|
190
191
|
@$results = @$el.find '.results .items'
|
191
192
|
|
192
193
|
# Fetch default data
|
193
|
-
@load = loader @results
|
194
|
+
@load = @sandbox.ui.loader @results
|
194
195
|
# TODO better scoping support by viewer
|
195
196
|
|
196
197
|
@populate handlers
|
data/lib/ende/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ende
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Heitor Salazar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|