Skip to content

Commit 6a56aac

Browse files
committed
Minimal update of JSROOT demo and docu
git-svn-id: https://subversion.gsi.de/dabc/trunk/plugins/root/js@2914 bcbf6573-9a26-0410-9ebc-ce4ab7aade96
1 parent 5998457 commit 6a56aac

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

demo/drawoptions.htm

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,51 +14,48 @@
1414
$('#debug').append("<h4>" + str + "</h4>");
1515
}
1616

17-
var global_dir = "files/"; // for testing
17+
var global_dir = "files/"; // for local testing
18+
19+
if (JSROOT.source_dir.indexOf("http")==0) global_dir = "../files/";
1820

19-
if (JSROOT.source_dir.indexOf("root.cern.ch")>0)
20-
global_dir = "https://root.cern.ch/js/files/";
21-
if (JSROOT.source_dir.indexOf("web-docs.gsi.de")>0)
22-
global_dir = "http://web-docs.gsi.de/~linev/js/files/";
23-
2421
function draw_item(file, itemname, divid, drawopt) {
2522
file.ReadObject(itemname, function(obj) {
2623
if (obj==null) return file_error("In file " + file.fURL + " item " + itemname + " cannot be find");
2724
JSROOT.draw(divid, obj, drawopt);
2825
});
2926
}
30-
27+
3128
function draw_item_options(file, itemname, divid, options, factor) {
3229
var arr = options.split(";");
3330

34-
var fname = (file.fURL.indexOf("http://")==0) ? file.fURL : "demo/"+ file.fURL;
31+
var fname = (JSROOT.source_dir.indexOf("http")==0) ? file.fURL : "demo/"+ file.fURL;
3532

3633
var has_equal = false;
37-
34+
3835
var html = 'File: <a href="../index.htm?file=' + fname + '" target="_blank">' + fname.slice(fname.lastIndexOf('/')+1) + '</a>';
3936
for (var i in arr) {
4037
if (i==0) html += " Item: "; else
4138
if (i==1) html += " Options: "; else html += ", ";
4239
html += '<a href="../index.htm?nobrowser&file=' + fname;
4340
html += '&item=' + itemname + '&';
44-
41+
4542
if (arr[i].indexOf("=")<0) html += 'opt=' + arr[i];
4643
else { html += arr[i]; has_equal = true; }
47-
44+
4845
html += '" target="_blank">';
4946
if (i==0) html += itemname; else
5047
if (arr[i] == "") html += '&lt;default&gt;'; else html += arr[i];
5148
html += '</a>';
5249
}
5350
html += "<br/><br/>";
54-
51+
5552
$("#" + divid).append(html);
5653

5754
if (JSROOT.GetUrlOption("minimal") ||
5855
((JSROOT.GetUrlOption("all")==null) && (JSROOT.GetUrlOption("default")==null))) return;
5956

6057
// special case - do not draw on main page
61-
if (has_equal) return;
58+
if (has_equal) { $("#" + divid).append("skip drawing on central page - use provided links"); return; }
6259

6360
var w = JSROOT.GetUrlOption("w", null, "800");
6461
var h = JSROOT.GetUrlOption("h", null, "600");
@@ -140,7 +137,7 @@
140137
draw_item_options(file, "zdemo;1", "can3_draw", "", 0.);
141138
});
142139

143-
if (global_dir.indexOf("root.cern.ch")<0)
140+
if (JSROOT.source_dir.indexOf("http")<0)
144141
LoadFile("JPsi_evolution.root", function(file) {
145142
draw_item_options(file, "CutTrees/cut1/C_cut1 < 2.85714;1", "can4_draw", "", 0.);
146143
});
@@ -157,7 +154,7 @@
157154
draw_item_options(file, "exclusion;1", "can7_draw", "", 0.);
158155
});
159156

160-
if (global_dir.indexOf("root.cern.ch")<0) {
157+
if (JSROOT.source_dir.indexOf("http")<0) {
161158
LoadFile("can4.root", function(file) {
162159
draw_item_options(file, "c1;1", "can8_draw", "", 0.);
163160
});

0 commit comments

Comments
 (0)