radiant-fabulator_exhibit-extension 0.0.5 → 0.0.6
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.
- data/History.txt +4 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/fabulator_exhibit_extension.rb +1 -1
- data/lib/fabulator_exhibit_extension/database.rb +42 -17
- data/public/javascripts/fabulator/exhibit/data.js +152 -53
- data/public/javascripts/fabulator/exhibit/exhibit.js +73 -1
- data/public/javascripts/fabulator/exhibit/expressions.js +1 -1
- data/public/javascripts/fabulator/exhibit/views.js +13 -5
- data/public/stylesheets/fabulator/exhibit/exhibit.css +11 -0
- metadata +7 -7
data/History.txt
CHANGED
data/Rakefile
CHANGED
@@ -8,7 +8,7 @@ begin
|
|
8
8
|
gem.homepage = "http://github.com/jgsmith/radiant-fabulator-exhibit"
|
9
9
|
gem.authors = ["James Smith"]
|
10
10
|
gem.add_dependency('radiant-fabulator-extension', '>= 0.0.7')
|
11
|
-
gem.add_dependency('fabulator-exhibit', '>= 0.0.
|
11
|
+
gem.add_dependency('fabulator-exhibit', '>= 0.0.7')
|
12
12
|
gem.add_dependency('json', '>= 1.4.3')
|
13
13
|
gem.add_dependency('uuid', '>= 2.3.1')
|
14
14
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
@@ -2,33 +2,50 @@ class FabulatorExhibitExtension
|
|
2
2
|
class Database
|
3
3
|
def initialize(db)
|
4
4
|
@db = db
|
5
|
+
@info = {
|
6
|
+
:items => ItemCollection.new(@db),
|
7
|
+
:properties => PropertyCollection.new(@db),
|
8
|
+
:types => TypeCollection.new(@db)
|
9
|
+
}
|
5
10
|
end
|
6
11
|
|
7
12
|
def to_json
|
8
|
-
'{ "items":' +
|
9
|
-
' "types":' +
|
10
|
-
' "properties":' +
|
13
|
+
'{ "items":' + @info[:items].to_json + ', ' +
|
14
|
+
' "types":' + @info[:types].to_json + ', ' +
|
15
|
+
' "properties":' + @info[:properties].to_json +
|
11
16
|
'}'
|
12
17
|
end
|
13
18
|
|
14
19
|
def [](t)
|
15
|
-
|
16
|
-
when :items
|
17
|
-
return ItemCollection.new(@db)
|
18
|
-
when :properties
|
19
|
-
return PropertyCollection.new(@db)
|
20
|
-
when :types
|
21
|
-
return TypeCollection.new(@db)
|
22
|
-
end
|
20
|
+
@info[t.to_sym]
|
23
21
|
end
|
24
22
|
end
|
25
23
|
|
26
24
|
class ItemCollection
|
27
25
|
def initialize(db)
|
28
26
|
@db = db
|
27
|
+
@items = { }
|
28
|
+
end
|
29
|
+
|
30
|
+
def delete_if(&block)
|
31
|
+
self.each do |i|
|
32
|
+
r = yield i['id'], i
|
33
|
+
if r
|
34
|
+
@items.delete(i['id'])
|
35
|
+
i.delete
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def each(&block)
|
41
|
+
@db.fabulator_exhibit_items.find(:all).each do |i|
|
42
|
+
@items[i.id.to_s] ||= Item.new(i)
|
43
|
+
yield @items[i.id.to_s]
|
44
|
+
end
|
29
45
|
end
|
30
46
|
|
31
47
|
def [](nom)
|
48
|
+
return @items[nom] if @items.include?(nom)
|
32
49
|
ob = nil
|
33
50
|
begin
|
34
51
|
ob = @db.fabulator_exhibit_items.find(:first, [ 'uuid = ?', nom ])
|
@@ -41,13 +58,13 @@ class FabulatorExhibitExtension
|
|
41
58
|
:fabulator_exhibit_id => @db.id
|
42
59
|
})
|
43
60
|
end
|
44
|
-
Item.new(ob)
|
61
|
+
@items[nom] = Item.new(ob)
|
45
62
|
end
|
46
63
|
|
47
64
|
def include?(nom)
|
48
65
|
ob = nil
|
49
66
|
begin
|
50
|
-
ob = @db.fabulator_exhibit_items.find(:first, [ 'uuid = ?', nom ])
|
67
|
+
ob = @db.fabulator_exhibit_items.find(:first, :conditions => [ 'uuid = ?', nom ])
|
51
68
|
rescue
|
52
69
|
ob = nil
|
53
70
|
end
|
@@ -72,12 +89,14 @@ class FabulatorExhibitExtension
|
|
72
89
|
class PropertyCollection
|
73
90
|
def initialize(db)
|
74
91
|
@db = db
|
92
|
+
@properties = { }
|
75
93
|
end
|
76
94
|
|
77
95
|
def [](nom)
|
96
|
+
return @properties[nom] if @properties.include?(nom)
|
78
97
|
ob = nil
|
79
98
|
begin
|
80
|
-
ob = @db.fabulator_exhibit_properties.find(:first, [ 'name = ?', nom ])
|
99
|
+
ob = @db.fabulator_exhibit_properties.find(:first, :conditions => [ 'name = ?', nom ])
|
81
100
|
rescue
|
82
101
|
ob = nil
|
83
102
|
end
|
@@ -87,7 +106,7 @@ class FabulatorExhibitExtension
|
|
87
106
|
:fabulator_exhibit_id => @db.id
|
88
107
|
})
|
89
108
|
end
|
90
|
-
Property.new(ob)
|
109
|
+
@properties[nom] ||= Property.new(ob)
|
91
110
|
end
|
92
111
|
|
93
112
|
def []=(nom, hash)
|
@@ -110,12 +129,14 @@ class FabulatorExhibitExtension
|
|
110
129
|
class TypeCollection
|
111
130
|
def initialize(db)
|
112
131
|
@db = db
|
132
|
+
@types = { }
|
113
133
|
end
|
114
134
|
|
115
135
|
def [](nom)
|
136
|
+
return @types[nom] if @types.include?(nom)
|
116
137
|
ob = nil
|
117
138
|
begin
|
118
|
-
ob = @db.fabulator_exhibit_types.find(:first, [ 'name = ?', nom ])
|
139
|
+
ob = @db.fabulator_exhibit_types.find(:first, :conditions => [ 'name = ?', nom ])
|
119
140
|
rescue
|
120
141
|
ob = nil
|
121
142
|
end
|
@@ -125,7 +146,7 @@ class FabulatorExhibitExtension
|
|
125
146
|
:fabulator_exhibit_id => @db.id
|
126
147
|
})
|
127
148
|
end
|
128
|
-
Type.new(ob)
|
149
|
+
@types[nom] ||= Type.new(ob)
|
129
150
|
end
|
130
151
|
|
131
152
|
def []=(nom, hash)
|
@@ -151,6 +172,10 @@ class FabulatorExhibitExtension
|
|
151
172
|
@raw_data = ( JSON.parse(i.data) rescue {} )
|
152
173
|
end
|
153
174
|
|
175
|
+
def delete
|
176
|
+
@item.delete
|
177
|
+
end
|
178
|
+
|
154
179
|
def [](k)
|
155
180
|
@raw_data[k]
|
156
181
|
end
|
@@ -37,8 +37,11 @@ Fabulator.namespace('Exhibit');
|
|
37
37
|
|
38
38
|
var sources = { };
|
39
39
|
|
40
|
+
var data_view_counter = 1;
|
41
|
+
|
40
42
|
Exhibit.DataView = function(options) {
|
41
43
|
var that = { },
|
44
|
+
progress,
|
42
45
|
set = Exhibit.Set();
|
43
46
|
that.options = options;
|
44
47
|
|
@@ -53,12 +56,25 @@ Fabulator.namespace('Exhibit');
|
|
53
56
|
ob.events.onFilterChange.addListener(that.eventFilterChange);
|
54
57
|
};
|
55
58
|
|
59
|
+
$("<div id='data-source-progress-" + data_view_counter + "'>" +
|
60
|
+
"<div class='flc-progress progress-pop-up exhibit-progress-pop-up ui-corner-all'><h3>Filtering...</h3>" +
|
61
|
+
"<div class='flc-progress-indicator progress-indicator'></div>" +
|
62
|
+
"<p class='flc-progress-label progress-label'>0% Complete</p>" +
|
63
|
+
"</div></div>").appendTo($("html > body"));
|
64
|
+
|
65
|
+
progress = fluid.progress("#data-source-progress-" + data_view_counter);
|
66
|
+
|
67
|
+
progress.hide();
|
68
|
+
|
69
|
+
data_view_counter += 1;
|
70
|
+
|
71
|
+
|
56
72
|
that.items = set.items;
|
57
73
|
|
58
74
|
that.size = set.size;
|
59
75
|
|
60
|
-
that.filterItems = function() {
|
61
|
-
var id, fres, ids;
|
76
|
+
that.filterItems = function(endFn) {
|
77
|
+
var id, fres, ids, percent, old_percent, n, chunk_size, f;
|
62
78
|
|
63
79
|
set = Exhibit.Set();
|
64
80
|
|
@@ -68,30 +84,68 @@ Fabulator.namespace('Exhibit');
|
|
68
84
|
|
69
85
|
ids = that.dataSource.items();
|
70
86
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
87
|
+
old_percent = 0;
|
88
|
+
n = ids.length;
|
89
|
+
|
90
|
+
if(n > 100) {
|
91
|
+
progress.show();
|
92
|
+
}
|
93
|
+
|
94
|
+
chunk_size = parseInt(n / 100);
|
95
|
+
|
96
|
+
if(chunk_size > 200) {
|
97
|
+
chunk_size = 200;
|
98
|
+
}
|
99
|
+
|
100
|
+
f = function(start) {
|
101
|
+
var i, end;
|
102
|
+
end = start + chunk_size;
|
103
|
+
if( end > n ) {
|
104
|
+
end = n;
|
77
105
|
}
|
78
|
-
|
106
|
+
for(i = start; i < end; i += 1) {
|
107
|
+
id = ids[i];
|
108
|
+
fres = that.events.onFilterItem.fire(that.dataSource, id);
|
109
|
+
if(fres !== false) {
|
110
|
+
set.add(id);
|
111
|
+
}
|
112
|
+
}
|
113
|
+
if(n > 100 ) {
|
114
|
+
percent = parseInt(end * 100 / n);
|
115
|
+
if( percent > old_percent ) {
|
116
|
+
progress.update(percent, percent + "% Complete");
|
117
|
+
}
|
118
|
+
}
|
119
|
+
if(end < n) {
|
120
|
+
setTimeout(function() {
|
121
|
+
f(end);
|
122
|
+
}, 0);
|
123
|
+
}
|
124
|
+
else {
|
125
|
+
if(n > 100 ) {
|
126
|
+
progress.update(100, "100% Complete");
|
127
|
+
progress.hide();
|
128
|
+
}
|
129
|
+
if(endFn) { setTimeout(endFn, 0); }
|
130
|
+
}
|
131
|
+
};
|
132
|
+
f(0);
|
79
133
|
};
|
80
134
|
|
81
135
|
that.eventModelChange = function(model) {
|
82
136
|
var id;
|
83
137
|
|
84
|
-
that.filterItems()
|
85
|
-
|
86
|
-
|
138
|
+
that.filterItems(function() {
|
139
|
+
that.events.onModelChange.fire(that);
|
140
|
+
});
|
87
141
|
};
|
88
142
|
|
89
143
|
that.eventFilterChange = function() {
|
90
144
|
var id;
|
91
145
|
|
92
|
-
that.filterItems()
|
93
|
-
|
94
|
-
|
146
|
+
that.filterItems(function() {
|
147
|
+
that.events.onModelChange.fire(that);
|
148
|
+
});
|
95
149
|
};
|
96
150
|
|
97
151
|
that.getItem = function(id) {
|
@@ -108,10 +162,32 @@ Fabulator.namespace('Exhibit');
|
|
108
162
|
var separator = ", ",
|
109
163
|
last_separator = ", and ",
|
110
164
|
pair_separator = " and ",
|
111
|
-
values, value, lens,
|
165
|
+
values, value, lens, popupFn,
|
112
166
|
valueType, lensElmt, lensRender,
|
113
167
|
i, n;
|
114
168
|
|
169
|
+
popupFn = function(container, trigger, lens, itemID) {
|
170
|
+
var lensRender;
|
171
|
+
|
172
|
+
trigger.bind("click", function() {
|
173
|
+
var t, id;
|
174
|
+
|
175
|
+
if( !lensRender ) {
|
176
|
+
lensRender = lens.render(view, view.options.viewPanel.dataView, itemID);
|
177
|
+
/* TODO: make id more universally unique */
|
178
|
+
id = itemID;
|
179
|
+
id = id.replace('.', '-');
|
180
|
+
$(lensRender).attr('id', 'facet-item-lens-' + id);
|
181
|
+
$(lensRender).addClass('facets-overlay');
|
182
|
+
$("<a class='close ui-icon ui-icon-circle-close'></a>").prependTo($(lensRender));
|
183
|
+
$(lensRender).addClass('ui-corner-all');
|
184
|
+
$(lensRender).appendTo($(container));
|
185
|
+
$(trigger).attr('rel', '#facet-item-lens-' + id);
|
186
|
+
$(trigger).overlay({ load: true });
|
187
|
+
}
|
188
|
+
});
|
189
|
+
};
|
190
|
+
|
115
191
|
if( "separator" in templateNode ) {
|
116
192
|
separator = templateNode.separator;
|
117
193
|
}
|
@@ -150,18 +226,10 @@ Fabulator.namespace('Exhibit');
|
|
150
226
|
else {
|
151
227
|
/* construct a clickable link that will pop up the lens content */
|
152
228
|
lensElmt = $("<div></div>");
|
153
|
-
lensRender = lens.render(view, model, values[i]);
|
154
|
-
/* TODO: make id more universally unique */
|
155
|
-
$(lensRender).attr('id', 'facet-item-lens-' + values[i]);
|
156
|
-
$(lensRender).addClass('facets-overlay');
|
157
|
-
$("<a class='close ui-icon ui-icon-circle-close'></a>").prependTo($(lensRender));
|
158
|
-
$(lensRender).addClass('ui-corner-all');
|
159
|
-
trigger = $("<span rel='#facet-item-lens-'" + values[i] + "'>" + value.label[0] + "</span>")
|
160
|
-
trigger.appendTo(lensElmt);
|
161
|
-
$(lensRender).appendTo(lensElmt);
|
162
229
|
lensElmt.appendTo($(parentElmt));
|
163
|
-
$(
|
164
|
-
trigger.
|
230
|
+
trigger = $("<span rel='#facet-item-lens-" + values[i] + "'>" + value.label[0] + "</span>")
|
231
|
+
trigger.appendTo(lensElmt);
|
232
|
+
popupFn(lensElmt, trigger, lens, values[i]);
|
165
233
|
}
|
166
234
|
}
|
167
235
|
else {
|
@@ -416,7 +484,7 @@ Fabulator.namespace('Exhibit');
|
|
416
484
|
that.name = p;
|
417
485
|
|
418
486
|
that.getValueType = function() {
|
419
|
-
that.valueType;
|
487
|
+
return that.valueType;
|
420
488
|
};
|
421
489
|
|
422
490
|
return that;
|
@@ -509,19 +577,17 @@ Fabulator.namespace('Exhibit');
|
|
509
577
|
baseURI = location.href;
|
510
578
|
}
|
511
579
|
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
if("properties" in data) {
|
517
|
-
that.loadProperties(data.properties, baseURI);
|
518
|
-
}
|
519
|
-
|
520
|
-
if("items" in data) {
|
521
|
-
that.loadItems(data.items, baseURI);
|
522
|
-
}
|
580
|
+
data.types = data.types || { };
|
581
|
+
data.properties = data.properties || { };
|
582
|
+
data.items = data.items || [ ];
|
523
583
|
|
524
|
-
that.
|
584
|
+
that.loadTypes(data.types, baseURI, function() {
|
585
|
+
that.loadProperties(data.properties, baseURI, function() {
|
586
|
+
that.loadItems(data.items, baseURI, function() {
|
587
|
+
that.events.onModelChange.fire(that);
|
588
|
+
});
|
589
|
+
});
|
590
|
+
});
|
525
591
|
};
|
526
592
|
|
527
593
|
var canonicalBaseURI = function(baseURI) {
|
@@ -535,7 +601,7 @@ Fabulator.namespace('Exhibit');
|
|
535
601
|
return baseURI;
|
536
602
|
};
|
537
603
|
|
538
|
-
that.loadTypes = function(types, baseURI) {
|
604
|
+
that.loadTypes = function(types, baseURI, fn) {
|
539
605
|
var typeID, typeEntry, type, p;
|
540
606
|
|
541
607
|
that.events.onBeforeLoadingTypes.fire(that);
|
@@ -570,9 +636,11 @@ Fabulator.namespace('Exhibit');
|
|
570
636
|
catch(e) {
|
571
637
|
Exhibit.debug("loadTypes failed:", e);
|
572
638
|
}
|
639
|
+
|
640
|
+
setTimeout(fn, 0);
|
573
641
|
};
|
574
642
|
|
575
|
-
that.loadProperties = function(properties, baseURI) {
|
643
|
+
that.loadProperties = function(properties, baseURI, fn) {
|
576
644
|
var propertyID, propertyEntry, property;
|
577
645
|
|
578
646
|
that.events.onBeforeLoadingProperties.fire(that);
|
@@ -612,10 +680,11 @@ Fabulator.namespace('Exhibit');
|
|
612
680
|
catch(e) {
|
613
681
|
Exhibit.debug("loadProperties failed: ", e);
|
614
682
|
}
|
683
|
+
setTimeout(fn, 0);
|
615
684
|
};
|
616
685
|
|
617
|
-
that.loadItems = function(items, baseURI) {
|
618
|
-
var spo, ops, indexTriple,
|
686
|
+
that.loadItems = function(items, baseURI, fn) {
|
687
|
+
var spo, ops, indexTriple, entry, n, progress, percent, old_percent, f;
|
619
688
|
|
620
689
|
var indexPut = function(index, x, y, z) {
|
621
690
|
var hash = index[x],
|
@@ -643,7 +712,7 @@ Fabulator.namespace('Exhibit');
|
|
643
712
|
|
644
713
|
that.events.onBeforeLoadingItems.fire(that);
|
645
714
|
$("<div id='progress-items-" + options.source + "'>" +
|
646
|
-
"<div class='flc-progress progress-pop-up exhibit-progress-pop-up'><h3>Loading " + items.length + " Item" + (items.length == 1 ? "" : "s") + "</h3>" +
|
715
|
+
"<div class='flc-progress progress-pop-up exhibit-progress-pop-up ui-corner-all'><h3>Loading " + items.length + " Item" + (items.length == 1 ? "" : "s") + "</h3>" +
|
647
716
|
"<div class='flc-progress-bar progress-bar'>" +
|
648
717
|
"<div class='flc-progress-indicator progress-indicator'></div>" +
|
649
718
|
"</div>" +
|
@@ -662,24 +731,54 @@ Fabulator.namespace('Exhibit');
|
|
662
731
|
indexPut(that.ops, o, p, s);
|
663
732
|
};
|
664
733
|
|
665
|
-
|
666
|
-
|
734
|
+
n = items.length;
|
735
|
+
chunk_size = parseInt( n / 100 );
|
736
|
+
if(chunk_size > 200) {
|
737
|
+
chunk_size = 200;
|
738
|
+
}
|
739
|
+
|
740
|
+
f = function(start) {
|
741
|
+
var end, i;
|
742
|
+
|
743
|
+
end = start + chunk_size;
|
744
|
+
if( end > n ) { end = n; }
|
745
|
+
|
746
|
+
try {
|
747
|
+
for(i = start; i < end; i += 1 ) {
|
748
|
+
entry = items[i];
|
749
|
+
if( typeof(entry) == "object" ) {
|
750
|
+
that.loadItem(entry, indexTriple, baseURI);
|
751
|
+
}
|
752
|
+
}
|
753
|
+
}
|
754
|
+
catch(e) {
|
755
|
+
Exhibit.debug("loadItems failed: ", e);
|
756
|
+
}
|
757
|
+
|
758
|
+
percent = parseInt(i * 100 / n);
|
667
759
|
if( percent > old_percent ) {
|
668
760
|
old_percent = percent;
|
669
761
|
progress.update(percent, percent + "% Complete");
|
670
762
|
}
|
671
|
-
|
672
|
-
|
673
|
-
|
763
|
+
if( end < n ) {
|
764
|
+
setTimeout(function() {
|
765
|
+
f(end);
|
766
|
+
}, 0);
|
767
|
+
}
|
768
|
+
else {
|
769
|
+
progress.update(100, "100% Complete");
|
770
|
+
progress.hide();
|
771
|
+
setTimeout(function() {
|
772
|
+
that.events.onAfterLoadingItems.fire(that);
|
773
|
+
setTimeout(fn, 0);
|
774
|
+
}, 0);
|
674
775
|
}
|
675
776
|
}
|
676
|
-
|
777
|
+
f(0);
|
677
778
|
}
|
678
779
|
catch(e) {
|
679
780
|
Exhibit.debug("loadItems failed: ", e);
|
680
781
|
}
|
681
|
-
progress.update(100, "100% Complete");
|
682
|
-
progress.hide();
|
683
782
|
};
|
684
783
|
|
685
784
|
that.loadItem = function(item, indexFn, baseURI) {
|
@@ -53,6 +53,9 @@ Fabulator.namespace('Exhibit');
|
|
53
53
|
var initDataView = function(that) {
|
54
54
|
that.dataView = Exhibit.DataView({ source: that.options.source });
|
55
55
|
that.dataView.events.onModelChange.addListener(that.eventModelChange);
|
56
|
+
if( "collection" in that ) {
|
57
|
+
that.dataView.events.onFilterItem.addListener( function(s,i) { return that.collection(s,i); } );
|
58
|
+
}
|
56
59
|
that.registerFilter = function(filter) {
|
57
60
|
that.dataView.registerFilter(filter);
|
58
61
|
};
|
@@ -72,6 +75,74 @@ Fabulator.namespace('Exhibit');
|
|
72
75
|
});
|
73
76
|
};
|
74
77
|
|
78
|
+
var initCollections = function(that) {
|
79
|
+
that.collections = { };
|
80
|
+
|
81
|
+
$(that.container).children().each(function(idx, el) {
|
82
|
+
var id, filterFn, priorFilterFn, n;
|
83
|
+
|
84
|
+
if( $(el).attr('ex:role') == "exhibit-collection" ) {
|
85
|
+
id = $(el).attr('id');
|
86
|
+
types = $(el).attr('ex:itemTypes');
|
87
|
+
if(types) {
|
88
|
+
types = types.split(/,\s*/);
|
89
|
+
|
90
|
+
n = types.length;
|
91
|
+
|
92
|
+
filterFn = function(dataSource, itemID) {
|
93
|
+
var i, j, m, item = dataSource.getItem(itemID);
|
94
|
+
if( typeof(item.type) == "undefined" ) {
|
95
|
+
item.type = "Item";
|
96
|
+
}
|
97
|
+
if(typeof(item.type) == "string") {
|
98
|
+
for(i = 0; i < n; i += 1 ) {
|
99
|
+
if( item.type == types[i] ) {
|
100
|
+
return;
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
else {
|
105
|
+
m = item.type.length;
|
106
|
+
for( i = 0; i < n; i += 1 ) {
|
107
|
+
for( j = 0; j < m; j += 1 ) {
|
108
|
+
if( item.type[j] == types[i] ) {
|
109
|
+
return;
|
110
|
+
}
|
111
|
+
}
|
112
|
+
}
|
113
|
+
}
|
114
|
+
return false;
|
115
|
+
};
|
116
|
+
|
117
|
+
if( id != null && id != "" ) {
|
118
|
+
if( id in that.collections ) {
|
119
|
+
priorFilterFn = that.collections[id];
|
120
|
+
that.collections[id] = function(dataSource, itemID) {
|
121
|
+
if( filterFn(dataSource, itemID) !== false ) { return; }
|
122
|
+
return priorFilterFn(dataSource, itemID);
|
123
|
+
};
|
124
|
+
}
|
125
|
+
else {
|
126
|
+
that.collections[id] = filterFn;
|
127
|
+
}
|
128
|
+
}
|
129
|
+
else {
|
130
|
+
if( "collection" in that ) {
|
131
|
+
priorFilterFn = that.collection;
|
132
|
+
that.collection = function(dataSource, itemID) {
|
133
|
+
if( filterFn(dataSource, itemID) !== false ) { return; }
|
134
|
+
return priorFilterFn(dataSource, itemID);
|
135
|
+
};
|
136
|
+
}
|
137
|
+
else {
|
138
|
+
that.collection = filterFn;
|
139
|
+
}
|
140
|
+
}
|
141
|
+
}
|
142
|
+
}
|
143
|
+
});
|
144
|
+
};
|
145
|
+
|
75
146
|
Exhibit.ViewPanel = function(container, options) {
|
76
147
|
var that = fluid.initView("Fabulator.Exhibit.ViewPanel", container, options),
|
77
148
|
lenses = new Array(),
|
@@ -124,6 +195,8 @@ Fabulator.namespace('Exhibit');
|
|
124
195
|
}
|
125
196
|
}
|
126
197
|
|
198
|
+
initCollections(that);
|
199
|
+
|
127
200
|
initDataView(that);
|
128
201
|
|
129
202
|
initPresentationViews(that);
|
@@ -132,7 +205,6 @@ Fabulator.namespace('Exhibit');
|
|
132
205
|
|
133
206
|
that.dataView.dataSource.fetchData();
|
134
207
|
|
135
|
-
|
136
208
|
return that;
|
137
209
|
};
|
138
210
|
})(jQuery, Fabulator.Exhibit);
|
@@ -251,15 +251,23 @@
|
|
251
251
|
*/
|
252
252
|
|
253
253
|
that.eventModelChange = function(model) {
|
254
|
-
var template, cutpoints, tree, lens, i, n, item;
|
254
|
+
var template, cutpoints, tree, lens, i, n, item, start, end, items;
|
255
255
|
|
256
256
|
$(body_container).empty();
|
257
|
-
|
258
|
-
|
257
|
+
|
258
|
+
items = model.items();
|
259
|
+
n = items.length;
|
260
|
+
start = 0;
|
261
|
+
end = 20;
|
262
|
+
if( end > n ) {
|
263
|
+
end = n;
|
264
|
+
}
|
265
|
+
for( i = start; i < end; i += 1 ) {
|
266
|
+
item = model.getItem(items[i]);
|
259
267
|
lens = that.getLens(item);
|
260
268
|
|
261
|
-
$(lens.render(that, model,
|
262
|
-
}
|
269
|
+
$(lens.render(that, model, items[i])).appendTo($(body_container));
|
270
|
+
};
|
263
271
|
|
264
272
|
$("<div class='clear'></div>").appendTo($(body_container));
|
265
273
|
};
|
@@ -111,6 +111,17 @@
|
|
111
111
|
|
112
112
|
.exhibit-progress-pop-up {
|
113
113
|
position: absolute;
|
114
|
+
padding: 5px;
|
114
115
|
right: 40%;
|
115
116
|
top: 40%;
|
117
|
+
background: rgb(255,255,253);
|
118
|
+
background: rgba(255,255,253, 0.95);
|
119
|
+
|
120
|
+
border: 1px solid #cccccc;
|
121
|
+
}
|
122
|
+
|
123
|
+
.exhibit-lens-title {
|
124
|
+
background-color: #eeeeee;
|
125
|
+
font-weight: bold;
|
126
|
+
font-size: 110%;
|
116
127
|
}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-fabulator_exhibit-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James Smith
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-08 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -42,12 +42,12 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
hash:
|
45
|
+
hash: 17
|
46
46
|
segments:
|
47
47
|
- 0
|
48
48
|
- 0
|
49
|
-
-
|
50
|
-
version: 0.0.
|
49
|
+
- 7
|
50
|
+
version: 0.0.7
|
51
51
|
type: :runtime
|
52
52
|
version_requirements: *id002
|
53
53
|
- !ruby/object:Gem::Dependency
|