radiant-fabulator_exhibit-extension 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +9 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/app/models/fabulator_exhibit.rb +8 -0
- data/app/models/fabulator_exhibit_item.rb +9 -0
- data/app/models/fabulator_exhibit_property.rb +8 -0
- data/app/models/fabulator_exhibit_type.rb +8 -0
- data/db/migrate/002_create_fabulator_exhibit_content_tables.rb +69 -0
- data/fabulator_exhibit_extension.rb +13 -28
- data/lib/fabulator_exhibit_extension/database.rb +274 -0
- data/public/javascripts/fabulator/exhibit/data.js +88 -10
- data/public/javascripts/fabulator/exhibit/exhibit.js +2 -1
- data/public/javascripts/fabulator/exhibit/expressions.js +1 -1
- data/public/javascripts/fabulator/exhibit/facets.js +7 -157
- data/public/javascripts/fabulator/exhibit/util.js +473 -0
- data/public/javascripts/fabulator/exhibit/views.js +184 -14
- metadata +13 -7
@@ -38,7 +38,8 @@
|
|
38
38
|
items = new Array(),
|
39
39
|
item_id_to_pos = { },
|
40
40
|
presentationStyle,
|
41
|
-
viewClass, viewClassObj, tab_html
|
41
|
+
viewClass, viewClassObj, tab_html,
|
42
|
+
container_id = $(container).attr('id');
|
42
43
|
|
43
44
|
var calculatePositions = function() {
|
44
45
|
/* we have glue between panels */
|
@@ -171,7 +172,7 @@
|
|
171
172
|
tab_html = tab_html + "</ul>";
|
172
173
|
$(tab_html).prependTo($(container));
|
173
174
|
|
174
|
-
|
175
|
+
//$(container).tabs();
|
175
176
|
}
|
176
177
|
else if(presentationStyle == 'flat') {
|
177
178
|
}
|
@@ -190,10 +191,9 @@
|
|
190
191
|
viewClass, viewClassObj, tab_html;
|
191
192
|
};
|
192
193
|
|
193
|
-
Exhibit.Presentations.
|
194
|
-
var that = fluid.initView("Fabulator.Exhibit.Presentations.
|
195
|
-
lenses = new Array()
|
196
|
-
l;
|
194
|
+
Exhibit.Presentations.initView = function(type, container, options) {
|
195
|
+
var that = fluid.initView("Fabulator.Exhibit.Presentations." + type, container, options),
|
196
|
+
lenses = new Array();
|
197
197
|
|
198
198
|
options = that.options;
|
199
199
|
|
@@ -202,7 +202,7 @@
|
|
202
202
|
lenses.push(Exhibit.Lens(el, options));
|
203
203
|
}
|
204
204
|
});
|
205
|
-
|
205
|
+
|
206
206
|
that.getLens = function(item) {
|
207
207
|
for(i = 0, n = lenses.length; i < n; i++) {
|
208
208
|
if(lenses[i].isForItem(item)) {
|
@@ -210,24 +210,94 @@
|
|
210
210
|
}
|
211
211
|
}
|
212
212
|
return that.options.viewPanel.getLens(item);
|
213
|
+
}
|
214
|
+
|
215
|
+
if( "settingSpec" in options ) {
|
216
|
+
that.options.settings = Exhibit.Util.collectSettingsFromDOM(container, options.settingSpec);
|
217
|
+
}
|
218
|
+
|
219
|
+
if( "accessorSpec" in options ) {
|
220
|
+
that.options.accessors = that.options.accessors || {};
|
221
|
+
Exhibit.Util.createAccessorsFromDOM(container, options.accessorSpec, that.options.accessors);
|
213
222
|
}
|
214
223
|
|
224
|
+
return that;
|
225
|
+
};
|
226
|
+
|
227
|
+
Exhibit.Presentations.Tile = function(container, options) {
|
228
|
+
var that = Exhibit.Presentations.initView("Tile", container, options),
|
229
|
+
body_container,
|
230
|
+
my_id = $(container).attr('id');
|
231
|
+
|
232
|
+
options = that.options;
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
$(container).empty();
|
237
|
+
|
238
|
+
/*
|
239
|
+
$("<ul class='flt-pager-top' id='" + my_id + "-pages-top'>" +
|
240
|
+
"<li class='flc-pager-previous'><a href='#'>< previous</a></li>" +
|
241
|
+
"<li class='flc-pager-next'><a href='#'>next ></a></li>" +
|
242
|
+
"</ul>").appendTo($(container));
|
243
|
+
*/
|
244
|
+
$("<div id='" + my_id + "-body'></div>").appendTo($(container));
|
245
|
+
body_container = $('#' + my_id + '-body');
|
246
|
+
/*
|
247
|
+
$("<ul class='flt-pager-bottom' id='" + my_id + "-pages-bottom'>" +
|
248
|
+
"<li class='flc-pager-previous'><a href='#'>< previous</a></li>" +
|
249
|
+
"<li class='flc-pager-next'><a href='#'>next ></a></li>" +
|
250
|
+
"</ul>").appendTo($(container));
|
251
|
+
*/
|
252
|
+
|
215
253
|
that.eventModelChange = function(model) {
|
216
254
|
var template, cutpoints, tree, lens, i, n, item;
|
217
255
|
|
218
|
-
$(
|
256
|
+
$(body_container).empty();
|
219
257
|
$(model.items()).each(function(idx, id) {
|
220
258
|
item = model.getItem(id);
|
221
259
|
lens = that.getLens(item);
|
222
260
|
|
223
|
-
$(lens.render(model, id)).appendTo($(
|
261
|
+
$(lens.render(that, model, id)).appendTo($(body_container));
|
224
262
|
});
|
225
263
|
|
226
|
-
$("<div class='clear'></div>").appendTo($(
|
264
|
+
$("<div class='clear'></div>").appendTo($(body_container));
|
227
265
|
};
|
228
266
|
|
267
|
+
/*
|
268
|
+
var pagerModelChange = function(newModel, oldModel) {
|
269
|
+
console.log("pagerModelChange", newModel, oldModel);
|
270
|
+
};
|
271
|
+
|
272
|
+
fluid.pager(container, {
|
273
|
+
listeners: {
|
274
|
+
onModelChange: pagerModelChange
|
275
|
+
},
|
276
|
+
bodyRenderer: {
|
277
|
+
type: "Fabulator.Exhibit.Presentations.Tile.selfRender",
|
278
|
+
options: {
|
279
|
+
}
|
280
|
+
}
|
281
|
+
});
|
282
|
+
*/
|
283
|
+
|
229
284
|
return that;
|
230
|
-
}
|
285
|
+
};
|
286
|
+
|
287
|
+
Exhibit.Presentations.Tile.selfRender = function() {
|
288
|
+
/* console.log(arguments); */
|
289
|
+
};
|
290
|
+
|
291
|
+
Exhibit.Presentations.Map = function(container, options) {
|
292
|
+
var that = Exhibit.Presentations.initView("Map", container, options),
|
293
|
+
|
294
|
+
options = that.options;
|
295
|
+
|
296
|
+
that.eventModelChange = function(model) {
|
297
|
+
};
|
298
|
+
|
299
|
+
return that;
|
300
|
+
};
|
231
301
|
|
232
302
|
var parseSubcontentAttribute = function(value) {
|
233
303
|
var fragments = [ ],
|
@@ -308,6 +378,15 @@
|
|
308
378
|
that.content = expressionParser.parse(value);
|
309
379
|
parseChildNodes = false;
|
310
380
|
}
|
381
|
+
else if( name == "separator" ) {
|
382
|
+
that.separator = value;
|
383
|
+
}
|
384
|
+
else if( name == "last-separator" ) {
|
385
|
+
that.last_separator = value;
|
386
|
+
}
|
387
|
+
else if( name == "pair-separator" ) {
|
388
|
+
that.pair_separator = value;
|
389
|
+
}
|
311
390
|
else if( name == "if-exists" ) {
|
312
391
|
that.condition = {
|
313
392
|
test: "if-exists",
|
@@ -397,7 +476,7 @@
|
|
397
476
|
var that = { },
|
398
477
|
template = { };
|
399
478
|
|
400
|
-
that.render = function(model, itemID) {
|
479
|
+
that.render = function(view, model, itemID) {
|
401
480
|
var text, item = model.getItem(itemID);
|
402
481
|
|
403
482
|
text = "<table><tr><td colspan='2'>" +
|
@@ -426,12 +505,12 @@
|
|
426
505
|
|
427
506
|
template = processors.TemplateNode(container);
|
428
507
|
|
429
|
-
that.render = function(model, itemID) {
|
508
|
+
that.render = function(view, model, itemID) {
|
430
509
|
var div = document.createElement("div"),
|
431
510
|
old_div = template.elmt,
|
432
511
|
result;
|
433
512
|
template.elmt = div;
|
434
|
-
result = model.renderTemplate(itemID, template);
|
513
|
+
result = model.renderTemplate(view, itemID, template);
|
435
514
|
template.elmt = old_div;
|
436
515
|
return result.elmt;
|
437
516
|
};
|
@@ -476,3 +555,94 @@
|
|
476
555
|
|
477
556
|
fluid.defaults("Fabulator.Exhibit.Presentations", {
|
478
557
|
});
|
558
|
+
|
559
|
+
fluid.defaults("Fabulator.Exhibit.Presentations.Map", {
|
560
|
+
settingSpec: {
|
561
|
+
"center": { type: "float", defaultValue: [20,0], dimensions: 2 },
|
562
|
+
"zoom": { type: "float", defaultValue: 2 },
|
563
|
+
"size": { type: "text", defaultValue: "small" },
|
564
|
+
"scaleControl": { type: "boolean", defaultValue: true },
|
565
|
+
"overviewControl": { type: "boolean", defaultValue: true },
|
566
|
+
"type": { type: "enum", defaultValue: "normal", choices: [ "normal", "hybrid", "satellite" ] },
|
567
|
+
"bubbleTip": { type: "enum", defaultValue: "top", choices: [ "top", "bottom" ] },
|
568
|
+
"mapHeight": { type: "int", defaultValue: 400 },
|
569
|
+
"mapConstructor": { type: "function", defaultValue: null },
|
570
|
+
"color": { type: "text", defaultValue: "#FF9000" },
|
571
|
+
"colorCoder": { type: "text", defaultValue: null },
|
572
|
+
"sizeCoder": { type: "text", defaultValue: null },
|
573
|
+
"iconCoder": { type: "text", defaultValue: null },
|
574
|
+
"selectCoordinator": { type: "text", defaultValue: null },
|
575
|
+
"iconSize": { type: "int", defaultValue: 0 },
|
576
|
+
"iconFit": { type: "text", defaultValue: "smaller" },
|
577
|
+
"iconScale": { type: "float", defaultValue: 1 },
|
578
|
+
"iconOffsetX": { type: "float", defaultValue: 0 },
|
579
|
+
"iconOffsetY": { type: "float", defaultValue: 0 },
|
580
|
+
"shape": { type: "text", defaultValue: "circle" },
|
581
|
+
"shapeWidth": { type: "int", defaultValue: 24 },
|
582
|
+
"shapeHeight": { type: "int", defaultValue: 24 },
|
583
|
+
"shapeAlpha": { type: "float", defaultValue: 0.7 },
|
584
|
+
"pin": { type: "boolean", defaultValue: true },
|
585
|
+
"pinHeight": { type: "int", defaultValue: 6 },
|
586
|
+
"pinWidth": { type: "int", defaultValue: 6 },
|
587
|
+
"sizeLegendLabel": { type: "text", defaultValue: null },
|
588
|
+
"colorLegendLabel": { type: "text", defaultValue: null },
|
589
|
+
"iconLegendLabel": { type: "text", defaultValue: null },
|
590
|
+
"markerScale": { type: "text", defaultValue: null },
|
591
|
+
"showHeader": { type: "boolean", defaultValue: true },
|
592
|
+
"showSummary": { type: "boolean", defaultValue: true },
|
593
|
+
"showFooter": { type: "boolean", defaultValue: true }
|
594
|
+
},
|
595
|
+
accessorSpec: [
|
596
|
+
{ accessorName: "getProxy",
|
597
|
+
attributeName: "proxy"
|
598
|
+
},
|
599
|
+
{ accessorName: "getLatlng",
|
600
|
+
alternatives: [
|
601
|
+
{ bindings: [
|
602
|
+
{ attributeName: "latlng",
|
603
|
+
types: [ "float", "float" ],
|
604
|
+
bindingNames: [ "lat", "lng" ]
|
605
|
+
},
|
606
|
+
{ attributeName: "maxAutoZoom",
|
607
|
+
type: "float",
|
608
|
+
bindingName: "maxAutoZoom",
|
609
|
+
optional: true
|
610
|
+
}
|
611
|
+
]
|
612
|
+
},
|
613
|
+
{ bindings: [
|
614
|
+
{ attributeName: "lat",
|
615
|
+
type: "float",
|
616
|
+
bindingName: "lat"
|
617
|
+
},
|
618
|
+
{ attributeName: "lng",
|
619
|
+
type: "float",
|
620
|
+
bindingName: "lng"
|
621
|
+
},
|
622
|
+
{ attributeName: "maxAutoZoom",
|
623
|
+
type: "float",
|
624
|
+
bindingName: "maxAutoZoom",
|
625
|
+
optional: true
|
626
|
+
}
|
627
|
+
]
|
628
|
+
}
|
629
|
+
]
|
630
|
+
},
|
631
|
+
{ accessorName: "getColorKey",
|
632
|
+
attributeName: "colorKey",
|
633
|
+
type: "text"
|
634
|
+
},
|
635
|
+
{ accessorName: "getSizeKey",
|
636
|
+
attributeName: "sizeKey",
|
637
|
+
type: "text"
|
638
|
+
},
|
639
|
+
{ accessorName: "getIconKey",
|
640
|
+
attributeName: "iconKey",
|
641
|
+
type: "text"
|
642
|
+
},
|
643
|
+
{ accessorName: "getIcon",
|
644
|
+
attributeName: "icon",
|
645
|
+
type: "url"
|
646
|
+
}
|
647
|
+
]
|
648
|
+
});
|
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: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
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-
|
18
|
+
date: 2010-11-06 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: 19
|
46
46
|
segments:
|
47
47
|
- 0
|
48
48
|
- 0
|
49
|
-
-
|
50
|
-
version: 0.0.
|
49
|
+
- 6
|
50
|
+
version: 0.0.6
|
51
51
|
type: :runtime
|
52
52
|
version_requirements: *id002
|
53
53
|
- !ruby/object:Gem::Dependency
|
@@ -98,6 +98,9 @@ files:
|
|
98
98
|
- app/controllers/admin/fabulator/exhibits_controller.rb
|
99
99
|
- app/controllers/api/exhibits_controller.rb
|
100
100
|
- app/models/fabulator_exhibit.rb
|
101
|
+
- app/models/fabulator_exhibit_item.rb
|
102
|
+
- app/models/fabulator_exhibit_property.rb
|
103
|
+
- app/models/fabulator_exhibit_type.rb
|
101
104
|
- app/views/admin/fabulator/exhibits/_form.html.haml
|
102
105
|
- app/views/admin/fabulator/exhibits/edit.html.haml
|
103
106
|
- app/views/admin/fabulator/exhibits/index.html.haml
|
@@ -105,7 +108,9 @@ files:
|
|
105
108
|
- app/views/admin/fabulator/exhibits/remove.html.haml
|
106
109
|
- config/routes.rb
|
107
110
|
- db/migrate/001_create_fabulator_exhibit_tables.rb
|
111
|
+
- db/migrate/002_create_fabulator_exhibit_content_tables.rb
|
108
112
|
- fabulator_exhibit_extension.rb
|
113
|
+
- lib/fabulator_exhibit_extension/database.rb
|
109
114
|
- lib/radiant-fabulator_exhibit-extension.rb
|
110
115
|
- lib/tasks/fabulator_exhibit_extension.rb
|
111
116
|
- lib/tasks/fabulator_exhibit_extension_tasks.rake
|
@@ -113,6 +118,7 @@ files:
|
|
113
118
|
- public/javascripts/fabulator/exhibit/exhibit.js
|
114
119
|
- public/javascripts/fabulator/exhibit/expressions.js
|
115
120
|
- public/javascripts/fabulator/exhibit/facets.js
|
121
|
+
- public/javascripts/fabulator/exhibit/util.js
|
116
122
|
- public/javascripts/fabulator/exhibit/views.js
|
117
123
|
- public/stylesheets/fabulator/exhibit/exhibit.css
|
118
124
|
has_rdoc: true
|