[datapress] r149 committed - Added extra values option for all views. Also added a few more stock o...

0 views
Skip to first unread message

codesite...@google.com

unread,
Feb 23, 2011, 9:52:04 PM2/23/11
to datapres...@googlegroups.com
Revision: 149
Author: edward.benson
Date: Wed Feb 23 18:51:08 2011
Log: Added extra values option for all views. Also added a few more stock
options for the timeline
http://code.google.com/p/datapress/source/detail?r=149

Modified:
/trunk/plugin/configurator/exhibit-inputbox-view-bar.php
/trunk/plugin/configurator/exhibit-inputbox-view-list.php
/trunk/plugin/configurator/exhibit-inputbox-view-map.php
/trunk/plugin/configurator/exhibit-inputbox-view-scatter.php
/trunk/plugin/configurator/exhibit-inputbox-view-table.php
/trunk/plugin/configurator/exhibit-inputbox-view-timeline.php
/trunk/plugin/model/view.php

=======================================
--- /trunk/plugin/configurator/exhibit-inputbox-view-bar.php Mon Mar 30
14:23:37 2009
+++ /trunk/plugin/configurator/exhibit-inputbox-view-bar.php Wed Feb 23
18:51:08 2011
@@ -12,7 +12,13 @@
<td><select id="view-bar-klass" class="alltypebox"></select></td>
<td>(Optional)</td>
</tr>
- </table>
+
+ <tr>
+ <td><i>Extra Attributes (Advanced)</i></td>
+ <td><input id="exhibit-views-bar-extra-attributes" type="text"
size="60" /></td>
+ </tr>
+
+ </table>
<br />
<p align="right"><a href="#" class="addlink"
onclick="submit_view_bar_facet(); return false">Add Bar Chart</a></p>

@@ -26,7 +32,7 @@
var xLabel = jQuery('#exhibit-views-bar-xLabel').val();
var yLabel = jQuery('#exhibit-views-bar-yLabel').val();
var klass = jQuery('#view-bar-klass').val();
- // var extra_attributes = jQuery('#view-bar-extra-attributes').val();
+ var extra_attributes =
jQuery('#exhibit-views-bar-extra-attributes').val();

var params = {
kind: kind,
@@ -37,9 +43,9 @@
label: label
};

- // if (extra_attributes != null) {
- // params['extra_attributes'] = extra_attributes;
- // }
+ if (extra_attributes != null) {
+ params['extra_attributes'] = extra_attributes;
+ }

if (klass != null) {
params['klass'] = klass;
=======================================
--- /trunk/plugin/configurator/exhibit-inputbox-view-list.php Thu Dec 10
12:01:32 2009
+++ /trunk/plugin/configurator/exhibit-inputbox-view-list.php Wed Feb 23
18:51:08 2011
@@ -28,6 +28,14 @@
<td><select id="exhibit-views-list-sortby"
class="allpropbox"></select></td>
<td>(Optional)</td>
</tr>
+
+ <tr>
+ <td><i>Extra Attributes (Advanced)</i></td>
+ <td><input id="exhibit-views-list-extra-attributes"
type="text" size="60" /></td>
+ </tr>
+
+
+
</table>
<br />
<p align="right"><a href="#" class="addlink"
onclick="submit_view_list_facet(); return false">Add List</a></p>
@@ -40,7 +48,7 @@
var sortby = jQuery('#exhibit-views-list-sortby').val();
var decoration = jQuery('#exhibit-views-list-decoration').val()
var klass = jQuery('#view-list-klass').val();
- // var extra_attributes = jQuery('#view-list-extra-attributes').val();
+ var extra_attributes =
jQuery('#exhibit-views-list-extra-attributes').val();

var params = {
kind: kind,
@@ -55,9 +63,9 @@
params['klass'] = klass;
}

- // if (extra_attributes != null) {
- // params['extra_attributes'] = extra_attributes;
- // }
+ if (extra_attributes != null) {
+ params['extra_attributes'] = extra_attributes;
+ }

editinfo = {
editable: true,
=======================================
--- /trunk/plugin/configurator/exhibit-inputbox-view-map.php Thu Sep 10
12:47:53 2009
+++ /trunk/plugin/configurator/exhibit-inputbox-view-map.php Wed Feb 23
18:51:08 2011
@@ -32,7 +32,11 @@
<td><select id="exhibit-views-maps-icon"
class="allpropbox"></select></td>
<td>(Optional)</td>
</tr>
- </table>
+ <tr>
+ <td><i>Extra Attributes (Advanced)</i></td>
+ <td><input id="exhibit-views-maps-extra-attributes"
type="text" size="60" /></td>
+ </tr>
+ </table>
<!--
<p><i>What field (if any) varies the size of the marker?</i><br /><select
id="view-map-coderfield" class="allpropbox"></select></p>
NOTE: Currently disabled. You have to put the coder definition OUTSIDE the
view panel for it to work. Then we can add this back in.
@@ -48,8 +52,8 @@
var field = jQuery('#exhibit-views-maps-field').val();
var coderfield = jQuery('#exhibit-views-maps-coderfield').val();
var locationtype = jQuery('#exhibit-views-maps-fieldtype').val();
- // var extra_attributes = jQuery('#view-map-extra-attributes').val();
- var icon = jQuery('#exhibit-views-maps-icon').val();
+ var extra_attributes =
jQuery('#exhibit-views-maps-extra-attributes').val();
+ var icon = jQuery('#exhibit-views-maps-icon').val();
var bw = jQuery('#exhibit-views-maps-bubblewidth').val();
var bh = jQuery('#exhibit-views-maps-bubbleheight').val();
var mw = jQuery('#exhibit-views-maps-markerwidth').val();
@@ -68,9 +72,9 @@
locationtype: locationtype
};

- // if (extra_attributes != null) {
- // params['extra_attributes'] = extra_attributes;
- // }
+ if (extra_attributes != null) {
+ params['extra_attributes'] = extra_attributes;
+ }
if (icon != null) {
params['icon'] = icon;
}
=======================================
--- /trunk/plugin/configurator/exhibit-inputbox-view-scatter.php Sun Mar 22
14:48:33 2009
+++ /trunk/plugin/configurator/exhibit-inputbox-view-scatter.php Wed Feb 23
18:51:08 2011
@@ -30,7 +30,14 @@
<td><select id="view-scatter-klass" class="alltypebox"></select></td>
<td>(Optional)</td>
</tr>
- </table>
+
+ <tr>
+ <td><i>Extra Attributes (Advanced)</i></td>
+ <td><input id="exhibit-views-scatter-extra-attributes"
type="text" size="60" /></td>
+ </tr>
+
+
+ </table>
<br />
<p align="right"><a href="#" class="addlink"
onclick="submit_view_scatter_facet(); return false">Add Scatter Plot</a></p>

@@ -44,7 +51,7 @@
var xLabel = jQuery('#exhibit-views-scatter-xLabel').val();
var yLabel = jQuery('#exhibit-views-scatter-yLabel').val();
var klass = jQuery('#view-scatter-klass').val();
- // var extra_attributes = jQuery('#view-scatter-extra-attributes').val();
+ var extra_attributes =
jQuery('#exhibit-views-scatter-extra-attributes').val();

var params = {
kind: kind,
@@ -55,9 +62,9 @@
label: label
};

- // if (extra_attributes != null) {
- // params['extra_attributes'] = extra_attributes;
- // }
+ if (extra_attributes != null) {
+ params['extra_attributes'] = extra_attributes;
+ }
if (klass != null) {
params['klass'] = klass;
}
=======================================
--- /trunk/plugin/configurator/exhibit-inputbox-view-table.php Mon Mar 30
10:29:39 2009
+++ /trunk/plugin/configurator/exhibit-inputbox-view-table.php Wed Feb 23
18:51:08 2011
@@ -5,7 +5,14 @@
<tr><td><i>Include Fields</i></td><td><select
id="exhibit-views-table-field" style="height: 100px; width: 200px;"
class="allpropbox" multiple></select></td><td></td></tr>
<tr><td><i>Field Captions</i><br />(Comma-separated)</td><td><input
id="exhibit-views-table-caption" title="Enter captions for the fields you
have selected as a comme-separated list in the same order as they appear
above." type="text" size="30" /></td><td>(Optional)</td></tr>
<tr><td><i>Only show items of type</i></td><td><select
id="exhibit-views-table-klass"
class="alltypebox"></select></td><td>(Optional)</td></tr>
- </table>
+
+ <tr>
+ <td><i>Extra Attributes (Advanced)</i></td>
+ <td><input id="exhibit-views-table-extra-attributes"
type="text" size="60" /></td>
+ </tr>
+
+
+ </table>
<br />
<p align="right"><a href="#" class="addlink"
onclick="submit_view_table_facet(); return false">Add Table</a></p>

@@ -18,7 +25,7 @@
var klass = jQuery('#exhibit-views-table-klass').val();
var fields = jQuery('#exhibit-views-table-field')[0];
var caption = jQuery('#exhibit-views-table-caption').val();
- // var extra_attributes = jQuery('#view-table-extra-attributes').val();
+ var extra_attributes =
jQuery('#exhibit-views-table-extra-attributes').val();

var field = "";

@@ -39,9 +46,9 @@
label: label
};

- // if (extra_attributes != null) {
- // params['extra_attributes'] = extra_attributes;
- // }
+ if (extra_attributes != null) {
+ params['extra_attributes'] = extra_attributes;
+ }

if (klass != null) {
params['klass'] = klass;
=======================================
--- /trunk/plugin/configurator/exhibit-inputbox-view-timeline.php Sun Mar
22 14:48:33 2009
+++ /trunk/plugin/configurator/exhibit-inputbox-view-timeline.php Wed Feb
23 18:51:08 2011
@@ -21,17 +21,37 @@
<td><select id="exhibit-views-timeline-color"
class="allpropbox"></select></td>
<td>(Optional)</td>
</tr>
- <tr>
- <td><i>Proxy (advanced)</i></td>
- <td><select id="exhibit-views-timeline-proxy"
class="allpropbox"></select></td>
- <td>(Optional)</td>
- </tr>
- <tr>
+ <tr>
+ <td><i>Timeline Height</i></td>
+ <td><input id="exhibit-views-timeline-height" type="text"
value="170" /></td>
+ </tr>
+ <tr>
+ <td><i>Top Band Unit</i></td>
+ <td><select id="exhibit-views-timeline-topBandUnit">
+ <option value="year">Year</option><option
value="month">Month</option><option value="week">Week</option><option
value="day">Day</option>
+ </select></td>
+ </tr>
+ <tr>
+ <td><i>Bottom Band Unit</i></td>
+ <td><select id="exhibit-views-timeline-bottomBandUnit">
+ <option value="year">Year</option><option
value="month">Month</option><option value="week">Week</option><option
value="day">Day</option>
+ </select></td>
+ </tr>
+ <tr>
<td><i>Only show items of type</i></td>
<td><select id="view-timeline-klass" class="alltypebox"></select></td>
<td>(Optional)</td>
</tr>
- </table>
+ <tr>
+ <td><i>Proxy (advanced)</i></td>
+ <td><select id="exhibit-views-timeline-proxy"
class="allpropbox"></select></td>
+ <td>(Optional)</td>
+ </tr>
+ <tr>
+ <td><i>Extra Attributes (Advanced)</i></td>
+ <td><input id="exhibit-views-timeline-extra-attributes"
type="text" size="60" /></td>
+ </tr>
+</table>
<br />
<p align="right"><a href="#" class="addlink"
onclick="submit_view_timeline_facet(); return false">Add Timeline</a></p>

@@ -46,13 +66,18 @@
var color = jQuery('#exhibit-views-timeline-color').val();
var proxy = jQuery('#exhibit-views-timeline-proxy').val();
var klass = jQuery('#view-timeline-klass').val();
-
- // var extra_attributes = jQuery('#view-timeline-extra-attributes').val();
+ var height = jQuery('#exhibit-views-timeline-height').val();
+ var topUnit = jQuery('#exhibit-views-timeline-topBandUnit').val();
+ var bottomUnit =
jQuery('#exhibit-views-timeline-bottomBandUnit').val();
+ var extra_attributes =
jQuery('#exhibit-views-timeline-extra-attributes').val();

var params = {
kind: kind,
label: label,
- field : start
+ field : start,
+ height : height,
+ topBandUnit : topUnit,
+ bottomBandUnit : bottomUnit
};

if (end != null) {
@@ -63,10 +88,11 @@
}
if (color != null) {
params['color'] = color;
- }
- // if (extra_attributes != null) {
- // params['extra_attributes'] = extra_attributes;
- // }
+ }
+
+ if (extra_attributes != null) {
+ params['extra_attributes'] = extra_attributes;
+ }
if (proxy != null) {
params['proxy'] = proxy;
}
=======================================
--- /trunk/plugin/model/view.php Thu Dec 10 12:01:32 2009
+++ /trunk/plugin/model/view.php Wed Feb 23 18:51:08 2011
@@ -26,7 +26,10 @@
'bubblewidth' => NULL,
'bubbleheight' => NULL,
'markerwidth' => NULL,
- 'markerheight' => NULL,
+ 'markerheight' => NULL,
+ 'height' => NULL,
+ 'topBandUnit' => NULL,
+ 'bottomBandUnit' => NULL,
'extra_attributes' => NULL
);

