author | Florian Forster <octo@verplant.org> | |
Tue, 5 Jun 2012 15:05:34 +0000 (17:05 +0200) | ||
committer | Florian Forster <octo@verplant.org> | |
Tue, 5 Jun 2012 15:05:34 +0000 (17:05 +0200) |
1 | 2 | |||
---|---|---|---|---|
share/collection.js | patch | | diff1 | | diff2 | | blob | history |
diff --combined share/collection.js
index 7bcdc54fc0a01d01a6674a6d727bfabc2783b1be,158a36ec9e07defba3c787903c66e2633dc26dcd..e1764acb12b828c74d36f8f121f3fd218542164e
--- 1/share/collection.js
--- 2/share/collection.js
+++ b/share/collection.js
var c4 =
{
- instances: []
+ instances: new Array (),
+ config:
+ {
+ width: 324,
+ height: 200
+ }
};
function value_to_string (value) /* {{{ */
params.action = "instance_data_json";
params.begin = begin || inst.begin;
params.end = end || inst.end;
+ params.resolution = (params.end - params.begin) / c4.config.width;
$.getJSON ("collection.fcgi", params,
function (data)
return (zoom_relative (graph_id, (-1.0 / 3.0), (1.0 / 3.0)));
} /* }}} function zoom_earlier */
+function graph_recalc_width () /* {{{ */
+{
+ var tmp;
+
+ tmp = $("#layout-middle-center").width ();
+ if (!tmp)
+ return;
+
+ if (tmp < 324)
+ tmp = 324;
+
+ c4.config.width = tmp;
+ c4.config.height = Math.round (tmp / 1.61803398874989484820);
+ $(".graph-json").each (function ()
+ {
+ $(this).width (c4.config.width);
+ $(this).height (c4.config.height);
+ });
+} /* }}} function graph_recalc_width */
+
$(document).ready(function() {
/* $("#layout-middle-right").html ("<ul id=\"search-suggest\" class=\"graph_list\"></ul>"); */
$("#search-form").append ("<ul id=\"search-suggest\" class=\"graph_list\"></ul>");
+ "<div class=\"graph-button\" onClick=\"zoom_reference ('"+id+"');\">!</div>"
+ "</div>"
+ "<div class=\"graph-buttons navigation\">"
- + "<div class=\"graph-button\" onClick=\"zoom_earlier ('"+id+"');\">←</div>"
- + "<div class=\"graph-button\" onClick=\"zoom_out ('"+id+"');\">−</div>"
+ + "<div class=\"graph-button\" onClick=\"zoom_earlier ('"+id+"');\">\u2190</div>"
+ + "<div class=\"graph-button\" onClick=\"zoom_out ('"+id+"');\">\u2212</div>"
+ "<div class=\"graph-button\" onClick=\"zoom_in ('"+id+"');\">+</div>"
- + "<div class=\"graph-button\" onClick=\"zoom_later ('"+id+"');\">→</div>"
+ + "<div class=\"graph-button\" onClick=\"zoom_later ('"+id+"');\">\u2192</div>"
+ "</div>"
);
});
+ graph_recalc_width ();
+
var i;
for (i = 0; i < c4.instances.length; i++)
{