-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.js
More file actions
36 lines (30 loc) · 1.05 KB
/
options.js
File metadata and controls
36 lines (30 loc) · 1.05 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
'use strict'
chrome.storage.sync.get('protocol', (data) => {
const currentProtocol = data.protocol
const protocols = ['ssh', 'https']
protocols.forEach((protocol) => {
return //FIXME
const button = document.getElementById(protocol)
button.checked = protocol === currentProtocol
button.addEventListener('change', function () {
chrome.storage.sync.set({ protocol: protocol }, function () {
var status = document.getElementById('status')
status.textContent = 'Saved'
setTimeout(() => { status.textContent = '' }, 750)
})
})
})
})
chrome.storage.sync.get('ideCommand', (data) => {
const ideCommand = data.ideCommand
const input = document.getElementById('ideCommand')
input.value = ideCommand
input.addEventListener('input', function () {
const ideCommand = input.value
chrome.storage.sync.set({ ideCommand: ideCommand }, function () {
var status = document.getElementById('status')
status.textContent = 'Saved'
setTimeout(() => { status.textContent = '' }, 750)
})
})
})