Merge remote-tracking branch 'origin/develop' into shigusegubu-themes3
This commit is contained in:
commit
e6fc460b02
13 changed files with 754 additions and 954 deletions
1
changelog.d/better-scroll-button.add
Normal file
1
changelog.d/better-scroll-button.add
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Add support for detachable scrollTop button
|
||||||
17
package.json
17
package.json
|
|
@ -72,19 +72,20 @@
|
||||||
"babel-plugin-lodash": "3.3.4",
|
"babel-plugin-lodash": "3.3.4",
|
||||||
"chai": "5.2.0",
|
"chai": "5.2.0",
|
||||||
"chalk": "5.4.1",
|
"chalk": "5.4.1",
|
||||||
"chromedriver": "134.0.5",
|
"chromedriver": "135.0.0",
|
||||||
"connect-history-api-fallback": "2.0.0",
|
"connect-history-api-fallback": "2.0.0",
|
||||||
"cross-spawn": "7.0.6",
|
"cross-spawn": "7.0.6",
|
||||||
"custom-event-polyfill": "1.0.7",
|
"custom-event-polyfill": "1.0.7",
|
||||||
"eslint": "9.23.0",
|
"eslint": "9.24.0",
|
||||||
|
"vue-eslint-parser": "10.1.3",
|
||||||
"eslint-config-standard": "17.1.0",
|
"eslint-config-standard": "17.1.0",
|
||||||
"eslint-formatter-friendly": "7.0.0",
|
"eslint-formatter-friendly": "7.0.0",
|
||||||
"eslint-plugin-import": "2.31.0",
|
"eslint-plugin-import": "2.31.0",
|
||||||
"eslint-plugin-n": "17.17.0",
|
"eslint-plugin-n": "17.17.0",
|
||||||
"eslint-plugin-promise": "7.2.1",
|
"eslint-plugin-promise": "7.2.1",
|
||||||
"eslint-plugin-vue": "9.33.0",
|
"eslint-plugin-vue": "10.0.0",
|
||||||
"eventsource-polyfill": "0.9.6",
|
"eventsource-polyfill": "0.9.6",
|
||||||
"express": "4.21.2",
|
"express": "5.1.0",
|
||||||
"function-bind": "1.1.2",
|
"function-bind": "1.1.2",
|
||||||
"http-proxy-middleware": "3.0.3",
|
"http-proxy-middleware": "3.0.3",
|
||||||
"iso-639-1": "3.1.5",
|
"iso-639-1": "3.1.5",
|
||||||
|
|
@ -95,19 +96,19 @@
|
||||||
"postcss": "8.5.3",
|
"postcss": "8.5.3",
|
||||||
"postcss-html": "^1.5.0",
|
"postcss-html": "^1.5.0",
|
||||||
"postcss-scss": "^4.0.6",
|
"postcss-scss": "^4.0.6",
|
||||||
"sass": "1.86.1",
|
"sass": "1.86.3",
|
||||||
"selenium-server": "3.141.59",
|
"selenium-server": "3.141.59",
|
||||||
"semver": "7.7.1",
|
"semver": "7.7.1",
|
||||||
"serve-static": "2.2.0",
|
"serve-static": "2.2.0",
|
||||||
"shelljs": "0.9.2",
|
"shelljs": "0.9.2",
|
||||||
"sinon": "20.0.0",
|
"sinon": "20.0.0",
|
||||||
"sinon-chai": "4.0.0",
|
"sinon-chai": "4.0.0",
|
||||||
"stylelint": "16.17.0",
|
"stylelint": "16.18.0",
|
||||||
"stylelint-config-html": "^1.1.0",
|
"stylelint-config-html": "^1.1.0",
|
||||||
"stylelint-config-recommended": "^14.0.0",
|
"stylelint-config-recommended": "^16.0.0",
|
||||||
"stylelint-config-recommended-scss": "^14.0.0",
|
"stylelint-config-recommended-scss": "^14.0.0",
|
||||||
"stylelint-config-recommended-vue": "^1.6.0",
|
"stylelint-config-recommended-vue": "^1.6.0",
|
||||||
"stylelint-config-standard": "37.0.0",
|
"stylelint-config-standard": "38.0.0",
|
||||||
"vite": "^6.1.0",
|
"vite": "^6.1.0",
|
||||||
"vite-plugin-eslint2": "^5.0.3",
|
"vite-plugin-eslint2": "^5.0.3",
|
||||||
"vite-plugin-stylelint": "^6.0.0",
|
"vite-plugin-stylelint": "^6.0.0",
|
||||||
|
|
|
||||||
23
src/App.js
23
src/App.js
|
|
@ -20,6 +20,8 @@ import { defineAsyncComponent } from 'vue'
|
||||||
import { useShoutStore } from './stores/shout'
|
import { useShoutStore } from './stores/shout'
|
||||||
import { useInterfaceStore } from './stores/interface'
|
import { useInterfaceStore } from './stores/interface'
|
||||||
|
|
||||||
|
import { throttle } from 'lodash'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'app',
|
name: 'app',
|
||||||
components: {
|
components: {
|
||||||
|
|
@ -58,16 +60,23 @@ export default {
|
||||||
// Load the locale from the storage
|
// Load the locale from the storage
|
||||||
const val = this.$store.getters.mergedConfig.interfaceLanguage
|
const val = this.$store.getters.mergedConfig.interfaceLanguage
|
||||||
this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
|
this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
|
||||||
window.addEventListener('resize', this.updateMobileState)
|
|
||||||
document.getElementById('modal').classList = ['-' + this.layoutType]
|
document.getElementById('modal').classList = ['-' + this.layoutType]
|
||||||
|
|
||||||
|
// Create bound handlers
|
||||||
|
this.updateScrollState = throttle(this.scrollHandler, 200)
|
||||||
|
this.updateMobileState = throttle(this.resizeHandler, 200)
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
window.addEventListener('resize', this.updateMobileState)
|
||||||
|
this.scrollParent.addEventListener('scroll', this.updateScrollState)
|
||||||
|
|
||||||
if (useInterfaceStore().themeApplied) {
|
if (useInterfaceStore().themeApplied) {
|
||||||
this.removeSplash()
|
this.removeSplash()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
unmounted () {
|
unmounted () {
|
||||||
window.removeEventListener('resize', this.updateMobileState)
|
window.removeEventListener('resize', this.updateMobileState)
|
||||||
|
this.scrollParent.removeEventListener('scroll', this.updateScrollState)
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
themeApplied () {
|
themeApplied () {
|
||||||
|
|
@ -146,13 +155,23 @@ export default {
|
||||||
},
|
},
|
||||||
noSticky () { return this.$store.getters.mergedConfig.disableStickyHeaders },
|
noSticky () { return this.$store.getters.mergedConfig.disableStickyHeaders },
|
||||||
showScrollbars () { return this.$store.getters.mergedConfig.showScrollbars },
|
showScrollbars () { return this.$store.getters.mergedConfig.showScrollbars },
|
||||||
|
scrollParent () { return window; /* this.$refs.appContentRef */ },
|
||||||
...mapGetters(['mergedConfig'])
|
...mapGetters(['mergedConfig'])
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateMobileState () {
|
resizeHandler () {
|
||||||
useInterfaceStore().setLayoutWidth(windowWidth())
|
useInterfaceStore().setLayoutWidth(windowWidth())
|
||||||
useInterfaceStore().setLayoutHeight(windowHeight())
|
useInterfaceStore().setLayoutHeight(windowHeight())
|
||||||
},
|
},
|
||||||
|
scrollHandler () {
|
||||||
|
const scrollPosition = this.scrollParent === window ? window.scrollY : this.scrollParent.scrollTop
|
||||||
|
|
||||||
|
if (scrollPosition != 0) {
|
||||||
|
this.$refs.appContentRef.classList.add(['-scrolled'])
|
||||||
|
} else {
|
||||||
|
this.$refs.appContentRef.classList.remove(['-scrolled'])
|
||||||
|
}
|
||||||
|
},
|
||||||
removeSplash () {
|
removeSplash () {
|
||||||
document.querySelector('#status').textContent = this.$t('splash.fun_' + Math.ceil(Math.random() * 4))
|
document.querySelector('#status').textContent = this.$t('splash.fun_' + Math.ceil(Math.random() * 4))
|
||||||
const splashscreenRoot = document.querySelector('#splash')
|
const splashscreenRoot = document.querySelector('#splash')
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
<Notifications v-if="currentUser" />
|
<Notifications v-if="currentUser" />
|
||||||
<div
|
<div
|
||||||
id="content"
|
id="content"
|
||||||
|
ref="appContentRef"
|
||||||
class="app-layout container"
|
class="app-layout container"
|
||||||
:class="classes"
|
:class="classes"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,7 @@ export default {
|
||||||
inset: 0;
|
inset: 0;
|
||||||
display: grid;
|
display: grid;
|
||||||
place-items: center center;
|
place-items: center center;
|
||||||
background-color: rgba(100 0 0 / 50%);
|
background-color: rgb(100 0 0 / 50%);
|
||||||
|
|
||||||
.alert {
|
.alert {
|
||||||
padding: 0.5em 1em;
|
padding: 0.5em 1em;
|
||||||
|
|
@ -261,14 +261,14 @@ export default {
|
||||||
.preview-window {
|
.preview-window {
|
||||||
--__grid-color1: rgb(102 102 102);
|
--__grid-color1: rgb(102 102 102);
|
||||||
--__grid-color2: rgb(153 153 153);
|
--__grid-color2: rgb(153 153 153);
|
||||||
--__grid-color1-disabled: rgba(102 102 102 / 20%);
|
--__grid-color1-disabled: rgb(102 102 102 / 20%);
|
||||||
--__grid-color2-disabled: rgba(153 153 153 / 20%);
|
--__grid-color2-disabled: rgb(153 153 153 / 20%);
|
||||||
|
|
||||||
&.-light-grid {
|
&.-light-grid {
|
||||||
--__grid-color1: rgb(205 205 205);
|
--__grid-color1: rgb(205 205 205);
|
||||||
--__grid-color2: rgb(255 255 255);
|
--__grid-color2: rgb(255 255 255);
|
||||||
--__grid-color1-disabled: rgba(205 205 205 / 20%);
|
--__grid-color1-disabled: rgb(205 205 205 / 20%);
|
||||||
--__grid-color2-disabled: rgba(255 255 255 / 20%);
|
--__grid-color2-disabled: rgb(255 255 255 / 20%);
|
||||||
}
|
}
|
||||||
|
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
|
||||||
|
|
@ -2,21 +2,24 @@
|
||||||
<div class="image-cropper">
|
<div class="image-cropper">
|
||||||
<div v-if="dataUrl">
|
<div v-if="dataUrl">
|
||||||
<cropper-canvas
|
<cropper-canvas
|
||||||
|
ref="cropperCanvas"
|
||||||
background
|
background
|
||||||
class="image-cropper-canvas"
|
class="image-cropper-canvas"
|
||||||
ref="cropperCanvas"
|
|
||||||
height="25em"
|
height="25em"
|
||||||
>
|
>
|
||||||
<cropper-image
|
<cropper-image
|
||||||
|
ref="cropperImage"
|
||||||
:src="dataUrl"
|
:src="dataUrl"
|
||||||
alt="Picture"
|
alt="Picture"
|
||||||
ref="cropperImage"
|
|
||||||
class="image-cropper-image"
|
class="image-cropper-image"
|
||||||
translatable
|
translatable
|
||||||
scalable
|
scalable
|
||||||
/>
|
/>
|
||||||
<cropper-shade hidden />
|
<cropper-shade hidden />
|
||||||
<cropper-handle action="select" plain />
|
<cropper-handle
|
||||||
|
action="select"
|
||||||
|
plain
|
||||||
|
/>
|
||||||
<cropper-selection
|
<cropper-selection
|
||||||
ref="cropperSelection"
|
ref="cropperSelection"
|
||||||
initial-coverage="1"
|
initial-coverage="1"
|
||||||
|
|
@ -25,17 +28,23 @@
|
||||||
resizable
|
resizable
|
||||||
@change="onCropperSelectionChange"
|
@change="onCropperSelectionChange"
|
||||||
>
|
>
|
||||||
<cropper-grid role="grid" covered></cropper-grid>
|
<cropper-grid
|
||||||
<cropper-crosshair centered></cropper-crosshair>
|
role="grid"
|
||||||
<cropper-handle action="move" theme-color="rgba(255, 255, 255, 0.35)"></cropper-handle>
|
covered
|
||||||
<cropper-handle action="n-resize"></cropper-handle>
|
/>
|
||||||
<cropper-handle action="e-resize"></cropper-handle>
|
<cropper-crosshair centered />
|
||||||
<cropper-handle action="s-resize"></cropper-handle>
|
<cropper-handle
|
||||||
<cropper-handle action="w-resize"></cropper-handle>
|
action="move"
|
||||||
<cropper-handle action="ne-resize"></cropper-handle>
|
theme-color="rgba(255, 255, 255, 0.35)"
|
||||||
<cropper-handle action="nw-resize"></cropper-handle>
|
/>
|
||||||
<cropper-handle action="se-resize"></cropper-handle>
|
<cropper-handle action="n-resize" />
|
||||||
<cropper-handle action="sw-resize"></cropper-handle>
|
<cropper-handle action="e-resize" />
|
||||||
|
<cropper-handle action="s-resize" />
|
||||||
|
<cropper-handle action="w-resize" />
|
||||||
|
<cropper-handle action="ne-resize" />
|
||||||
|
<cropper-handle action="nw-resize" />
|
||||||
|
<cropper-handle action="se-resize" />
|
||||||
|
<cropper-handle action="sw-resize" />
|
||||||
</cropper-selection>
|
</cropper-selection>
|
||||||
</cropper-canvas>
|
</cropper-canvas>
|
||||||
<div class="image-cropper-buttons-wrapper">
|
<div class="image-cropper-buttons-wrapper">
|
||||||
|
|
|
||||||
|
|
@ -93,4 +93,4 @@
|
||||||
|
|
||||||
<script src="./login_form.js"></script>
|
<script src="./login_form.js"></script>
|
||||||
|
|
||||||
<style src="./login_form.scss"/>
|
<style src="./login_form.scss" />
|
||||||
|
|
|
||||||
18
src/components/scroll_top_button/scroll_top_button.js
Normal file
18
src/components/scroll_top_button/scroll_top_button.js
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
const ScrollTopButton = {
|
||||||
|
props: {
|
||||||
|
fast: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
scrollToTop() {
|
||||||
|
const speed = this.fast ? 'instant' : 'smooth';
|
||||||
|
|
||||||
|
window.scrollTo({ top: 0, behavior: speed })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ScrollTopButton
|
||||||
29
src/components/scroll_top_button/scroll_top_button.vue
Normal file
29
src/components/scroll_top_button/scroll_top_button.vue
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
<template>
|
||||||
|
<div class="rightside-button scroll-to-top">
|
||||||
|
<button
|
||||||
|
class="button-unstyled scroll-to-top-button"
|
||||||
|
type="button"
|
||||||
|
:title="$t('general.scroll_to_top')"
|
||||||
|
@click="scrollToTop"
|
||||||
|
>
|
||||||
|
<FALayers class="fa-scale-110 fa-old-padding-layer">
|
||||||
|
<FAIcon icon="arrow-up" />
|
||||||
|
<FAIcon
|
||||||
|
icon="minus"
|
||||||
|
transform="up-7"
|
||||||
|
/>
|
||||||
|
</FALayers>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script src="./scroll_top_button.js"></script>
|
||||||
|
<style lang="scss">
|
||||||
|
.scroll-to-top {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.-scrolled .scroll-to-top {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -103,7 +103,6 @@
|
||||||
min-width: 1.6em;
|
min-width: 1.6em;
|
||||||
margin-right: 0.4em;
|
margin-right: 0.4em;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow-wrap: nowrap;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
flex: 1 1 0;
|
flex: 1 1 0;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import Conversation from '../conversation/conversation.vue'
|
||||||
import TimelineMenu from '../timeline_menu/timeline_menu.vue'
|
import TimelineMenu from '../timeline_menu/timeline_menu.vue'
|
||||||
import QuickFilterSettings from '../quick_filter_settings/quick_filter_settings.vue'
|
import QuickFilterSettings from '../quick_filter_settings/quick_filter_settings.vue'
|
||||||
import QuickViewSettings from '../quick_view_settings/quick_view_settings.vue'
|
import QuickViewSettings from '../quick_view_settings/quick_view_settings.vue'
|
||||||
|
import ScrollTopButton from '../scroll_top_button/scroll_top_button.vue'
|
||||||
import { debounce, throttle, keyBy } from 'lodash'
|
import { debounce, throttle, keyBy } from 'lodash'
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import { faCircleNotch, faCirclePlus, faCog, faMinus, faArrowUp, faCheck } from '@fortawesome/free-solid-svg-icons'
|
import { faCircleNotch, faCirclePlus, faCog, faMinus, faArrowUp, faCheck } from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
@ -47,6 +48,7 @@ const Timeline = {
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Status,
|
Status,
|
||||||
|
ScrollTopButton,
|
||||||
Conversation,
|
Conversation,
|
||||||
TimelineMenu,
|
TimelineMenu,
|
||||||
QuickFilterSettings,
|
QuickFilterSettings,
|
||||||
|
|
@ -144,9 +146,6 @@ const Timeline = {
|
||||||
this.$store.commit('setLoading', { timeline: this.timelineName, value: false })
|
this.$store.commit('setLoading', { timeline: this.timelineName, value: false })
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
scrollToTop () {
|
|
||||||
window.scrollTo({ top: this.$el.offsetTop })
|
|
||||||
},
|
|
||||||
stopBlockingClicks: debounce(function () {
|
stopBlockingClicks: debounce(function () {
|
||||||
this.blockingClicks = false
|
this.blockingClicks = false
|
||||||
}, 1000),
|
}, 1000),
|
||||||
|
|
@ -251,7 +250,6 @@ const Timeline = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleScroll: throttle(function (e) {
|
handleScroll: throttle(function (e) {
|
||||||
this.showScrollTop = this.$el.offsetTop < window.scrollY
|
|
||||||
this.determineVisibleStatuses()
|
this.determineVisibleStatuses()
|
||||||
this.scrollLoad(e)
|
this.scrollLoad(e)
|
||||||
}, 200),
|
}, 200),
|
||||||
|
|
|
||||||
|
|
@ -8,25 +8,7 @@
|
||||||
v-if="!embedded"
|
v-if="!embedded"
|
||||||
:timeline-name="timelineName"
|
:timeline-name="timelineName"
|
||||||
/>
|
/>
|
||||||
<div
|
<ScrollTopButton />
|
||||||
v-if="showScrollTop"
|
|
||||||
class="rightside-button"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
class="button-unstyled scroll-to-top-button"
|
|
||||||
type="button"
|
|
||||||
:title="$t('general.scroll_to_top')"
|
|
||||||
@click="scrollToTop"
|
|
||||||
>
|
|
||||||
<FALayers class="fa-scale-110 fa-old-padding-layer">
|
|
||||||
<FAIcon icon="arrow-up" />
|
|
||||||
<FAIcon
|
|
||||||
icon="minus"
|
|
||||||
transform="up-7"
|
|
||||||
/>
|
|
||||||
</FALayers>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<template v-if="mobileLayout">
|
<template v-if="mobileLayout">
|
||||||
<div
|
<div
|
||||||
v-if="showLoadButton"
|
v-if="showLoadButton"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue