aboutsummaryrefslogtreecommitdiff
path: root/src/site/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/site/components')
-rw-r--r--src/site/components/album/AlbumDetails.vue12
-rw-r--r--src/site/components/album/AlbumEntry.vue6
-rw-r--r--src/site/components/footer/Footer.vue8
-rw-r--r--src/site/components/grid/Grid.vue46
-rw-r--r--src/site/components/grid/waterfall/Waterfall.vue41
-rw-r--r--src/site/components/image-modal/AlbumInfo.vue20
-rw-r--r--src/site/components/image-modal/ImageInfo.vue21
-rw-r--r--src/site/components/image-modal/TagInfo.vue16
-rw-r--r--src/site/components/loading/CubeShadow.vue12
-rw-r--r--src/site/components/loading/Origami.vue4
-rw-r--r--src/site/components/loading/PingPong.vue4
-rw-r--r--src/site/components/loading/RotateSquare.vue4
-rw-r--r--src/site/components/navbar/Navbar.vue4
-rw-r--r--src/site/components/search-input/SearchInput.vue49
-rw-r--r--src/site/components/search/Search.vue59
-rw-r--r--src/site/components/sidebar/Sidebar.vue2
-rw-r--r--src/site/components/uploader/Uploader.vue4
17 files changed, 159 insertions, 153 deletions
diff --git a/src/site/components/album/AlbumDetails.vue b/src/site/components/album/AlbumDetails.vue
index 4067853..f81e257 100644
--- a/src/site/components/album/AlbumDetails.vue
+++ b/src/site/components/album/AlbumDetails.vue
@@ -119,12 +119,12 @@ import { mapState, mapActions } from 'vuex';
export default {
props: {
albumId: {
- type: Number,
- default: 0
+ 'type': Number,
+ 'default': 0
},
details: {
- type: Object,
- default: () => ({})
+ 'type': Object,
+ 'default': () => ({})
}
},
data() {
@@ -175,7 +175,7 @@ export default {
} catch (e) {
this.alert({ text: e.message, error: true });
} finally {
- this.isDeletingLinks = this.isDeletingLinks.filter((e) => e !== identifier);
+ this.isDeletingLinks = this.isDeletingLinks.filter(e => e !== identifier);
}
},
async createLink(albumId) {
@@ -207,7 +207,7 @@ export default {
maxlength: 10
},
trapFocus: true,
- onConfirm: (value) => this.$handler.executeAction('albums/createCustomLink', { albumId, value })
+ onConfirm: value => this.$handler.executeAction('albums/createCustomLink', { albumId, value })
});
},
isDeleting(identifier) {
diff --git a/src/site/components/album/AlbumEntry.vue b/src/site/components/album/AlbumEntry.vue
index 1e1b2cf..18633c4 100644
--- a/src/site/components/album/AlbumEntry.vue
+++ b/src/site/components/album/AlbumEntry.vue
@@ -53,7 +53,7 @@
<AlbumDetails
v-if="isExpanded"
:details="getDetails(album.id)"
- :albumId="album.id" />
+ :album-id="album.id" />
</div>
</template>
@@ -67,8 +67,8 @@ export default {
},
props: {
album: {
- type: Object,
- default: () => ({})
+ 'type': Object,
+ 'default': () => ({})
}
},
computed: {
diff --git a/src/site/components/footer/Footer.vue b/src/site/components/footer/Footer.vue
index b409cf5..aa54dce 100644
--- a/src/site/components/footer/Footer.vue
+++ b/src/site/components/footer/Footer.vue
@@ -54,6 +54,8 @@
</div>
<div class="column">
<a href="https://github.com/weebdev/lolisafe">GitHub</a>
+ <a href="https://patreon.com/pitu">Patreon</a>
+ <a href="https://discord.gg/5g6vgwn">Discord</a>
</div>
<div class="column">
<a
@@ -79,9 +81,9 @@ export default {
computed: {
...mapGetters({ loggedIn: 'auth/isLoggedIn' }),
...mapState({
- version: (state) => state.config.version,
- serviceName: (state) => state.config.serviceName,
- token: (state) => state.auth.token
+ version: state => state.config.version,
+ serviceName: state => state.config.serviceName,
+ token: state => state.auth.token
})
},
methods: {
diff --git a/src/site/components/grid/Grid.vue b/src/site/components/grid/Grid.vue
index ea568f0..0693c77 100644
--- a/src/site/components/grid/Grid.vue
+++ b/src/site/components/grid/Grid.vue
@@ -23,10 +23,10 @@
<template v-if="!images.showList">
<Waterfall
- :gutterWidth="10"
- :gutterHeight="4"
+ :gutter-width="10"
+ :gutter-height="4"
:options="{fitWidth: true}"
- :itemWidth="width"
+ :item-width="width"
:items="gridFiles">
<template v-slot="{item}">
<template v-if="isPublic">
@@ -165,32 +165,32 @@ export default {
},
props: {
files: {
- type: Array,
- default: () => []
+ 'type': Array,
+ 'default': () => []
},
total: {
- type: Number,
- default: 0
+ 'type': Number,
+ 'default': 0
},
fixed: {
- type: Boolean,
- default: false
+ 'type': Boolean,
+ 'default': false
},
isPublic: {
- type: Boolean,
- default: false
+ 'type': Boolean,
+ 'default': false
},
width: {
- type: Number,
- default: 150
+ 'type': Number,
+ 'default': 150
},
enableSearch: {
- type: Boolean,
- default: true
+ 'type': Boolean,
+ 'default': true
},
enableToolbar: {
- type: Boolean,
- default: true
+ 'type': Boolean,
+ 'default': true
}
},
data() {
@@ -212,16 +212,16 @@ export default {
},
computed: {
...mapState({
- user: (state) => state.auth.user,
- albums: (state) => state.albums.tinyDetails,
- images: (state) => state.images
+ user: state => state.auth.user,
+ albums: state => state.albums.tinyDetails,
+ images: state => state.images
}),
blank() {
// eslint-disable-next-line global-require, import/no-unresolved
return require('@/assets/images/blank.png');
},
gridFiles() {
- return (this.files || []).filter((v) => !v.hideFromList);
+ return (this.files || []).filter(v => !v.hideFromList);
}
},
watch: {
@@ -259,8 +259,8 @@ export default {
},
isAlbumSelected(id) {
if (!this.showingModalForFile) return false;
- const found = this.showingModalForFile.albums.find((el) => el.id === id);
- return !!(found && found.id);
+ const found = this.showingModalForFile.albums.find(el => el.id === id);
+ return Boolean(found && found.id);
},
async openAlbumModal(file) {
const { id } = file;
diff --git a/src/site/components/grid/waterfall/Waterfall.vue b/src/site/components/grid/waterfall/Waterfall.vue
index af2af3f..5a4c569 100644
--- a/src/site/components/grid/waterfall/Waterfall.vue
+++ b/src/site/components/grid/waterfall/Waterfall.vue
@@ -24,24 +24,24 @@ export default {
},
props: {
options: {
- type: Object,
- default: () => {}
+ 'type': Object,
+ 'default': () => {}
},
items: {
- type: Array,
- default: () => []
+ 'type': Array,
+ 'default': () => []
},
itemWidth: {
- type: Number,
- default: 150
+ 'type': Number,
+ 'default': 150
},
gutterWidth: {
- type: Number,
- default: 10
+ 'type': Number,
+ 'default': 10
},
gutterHeight: {
- type: Number,
- default: 4
+ 'type': Number,
+ 'default': 4
}
},
mounted() {
@@ -84,20 +84,20 @@ export default {
this.masonry.layout();
},
diffDomChildren() {
- const oldChildren = this.domChildren.filter((element) => !!element.parentNode);
+ const oldChildren = this.domChildren.filter(element => Boolean(element.parentNode));
const newChildren = this.getNewDomChildren();
- const removed = oldChildren.filter((oldChild) => !newChildren.includes(oldChild));
- const domDiff = newChildren.filter((newChild) => !oldChildren.includes(newChild));
+ const removed = oldChildren.filter(oldChild => !newChildren.includes(oldChild));
+ const domDiff = newChildren.filter(newChild => !oldChildren.includes(newChild));
const prepended = domDiff.filter((newChild, index) => newChildren[index] === newChild);
- const appended = domDiff.filter((el) => !prepended.includes(el));
+ const appended = domDiff.filter(el => !prepended.includes(el));
let moved = [];
if (removed.length === 0) {
moved = oldChildren.filter((child, index) => index !== newChildren.indexOf(child));
}
this.domChildren = newChildren;
return {
- old: oldChildren,
- new: newChildren,
+ 'old': oldChildren,
+ 'new': newChildren,
removed,
appended,
prepended,
@@ -120,15 +120,10 @@ export default {
getNewDomChildren() {
const node = this.$refs.waterfall;
const children = this.options && this.options.itemSelector
- ? node.querySelectorAll(this.options.itemSelector) : node.children;
+ ? node.querySelectorAll(this.options.itemSelector)
+ : node.children;
return Array.prototype.slice.call(children);
}
}
};
</script>
-
-<style lang="scss" scoped>
-.wfi {
-
-}
-</style>
diff --git a/src/site/components/image-modal/AlbumInfo.vue b/src/site/components/image-modal/AlbumInfo.vue
index 17c375a..8aeb02e 100644
--- a/src/site/components/image-modal/AlbumInfo.vue
+++ b/src/site/components/image-modal/AlbumInfo.vue
@@ -24,22 +24,20 @@
</template>
<script>
-import { mapState } from 'vuex';
-
export default {
name: 'Albuminfo',
props: {
imageId: {
- type: Number,
- default: 0
+ 'type': Number,
+ 'default': 0
},
imageAlbums: {
- type: Array,
- default: () => []
+ 'type': Array,
+ 'default': () => []
},
albums: {
- type: Array,
- default: () => []
+ 'type': Array,
+ 'default': () => []
}
},
data() {
@@ -52,7 +50,7 @@ export default {
this.orderedAlbums = this.getOrderedAlbums();
// we're sorting here instead of computed because we want sort on creation
// then the array's values should be frozen
- this.selectedOptions = this.imageAlbums.map((e) => e.id);
+ this.selectedOptions = this.imageAlbums.map(e => e.id);
},
methods: {
getOrderedAlbums() {
@@ -70,8 +68,8 @@ export default {
},
isAlbumSelected(id) {
if (!this.showingModalForFile) return false;
- const found = this.showingModalForFile.albums.find((el) => el.id === id);
- return !!(found && found.id);
+ const found = this.showingModalForFile.albums.find(el => el.id === id);
+ return Boolean(found && found.id);
},
async handleClick(id) {
// here the album should be already removed from the selected list
diff --git a/src/site/components/image-modal/ImageInfo.vue b/src/site/components/image-modal/ImageInfo.vue
index 73b6339..07c87b5 100644
--- a/src/site/components/image-modal/ImageInfo.vue
+++ b/src/site/components/image-modal/ImageInfo.vue
@@ -97,12 +97,12 @@
<div class="divider is-lolisafe has-text-light">
Tags
</div>
- <Taginfo :imageId="file.id" :imageTags="tags" />
+ <Taginfo :image-id="file.id" :image-tags="tags" />
<div class="divider is-lolisafe has-text-light">
Albums
</div>
- <Albuminfo :imageId="file.id" :imageAlbums="albums" :albums="tinyDetails" />
+ <Albuminfo :image-id="file.id" :image-albums="albums" :albums="tinyDetails" />
</div>
</div>
</div>
@@ -122,21 +122,21 @@ export default {
},
props: {
file: {
- type: Object,
- default: () => ({})
+ 'type': Object,
+ 'default': () => ({})
},
albums: {
- type: Array,
- default: () => ([])
+ 'type': Array,
+ 'default': () => ([])
},
tags: {
- type: Array,
- default: () => ([])
+ 'type': Array,
+ 'default': () => ([])
}
},
computed: mapState({
- images: (state) => state.images,
- tinyDetails: (state) => state.albums.tinyDetails
+ images: state => state.images,
+ tinyDetails: state => state.albums.tinyDetails
}),
methods: {
formatBytes(bytes, decimals = 2) {
@@ -148,6 +148,7 @@ export default {
const i = Math.floor(Math.log(bytes) / Math.log(k));
+ // eslint-disable-next-line no-mixed-operators
return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`;
},
isVideo(type) {
diff --git a/src/site/components/image-modal/TagInfo.vue b/src/site/components/image-modal/TagInfo.vue
index 59d01f5..756a32d 100644
--- a/src/site/components/image-modal/TagInfo.vue
+++ b/src/site/components/image-modal/TagInfo.vue
@@ -22,12 +22,12 @@ export default {
name: 'Taginfo',
props: {
imageId: {
- type: Number,
- default: 0
+ 'type': Number,
+ 'default': 0
},
imageTags: {
- type: Array,
- default: () => []
+ 'type': Array,
+ 'default': () => []
}
},
data() {
@@ -37,14 +37,14 @@ export default {
},
computed: {
...mapState({
- tags: (state) => state.tags.tagsList
+ tags: state => state.tags.tagsList
}),
- selectedTags() { return this.imageTags.map((e) => e.name); },
- lowercaseTags() { return this.imageTags.map((e) => e.name.toLowerCase()); }
+ selectedTags() { return this.imageTags.map(e => e.name); },
+ lowercaseTags() { return this.imageTags.map(e => e.name.toLowerCase()); }
},
methods: {
getFilteredTags(str) {
- this.filteredTags = this.tags.map((e) => e.name).filter((e) => {
+ this.filteredTags = this.tags.map(e => e.name).filter(e => {
// check if the search string matches any of the tags
const sanitezedTag = e.toString().toLowerCase();
const matches = sanitezedTag.indexOf(str.toLowerCase()) >= 0;
diff --git a/src/site/components/loading/CubeShadow.vue b/src/site/components/loading/CubeShadow.vue
index 71b5da5..7aeed65 100644
--- a/src/site/components/loading/CubeShadow.vue
+++ b/src/site/components/loading/CubeShadow.vue
@@ -8,16 +8,16 @@
export default {
props: {
size: {
- type: String,
- default: '60px'
+ 'type': String,
+ 'default': '60px'
},
background: {
- type: String,
- default: '#9C27B0'
+ 'type': String,
+ 'default': '#9C27B0'
},
duration: {
- type: String,
- default: '1.8s'
+ 'type': String,
+ 'default': '1.8s'
}
},
computed: {
diff --git a/src/site/components/loading/Origami.vue b/src/site/components/loading/Origami.vue
index 59c5d8f..1c7a4c3 100644
--- a/src/site/components/loading/Origami.vue
+++ b/src/site/components/loading/Origami.vue
@@ -19,8 +19,8 @@
export default {
props: {
size: {
- type: String,
- default: '40px'
+ 'type': String,
+ 'default': '40px'
}
},
computed: {
diff --git a/src/site/components/loading/PingPong.vue b/src/site/components/loading/PingPong.vue
index c04ae72..bab33d5 100644
--- a/src/site/components/loading/PingPong.vue
+++ b/src/site/components/loading/PingPong.vue
@@ -18,8 +18,8 @@
export default {
props: {
size: {
- type: String,
- default: '60px'
+ 'type': String,
+ 'default': '60px'
}
},
computed: {
diff --git a/src/site/components/loading/RotateSquare.vue b/src/site/components/loading/RotateSquare.vue
index 7bc9bb0..b7967ec 100644
--- a/src/site/components/loading/RotateSquare.vue
+++ b/src/site/components/loading/RotateSquare.vue
@@ -8,8 +8,8 @@
export default {
props: {
size: {
- type: String,
- default: '40px'
+ 'type': String,
+ 'default': '40px'
}
},
computed: {
diff --git a/src/site/components/navbar/Navbar.vue b/src/site/components/navbar/Navbar.vue
index 22d41d4..c0b8668 100644
--- a/src/site/components/navbar/Navbar.vue
+++ b/src/site/components/navbar/Navbar.vue
@@ -72,8 +72,8 @@ import { mapState, mapGetters } from 'vuex';
export default {
props: {
isWhite: {
- type: Boolean,
- default: false
+ 'type': Boolean,
+ 'default': false
}
},
data() {
diff --git a/src/site/components/search-input/SearchInput.vue b/src/site/components/search-input/SearchInput.vue
index 1c5b983..10728a0 100644
--- a/src/site/components/search-input/SearchInput.vue
+++ b/src/site/components/search-input/SearchInput.vue
@@ -89,12 +89,12 @@ export default {
props: {
value: [Number, String],
data: {
- type: Array,
- default: () => []
+ 'type': Array,
+ 'default': () => []
},
field: {
- type: String,
- default: 'value'
+ 'type': String,
+ 'default': 'value'
},
keepFirst: Boolean,
clearOnSelect: Boolean,
@@ -105,8 +105,8 @@ export default {
clearable: Boolean,
maxHeight: [String, Number],
dropdownPosition: {
- type: String,
- default: 'auto'
+ 'type': String,
+ 'default': 'auto'
},
iconRight: String,
iconRightClickable: Boolean,
@@ -159,25 +159,25 @@ export default {
* Check if exists default slot
*/
hasDefaultSlot() {
- return !!this.$scopedSlots.default;
+ return Boolean(this.$scopedSlots.default);
},
/**
* Check if exists "empty" slot
*/
hasEmptySlot() {
- return !!this.$slots.empty;
+ return Boolean(this.$slots.empty);
},
/**
* Check if exists "header" slot
*/
hasHeaderSlot() {
- return !!this.$slots.header;
+ return Boolean(this.$slots.header);
},
/**
* Check if exists "footer" slot
*/
hasFooterSlot() {
- return !!this.$slots.footer;
+ return Boolean(this.$slots.footer);
},
/**
* Apply dropdownPosition property
@@ -202,7 +202,8 @@ export default {
// eslint-disable-next-line no-nested-ternary
maxHeight: this.maxHeight === undefined
// eslint-disable-next-line no-restricted-globals
- ? null : (isNaN(this.maxHeight) ? this.maxHeight : `${this.maxHeight}px`)
+ ? null
+ : (isNaN(this.maxHeight) ? this.maxHeight : `${this.maxHeight}px`)
};
}
},
@@ -239,7 +240,7 @@ export default {
}
// Close dropdown if input is clear or else open it
if (this.hasFocus && (!this.openOnFocus || value)) {
- this.isActive = !!value;
+ this.isActive = Boolean(value);
}
},
/**
@@ -378,8 +379,8 @@ export default {
* reached it's end.
*/
checkIfReachedTheEndOfScroll(list) {
- if (list.clientHeight !== list.scrollHeight
- && list.scrollTop + list.clientHeight >= list.scrollHeight) {
+ if (list.clientHeight !== list.scrollHeight &&
+ list.scrollTop + list.clientHeight >= list.scrollHeight) {
this.$emit('infinite-scroll');
}
},
@@ -396,9 +397,9 @@ export default {
if (this.$refs.dropdown === undefined) return;
const rect = this.$refs.dropdown.getBoundingClientRect();
this.isListInViewportVertically = (
- rect.top >= 0
- && rect.bottom <= (window.innerHeight
- || document.documentElement.clientHeight)
+ rect.top >= 0 &&
+ rect.bottom <= (window.innerHeight ||
+ document.documentElement.clientHeight)
);
if (this.appendToBody) {
this.updateAppendToBody();
@@ -425,9 +426,9 @@ export default {
list.scrollTop = element.offsetTop;
} else if (element.offsetTop >= visMax) {
list.scrollTop = (
- element.offsetTop
- - list.clientHeight
- + element.clientHeight
+ element.offsetTop -
+ list.clientHeight +
+ element.clientHeight
);
}
} else {
@@ -487,7 +488,7 @@ export default {
if (dropdownMenu && trigger) {
// update wrapper dropdown
const root = this.$data._bodyEl;
- root.classList.forEach((item) => root.classList.remove(item));
+ root.classList.forEach(item => root.classList.remove(item));
root.classList.add('autocomplete');
root.classList.add('control');
if (this.expandend) {
@@ -496,10 +497,10 @@ export default {
const rect = trigger.getBoundingClientRect();
let top = rect.top + window.scrollY;
const left = rect.left + window.scrollX;
- if (!this.isOpenedTop) {
- top += trigger.clientHeight;
- } else {
+ if (this.isOpenedTop) {
top -= dropdownMenu.clientHeight;
+ } else {
+ top += trigger.clientHeight;
}
this.style = {
position: 'absolute',
diff --git a/src/site/components/search/Search.vue b/src/site/components/search/Search.vue
index 778474c..2c4e3bc 100644
--- a/src/site/components/search/Search.vue
+++ b/src/site/components/search/Search.vue
@@ -6,7 +6,7 @@
ref="autocomplete"
v-model="query"
:data="filteredHints"
- :customSelector="handleSelect"
+ :custom-selector="handleSelect"
field="name"
class="lolisafe-input search"
placeholder="Search"
@@ -40,8 +40,8 @@ export default {
},
props: {
hiddenHints: {
- type: Array,
- default: () => []
+ 'type': Array,
+ 'default': () => []
}
},
data() {
@@ -49,34 +49,34 @@ export default {
query: '',
hints: [
{
- 'name': 'tag',
- 'valueFormat': 'name',
- 'hint': ''
+ name: 'tag',
+ valueFormat: 'name',
+ hint: ''
},
{
- 'name': 'album',
- 'valueFormat': 'name',
- 'hint': ''
+ name: 'album',
+ valueFormat: 'name',
+ hint: ''
},
{
- 'name': 'before',
- 'valueFormat': 'specific date',
- 'hint': ''
+ name: 'before',
+ valueFormat: 'specific date',
+ hint: ''
},
{
- 'name': 'during',
- 'valueFormat': 'specific date',
- 'hint': ''
+ name: 'during',
+ valueFormat: 'specific date',
+ hint: ''
},
{
- 'name': 'after',
- 'valueFormat': 'specific date',
- 'hint': ''
+ name: 'after',
+ valueFormat: 'specific date',
+ hint: ''
},
{
- 'name': 'file',
- 'valueFormat': 'generated name',
- 'hint': ''
+ name: 'file',
+ valueFormat: 'generated name',
+ hint: ''
}
],
filteredHints: []
@@ -98,13 +98,22 @@ export default {
// get the last word or group of words
let lastWord = (qry.match(/("[^"]*")|[^\s]+/g) || ['']).pop().toLowerCase();
// if there's an open/unbalanced quote, don't autosuggest
- if (/^[^"]*("[^"]*"[^"]*)*(")[^"]*$/.test(qry)) { this.filteredHints = []; return; }
+ if (/^[^"]*("[^"]*"[^"]*)*(")[^"]*$/.test(qry)) {
+ this.filteredHints = [];
+ return;
+ }
// don't autosuggest if we have an open query but no text yet
- if (/:\s+$/gi.test(qry)) { this.filteredHints = []; return; }
+ if (/:\s+$/gi.test(qry)) {
+ this.filteredHints = [];
+ return;
+ }
// if the above query didn't match (all quotes are balanced
// and the previous tag has value
// check if we're about to start a new tag
- if (/\s+$/gi.test(qry)) { this.filteredHints = this.hints; return; }
+ if (/\s+$/gi.test(qry)) {
+ this.filteredHints = this.hints;
+ return;
+ }
// ignore starting `-` from lastword, because - is used to
// exclude something, so -alb should autosuggest album
@@ -112,7 +121,7 @@ export default {
// if we got here, then we handled all special cases
// now take last word, and check if we can autosuggest a tag
- this.filteredHints = this.hints.filter((hint) => hint.name
+ this.filteredHints = this.hints.filter(hint => hint.name
.toString()
.toLowerCase()
.indexOf(lastWord) === 0);
diff --git a/src/site/components/sidebar/Sidebar.vue b/src/site/components/sidebar/Sidebar.vue
index e0c8fa2..8d96712 100644
--- a/src/site/components/sidebar/Sidebar.vue
+++ b/src/site/components/sidebar/Sidebar.vue
@@ -48,7 +48,7 @@ import { mapState } from 'vuex';
export default {
computed: mapState({
- user: (state) => state.auth.user
+ user: state => state.auth.user
}),
methods: {
isRouteActive(id) {
diff --git a/src/site/components/uploader/Uploader.vue b/src/site/components/uploader/Uploader.vue
index 2740bee..94d4003 100644
--- a/src/site/components/uploader/Uploader.vue
+++ b/src/site/components/uploader/Uploader.vue
@@ -93,8 +93,8 @@ export default {
},
computed: {
...mapState({
- config: (state) => state.config,
- albums: (state) => state.albums.tinyDetails
+ config: state => state.config,
+ albums: state => state.albums.tinyDetails
}),
...mapGetters({ loggedIn: 'auth/isLoggedIn', token: 'auth/getToken' })
},