remember last selected scope

pull/2/head
gorhill 10 years ago
parent 7e17e2ea84
commit e3dcf085a8

@ -61,6 +61,7 @@ return {
processBehindTheSceneRequests: false, processBehindTheSceneRequests: false,
processHyperlinkAuditing: true, processHyperlinkAuditing: true,
processReferer: false, processReferer: false,
scopeLevel: '*',
smartAutoReload: 'all', smartAutoReload: 'all',
spoofUserAgent: false, spoofUserAgent: false,
spoofUserAgentEvery: 5, spoofUserAgentEvery: 5,

@ -1208,6 +1208,7 @@ function initMenuEnvironment() {
function createGlobalScope() { function createGlobalScope() {
targetScope = '*'; targetScope = '*';
setUserSetting('scopeLevel', '*');
updateMatrixStats(); updateMatrixStats();
updateMatrixColors(); updateMatrixColors();
updateMatrixBehavior(); updateMatrixBehavior();
@ -1217,6 +1218,7 @@ function createGlobalScope() {
function createDomainScope() { function createDomainScope() {
targetScope = targetPageDomain; targetScope = targetPageDomain;
setUserSetting('scopeLevel', 'domain');
updateMatrixStats(); updateMatrixStats();
updateMatrixColors(); updateMatrixColors();
updateMatrixBehavior(); updateMatrixBehavior();
@ -1226,6 +1228,7 @@ function createDomainScope() {
function createSiteScope() { function createSiteScope() {
targetScope = targetPageHostname; targetScope = targetPageHostname;
setUserSetting('scopeLevel', 'site');
updateMatrixStats(); updateMatrixStats();
updateMatrixColors(); updateMatrixColors();
updateMatrixBehavior(); updateMatrixBehavior();
@ -1256,6 +1259,14 @@ function initScopeCell() {
uDom('#scopeKeyDomain').text(targetPageDomain); uDom('#scopeKeyDomain').text(targetPageDomain);
} }
uDom('#scopeKeySite').text(targetPageHostname); uDom('#scopeKeySite').text(targetPageHostname);
var scopeLevel = getUserSetting('scopeLevel');
if ( scopeLevel === 'site' ) {
targetScope = targetPageHostname;
} else if ( scopeLevel === 'domain' ) {
targetScope = targetPageDomain;
} else {
targetScope = '*';
}
updateScopeCell(); updateScopeCell();
} }
@ -1419,7 +1430,7 @@ var bindToTab = function(tabs) {
targetPageURL = µm.pageUrlFromTabId(targetTabId); targetPageURL = µm.pageUrlFromTabId(targetTabId);
} }
targetPageHostname = µm.URI.hostnameFromURI(targetPageURL); targetPageHostname = µm.URI.hostnameFromURI(targetPageURL);
targetPageDomain = µm.URI.domainFromHostname(targetPageHostname); targetPageDomain = µm.URI.domainFromHostname(targetPageHostname) || targetPageHostname;
// Now that tabId and pageURL are set, we can build our menu // Now that tabId and pageURL are set, we can build our menu
initMenuEnvironment(); initMenuEnvironment();

Loading…
Cancel
Save