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:
parent
028786d348
commit
577500af92
42 changed files with 4813 additions and 3174 deletions
|
@ -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");
|
||||
},
|
||||
});
|
25
dashboard/src/directives/trim-indents.ts
Normal file
25
dashboard/src/directives/trim-indents.ts
Normal 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");
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue