PageRenderTime 130ms CodeModel.GetById 60ms app.highlight 1ms RepoModel.GetById 47ms app.codeStats 0ms

/timeplot.patch

http://showslow.googlecode.com/
Patch | 55 lines | 49 code | 6 blank | 0 comment | 0 complexity | af4e0c4b24a4dd994d171a52fc0129c0 MD5 | raw file
 1Index: timeplot/timeplot-api.js
 2===================================================================
 3--- timeplot/timeplot-api.js	(revision 2024)
 4+++ timeplot/timeplot-api.js	(working copy)
 5@@ -8,7 +8,8 @@
 6 
 7 (function() {
 8 
 9-    var local = false;
10+    var local = true;
11+    var enableFirebug = false;
12 
13     // obtain local mode from the document URL    
14     if (document.location.search.length > 0) {
15@@ -107,7 +108,7 @@
16 
17         var timeplotURLPrefix = Timeplot.urlPrefix;
18 
19-        if (local && !("console" in window)) {
20+        if (enableFirebug && !("console" in window)) {
21             var firebug = [ timeplotURLPrefix + "lib/firebug/firebug.js" ];
22             SimileAjax.includeJavascriptFiles(document, "", firebug);
23         }
24Index: timeplot/scripts/timeplot.js
25===================================================================
26--- timeplot/scripts/timeplot.js	(revision 2024)
27+++ timeplot/scripts/timeplot.js	(working copy)
28@@ -34,6 +34,7 @@
29 Timeplot.createPlotInfo = function(params) {
30     return {   
31         id:                ("id" in params) ? params.id : "p" + Math.round(Math.random() * 1000000),
32+        label:             ("label" in params) ? params.label : '',
33         dataSource:        ("dataSource" in params) ? params.dataSource : null,
34         eventSource:       ("eventSource" in params) ? params.eventSource : null,
35         timeGeometry:      ("timeGeometry" in params) ? params.timeGeometry : new Timeplot.DefaultTimeGeometry(),
36Index: timeplot/scripts/plot.js
37===================================================================
38--- timeplot/scripts/plot.js	(revision 2024)
39+++ timeplot/scripts/plot.js	(working copy)
40@@ -81,7 +81,7 @@
41                     x = plot._timeGeometry.toScreen(validTime);
42                     var v = plot._dataSource.getValue(validTime);
43                     if (plot._plotInfo.roundValues) v = Math.round(v);
44-                    plot._valueFlag.innerHTML = new String(v);
45+                    plot._valueFlag.innerHTML = (plot._plotInfo.label ? plot._plotInfo.label + ': ' : '') + new String(v);
46                     var d = new Date(validTime);
47                     var p = plot._timeGeometry.getPeriod(); 
48                     if (p < day) {
49@@ -397,4 +397,4 @@
50         }
51     }
52 
53-}
54\ No newline at end of file
55+}