3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

dashboard: use webpack for builds; use tailwindcss instead of bulma; all sorts of tweaks

This commit is contained in:
Dragory 2019-10-10 21:58:00 +03:00
parent 028786d348
commit 577500af92
42 changed files with 4813 additions and 3174 deletions

View file

@ -1,11 +0,0 @@
import Vue from "vue";
Vue.directive("trim-code", {
bind(el, binding) {
el.innerHTML = el.innerHTML
.replace(/(^\n+|\n+$)/g, "")
.split("\n")
.map(line => line.slice(binding.value))
.join("\n");
},
});

View file

@ -0,0 +1,25 @@
import Vue from "vue";
Vue.directive("trim-indents", {
bind(el, binding) {
const withoutStartEndWhitespace = el.innerHTML.replace(/(^\n+|\n+$)/g, "");
const mode = binding.value != null ? binding.value : "start";
let spacesToTrim;
if (mode === "start") {
const match = withoutStartEndWhitespace.match(/^\s+/);
spacesToTrim = match ? match[0].length : 0;
} else if (mode === "end") {
const match = withoutStartEndWhitespace.match(/\s+$/);
spacesToTrim = match ? match[0].length : 0;
} else {
spacesToTrim = parseInt(mode, 10);
}
el.innerHTML = withoutStartEndWhitespace
.split("\n")
.map(line => line.slice(spacesToTrim))
.join("\n");
},
});