otsdaq_utilities  v2_05_02_indev
JSRootInterface.min.js
1 (function(a){if(typeof define==="function"&&define.amd){define(["jquery","jquery-ui","d3","JSRootPainter"],a)}else{if(typeof jQuery=="undefined"){throw new Error("jQuery not defined","JSRootPainter.jquery.js")}if(typeof jQuery.ui=="undefined"){throw new Error("jQuery-ui not defined","JSRootPainter.jquery.js")}if(typeof d3!="object"){throw new Error("This extension requires d3.v3.js","JSRootPainter.jquery.js")}if(typeof JSROOT=="undefined"){throw new Error("JSROOT is not defined","JSRootPainter.jquery.js")}if(typeof JSROOT.Painter!="object"){throw new Error("JSROOT.Painter not defined","JSRootPainter.jquery.js")}a(jQuery,jQuery.ui,d3,JSROOT)}}(function(d,e,b,a){var c=null;if(typeof define==="function"&&define.amd){a.loadScript("$$$style/JSRootInterface.css")}ResetUI=function(){if(c){c.clear(true)}};guiLayout=function(){var g="collapsible";var f=document.getElementById("layout");if(f){g=f.options[f.selectedIndex].text}return g};setGuiLayout=function(j){var g=document.getElementById("layout");if(!g){return}for(var f in g.options){var h=g.options[f].text;if(typeof h=="undefined"){continue}if((h==j)||(h.replace(/ /g,"")==j)){g.selectedIndex=f;break}}};ReadFile=function(){var f=d("#urlToLoad").val();f.trim();if(f.length==0){return}if(c==null){alert("Hierarchy painter not initialized")}if((f.lastIndexOf(".json")==f.length-5)||(f.lastIndexOf(".JSON")==f.length-5)){c.OpenJsonFile(f)}else{c.OpenRootFile(f)}};BuildSimpleGUI=function(){if(a.GetUrlOption("nobrowser")!=null){return a.BuildNobrowserGUI()}var g=d("#simpleGUI");var l=false;if(g.length==0){g=d("#onlineGUI");if(g.length==0){return alert("no div for simple gui found")}l=true}a.Painter.readStyleFromURL();var h="<div id='left-div' class='column' style='top:1px; bottom:1px'>";if(l){h+="<h1><font face=\"Verdana\" size=\"4\"><div id=\"toptitle\">ROOT online server</div></font></h1><p><font face='Verdana' size='1px'><a href='https://github.com/linev/jsroot'>JSROOT</a> version <span style='color:green'><b>"+a.version+'</b></span></font></p><p> Hierarchy in <a href="h.json">json</a> and <a href="h.xml">xml</a> format</p> <input type="checkbox" name="monitoring" id="monitoring"/> Monitoring <select style="padding:2px; margin-left:10px; margin-top:5px;" id="layout"> <option>simple</option><option>collapsible</option><option>flex</option><option>tabs</option><option>grid 1x2</option><option>grid 2x2</option><option>grid 1x3</option><option>grid 2x3</option><option>grid 3x3</option><option>grid 4x4</option> </select>'}else{var f=g.attr("files");var o=a.GetUrlOption("path");if(o==null){o=g.attr("path")}if(o==null){o=""}if(f==null){f="../files/hsimple.root"}var j=f.split(";");h+="<h1><font face='Verdana' size='4'>Read a ROOT file</font></h1><p><font face='Verdana' size='1px'><a href='https://root.cern.ch/js/'>JSROOT</a> version <span style='color:green'><b>"+a.version+"</b></span></font></p>";if(a.GetUrlOption("noselect")==null){h+='<form name="ex"><input type="text" name="state" value="" style="width:95%; margin-top:5px;" id="urlToLoad"/><select name="s" style="width:65%; margin-top:5px;" onchange="document.ex.state.value = document.ex.s.options[document.ex.s.selectedIndex].value;document.ex.s.selectedIndex=0;document.ex.s.value=\'\'"><option value=" " selected="selected">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>';for(var k in j){h+='<option value = "'+o+j[k]+'">'+j[k]+"</option>"}h+='</select><br/><p><small><a href="https://github.com/linev/jsroot/blob/master/docs/JSROOT.md#reading-root-files-from-other-servers">Read docu</a> how to open files from other servers.</small></p><input style="padding:2px; margin-top:5px;" onclick="ReadFile()" type="button" title="Read the Selected File" value="Load"/><input style="padding:2px; margin-left:10px;" onclick="ResetUI()" type="button" title="Clear All" value="Reset"/><select style="padding:2px; margin-left:10px; margin-top:5px;" title="layout kind" id="layout"> <option>simple</option><option>collapsible</option><option>flex</option><option>tabs</option><option>grid 1x2</option><option>grid 2x2</option><option>grid 1x3</option><option>grid 2x3</option><option>grid 3x3</option><option>grid 4x4</option></select><br/></form>'}}h+='<div id="browser"></div></div><div id="separator-div" style="top:1px; bottom:1px"></div><div id="right-div" class="column" style="top:1px; bottom:1px"></div>';var m="right-div";g.empty().append(h);var n=null;if(l){if(typeof GetCachedHierarchy=="function"){n=GetCachedHierarchy()}if(typeof n!="object"){n=""}}c=new a.HierarchyPainter("root","browser");c.SetDisplay(null,m);a.Painter.ConfigureVSeparator(c);c.StartGUI(n,function(){setGuiLayout(c.GetLayout());d("#layout").change(function(){if(c){c.SetDisplay(guiLayout(),m)}});if(l){if((c.h!=null)&&("_toptitle" in c.h)){d("#toptitle").html(c.h._toptitle)}d("#monitoring").prop("checked",c.IsMonitoring()).click(function(){c.EnableMonitoring(this.checked);c.updateAll(!this.checked)})}else{var i="";c.ForEachRootFile(function(p){if(i==""){i=p._fullurl}});d("#urlToLoad").val(i)}})};return a}));