()
| 1 | export const settings = () => { |
| 2 | popUp(`Settings`, ` |
| 3 | <blockquote class="darken"> |
| 4 | <input class="settingsCheckbox" id="maskLocationBox" type="checkbox"></input> |
| 5 | Mask and prevent SCiPNET from displaying details regarding your location |
| 6 | </blockquote> |
| 7 | <blockquote class="darken"> |
| 8 | <input class="settingsCheckbox" checked="${setting["audioStatus"]}" id="audioStatusBox" type="checkbox"></input> |
| 9 | Terminal sound effect |
| 10 | </blockquote>`) |
| 11 | |
| 12 | if (setting["audioStatus"] == true) { |
| 13 | $("#audioStatusBox").prop('checked', true); |
| 14 | } else { |
| 15 | $("#audioStatusBox").prop('checked', false); |
| 16 | } |
| 17 | |
| 18 | function backupSettings() { |
| 19 | if (userLoggedIn && firebase.auth().currentUser.uid != null) { |
| 20 | firebase.firestore().collection("users").doc(firebase.auth().currentUser.uid).set({ |
| 21 | Settings: { |
| 22 | checkLocation: $('#maskLocationBox').is(':checked'), |
| 23 | audioStatus: $('#audioStatusBox').is(':checked'), |
| 24 | }, |
| 25 | }, { |
| 26 | merge: true |
| 27 | }) |
| 28 | } |
| 29 | |
| 30 | setting["checkLocation"] = $('#maskLocationBox').is(':checked') |
| 31 | setting["audioStatus"] = $('#audioStatusBox').is(':checked') |
| 32 | localStorage.setItem('checkLocation', $('#maskLocationBox').is(':checked')); |
| 33 | localStorage.setItem('audioStatus', $('#audioStatusBox').is(':checked')); |
| 34 | } |
| 35 | |
| 36 | //location masking function |
| 37 | $('#maskLocationBox').change(function() { |
| 38 | addEventLog(`Location masking set to: ${this.checked}`) |
| 39 | locationMasking(this.checked) |
| 40 | }); |
| 41 | |
| 42 | $('#audioStatusBox').change(function() { |
| 43 | addEventLog(`Audio set to: ${this.checked}`) |
| 44 | }); |
| 45 | |
| 46 | $('.settingsCheckbox').change(function() { |
| 47 | backupSettings() |
| 48 | }) |
| 49 | |
| 50 | } |
nothing calls this directly
no test coverage detected