Change extension to accept on new rule, adding new font, change text

This commit is contained in:
Jorge 2021-09-04 15:55:03 +03:00
parent 4c7909335a
commit fe715360a5
29 changed files with 831 additions and 15168 deletions

14785
frontend/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,144 +1,241 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
[{[ if .ReCaptcha -]}]
[{[ if .ReCaptcha -]}]
<script src="[{[ .ReCaptchaHost ]}]/recaptcha/api.js?render=explicit"></script>
[{[ end ]}]
[{[ end ]}]
<title>[{[ if .Name -]}][{[ .Name ]}][{[ else ]}]File Browser[{[ end ]}]</title>
<title>[{[ if .Name -]}][{[ .Name ]}][{[ else ]}]File Browser[{[ end ]}]</title>
<link rel="icon" type="image/png" sizes="32x32" href="[{[ .StaticURL ]}]/img/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="[{[ .StaticURL ]}]/img/icons/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="[{[ .StaticURL ]}]/img/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="[{[ .StaticURL ]}]/img/icons/favicon-16x16.png">
<!-- Add to home screen for Android and modern mobile browsers -->
<link rel="manifest" id="manifestPlaceholder" crossorigin="use-credentials">
<meta name="theme-color" content="#2979ff">
<!-- Add to home screen for Android and modern mobile browsers -->
<link rel="manifest" id="manifestPlaceholder" crossorigin="use-credentials">
<meta name="theme-color" content="#2979ff">
<!-- Add to home screen for Safari on iOS/iPadOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="assets">
<link rel="apple-touch-icon" href="[{[ .StaticURL ]}]/img/icons/apple-touch-icon.png">
<!-- Add to home screen for Safari on iOS/iPadOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="assets">
<link rel="apple-touch-icon" href="[{[ .StaticURL ]}]/img/icons/apple-touch-icon.png">
<!-- Add to home screen for Windows -->
<meta name="msapplication-TileImage" content="[{[ .StaticURL ]}]/img/icons/mstile-144x144.png">
<meta name="msapplication-TileColor" content="#2979ff">
<!-- Add to home screen for Windows -->
<meta name="msapplication-TileImage" content="[{[ .StaticURL ]}]/img/icons/mstile-144x144.png">
<meta name="msapplication-TileColor" content="#2979ff">
<!-- Inject Some Variables and generate the manifest json -->
<script>
window.FileBrowser = JSON.parse('[{[ .Json ]}]');
<link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700|Roboto:300,400,500,600,700"
rel="stylesheet">
var fullStaticURL = window.location.origin + window.FileBrowser.StaticURL;
var dynamicManifest = {
"name": window.FileBrowser.Name || 'File Browser',
"short_name": window.FileBrowser.Name || 'File Browser',
"icons": [
{
"src": fullStaticURL + "/img/icons/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": fullStaticURL + "/img/icons/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
<!-- Inject Some Variables and generate the manifest json -->
<script>
window.FileBrowser = JSON.parse('[{[ .Json ]}]');
var fullStaticURL = window.location.origin + window.FileBrowser.StaticURL;
var dynamicManifest = {
"name": window.FileBrowser.Name || 'File Browser',
"short_name": window.FileBrowser.Name || 'File Browser',
"icons": [
{
"src": fullStaticURL + "/img/icons/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": fullStaticURL + "/img/icons/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"start_url": window.location.origin + window.FileBrowser.BaseURL,
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#455a64"
}
],
"start_url": window.location.origin + window.FileBrowser.BaseURL,
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#455a64"
}
const stringManifest = JSON.stringify(dynamicManifest);
const blob = new Blob([stringManifest], {type: 'application/json'});
const manifestURL = URL.createObjectURL(blob);
document.querySelector('#manifestPlaceholder').setAttribute('href', manifestURL);
</script>
const stringManifest = JSON.stringify(dynamicManifest);
const blob = new Blob([stringManifest], {type: 'application/json'});
const manifestURL = URL.createObjectURL(blob);
document.querySelector('#manifestPlaceholder').setAttribute('href', manifestURL);
</script>
<style>
#loading {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #fff;
z-index: 9999;
transition: .1s ease opacity;
-webkit-transition: .1s ease opacity;
}
<style>
#loading {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #fff;
z-index: 9999;
transition: .1s ease opacity;
-webkit-transition: .1s ease opacity;
}
#loading.done {
opacity: 0;
}
#loading.done {
opacity: 0;
}
#loading .spinner {
width: 70px;
text-align: center;
position: fixed;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
#loading .spinner {
width: 70px;
text-align: center;
position: fixed;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
}
#loading .spinner > div {
width: 18px;
height: 18px;
background-color: #333;
border-radius: 100%;
display: inline-block;
-webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}
#loading .spinner > div {
width: 18px;
height: 18px;
background-color: #333;
border-radius: 100%;
display: inline-block;
-webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}
#loading .spinner .bounce1 {
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;
}
#loading .spinner .bounce1 {
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;
}
#loading .spinner .bounce2 {
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s;
}
#loading .spinner .bounce2 {
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s;
}
@-webkit-keyframes sk-bouncedelay {
0%, 80%, 100% { -webkit-transform: scale(0) }
40% { -webkit-transform: scale(1.0) }
}
@-webkit-keyframes sk-bouncedelay {
0%, 80%, 100% {
-webkit-transform: scale(0)
}
40% {
-webkit-transform: scale(1.0)
}
}
@keyframes sk-bouncedelay {
0%, 80%, 100% {
-webkit-transform: scale(0);
transform: scale(0);
} 40% {
-webkit-transform: scale(1.0);
transform: scale(1.0);
}
}
</style>
@keyframes sk-bouncedelay {
0%, 80%, 100% {
-webkit-transform: scale(0);
transform: scale(0);
}
40% {
-webkit-transform: scale(1.0);
transform: scale(1.0);
}
}
.lds-dual-ring {
display: block;
border-radius: 50%;
animation: lds-dual-ring .8s linear infinite;
border: 1px solid #232f3e;
border-color: #232f3e rgb(236, 236, 236);
}
@keyframes lds-dual-ring {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.la-line-scale-pulse-out.la-2x > div {
width: 5px;
height: 40px;
margin: 0 2px;
border-radius: 5px;
}
.la-line-scale-pulse-out > div:nth-child(1), .la-line-scale-pulse-out > div:nth-child(5) {
-webkit-animation-delay: -.5s;
animation-delay: -.5s;
}
.la-line-scale-pulse-out > div:nth-child(2), .la-line-scale-pulse-out > div:nth-child(4) {
-webkit-animation-delay: -.7s;
animation-delay: -.7s;
}
.la-line-scale-pulse-out > div:nth-child(3) {
-webkit-animation-delay: -.9s;
animation-delay: -.9s;
}
.label-color {
color: rgba(0, 75, 139, 0.3);
}
.la-line-scale-pulse-out > div {
display: inline-block;
float: none;
background-color: rgba(0, 75, 139, 0.3);
border: 0 solid rgba(0, 75, 139, 0.3);
width: 4px;
height: 32px;
margin: 0 2px;
border-radius: 0;
-webkit-animation: .9s cubic-bezier(.85, .25, .37, .85) infinite line-scale-pulse-out;
animation: .9s cubic-bezier(.85, .25, .37, .85) infinite line-scale-pulse-out;
}
.la-line-scale-pulse-out, .la-line-scale-pulse-out > div {
position: relative;
box-sizing: border-box;
}
@keyframes line-scale-pulse-out {
0%, 100% {
transform: scaley(1)
}
50% {
transform: scaley(.3)
}
}
.sbl-circ-path {
width: 25px;
height: 25px;
color: rgba(90, 90, 90, 0.2);
position: relative;
display: inline-block;
border: 2px solid;
border-radius: 50%;
border-right-color: #232f3e;
animation: rotate 1s linear infinite;
}
@keyframes rotate {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div id="app"></div>
<div id="app"></div>
<div id="loading">
<div class="spinner">
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>
<div id="loading">
<div class="utm-spinner d-flex flex-column align-items-center justify-content-center">
<div class="sbl-circ-path"></div>
</div>
</div>
</div>
[{[ if .Theme -]}]
<link rel="stylesheet" href="[{[ .StaticURL ]}]/themes/[{[ .Theme ]}].css" />
[{[ end ]}]
[{[ if .CSS -]}]
<link rel="stylesheet" href="[{[ .StaticURL ]}]/custom.css" />
[{[ end ]}]
[{[ if .Theme -]}]
<link rel="stylesheet" href="[{[ .StaticURL ]}]/themes/[{[ .Theme ]}].css"/>
[{[ end ]}]
[{[ if .CSS -]}]
<link rel="stylesheet" href="[{[ .StaticURL ]}]/custom.css"/>
[{[ end ]}]
</body>
</html>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -2,21 +2,21 @@
<div id="search" @click="open" v-bind:class="{ active, ongoing }">
<div id="input">
<input
type="text"
@keyup.exact="keyup"
@keyup.enter="submit"
ref="input"
:autofocus="active"
v-model.trim="value"
:aria-label="$t('search.pressToSearch')"
:placeholder="$t('search.pressToSearch')"
type="text"
@keyup.exact="keyup"
@keyup.enter="submit"
ref="input"
:autofocus="active"
v-model.trim="value"
:aria-label="$t('search.pressToSearch')"
:placeholder="$t('search.pressToSearch')"
/>
<button
v-if="active"
class="action"
@click="close"
:aria-label="$t('buttons.close')"
:title="$t('buttons.close')"
v-if="active"
class="action"
@click="close"
:aria-label="$t('buttons.close')"
:title="$t('buttons.close')"
>
<i class="material-icons">arrow_back</i>
</button>
@ -28,8 +28,8 @@
<template v-if="isEmpty">
<template v-if="value.length === 0">
<div class="valign-wrapper" style="padding: 45%">
<i class="material-icons" style="font-size: 8em !important"
>toc</i
<i class="material-icons" style="font-size: 2em !important"
>toc</i
>
</div>
</template>
@ -44,9 +44,9 @@
</li>
</ul>
</div>
<p id="renew">
<i class="material-icons spin" style="font-size: 8em !important"
>autorenew</i
<p id="renew" style=" padding: 45%">
<span style="font-size: 1em !important"
>Searching...</span
>
</p>
</div>
@ -54,15 +54,15 @@
</template>
<script>
import { mapGetters, mapMutations, mapState } from "vuex";
import {mapGetters, mapMutations, mapState} from "vuex";
import url from "@/utils/url";
import { search } from "@/api";
import {search} from "@/api";
var boxes = {
image: { label: "images", icon: "insert_photo" },
audio: { label: "music", icon: "volume_up" },
video: { label: "video", icon: "movie" },
pdf: { label: "pdf", icon: "picture_as_pdf" },
image: {label: "images", icon: "insert_photo"},
audio: {label: "music", icon: "volume_up"},
video: {label: "video", icon: "movie"},
pdf: {label: "pdf", icon: "picture_as_pdf"},
};
export default {
@ -119,8 +119,8 @@ export default {
}
return this.value === ""
? this.$t("search.typeToSearch")
: this.$t("search.pressToSearch");
? this.$t("search.typeToSearch")
: this.$t("search.pressToSearch");
},
filteredResults() {
return this.results.slice(0, this.resultsCount);
@ -129,8 +129,8 @@ export default {
mounted() {
this.$refs.result.addEventListener("scroll", (event) => {
if (
event.target.offsetHeight + event.target.scrollTop >=
event.target.scrollHeight - 100
event.target.offsetHeight + event.target.scrollTop >=
event.target.scrollHeight - 100
) {
this.resultsCount += 50;
}

View File

@ -12,16 +12,6 @@
</router-link>
<div v-if="user.perm.create">
<button
@click="$store.commit('showHover', 'newDir')"
class="action"
:aria-label="$t('sidebar.newFolder')"
:title="$t('sidebar.newFolder')"
>
<i class="material-icons">create_new_folder</i>
<span>{{ $t("sidebar.newFolder") }}</span>
</button>
<button
@click="$store.commit('showHover', 'newFile')"
class="action"

View File

@ -1,11 +1,11 @@
<template>
<div class="card floating">
<div class="card-title">
<h2>{{ $t("prompts.newFile") }}</h2>
<h2>New rule</h2>
</div>
<div class="card-content">
<p>{{ $t("prompts.newFileMessage") }}</p>
<p>Rule name (extension .yml)</p>
<input
class="input input--block"
v-focus

View File

@ -1,15 +1,4 @@
body {
overflow-x: hidden;
color: #333;
text-align: left;
background-color: #f5f5f5;
margin: 0;
font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-size: 13px;
font-weight: 300 !important;
line-height: 1.5385;
}
@import "fonts.css";
* {
box-sizing: border-box;
}
@ -136,3 +125,20 @@ main {
.break-word {
word-break: break-all;
}
body {
overflow-x: hidden;
color: #333;
text-align: left;
background-color: #f5f5f5;
margin: 0;
font-family: Poppins, sans-serif !important;
font-size: 13px;
font-weight: 300 !important;
line-height: 1.5385;
}
button, input, optgroup, select, textarea {
font-family: Poppins, sans-serif !important;
}

View File

@ -1,17 +1,286 @@
/* cyrillic-ext */
@font-face {
font-family: 'Roboto';
font-family: 'Poppins';
font-style: normal;
font-weight: 300;
src: local('Roboto'), local('Roboto-Regular'), url(../assets/fonts/roboto/normal-cyrillic-ext.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
font-weight: 400;
src: local('Poppins'), local('Poppins-Regular'), url(../assets/fonts/poppins/Poppins-Regular.ttf) format('ttf');
unicode-range: U+0460-052f, U+20b4, U+2de0-2dff, U+A640-A69F;
}
/* cyrillic */
@font-face {
font-family: 'Roboto';
font-family: 'Poppins';
font-style: normal;
font-weight: 300;
src: local('Roboto'), local('Roboto-Regular'), url(../assets/fonts/roboto/normal-cyrillic.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
font-weight: 400;
src: local('Poppins'), local('Poppins-Regular'), url(../assets/fonts/poppins/Poppins-Light.ttf) format('ttf');
unicode-range: U+0400-045f, U+0490-0491, U+04b0-04b1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Poppins';
font-style: normal;
font-weight: 400;
src: local('Poppins'), local('Poppins-Regular'), url(../assets/fonts/poppins/Poppins-Light.ttf) format('ttf');
unicode-range: U+1f00-1fff;
}
/* greek */
@font-face {
font-family: 'Poppins';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(../assets/fonts/poppins/Poppins-Light.ttf) format('ttf');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-family: 'Poppins';
font-style: normal;
font-weight: 400;
src: local('Poppins'), local('Poppins-Regular'), url(../assets/fonts/poppins/Poppins-Light.ttf) format('ttf');
unicode-range: U+0102-0103, U+1ea0-1ef9, U+20ab;
}
/* latin-ext */
@font-face {
font-family: 'Poppins';
font-style: normal;
font-weight: 400;
src: local('Poppins'), local('Poppins-Regular'), url(../assets/fonts/poppins/Poppins-Light.ttf) format('ttf');
unicode-range: U+0100-024f, U+1-1eff, U+20a0-20ab, U+20ad-20cf, U+2c60-2c7f, U+A720-A7FF;
}
/* latin */
@font-face {
font-display: swap;
font-family: 'Poppins';
font-style: normal;
font-weight: 400;
src: local('Poppins'), local('Poppins-Regular'), url(../assets/fonts/poppins/Poppins-Light.ttf) format('ttf');
unicode-range: U+0000-00ff, U+0131, U+0152-0153, U+02c6, U+02da, U+02dc, U+2000-206f, U+2074, U+20ac, U+2212, U+2215;
}
/* cyrillic-ext */
@font-face {
font-family: 'Poppins';
font-style: normal;
font-weight: 500;
src: local('Poppins Medium'), local('Poppins-Medium'), url(../assets/fonts/poppins/Poppins-Medium.ttf) format('ttf');
unicode-range: U+0460-052f, U+20b4, U+2de0-2dff, U+A640-A69F;
}
/* cyrillic */
@font-face {
font-family: 'Poppins';
font-style: normal;
font-weight: 500;
src: local('Poppins Medium'), local('Poppins-Medium'), url(../assets/fonts/poppins/Poppins-Medium.ttf) format('ttf');
unicode-range: U+0400-045f, U+0490-0491, U+04b0-04b1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Poppins';
font-style: normal;
font-weight: 500;
src: local('Poppins Medium'), local('Poppins-Medium'), url(../assets/fonts/poppins/Poppins-Medium.ttf) format('ttf');
unicode-range: U+1f00-1fff;
}
/* greek */
@font-face {
font-family: 'Poppins';
font-style: normal;
font-weight: 500;
src: local('Poppins Medium'), local('Poppins-Medium'), url(../assets/fonts/poppins/Poppins-Medium.ttf) format('ttf');
unicode-range: U+0370-03ff;
}
/* vietnamese */
@font-face {
font-family: 'Poppins';
font-style: normal;
font-weight: 500;
src: local('Poppins Medium'), local('Poppins-Medium'), url(../assets/fonts/poppins/Poppins-Medium.ttf) format('ttf');
unicode-range: U+0102-0103, U+1ea0-1ef9, U+20ab;
}
/* latin-ext */
@font-face {
font-family: 'Poppins';
font-style: normal;
font-weight: 500;
src: local('Poppins Medium'), local('Poppins-Medium'), url(../assets/fonts/poppins/Poppins-Medium.ttf) format('ttf');
unicode-range: U+0100-024f, U+1-1eff, U+20a0-20ab, U+20ad-20cf, U+2c60-2c7f, U+A720-A7FF;
}
/* latin */
@font-face {
font-display: swap;
font-family: 'Poppins';
font-style: normal;
font-weight: 500;
src: local('Poppins Medium'), local('Poppins-Medium'), url(../assets/fonts/poppins/Poppins-Medium.ttf) format('ttf');
unicode-range: U+0000-00ff, U+0131, U+0152-0153, U+02c6, U+02da, U+02dc, U+2000-206f, U+2074, U+20ac, U+2212, U+2215;
}
/* cyrillic-ext */
@font-face {
font-family: 'Poppins';
font-style: italic;
font-weight: 400;
src: local('Poppins Italic'), local('Poppins-Italic'), url(../assets/fonts/poppins/Poppins-MediumItalic.ttf) format('ttf');
unicode-range: U+0460-052f, U+20b4, U+2de0-2dff, U+A640-A69F;
}
/* cyrillic */
@font-face {
font-family: 'Poppins';
font-style: italic;
font-weight: 400;
src: local('Poppins Italic'), local('Poppins-Italic'), url(../assets/fonts/poppins/Poppins-MediumItalic.ttf) format('ttf');
unicode-range: U+0400-045f, U+0490-0491, U+04b0-04b1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Poppins';
font-style: italic;
font-weight: 400;
src: local('Poppins Italic'), local('Poppins-Italic'), url(../assets/fonts/poppins/Poppins-MediumItalic.ttf) format('ttf');
unicode-range: U+1f00-1fff;
}
/* greek */
@font-face {
font-family: 'Poppins';
font-style: italic;
font-weight: 400;
src: local('Poppins Italic'), local('Poppins-Italic'), url(../assets/fonts/poppins/Poppins-MediumItalic.ttf) format('ttf');
unicode-range: U+0370-03ff;
}
/* vietnamese */
@font-face {
font-family: 'Poppins';
font-style: italic;
font-weight: 400;
src: local('Poppins Italic'), local('Poppins-Italic'), url(../assets/fonts/poppins/Poppins-MediumItalic.ttf) format('ttf');
unicode-range: U+0102-0103, U+1ea0-1ef9, U+20ab;
}
/* latin-ext */
@font-face {
font-family: 'Poppins';
font-style: italic;
font-weight: 400;
src: local('Poppins Italic'), local('Poppins-Italic'), url(../assets/fonts/poppins/Poppins-MediumItalic.ttf) format('ttf');
unicode-range: U+0100-024f, U+1-1eff, U+20a0-20ab, U+20ad-20cf, U+2c60-2c7f, U+A720-A7FF;
}
/* latin */
@font-face {
font-display: swap;
font-family: 'Poppins';
font-style: italic;
font-weight: 400;
src: local('Poppins Italic'), local('Poppins-Italic'), url(../assets/fonts/poppins/Poppins-MediumItalic.ttf) format('ttf');
unicode-range: U+0000-00ff, U+0131, U+0152-0153, U+02c6, U+02da, U+02dc, U+2000-206f, U+2074, U+20ac, U+2212, U+2215;
}
/* cyrillic-ext */
@font-face {
font-family: 'Poppins';
font-style: italic;
font-weight: 500;
src: local('Poppins Medium Italic'), local('Poppins-MediumItalic'),
url(../assets/fonts/poppins/Poppins-MediumItalic.ttf) format('ttf');
unicode-range: U+0460-052f, U+20b4, U+2de0-2dff, U+A640-A69F;
}
/* cyrillic */
@font-face {
font-family: 'Poppins';
font-style: italic;
font-weight: 500;
src: local('Poppins Medium Italic'), local('Poppins-MediumItalic'),
url(../assets/fonts/poppins/Poppins-MediumItalic.ttf) format('ttf');
unicode-range: U+0400-045f, U+0490-0491, U+04b0-04b1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Poppins';
font-style: italic;
font-weight: 500;
src: local('Poppins Medium Italic'), local('Poppins-MediumItalic'),
url(../assets/fonts/poppins/Poppins-MediumItalic.ttf) format('ttf');
unicode-range: U+1f00-1fff;
}
/* greek */
@font-face {
font-family: 'Poppins';
font-style: italic;
font-weight: 500;
src: local('Poppins Medium Italic'), local('Poppins-MediumItalic'),
url(../assets/fonts/poppins/Poppins-MediumItalic.ttf) format('ttf');
unicode-range: U+0370-03ff;
}
/* vietnamese */
@font-face {
font-family: 'Poppins';
font-style: italic;
font-weight: 500;
src: local('Poppins Medium Italic'), local('Poppins-MediumItalic'),
url(../assets/fonts/poppins/Poppins-MediumItalic.ttf) format('ttf');
unicode-range: U+0102-0103, U+1ea0-1ef9, U+20ab;
}
/* latin-ext */
@font-face {
font-family: 'Poppins';
font-style: italic;
font-weight: 500;
src: local('Poppins Medium Italic'), local('Poppins-MediumItalic'),
url(../assets/fonts/poppins/Poppins-MediumItalic.ttf) format('ttf');
unicode-range: U+0100-024f, U+1-1eff, U+20a0-20ab, U+20ad-20cf, U+2c60-2c7f, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Poppins';
font-style: italic;
font-weight: 500;
src: local('Poppins Medium Italic'), local('Poppins-MediumItalic'),
url(../assets/fonts/poppins/Poppins-MediumItalic.ttf) format('ttf');
unicode-range: U+0000-00ff, U+0131, U+0152-0153, U+02c6, U+02da, U+02dc, U+2000-206f, U+2074, U+20ac, U+2212, U+2215;
}
/* latin */
@font-face {
font-family: 'Poppins Mono';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(../assets/fonts/poppins/Poppins-MediumItalic.ttf) format('ttf');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC,
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
font-family: 'Poppins Mono';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url(../assets/fonts/poppins/Poppins-MediumItalic.ttf) format('ttf');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC,
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@import "~material-design-icons/iconfont/material-icons.css";

View File

@ -3,7 +3,7 @@
"cancel": "Cancel",
"close": "Close",
"copy": "Copy",
"copyFile": "Copy file",
"copyFile": "Copy rule",
"copyToClipboard": "Copy to clipboard",
"create": "Create",
"delete": "Delete",
@ -12,7 +12,7 @@
"info": "Info",
"more": "More",
"move": "Move",
"moveFile": "Move file",
"moveFile": "Move ",
"new": "New",
"next": "Next",
"ok": "OK",
@ -34,10 +34,10 @@
"toggleSidebar": "Toggle sidebar",
"update": "Update",
"upload": "Upload",
"openFile": "Open file"
"openFile": "Open rule"
},
"download": {
"downloadFile": "Download File",
"downloadFile": "Download Rule",
"downloadFolder": "Download Folder",
"downloadSelected": "Download Selected"
},
@ -66,17 +66,17 @@
"sortBySize": "Sort by size"
},
"help": {
"click": "select file or directory",
"click": "select rule or directory",
"ctrl": {
"click": "select multiple files or directories",
"f": "opens search",
"s": "save a file or download the directory where you are"
"s": "save a rule or download the directory where you are"
},
"del": "delete selected items",
"doubleClick": "open a file or directory",
"doubleClick": "open a rule or directory",
"esc": "clear selection and/or close the prompt",
"f1": "this information",
"f2": "rename file",
"f2": "rename rule",
"help": "Help"
},
"languages": {
@ -116,24 +116,24 @@
"copy": "Copy",
"copyMessage": "Choose the place to copy your files:",
"currentlyNavigating": "Currently navigating on:",
"deleteMessageMultiple": "Are you sure you want to delete {count} file(s)?",
"deleteMessageSingle": "Are you sure you want to delete this file/folder?",
"deleteMessageMultiple": "Are you sure you want to delete {count} rule(s)?",
"deleteMessageSingle": "Are you sure you want to delete this rule/folder?",
"deleteMessageShare": "Are you sure you want to delete this share({path})?",
"deleteTitle": "Delete files",
"displayName": "Display Name:",
"download": "Download files",
"downloadMessage": "Choose the format you want to download.",
"error": "Something went wrong",
"fileInfo": "File information",
"fileInfo": "Rule information",
"filesSelected": "{count} files selected.",
"lastModified": "Last Modified",
"move": "Move",
"moveMessage": "Choose new house for your file(s)/folder(s):",
"newArchetype": "Create a new post based on an archetype. Your file will be created on content folder.",
"moveMessage": "Choose new house for your rule(s)/folder(s):",
"newArchetype": "Create a new post based on an archetype. Your rule will be created on content folder.",
"newDir": "New rule directory",
"newDirMessage": "Write the name of the new directory.",
"newFile": "New rule file",
"newFileMessage": "Write the name of the new rule file.",
"newFile": "New rule rule",
"newFileMessage": "Write the name of the new rule rule.",
"numberDirs": "Number of directories",
"numberFiles": "Number of files",
"rename": "Rename",
@ -169,7 +169,7 @@
"avoidChanges": "(leave blank to avoid changes)",
"branding": "Branding",
"brandingDirectoryPath": "Branding directory path",
"brandingHelp": "You can customize how your File Browser instance looks and feels by changing its name, replacing the logo, adding custom styles and even disable external links to GitHub.\nFor more information about custom branding, please check out the {0}.",
"brandingHelp": "You can customize how your Rule Browser instance looks and feels by changing its name, replacing the logo, adding custom styles and even disable external links to GitHub.\nFor more information about custom branding, please check out the {0}.",
"changePassword": "Change Password",
"commandRunner": "Command runner",
"commandRunnerHelp": "Here you can set commands that are executed in the named events. You must write one per line. The environment variables {0} and {1} will be available, being {0} relative to {1}. For more information about this feature and the available environment variables, please read the {2}.",
@ -181,7 +181,7 @@
"documentation": "documentation",
"examples": "Examples",
"executeOnShell": "Execute on shell",
"executeOnShellDescription": "By default, File Browser executes the commands by calling their binaries directly. If you want to run them on a shell instead (such as Bash or PowerShell), you can define it here with the required arguments and flags. If set, the command you execute will be appended as an argument. This apply to both user commands and event hooks.",
"executeOnShellDescription": "By default, Rule Browser executes the commands by calling their binaries directly. If you want to run them on a shell instead (such as Bash or PowerShell), you can define it here with the required arguments and flags. If set, the command you execute will be appended as an argument. This apply to both user commands and event hooks.",
"globalRules": "This is a global set of allow and disallow rules. They apply to every user. You can define specific rules on each user's settings to override this ones.",
"globalSettings": "Global Settings",
"hideDotfiles": "Hide dotfiles",
@ -208,8 +208,8 @@
"permissions": "Permissions",
"permissionsHelp": "You can set the user to be an administrator or choose the permissions individually. If you select \"Administrator\", all of the other options will be automatically checked. The management of users remains a privilege of an administrator.\n",
"profileSettings": "Profile Settings",
"ruleExample1": "prevents the access to any dot file (such as .git, .gitignore) in every folder.\n",
"ruleExample2": "blocks the access to the file named Caddyfile on the root of the scope.",
"ruleExample1": "prevents the access to any dot rule (such as .git, .gitignore) in every folder.\n",
"ruleExample2": "blocks the access to the rule named Caddyfile on the root of the scope.",
"rules": "Rules",
"rulesHelp": "Here you can define a set of allow and disallow rules for this specific user. The blocked files won't show up in the listings and they wont be accessible to the user. We support regex and paths relative to the users scope.\n",
"scope": "Scope",
@ -240,7 +240,7 @@
"login": "Login",
"logout": "Logout",
"myFiles": "Rules",
"newFile": "New file",
"newFile": "New rule",
"newFolder": "New folder",
"preview": "Preview",
"settings": "Settings",

View File

@ -1,116 +1,34 @@
import Vue from "vue";
import VueI18n from "vue-i18n";
import ar from "./ar.json";
import de from "./de.json";
import en from "./en.json";
import es from "./es.json";
import fr from "./fr.json";
import is from "./is.json";
import it from "./it.json";
import ja from "./ja.json";
import ko from "./ko.json";
import nlBE from "./nl-be.json";
import pl from "./pl.json";
import pt from "./pt.json";
import ptBR from "./pt-br.json";
import ro from "./ro.json";
import ru from "./ru.json";
import svSE from "./sv-se.json";
import zhCN from "./zh-cn.json";
import zhTW from "./zh-tw.json";
Vue.use(VueI18n);
export function detectLocale() {
let locale = (navigator.language || navigator.browserLangugae).toLowerCase();
switch (true) {
case /^ar.*/i.test(locale):
locale = "ar";
break;
case /^es.*/i.test(locale):
locale = "es";
break;
case /^en.*/i.test(locale):
locale = "en";
break;
case /^it.*/i.test(locale):
locale = "it";
break;
case /^fr.*/i.test(locale):
locale = "fr";
break;
case /^pt.*/i.test(locale):
locale = "pt";
break;
case /^pt-BR.*/i.test(locale):
locale = "pt-br";
break;
case /^ja.*/i.test(locale):
locale = "ja";
break;
case /^zh-CN/i.test(locale):
locale = "zh-cn";
break;
case /^zh-TW/i.test(locale):
locale = "zh-tw";
break;
case /^zh.*/i.test(locale):
locale = "zh-cn";
break;
case /^de.*/i.test(locale):
locale = "de";
break;
case /^ru.*/i.test(locale):
locale = "ru";
break;
case /^pl.*/i.test(locale):
locale = "pl";
break;
case /^ko.*/i.test(locale):
locale = "ko";
break;
default:
locale = "en";
}
return locale;
return "en";
}
// eslint-disable-next-line no-unused-vars
const removeEmpty = (obj) =>
Object.keys(obj)
.filter((k) => obj[k] !== null && obj[k] !== undefined && obj[k] !== "") // Remove undef. and null and empty.string.
.reduce(
(newObj, k) =>
typeof obj[k] === "object"
? Object.assign(newObj, { [k]: removeEmpty(obj[k]) }) // Recurse.
: Object.assign(newObj, { [k]: obj[k] }), // Copy value.
{}
);
Object.keys(obj)
.filter((k) => obj[k] !== null && obj[k] !== undefined && obj[k] !== "") // Remove undef. and null and empty.string.
.reduce(
(newObj, k) =>
typeof obj[k] === "object"
? Object.assign(newObj, {[k]: removeEmpty(obj[k])}) // Recurse.
: Object.assign(newObj, {[k]: obj[k]}), // Copy value.
{}
);
const i18n = new VueI18n({
locale: detectLocale(),
fallbackLocale: "en",
messages: {
ar: removeEmpty(ar),
de: removeEmpty(de),
en: en,
es: removeEmpty(es),
fr: removeEmpty(fr),
is: removeEmpty(is),
it: removeEmpty(it),
ja: removeEmpty(ja),
ko: removeEmpty(ko),
"nl-be": removeEmpty(nlBE),
pl: removeEmpty(pl),
"pt-br": removeEmpty(ptBR),
pt: removeEmpty(pt),
ru: removeEmpty(ru),
ro: removeEmpty(ro),
"sv-se": removeEmpty(svSE),
"zh-cn": removeEmpty(zhCN),
"zh-tw": removeEmpty(zhTW),
},
locale: detectLocale(),
fallbackLocale: "en",
messages: {
en: en,
},
});
export default i18n;

View File

@ -4,15 +4,9 @@ import Login from "@/views/Login";
import Layout from "@/views/Layout";
import Files from "@/views/Files";
import Share from "@/views/Share";
import Users from "@/views/settings/Users";
import User from "@/views/settings/User";
import Settings from "@/views/Settings";
import GlobalSettings from "@/views/settings/Global";
import ProfileSettings from "@/views/settings/Profile";
import Shares from "@/views/settings/Shares";
import Errors from "@/views/Errors";
import store from "@/store";
import { baseURL } from "@/utils/constants";
import {baseURL} from "@/utils/constants";
Vue.use(Router);

View File

@ -1,81 +1,71 @@
<template>
<div>
<header-bar showMenu showLogo>
<search /> <title />
<search/>
<title/>
<action
class="search-button"
icon="search"
:label="$t('buttons.search')"
@action="openSearch()"
class="search-button"
icon="search"
:label="$t('buttons.search')"
@action="openSearch()"
/>
<template #actions>
<template v-if="!isMobile">
<action
v-if="headerButtons.share"
icon="share"
:label="$t('buttons.share')"
show="share"
v-if="headerButtons.share"
icon="share"
:label="$t('buttons.share')"
show="share"
/>
<action
v-if="headerButtons.rename"
icon="mode_edit"
:label="$t('buttons.rename')"
show="rename"
v-if="headerButtons.rename"
icon="mode_edit"
:label="$t('buttons.rename')"
show="rename"
/>
<action
v-if="headerButtons.copy"
id="copy-button"
icon="content_copy"
:label="$t('buttons.copyFile')"
show="copy"
v-if="headerButtons.copy"
id="copy-button"
icon="content_copy"
:label="$t('buttons.copyFile')"
show="copy"
/>
<action
v-if="headerButtons.move"
id="move-button"
icon="forward"
:label="$t('buttons.moveFile')"
show="move"
v-if="headerButtons.move"
id="move-button"
icon="forward"
:label="$t('buttons.moveFile')"
show="move"
/>
<action
v-if="headerButtons.delete"
id="delete-button"
icon="delete"
:label="$t('buttons.delete')"
show="delete"
v-if="headerButtons.delete"
id="delete-button"
icon="delete"
:label="$t('buttons.delete')"
show="delete"
/>
</template>
<action
v-if="headerButtons.shell"
icon="code"
:label="$t('buttons.shell')"
@action="$store.commit('toggleShell')"
v-if="headerButtons.download"
icon="file_download"
:label="$t('buttons.download')"
@action="download"
:counter="selectedCount"
/>
<action
:icon="user.viewMode === 'mosaic' ? 'view_list' : 'view_module'"
:label="$t('buttons.switchView')"
@action="switchView"
v-if="headerButtons.upload"
icon="file_upload"
id="upload-button"
:label="$t('buttons.upload')"
@action="upload"
/>
<action icon="info" :label="$t('buttons.info')" show="info"/>
<action
v-if="headerButtons.download"
icon="file_download"
:label="$t('buttons.download')"
@action="download"
:counter="selectedCount"
/>
<action
v-if="headerButtons.upload"
icon="file_upload"
id="upload-button"
:label="$t('buttons.upload')"
@action="upload"
/>
<action icon="info" :label="$t('buttons.info')" show="info" />
<action
icon="check_circle"
:label="$t('buttons.selectMultiple')"
@action="toggleMultipleSelection"
icon="check_circle"
:label="$t('buttons.selectMultiple')"
@action="toggleMultipleSelection"
/>
</template>
</header-bar>
@ -83,34 +73,34 @@
<div v-if="isMobile" id="file-selection">
<span v-if="selectedCount > 0">{{ selectedCount }} selected</span>
<action
v-if="headerButtons.share"
icon="share"
:label="$t('buttons.share')"
show="share"
v-if="headerButtons.share"
icon="share"
:label="$t('buttons.share')"
show="share"
/>
<action
v-if="headerButtons.rename"
icon="mode_edit"
:label="$t('buttons.rename')"
show="rename"
v-if="headerButtons.rename"
icon="mode_edit"
:label="$t('buttons.rename')"
show="rename"
/>
<action
v-if="headerButtons.copy"
icon="content_copy"
:label="$t('buttons.copyFile')"
show="copy"
v-if="headerButtons.copy"
icon="content_copy"
:label="$t('buttons.copyFile')"
show="copy"
/>
<action
v-if="headerButtons.move"
icon="forward"
:label="$t('buttons.moveFile')"
show="move"
v-if="headerButtons.move"
icon="forward"
:label="$t('buttons.moveFile')"
show="move"
/>
<action
v-if="headerButtons.delete"
icon="delete"
:label="$t('buttons.delete')"
show="delete"
v-if="headerButtons.delete"
icon="delete"
:label="$t('buttons.delete')"
show="delete"
/>
</div>
@ -131,19 +121,20 @@
<span>{{ $t("files.lonely") }}</span>
</h2>
<input
style="display: none"
type="file"
id="upload-input"
@change="uploadInput($event)"
multiple
style="display: none"
type="file"
id="upload-input"
accept=".yml"
@change="uploadInput($event)"
multiple
/>
<input
style="display: none"
type="file"
id="upload-folder-input"
@change="uploadInput($event)"
webkitdirectory
multiple
style="display: none"
type="file"
id="upload-folder-input"
@change="uploadInput($event)"
webkitdirectory
multiple
/>
</div>
<div v-else id="listing" ref="listing" :class="user.viewMode">
@ -152,38 +143,38 @@
<div></div>
<div>
<p
:class="{ active: nameSorted }"
class="name"
role="button"
tabindex="0"
@click="sort('name')"
:title="$t('files.sortByName')"
:aria-label="$t('files.sortByName')"
:class="{ active: nameSorted }"
class="name"
role="button"
tabindex="0"
@click="sort('name')"
:title="$t('files.sortByName')"
:aria-label="$t('files.sortByName')"
>
<span>{{ $t("files.name") }}</span>
<i class="material-icons">{{ nameIcon }}</i>
</p>
<p
:class="{ active: sizeSorted }"
class="size"
role="button"
tabindex="0"
@click="sort('size')"
:title="$t('files.sortBySize')"
:aria-label="$t('files.sortBySize')"
:class="{ active: sizeSorted }"
class="size"
role="button"
tabindex="0"
@click="sort('size')"
:title="$t('files.sortBySize')"
:aria-label="$t('files.sortBySize')"
>
<span>{{ $t("files.size") }}</span>
<i class="material-icons">{{ sizeIcon }}</i>
</p>
<p
:class="{ active: modifiedSorted }"
class="modified"
role="button"
tabindex="0"
@click="sort('modified')"
:title="$t('files.sortByLastModified')"
:aria-label="$t('files.sortByLastModified')"
:class="{ active: modifiedSorted }"
class="modified"
role="button"
tabindex="0"
@click="sort('modified')"
:title="$t('files.sortByLastModified')"
:aria-label="$t('files.sortByLastModified')"
>
<span>{{ $t("files.lastModified") }}</span>
<i class="material-icons">{{ modifiedIcon }}</i>
@ -195,15 +186,15 @@
<h2 v-if="req.numDirs > 0">{{ $t("files.folders") }}</h2>
<div v-if="req.numDirs > 0">
<item
v-for="item in dirs"
:key="base64(item.name)"
v-bind:index="item.index"
v-bind:name="item.name"
v-bind:isDir="item.isDir"
v-bind:url="item.url"
v-bind:modified="item.modified"
v-bind:type="item.type"
v-bind:size="item.size"
v-for="item in dirs"
:key="base64(item.name)"
v-bind:index="item.index"
v-bind:name="item.name"
v-bind:isDir="item.isDir"
v-bind:url="item.url"
v-bind:modified="item.modified"
v-bind:type="item.type"
v-bind:size="item.size"
>
</item>
</div>
@ -211,44 +202,45 @@
<h2 v-if="req.numFiles > 0">{{ $t("files.files") }}</h2>
<div v-if="req.numFiles > 0">
<item
v-for="item in files"
:key="base64(item.name)"
v-bind:index="item.index"
v-bind:name="item.name"
v-bind:isDir="item.isDir"
v-bind:url="item.url"
v-bind:modified="item.modified"
v-bind:type="item.type"
v-bind:size="item.size"
v-for="item in files"
:key="base64(item.name)"
v-bind:index="item.index"
v-bind:name="item.name"
v-bind:isDir="item.isDir"
v-bind:url="item.url"
v-bind:modified="item.modified"
v-bind:type="item.type"
v-bind:size="item.size"
>
</item>
</div>
<input
style="display: none"
type="file"
id="upload-input"
@change="uploadInput($event)"
multiple
style="display: none"
type="file"
id="upload-input"
accept=".yml"
@change="uploadInput($event)"
multiple
/>
<input
style="display: none"
type="file"
id="upload-folder-input"
@change="uploadInput($event)"
webkitdirectory
multiple
style="display: none"
type="file"
id="upload-folder-input"
@change="uploadInput($event)"
webkitdirectory
multiple
/>
<div :class="{ active: $store.state.multiple }" id="multiple-selection">
<p>{{ $t("files.multipleSelectionEnabled") }}</p>
<div
@click="$store.commit('multiple', false)"
tabindex="0"
role="button"
:title="$t('files.clear')"
:aria-label="$t('files.clear')"
class="action"
@click="$store.commit('multiple', false)"
tabindex="0"
role="button"
:title="$t('files.clear')"
:aria-label="$t('files.clear')"
class="action"
>
<i class="material-icons">clear</i>
</div>
@ -260,9 +252,9 @@
<script>
import Vue from "vue";
import { mapState, mapGetters, mapMutations } from "vuex";
import { users, files as api } from "@/api";
import { enableExec } from "@/utils/constants";
import {mapGetters, mapMutations, mapState} from "vuex";
import {files as api, users} from "@/api";
import {enableExec} from "@/utils/constants";
import * as upload from "@/utils/upload";
import css from "@/utils/css";
import throttle from "lodash.throttle";
@ -323,7 +315,7 @@ export default {
}
});
return { dirs, files };
return {dirs, files};
},
dirs() {
return this.items.dirs.slice(0, this.showLimit);
@ -528,10 +520,10 @@ export default {
for (let item of this.$store.state.clipboard.items) {
const from = item.from.endsWith("/")
? item.from.slice(0, -1)
: item.from;
? item.from.slice(0, -1)
: item.from;
const to = this.$route.path + encodeURIComponent(item.name);
items.push({ from, to, name: item.name });
items.push({from, to, name: item.name});
}
if (items.length === 0) {
@ -540,22 +532,22 @@ export default {
let action = (overwrite, rename) => {
api
.copy(items, overwrite, rename)
.then(() => {
this.$store.commit("setReload", true);
})
.catch(this.$showError);
.copy(items, overwrite, rename)
.then(() => {
this.$store.commit("setReload", true);
})
.catch(this.$showError);
};
if (this.$store.state.clipboard.key === "x") {
action = (overwrite, rename) => {
api
.move(items, overwrite, rename)
.then(() => {
this.$store.commit("resetClipboard");
this.$store.commit("setReload", true);
})
.catch(this.$showError);
.move(items, overwrite, rename)
.then(() => {
this.$store.commit("resetClipboard");
this.$store.commit("setReload", true);
})
.catch(this.$showError);
};
}
@ -591,7 +583,7 @@ export default {
colunmsResize() {
// Update the columns size based on the window width.
let columns = Math.floor(
document.querySelector("main").offsetWidth / 300
document.querySelector("main").offsetWidth / 300
);
let items = css(["#listing.mosaic .item", ".mosaic#listing .item"]);
if (columns === 0) columns = 1;
@ -611,7 +603,7 @@ export default {
if (currentPos > triggerPos) {
// Quantity of items needed to fill 2x of the window height
const showQuantity = Math.ceil(
(window.innerHeight * 2) / this.itemWeight
(window.innerHeight * 2) / this.itemWeight
);
// Increase the number of displayed items
@ -655,13 +647,13 @@ export default {
let files = await upload.scanFiles(dt);
let items = this.req.items;
let path = this.$route.path.endsWith("/")
? this.$route.path
: this.$route.path + "/";
? this.$route.path
: this.$route.path + "/";
if (
el !== null &&
el.classList.contains("item") &&
el.dataset.dir === "true"
el !== null &&
el.classList.contains("item") &&
el.dataset.dir === "true"
) {
// Get url from ListingItem instance
path = el.__vue__.url;
@ -695,8 +687,8 @@ export default {
let files = event.currentTarget.files;
let folder_upload =
files[0].webkitRelativePath !== undefined &&
files[0].webkitRelativePath !== "";
files[0].webkitRelativePath !== undefined &&
files[0].webkitRelativePath !== "";
if (folder_upload) {
for (let i = 0; i < files.length; i++) {
@ -706,8 +698,8 @@ export default {
}
let path = this.$route.path.endsWith("/")
? this.$route.path
: this.$route.path + "/";
? this.$route.path
: this.$route.path + "/";
let conflict = upload.checkConflict(files, this.req.items);
if (conflict) {
@ -750,7 +742,7 @@ export default {
}
try {
await users.update({ id: this.user.id, sorting: { by, asc } }, [
await users.update({id: this.user.id, sorting: {by, asc}}, [
"sorting",
]);
} catch (e) {
@ -822,8 +814,8 @@ export default {
},
upload: function () {
if (
typeof window.DataTransferItem !== "undefined" &&
typeof DataTransferItem.prototype.webkitGetAsEntry !== "undefined"
typeof window.DataTransferItem !== "undefined" &&
typeof DataTransferItem.prototype.webkitGetAsEntry !== "undefined"
) {
this.$store.commit("showHover", "upload");
} else {
@ -850,7 +842,7 @@ export default {
// Quantity of items needed to fill 2x of the window height
const showQuantity = Math.ceil(
(windowHeight + windowHeight * 2) / this.itemWeight
(windowHeight + windowHeight * 2) / this.itemWeight
);
// Less items to display than current