diff --git a/etc/http/changes.md b/etc/http/changes.md index c5c266312d6256cd089ddc5ba2f7607564530442..0803ccb5bcb732c6f463f2c008fd61c884f398db 100644 --- a/etc/http/changes.md +++ b/etc/http/changes.md @@ -1,12 +1,19 @@ # JSROOT changelog +## Changes in 5.5.1 +1. Implement 'nocache' option for JSROOT scripts lodaing. When specified in URL with + JSRootCore.js script, tries to avoid scripts caching problem by adding stamp parameter to all URLs. +2. Adjust v7 part to new class naming convention, started with R +3. Show RCanvas title + + ## Changes in 5.5.0 -1. Introduce JSROOT.StoreJSON() function. It creates JSON code for the +1. Introduce JSROOT.StoreJSON() function. It creates JSON code for the TCanvas with all drawn objects inside. Allows to store current canvas state 2. Support "item=img:file.png" parameter to insert images in existing layout (#151) 3. Support TTree drawing into TGraph (#153), thanks @cozzyd 4. Let configure "&toolbar=right" in URL to change position of tool buttons -5. Let configure "&divsize=500x400" in URL of size of main div element (default - full browser) +5. Let configure "&divsize=500x400" in URL of size of main div element (default - full browser) 6. Implement "optstat1001" and "optfit101" draw options for histograms 7. Remove "autocol" options - standard "plc" should be used instead 8. Provide drawing of artificial "$legend" item - it creates TLegend for all primitives in pad diff --git a/etc/http/scripts/JSRootCore.js b/etc/http/scripts/JSRootCore.js index ce361baf0c2a1b23296c17aeb03c38e6b225fa23..38f9b1b34c945ca5027c0b9950eca79d4d1984f7 100644 --- a/etc/http/scripts/JSRootCore.js +++ b/etc/http/scripts/JSRootCore.js @@ -96,12 +96,13 @@ "use strict"; - JSROOT.version = "5.5.0 6/07/2018"; + JSROOT.version = "5.5.1 16/07/2018"; JSROOT.source_dir = ""; JSROOT.source_min = false; JSROOT.source_fullpath = ""; // full name of source script JSROOT.bower_dir = null; // when specified, use standard libs from bower location + JSROOT.nocache = false; JSROOT.sources = ['core']; // indicates which major sources were loaded JSROOT.id_counter = 0; @@ -965,16 +966,14 @@ isrootjs = true; filename = filename.slice(3); if (JSROOT.use_full_libs) filename = "libs/" + filename.slice(8, filename.length-7) + ".js"; - } else - if (filename.indexOf("$$$")===0) { + } else if (filename.indexOf("$$$")===0) { isrootjs = true; filename = filename.slice(3); if ((filename.indexOf("style/")==0) && JSROOT.source_min && (filename.lastIndexOf('.css')==filename.length-4) && (filename.indexOf('.min.css')<0)) filename = filename.slice(0, filename.length-4) + '.min.css'; - } else - if (filename.indexOf("###")===0) { + } else if (filename.indexOf("###")===0) { isbower = true; filename = filename.slice(3); } @@ -1020,6 +1019,9 @@ else JSROOT.progress("loading " + filename + " ..."); + if (JSROOT.nocache && isrootjs && (filename.indexOf("?")<0)) + filename += "?stamp=" + JSROOT.nocache; + if (isstyle) { element = document.createElement("link"); element.setAttribute("rel", "stylesheet"); @@ -2218,6 +2220,8 @@ var src = JSROOT.source_fullpath; + if (JSROOT.GetUrlOption('nocache', src)!=null) JSROOT.nocache = (new Date).getTime(); // use timestamp to overcome cache limitation + if (JSROOT.GetUrlOption('gui', src) !== null) return window_on_load( function() { JSROOT.BuildSimpleGUI(); } ); diff --git a/etc/http/scripts/JSRootPainter.v7.js b/etc/http/scripts/JSRootPainter.v7.js index 66ea45ba6a9ceadb8c483768d7d934ee68099a2e..3939ad5c0230601304d7fcb58b726070210b42e1 100644 --- a/etc/http/scripts/JSRootPainter.v7.js +++ b/etc/http/scripts/JSRootPainter.v7.js @@ -2865,7 +2865,7 @@ if (arr) for (var n=0;n<arr.length;++n) - if (arr[n] && arr[n]._typename != "ROOT::Experimental::TPadDisplayItem") return true; + if (arr[n] && arr[n]._typename != "ROOT::Experimental::RPadDisplayItem") return true; return false; } @@ -3154,7 +3154,7 @@ if (objpainter) { - if (snap._typename == "ROOT::Experimental::TPadDisplayItem") // subpad + if (snap._typename == "ROOT::Experimental::RPadDisplayItem") // subpad return objpainter.RedrawPadSnap(snap, draw_callback); if (objpainter.UpdateObject(snap.fObject, snap.fOption || "")) objpainter.Redraw(); @@ -3162,7 +3162,7 @@ continue; // call next } - if (snap._typename == "ROOT::Experimental::TPadDisplayItem") { // subpad + if (snap._typename == "ROOT::Experimental::RPadDisplayItem") { // subpad var subpad = snap; // not subpad, but just attributes @@ -3192,7 +3192,7 @@ var handle = { func: draw_callback }; - if (snap._typename === "ROOT::Experimental::TObjectDisplayItem") + if (snap._typename === "ROOT::Experimental::RObjectDisplayItem") if (!this.frame_painter()) return JSROOT.draw(this.divid, { _typename: "TFrame", $dummy: true }, "", function() { handle.func("workaround"); // call function with "workaround" as argument @@ -3239,6 +3239,9 @@ var padattr = snap.fPadAttributes || { fCw: 0, fCh: 0 }; // for the moment no canvas attributes are provided + if (this.iscan && snap.fTitle && document) + document.title = snap.fTitle; + if (this.snapid === undefined) { // first time getting snap, create all gui elements first @@ -4110,10 +4113,10 @@ return painter; } - // JSROOT.addDrawFunc({ name: "ROOT::Experimental::TPadDisplayItem", icon: "img_canvas", func: drawPad, opt: "" }); + // JSROOT.addDrawFunc({ name: "ROOT::Experimental::RPadDisplayItem", icon: "img_canvas", func: drawPad, opt: "" }); - JSROOT.addDrawFunc({ name: "ROOT::Experimental::THistDrawable<1>", icon: "img_histo1d", prereq: "v7hist", func: "JSROOT.v7.drawHist1", opt: "" }); - JSROOT.addDrawFunc({ name: "ROOT::Experimental::THistDrawable<2>", icon: "img_histo2d", prereq: "v7hist", func: "JSROOT.v7.drawHist2", opt: "" }); + JSROOT.addDrawFunc({ name: "ROOT::Experimental::RHistDrawable<1>", icon: "img_histo1d", prereq: "v7hist", func: "JSROOT.v7.drawHist1", opt: "" }); + JSROOT.addDrawFunc({ name: "ROOT::Experimental::RHistDrawable<2>", icon: "img_histo2d", prereq: "v7hist", func: "JSROOT.v7.drawHist2", opt: "" }); JSROOT.addDrawFunc({ name: "ROOT::Experimental::RText", icon: "img_text", prereq: "v7more", func: "JSROOT.v7.drawText", opt: "", direct: true }); JSROOT.addDrawFunc({ name: "ROOT::Experimental::RLine", icon: "img_graph", prereq: "v7more", func: "JSROOT.v7.drawLine", opt: "", direct: true }); JSROOT.addDrawFunc({ name: "ROOT::Experimental::RMarker", icon: "img_graph", prereq: "v7more", func: "JSROOT.v7.drawMarker", opt: "", direct: true }); diff --git a/etc/http/scripts/JSRootPainter.v7hist.js b/etc/http/scripts/JSRootPainter.v7hist.js index f63422f1f06ea5760e463f33a46abab93686affc..854e16217f60b5796390c35c81547a6bad3b3056 100644 --- a/etc/http/scripts/JSRootPainter.v7hist.js +++ b/etc/http/scripts/JSRootPainter.v7hist.js @@ -207,7 +207,7 @@ } if (!axis || axis.GetBinCoord) return axis; - if (axis._typename == "ROOT::Experimental::TAxisEquidistant") { + if (axis._typename == "ROOT::Experimental::RAxisEquidistant") { axis.min = axis.fLow; axis.max = axis.fLow + (axis.fNBins-2)/axis.fInvBinWidth;