mirror of https://github.com/gorhill/uBlock.git
code review for last commit: we want to keep namespacing though
This commit is contained in:
parent
528354f594
commit
bfcf0e0bfe
|
@ -837,29 +837,31 @@ var onHideTooltip = function() {
|
||||||
// Popup DOM is assumed to be loaded at this point -- because this script
|
// Popup DOM is assumed to be loaded at this point -- because this script
|
||||||
// is loaded after everything else..
|
// is loaded after everything else..
|
||||||
|
|
||||||
// If there's no tab id specified in the query string,
|
(function() {
|
||||||
// it will default to current tab.
|
// If there's no tab id specified in the query string,
|
||||||
var tabId = null;
|
// it will default to current tab.
|
||||||
|
var tabId = null;
|
||||||
|
|
||||||
// Extract the tab id of the page this popup is for
|
// Extract the tab id of the page this popup is for
|
||||||
var matches = window.location.search.match(/[\?&]tabId=([^&]+)/);
|
var matches = window.location.search.match(/[\?&]tabId=([^&]+)/);
|
||||||
if ( matches && matches.length === 2 ) {
|
if ( matches && matches.length === 2 ) {
|
||||||
tabId = matches[1];
|
tabId = matches[1];
|
||||||
}
|
}
|
||||||
getPopupData(tabId);
|
getPopupData(tabId);
|
||||||
|
|
||||||
uDom('#switch').on('click', toggleNetFilteringSwitch);
|
uDom('#switch').on('click', toggleNetFilteringSwitch);
|
||||||
uDom('#gotoPick').on('click', gotoPick);
|
uDom('#gotoPick').on('click', gotoPick);
|
||||||
uDom('a[href]').on('click', gotoURL);
|
uDom('a[href]').on('click', gotoURL);
|
||||||
uDom('h2').on('click', toggleFirewallPane);
|
uDom('h2').on('click', toggleFirewallPane);
|
||||||
uDom('#refresh').on('click', reloadTab);
|
uDom('#refresh').on('click', reloadTab);
|
||||||
uDom('.hnSwitch').on('click', toggleHostnameSwitch);
|
uDom('.hnSwitch').on('click', toggleHostnameSwitch);
|
||||||
uDom('#saveRules').on('click', saveFirewallRules);
|
uDom('#saveRules').on('click', saveFirewallRules);
|
||||||
uDom('#revertRules').on('click', revertFirewallRules);
|
uDom('#revertRules').on('click', revertFirewallRules);
|
||||||
uDom('[data-i18n="popupAnyRulePrompt"]').on('click', toggleMinimize);
|
uDom('[data-i18n="popupAnyRulePrompt"]').on('click', toggleMinimize);
|
||||||
|
|
||||||
uDom('body').on('mouseenter', '[data-tip]', onShowTooltip)
|
uDom('body').on('mouseenter', '[data-tip]', onShowTooltip)
|
||||||
.on('mouseleave', '[data-tip]', onHideTooltip);
|
.on('mouseleave', '[data-tip]', onHideTooltip);
|
||||||
|
})();
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue