-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.js
More file actions
92 lines (87 loc) · 2.81 KB
/
Copy pathoptions.js
File metadata and controls
92 lines (87 loc) · 2.81 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
function save_bookmarks_options() {
var settingsArray = [];
if (document.getElementById('cool').checked) {
settingsArray.push(
{
id : "cool",
url: "http://myneu.neu.edu/cp/ip/login?sys=pp&url=https://www.cool.neu.edu/students/mainmenu.aspx",
icon: "suitcase"
}
);
}
if (document.getElementById('schedule').checked) {
settingsArray.push(
{
id : "schedule",
url: "http://myneu.neu.edu/cp/ip/login?sys=sctssb&url=https://wl11gp.neu.edu/udcprod8/bwskfshd.P_CrseSchdDetl",
icon: "calendar-o"
}
);
}
if (document.getElementById('timesheet').checked) {
settingsArray.push(
{
id : "timesheet",
url: "https://studentemployment.neu.edu/Tsx_StudentJobs.aspx?fo=true",
icon: "money"
}
);
}
if (document.getElementById('advising').checked) {
settingsArray.push(
{
id : "advising",
url: "https://prod-web.neu.edu/wasapp/public/calendar/booking/app/secure/main.action?",
icon: "graduation-cap"
}
);
}
if (document.getElementById('email').checked) {
settingsArray.push(
{
id : "email",
url: "https://mail.google.com/",
icon: "envelope-o"
}
);
}
if (document.getElementById('files').checked) {
settingsArray.push(
{
id : "files",
url: "https://myfiles.neu.edu/xythoswfs/webview/fileManager.action?x=y&shareLogin=false&stk=698B6A654DF1F49",
icon: "folder-o"
}
);
}
if (document.getElementById('nupay').checked) {
settingsArray.push(
{
id : "nupay",
url: "https://commerce.cashnet.com/cashneta/selfserve/youraccount.aspx",
icon: "dollar"
}
);
}
chrome.storage.sync.set({ settings: settingsArray}, function() {
// Update status to let user know options were saved.
var status = document.getElementById('status');
status.textContent = 'Options saved.';
setTimeout(function() {
status.textContent = '';
}, 750);
});
}
function restore_options() {
chrome.storage.sync.get({
settings: []
}, function(storage) {
for (i in storage.settings) {
var bookmark = storage.settings[i];
document.getElementById(bookmark.id).checked = true;
}
});
}
document.addEventListener('DOMContentLoaded', restore_options);
document.getElementById('bookmarks_save').addEventListener('click',
save_bookmarks_options);