mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 02:48:26 +00:00
Introduce fomantic-ui, replacing semantic-ui
Replaced semantic-ui with the drop-in replacement fomantic-ui [0] which is a maintained fork. The fomantic-ui used here is a custom build [1] of the less-version _without_ google-fonts (css-only). The javascript part of fomantic-ui is not used, and also jquery could be dropped now. [0] https://fomantic-ui.com [1] https://github.com/eikek/fomantic-slim-default Issue: #349
This commit is contained in:
@ -1,4 +1,24 @@
|
||||
/* Docspell JS */
|
||||
function forEachIn(obj, fn) {
|
||||
var index = 0;
|
||||
for (var key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
fn(obj[key], key, index++);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function extend() {
|
||||
var result = {};
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
forEachIn(arguments[i],
|
||||
function(obj, key) {
|
||||
result[key] = obj;
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
var elmApp = Elm.Main.init({
|
||||
node: document.getElementById("docspell-app"),
|
||||
@ -16,21 +36,6 @@ elmApp.ports.removeAccount.subscribe(function() {
|
||||
localStorage.removeItem("account");
|
||||
});
|
||||
|
||||
elmApp.ports.setProgress.subscribe(function(input) {
|
||||
var id = input[0];
|
||||
var percent = input[1];
|
||||
setTimeout(function () {
|
||||
$("#"+id).progress({percent: percent});
|
||||
}, 100);
|
||||
});
|
||||
|
||||
elmApp.ports.setAllProgress.subscribe(function(input) {
|
||||
var id = input[0];
|
||||
var percent = input[1];
|
||||
setTimeout(function () {
|
||||
$("."+id).progress({percent: percent});
|
||||
}, 100);
|
||||
});
|
||||
|
||||
elmApp.ports.saveUiSettings.subscribe(function(args) {
|
||||
if (Array.isArray(args) && args.length == 2) {
|
||||
@ -58,7 +63,7 @@ elmApp.ports.requestUiSettings.subscribe(function(args) {
|
||||
var settings = localStorage.getItem(key);
|
||||
var data = settings ? JSON.parse(settings) : null;
|
||||
if (data && defaults) {
|
||||
$.extend(defaults, data);
|
||||
var defaults = extend(defaults, data);
|
||||
elmApp.ports.receiveUiSettings.send(defaults);
|
||||
} else if (defaults) {
|
||||
elmApp.ports.receiveUiSettings.send(defaults);
|
||||
|
Reference in New Issue
Block a user