forked from gapop/pinboard-webextension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup_menu.js
35 lines (26 loc) · 1.37 KB
/
popup_menu.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
document.addEventListener('DOMContentLoaded', function () {
document.getElementById('menu-save').addEventListener('click', function () {
browser.runtime.sendMessage({'message': 'save'}).then(function () { window.close(); });
});
document.getElementById('menu-later').addEventListener('click', function () {
browser.runtime.sendMessage({'message': 'read_later'}).then(function () { window.close(); });
});
document.getElementById('menu-tabset').addEventListener('click', function () {
browser.runtime.sendMessage({'message': 'save_tab_set'}).then(function () { window.close(); });
});
document.getElementById('menu-all-unread').addEventListener('click', function () {
browser.runtime.sendMessage({'message': 'view_all_unread'}).then(function () { window.close(); });
});
document.getElementById('menu-all-tabsets').addEventListener('click', function () {
browser.runtime.sendMessage({'message': 'view_all_tabsets'}).then(function () { window.close(); });
});
document.getElementById('menu-preferences').addEventListener('click', function () {
browser.runtime.openOptionsPage();
window.close();
});
for (let header_link of document.querySelectorAll('.panel-section-header a')) {
header_link.addEventListener('click', function (event) {
this.blur();
});
}
});