You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.4 KiB
JavaScript

/*
* Copyright 2021 Netsyms Technologies.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
var pdfjsLib = window['pdfjs-dist/build/pdf'];
pdfjsLib.GlobalWorkerOptions.workerSrc = 'node_modules/pdfjs-dist/build/pdf.worker.min.js';
function setAppTheme(theme) {
if (typeof theme != "string") {
theme = "purple";
}
var classobj = $("body").attr("class");
if (classobj != undefined) {
var classlist = classobj.split(" ");
var classes = [];
for (var i = 0; i < classlist.length; i++) {
if (!classlist[i].startsWith("theme-")) {
classes.push(classlist[i]);
}
}
}
$("body").removeClass().addClass(classes).addClass("theme-" + theme);
}
function setButtonSize(size) {
if (typeof size != 'string') {
size = "sm";
}
$(".btn").removeClass(["btn-sm", "btn-lg", "btn-"]).addClass("btn-" + size);
}
$(document).ready(function () {
setButtonSize(getStorage("button_size"));
setAppTheme(getStorage("color_theme"));
$("body").addClass("load");
// Open settings automatically if setup is required
if (!inStorage("notary_name") || !inStorage("notary_state")) {
openSettingsModal();
}
});