|
@ -87,6 +87,23 @@ function setUserSetting(setting, value) { |
|
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
/******************************************************************************/ |
|
|
|
|
|
|
|
|
|
|
|
function getUISetting(setting) { |
|
|
|
|
|
var r = vAPI.localStorage.getItem(setting); |
|
|
|
|
|
if ( typeof r !== 'string' ) { |
|
|
|
|
|
return undefined; |
|
|
|
|
|
} |
|
|
|
|
|
return JSON.parse(r); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function setUISetting(setting, value) { |
|
|
|
|
|
vAPI.localStorage.setItem( |
|
|
|
|
|
setting, |
|
|
|
|
|
JSON.stringify(value) |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
|
|
|
|
|
|
function updateMatrixSnapshot() { |
|
|
function updateMatrixSnapshot() { |
|
|
matrixSnapshotPoller.pollNow(); |
|
|
matrixSnapshotPoller.pollNow(); |
|
|
} |
|
|
} |
|
@ -258,11 +275,11 @@ function getCellClass(hostname, type) { |
|
|
// want to lose all his hardwork.
|
|
|
// want to lose all his hardwork.
|
|
|
|
|
|
|
|
|
function getCollapseState(domain) { |
|
|
function getCollapseState(domain) { |
|
|
var states = getUserSetting('popupCollapseSpecificDomains'); |
|
|
|
|
|
if ( states !== undefined && states[domain] !== undefined ) { |
|
|
|
|
|
|
|
|
var states = getUISetting('popupCollapseSpecificDomains'); |
|
|
|
|
|
if ( typeof states === 'object' && states[domain] !== undefined ) { |
|
|
return states[domain]; |
|
|
return states[domain]; |
|
|
} |
|
|
} |
|
|
return getUserSetting('popupCollapseDomains'); |
|
|
|
|
|
|
|
|
return getUISetting('popupCollapseDomains'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function toggleCollapseState(elem) { |
|
|
function toggleCollapseState(elem) { |
|
@ -277,9 +294,9 @@ function toggleMainCollapseState(uelem) { |
|
|
var matHead = uelem.ancestors('#matHead.collapsible').toggleClass('collapsed'); |
|
|
var matHead = uelem.ancestors('#matHead.collapsible').toggleClass('collapsed'); |
|
|
var collapsed = matHead.hasClass('collapsed'); |
|
|
var collapsed = matHead.hasClass('collapsed'); |
|
|
uDom('#matList .matSection.collapsible').toggleClass('collapsed', collapsed); |
|
|
uDom('#matList .matSection.collapsible').toggleClass('collapsed', collapsed); |
|
|
setUserSetting('popupCollapseDomains', collapsed); |
|
|
|
|
|
|
|
|
setUISetting('popupCollapseDomains', collapsed); |
|
|
|
|
|
|
|
|
var specificCollapseStates = getUserSetting('popupCollapseSpecificDomains') || {}; |
|
|
|
|
|
|
|
|
var specificCollapseStates = getUISetting('popupCollapseSpecificDomains') || {}; |
|
|
var domains = Object.keys(specificCollapseStates); |
|
|
var domains = Object.keys(specificCollapseStates); |
|
|
var i = domains.length; |
|
|
var i = domains.length; |
|
|
var domain; |
|
|
var domain; |
|
@ -289,7 +306,7 @@ function toggleMainCollapseState(uelem) { |
|
|
delete specificCollapseStates[domain]; |
|
|
delete specificCollapseStates[domain]; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
setUserSetting('popupCollapseSpecificDomains', specificCollapseStates); |
|
|
|
|
|
|
|
|
setUISetting('popupCollapseSpecificDomains', specificCollapseStates); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function toggleSpecificCollapseState(uelem) { |
|
|
function toggleSpecificCollapseState(uelem) { |
|
@ -298,14 +315,14 @@ function toggleSpecificCollapseState(uelem) { |
|
|
var section = uelem.ancestors('.matSection.collapsible').toggleClass('collapsed'); |
|
|
var section = uelem.ancestors('.matSection.collapsible').toggleClass('collapsed'); |
|
|
var domain = section.prop('domain'); |
|
|
var domain = section.prop('domain'); |
|
|
var collapsed = section.hasClass('collapsed'); |
|
|
var collapsed = section.hasClass('collapsed'); |
|
|
var mainCollapseState = getUserSetting('popupCollapseDomains'); |
|
|
|
|
|
var specificCollapseStates = getUserSetting('popupCollapseSpecificDomains') || {}; |
|
|
|
|
|
|
|
|
var mainCollapseState = getUISetting('popupCollapseDomains'); |
|
|
|
|
|
var specificCollapseStates = getUISetting('popupCollapseSpecificDomains') || {}; |
|
|
if ( collapsed !== mainCollapseState ) { |
|
|
if ( collapsed !== mainCollapseState ) { |
|
|
specificCollapseStates[domain] = collapsed; |
|
|
specificCollapseStates[domain] = collapsed; |
|
|
setUserSetting('popupCollapseSpecificDomains', specificCollapseStates); |
|
|
|
|
|
|
|
|
setUISetting('popupCollapseSpecificDomains', specificCollapseStates); |
|
|
} else if ( specificCollapseStates[domain] !== undefined ) { |
|
|
} else if ( specificCollapseStates[domain] !== undefined ) { |
|
|
delete specificCollapseStates[domain]; |
|
|
delete specificCollapseStates[domain]; |
|
|
setUserSetting('popupCollapseSpecificDomains', specificCollapseStates); |
|
|
|
|
|
|
|
|
setUISetting('popupCollapseSpecificDomains', specificCollapseStates); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -495,7 +512,7 @@ var createMatrixRow = function() { |
|
|
|
|
|
|
|
|
function renderMatrixHeaderRow() { |
|
|
function renderMatrixHeaderRow() { |
|
|
var matHead = uDom('#matHead.collapsible'); |
|
|
var matHead = uDom('#matHead.collapsible'); |
|
|
matHead.toggleClass('collapsed', getUserSetting('popupCollapseDomains')); |
|
|
|
|
|
|
|
|
matHead.toggleClass('collapsed', getUISetting('popupCollapseDomains')); |
|
|
var cells = matHead.descendants('.matCell'); |
|
|
var cells = matHead.descendants('.matCell'); |
|
|
cells.at(0) |
|
|
cells.at(0) |
|
|
.prop('reqType', '*') |
|
|
.prop('reqType', '*') |
|
@ -902,7 +919,7 @@ function makeMatrixGroup4(group) { |
|
|
var groupDiv = createMatrixGroup().addClass('g4'); |
|
|
var groupDiv = createMatrixGroup().addClass('g4'); |
|
|
createMatrixSection() |
|
|
createMatrixSection() |
|
|
.addClass('g4Meta') |
|
|
.addClass('g4Meta') |
|
|
.toggleClass('g4Collapsed', !!getUserSetting('popupHideBlacklisted')) |
|
|
|
|
|
|
|
|
.toggleClass('g4Collapsed', !!getUISetting('popupHideBlacklisted')) |
|
|
.appendTo(groupDiv); |
|
|
.appendTo(groupDiv); |
|
|
makeMatrixMetaRow(computeMatrixGroupMetaStats(group), 'g4') |
|
|
makeMatrixMetaRow(computeMatrixGroupMetaStats(group), 'g4') |
|
|
.appendTo(groupDiv); |
|
|
.appendTo(groupDiv); |
|
@ -1332,7 +1349,7 @@ uDom('#matList').on('click', '.g4Meta', function() { |
|
|
var collapsed = uDom(this) |
|
|
var collapsed = uDom(this) |
|
|
.toggleClass('g4Collapsed') |
|
|
.toggleClass('g4Collapsed') |
|
|
.hasClass('g4Collapsed'); |
|
|
.hasClass('g4Collapsed'); |
|
|
setUserSetting('popupHideBlacklisted', collapsed); |
|
|
|
|
|
|
|
|
setUISetting('popupHideBlacklisted', collapsed); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
/******************************************************************************/ |
|
|