2
var locateStorageEnabled, jsonEnabled;
4
// Check for localStorage and native JSON support
5
locateStorageEnabled = ('localStorage' in window) &&
6
window['localStorage'] !== null;
8
jsonEnabled = typeof (JSON) !== "undefined";
10
// Initialize localStorage
11
if (locateStorageEnabled && jsonEnabled) {
12
var instruments = localStorage.dataMonitorOpenGroups;
15
localStorage.dataMonitorOpenGroups = "[]";
17
$.each(JSON.parse(instruments), function (i, inst) {
18
$(".datasource." + inst).show();
23
// Instrument click-handler
24
$(".instrument").click(function (e) {
25
// Don't activate for source link clicks
26
if (e.target.nodeName === "A") {
30
var inst = $($(this).find("td")[0]).text();
31
$(".datasource." + inst).toggle();
33
if (locateStorageEnabled && jsonEnabled) {
34
var instruments, index;
36
instruments = JSON.parse(localStorage.dataMonitorOpenGroups);
38
// Add or remove instrument from list of opened groups
39
index = $.inArray(inst, instruments);
41
instruments.push(inst);
43
instruments.splice(index, 1);
45
localStorage.dataMonitorOpenGroups = JSON.stringify(instruments);
47
}).find("td:first").each(function (i, item) {
50
//if ($.inArray(inst.text(), ["AIA", "HMI"]) !== -1) {
51
// inst.text(inst.text() + " (LMSAL/SAO)");
57
$("#info").hover(function (e) {
b'\\ No newline at end of file'