@@ -64,8 +67,22 @@
function getLinkCaption() {
return $this->getShortKind() . ": " . $this->get('label');
}
-
- function htmlContent() {
+
+ function propString($prop, $value, $default) {
+ if ($value == NULL) {
+ if ($default == NULL) {
+ return "";
+ }
+ else {
+ return " " . $prop . "=\"" . $default . "\" ";
+ }
+ }
+ else {
+ return " " . $prop . "=\"" . $value . "\" ";
+ }
+ }
+
+ function htmlContent() {
$kind = $this->get('kind');
$label = $this->get('label');

@@ -81,7 +98,13 @@
if ($kind == "view-tile") {
// Todo: add the actual date and time stuff
$bulletstyle = $this->get('decoration');
- return "<div class=\"$bulletstyle\" ex:role=\"exhibit-view\"
ex:viewClass=\"Exhibit.TileView\" $collection_insert
ex:label=\"$label\"></div>";
+ $inner = "";
+
+ if ($this->get('extra_attributes') != NULL) {
+ $inner .= " " . $this->get('extra_attributes') . " ";
+ }
+
+ return "<div class=\"$bulletstyle\" ex:role=\"exhibit-view\"
ex:viewClass=\"Exhibit.TileView\" $collection_insert $inner
ex:label=\"$label\"></div>";
}

if ($kind == "view-timeline") {
@@ -92,9 +115,16 @@
$inner = "";
if ($proxy != NULL) {
$inner .= " ex:proxy='.$proxy' ";
- }
-
- $ret = "<div ex:role=\"view\" ex:viewClass=\"Timeline\"
$collection_insert ex:bubbleWidth='320' ex:topBandPixelsPerUnit='400'
$inner ex:timelineHeight='170' ex:label=\"$label\" ex:start=\".$start\"";
+ }
+
+ $inner .= $this->propString("ex:timelineHeight",
$this->get('height'), "170");
+ $inner .= $this->propString("ex:topBandUnit",
$this->get('topBandUnit'), NULL);
+ $inner .= $this->propString("ex:bottomBandUnit",
$this->get('bottomBandUnit'), NULL);
+ if ($this->get('extra_attributes') != NULL) {
+ $inner .= " " . $this->get('extra_attributes') . " ";
+ }
+
+ $ret = "<div ex:role=\"view\" ex:viewClass=\"Timeline\"
$collection_insert ex:bubbleWidth='320' ex:topBandPixelsPerUnit='400'
$inner ex:label=\"$label\" ex:start=\".$start\"";
if ($this->get('end') != null) {
$end = $this->get('end');
$ret = $ret . " ex:end=\".$end\"";
@@ -123,7 +153,11 @@
if ($proxy != NULL) {
$inner .= " ex:proxy='.$proxy' ";
}
-
+
+ if ($this->get('extra_attributes') != NULL) {
+ $inner .= " " . $this->get('extra_attributes') . " ";
+ }
+
// NOTE: There is currently no nocderfeld thing being put in here.
$ret = "<div ex:role='view' ex:viewClass='Map' ex:label='$label'
$collection_insert ex:latlng='.$field' ex:bubbleWidth='$bw'
ex:bubbleHeight='$bh' ex:shapeWidth='$mw' ex:shapeHeight='$mh' $inner
></div>";
return $ret;
@@ -132,9 +166,15 @@
$columns = $this->get('field');
$columnlabels = $this->get('caption');
$klass = $this->get('klass');
-
+
+ $inner = "";
+
+ if ($this->get('extra_attributes') != NULL) {
+ $inner .= " " . $this->get('extra_attributes') . " ";
+ }
+
// Todo: add the actual location stuff
- $ret = "<div ex:role=\"view\" ex:viewClass=\"Exhibit.TabularView\"
$collection_insert ex:label=\"$label\" ex:columns=\"$columns\"
ex:columnLabels=\"$columnlabels\">";
+ $ret = "<div ex:role=\"view\" ex:viewClass=\"Exhibit.TabularView\"
$collection_insert $inner ex:label=\"$label\" ex:columns=\"$columns\"
ex:columnLabels=\"$columnlabels\">";
$ret .= "<table style=\"display: none;\"><tr>";
$columns_arr = explode(",", $columns);
foreach($columns_arr as $column) {
@@ -148,8 +188,13 @@
$field_x = $this->get("xField");
$field_y = $this->get("yField");
$field_xLabel = $this->get("xLabel");
- $field_yLabel = $this->get("yLabel");
- $ret = "<div ex:role=\"view\" ex:viewClass=\"Exhibit.ScatterPlotView\"
$collection_insert ex:label=\"$label\" ex:x=\".$field_x\"
ex:y=\".$field_y\" ex:xLabel=\"$field_xLabel\" ex:yLabel=\"$field_yLabel\"";
+ $field_yLabel = $this->get("yLabel");
+ $inner = "";
+ if ($this->get('extra_attributes') != NULL) {
+ $inner .= " " . $this->get('extra_attributes') . " ";
+ }
+
+ $ret = "<div ex:role=\"view\" ex:viewClass=\"Exhibit.ScatterPlotView\"
$collection_insert $inner ex:label=\"$label\" ex:x=\".$field_x\"
ex:y=\".$field_y\" ex:xLabel=\"$field_xLabel\" ex:yLabel=\"$field_yLabel\"";
$ret = $ret . "></div>";
return $ret;
}
@@ -158,8 +203,13 @@
$field_x = $this->get("xField");
$field_y = $this->get("yField");
$field_xLabel = $this->get("xLabel");
- $field_yLabel = $this->get("yLabel");
- $ret = "<div ex:role=\"view\" ex:viewClass=\"Exhibit.BarChartView\"
$collection_insert ex:label=\"$label\" ex:x=\".$field_x\"
ex:y=\".$field_y\" ex:xLabel=\"$field_xLabel\" ex:yLabel=\"$field_yLabel\"";
+ $field_yLabel = $this->get("yLabel");
+ $inner = "";
+ if ($this->get('extra_attributes') != NULL) {
+ $inner .= " " . $this->get('extra_attributes') . " ";
+ }
+
+ $ret = "<div ex:role=\"view\" ex:viewClass=\"Exhibit.BarChartView\"
$collection_insert $inner ex:label=\"$label\" ex:x=\".$field_x\"
ex:y=\".$field_y\" ex:xLabel=\"$field_xLabel\" ex:yLabel=\"$field_yLabel\"";
$ret = $ret . "></div>";
return $ret;
}

Reply all
Reply to author
Forward
0 new messages