()
| 50 | } |
| 51 | |
| 52 | function save() { |
| 53 | let delay = delayInput.val() |
| 54 | let readme = readmeInput.prop('checked') |
| 55 | let disableProjects = projectsInput.prop('checked') |
| 56 | let showSelf = showSelfInput.prop('checked') |
| 57 | let side = sideInput.prop('value') |
| 58 | let theme = themeInput.prop('value') |
| 59 | |
| 60 | let domains = [] |
| 61 | $('.domain').each(function() { |
| 62 | let domain = $(this) |
| 63 | .val() |
| 64 | .trim() |
| 65 | if (domains.indexOf(domain) === -1 && domain !== GH_DOMAIN) { |
| 66 | domains.push(domain) |
| 67 | } |
| 68 | }) |
| 69 | |
| 70 | let options = { delay, readme, disableProjects, showSelf, side, theme } |
| 71 | Object.assign(options, { domains }) |
| 72 | current = domains |
| 73 | |
| 74 | storage.set(options, () => { |
| 75 | browser.runtime.sendMessage({ event: 'optionschange' }, response => { |
| 76 | if (response.success) { |
| 77 | window.close() |
| 78 | } else { |
| 79 | log('Something went wrong.') |
| 80 | } |
| 81 | }) |
| 82 | }) |
| 83 | } |
| 84 | |
| 85 | function cancel() { |
| 86 | window.close() |
no test coverage detected