-
Notifications
You must be signed in to change notification settings - Fork 1
/
options.js
44 lines (37 loc) · 1.72 KB
/
options.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
35
36
37
38
39
40
41
42
43
44
chrome.storage.local.get(["alternativeSearch", "alternativeShortcutKeys", "useCursorKeys", "maxMessageWidth", "justUpdated"], (val) => {
$('[name="alternative-search"]').prop('checked', val.alternativeSearch);
$('[name="alternative-shortcut-keys"]').prop('checked', val.alternativeShortcutKeys);
$('[name="use-cusror-keys"]').prop('checked', val.useCursorKeys);
$('[name="max-message-width"]').prop('checked', val.maxMessageWidth);
if (val.justUpdated){
$('.updated').show();
chrome.storage.local.set({'justUpdated': false}, () => {});
} else {
$('span.updated').hide();
}
});
$("#alternative-search").on("click", () => {
let alternativeSearch = $('[name="alternative-search"]').prop('checked');
chrome.storage.local.set({'alternativeSearch': alternativeSearch}, () => {});
})
$("#alternative-shortcut-keys").on("click", () => {
let alternativeShortcutKeys = $('[name="alternative-shortcut-keys"]').prop('checked');
chrome.storage.local.set({'alternativeShortcutKeys': alternativeShortcutKeys}, () => {});
})
$("#use-cusror-keys").on("click", () => {
let useCursorKeys = $('[name="use-cusror-keys"]').prop('checked');
chrome.storage.local.set({'useCursorKeys': useCursorKeys}, () => {});
})
$("#max-message-width").on("click", () => {
let maxMessageWidth = $('[name="max-message-width"]').prop('checked');
chrome.storage.local.set({'maxMessageWidth': maxMessageWidth}, () => {});
})
$("#go-to-fastmail").on("click", () => {
chrome.tabs.create({ url: "http://www.fastmail.com/" });
})
$("#github-repo").on("click", () => {
chrome.tabs.create({ url: "https://github.com/yohasebe/fastmail-plus" });
})
$("#sign-up-with-fastmail").on("click", () => {
chrome.tabs.create({ url: "https://ref.fm/u27773408" });
})