summaryrefslogtreecommitdiff
path: root/ext/bg/settings.html
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-14 16:37:37 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-29 12:33:28 -0500
commitf17b55239e941394908fad4a6b1676a171342dac (patch)
tree2cdaf11a96cdb523fbaa5c4cebda412482005cc1 /ext/bg/settings.html
parent5045a9a3a063bafae94bc855627cd85f61671d62 (diff)
Implement settings import
Diffstat (limited to 'ext/bg/settings.html')
-rw-r--r--ext/bg/settings.html49
1 files changed, 49 insertions, 0 deletions
diff --git a/ext/bg/settings.html b/ext/bg/settings.html
index ec0e2939..56b5610e 100644
--- a/ext/bg/settings.html
+++ b/ext/bg/settings.html
@@ -866,6 +866,55 @@
<div>
<button class="btn btn-default" id="settings-export">Export Settings</button>
+ <button class="btn btn-default" id="settings-import">Import Settings</button>
+ </div>
+
+ <div hidden><input type="file" id="settings-import-file" accept=".json,application/json"></div>
+
+ <div class="modal fade" tabindex="-1" role="dialog" id="settings-import-error-modal">
+ <div class="modal-dialog modal-dialog-centered">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+ <h4 class="modal-title">Import Error</h4>
+ </div>
+ <div class="modal-body">
+ <p>
+ An error occurred while trying to import the settings file:
+ </p>
+ <p class="text-danger" id="settings-import-error-modal-message"></p>
+ <p>
+ Additional info can be found in the developer console.
+ </p>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="modal fade" tabindex="-1" role="dialog" id="settings-import-warning-modal">
+ <div class="modal-dialog modal-dialog-centered">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+ <h4 class="modal-title">Import Security Warning</h4>
+ </div>
+ <div class="modal-body">
+ <p>
+ Settings file contains settings which may pose a security risk.
+ Only import settings from sources you trust.
+ </p>
+ <ul class="text-danger" id="settings-import-warning-modal-message"></ul>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
+ <button type="button" class="btn btn-danger settings-import-warning-modal-import-button">Import</button>
+ <button type="button" class="btn btn-primary settings-import-warning-modal-import-button" data-import-sanitize="true">Sanitize and Import</button>
+ </div>
+ </div>
+ </div>
</div>
</div>