Merge branch 'akkoma-support-part-2' into shigusegubu-themes3
This commit is contained in:
commit
2f70309970
11 changed files with 51 additions and 37 deletions
1
changelog.d/action-button-extra-counter.add
Normal file
1
changelog.d/action-button-extra-counter.add
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Display counter for status action buttons when they are on the menu
|
||||||
0
changelog.d/akkoma.skip
Normal file
0
changelog.d/akkoma.skip
Normal file
1
changelog.d/bookmark-button-align.fix
Normal file
1
changelog.d/bookmark-button-align.fix
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Fix bookmark button alignment in the extra actions menu
|
||||||
|
|
@ -60,11 +60,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.extra-button {
|
.extra-button {
|
||||||
border-left: 1px solid var(--icon);
|
border-left: 1px solid;
|
||||||
|
border-image-source: linear-gradient(to bottom, transparent 0%, var(--icon) var(--__horizontal-gap) calc(100% - var(--__horizontal-gap)), transparent 100%);
|
||||||
|
border-image-slice: 1;
|
||||||
padding-left: calc(var(--__horizontal-gap) - 1px);
|
padding-left: calc(var(--__horizontal-gap) - 1px);
|
||||||
border-right: var(--__horizontal-gap) solid transparent;
|
padding-right: var(--__horizontal-gap);
|
||||||
border-top: var(--__horizontal-gap) solid transparent;
|
padding-top: var(--__horizontal-gap);
|
||||||
border-bottom: var(--__horizontal-gap) solid transparent;
|
padding-bottom: var(--__horizontal-gap);
|
||||||
|
max-width: fit-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-button {
|
.main-button {
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,7 @@ import { newImporter } from 'src/services/export_import/export_import.js'
|
||||||
import { convertTheme2To3 } from 'src/services/theme_data/theme2_to_theme3.js'
|
import { convertTheme2To3 } from 'src/services/theme_data/theme2_to_theme3.js'
|
||||||
import { init } from 'src/services/theme_data/theme_data_3.service.js'
|
import { init } from 'src/services/theme_data/theme_data_3.service.js'
|
||||||
import {
|
import {
|
||||||
getCssRules,
|
getCssRules
|
||||||
getScopedVersion
|
|
||||||
} from 'src/services/theme_data/css_utils.js'
|
} from 'src/services/theme_data/css_utils.js'
|
||||||
import { deserialize } from 'src/services/theme_data/iss_deserializer.js'
|
import { deserialize } from 'src/services/theme_data/iss_deserializer.js'
|
||||||
|
|
||||||
|
|
@ -155,19 +154,23 @@ const AppearanceTab = {
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.previewTheme('stock', 'v3')
|
||||||
|
|
||||||
if (window.IntersectionObserver) {
|
if (window.IntersectionObserver) {
|
||||||
this.intersectionObserver = new IntersectionObserver((entries, observer) => {
|
this.intersectionObserver = new IntersectionObserver((entries, observer) => {
|
||||||
entries.forEach(({ target, isIntersecting }) => {
|
entries.forEach(({ target, isIntersecting }) => {
|
||||||
if (!isIntersecting) return
|
if (!isIntersecting) return
|
||||||
const theme = this.availableStyles.find(x => x.key === target.dataset.themeKey)
|
const theme = this.availableStyles.find(x => x.key === target.dataset.themeKey)
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (theme) theme.ready = true
|
if (theme) this.previewTheme(theme.key, theme.version, theme.data)
|
||||||
})
|
})
|
||||||
observer.unobserve(target)
|
observer.unobserve(target)
|
||||||
})
|
})
|
||||||
}, {
|
}, {
|
||||||
root: this.$refs.themeList
|
root: this.$refs.themeList
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
this.availableStyles.forEach(theme => this.previewTheme(theme.key, theme.version, theme.data))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updated () {
|
updated () {
|
||||||
|
|
@ -391,7 +394,6 @@ const AppearanceTab = {
|
||||||
inputRuleset: [...input, paletteRule].filter(x => x),
|
inputRuleset: [...input, paletteRule].filter(x => x),
|
||||||
ultimateBackgroundColor: '#000000',
|
ultimateBackgroundColor: '#000000',
|
||||||
liteMode: true,
|
liteMode: true,
|
||||||
debug: true,
|
|
||||||
onlyNormalState: true
|
onlyNormalState: true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -400,7 +402,6 @@ const AppearanceTab = {
|
||||||
inputRuleset: [],
|
inputRuleset: [],
|
||||||
ultimateBackgroundColor: '#000000',
|
ultimateBackgroundColor: '#000000',
|
||||||
liteMode: true,
|
liteMode: true,
|
||||||
debug: true,
|
|
||||||
onlyNormalState: true
|
onlyNormalState: true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -409,10 +410,16 @@ const AppearanceTab = {
|
||||||
this.compilationCache[key] = theme3
|
this.compilationCache[key] = theme3
|
||||||
}
|
}
|
||||||
|
|
||||||
return getScopedVersion(
|
const styleEl = document.getElementById('theme-holder')
|
||||||
getCssRules(theme3.eager),
|
const styleSheet = styleEl.sheet
|
||||||
'#theme-preview-' + key
|
styleSheet.insertRule([
|
||||||
).join('\n')
|
'#theme-preview-',
|
||||||
|
key,
|
||||||
|
' {\n',
|
||||||
|
getCssRules(theme3.eager).join('\n'),
|
||||||
|
'\n}'
|
||||||
|
].join(''), 'index-max')
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,6 @@
|
||||||
:disabled="switchInProgress"
|
:disabled="switchInProgress"
|
||||||
@click="resetTheming"
|
@click="resetTheming"
|
||||||
>
|
>
|
||||||
<!-- eslint-disable vue/no-v-text-v-html-on-component -->
|
|
||||||
<!-- eslint-disable vue/no-v-html -->
|
|
||||||
<component
|
|
||||||
:is="'style'"
|
|
||||||
v-html="previewTheme('stock', 'v3')"
|
|
||||||
/>
|
|
||||||
<!-- eslint-enable vue/no-v-html -->
|
|
||||||
<!-- eslint-enable vue/no-v-text-v-html-on-component -->
|
|
||||||
<preview id="theme-preview-stock" />
|
<preview id="theme-preview-stock" />
|
||||||
<h4 class="theme-name">
|
<h4 class="theme-name">
|
||||||
{{ $t('settings.style.stock_theme_used') }}
|
{{ $t('settings.style.stock_theme_used') }}
|
||||||
|
|
@ -61,16 +53,6 @@
|
||||||
:disabled="switchInProgress"
|
:disabled="switchInProgress"
|
||||||
@click="style.version === 'v2' ? setTheme(style.key) : setStyle(style.key)"
|
@click="style.version === 'v2' ? setTheme(style.key) : setStyle(style.key)"
|
||||||
>
|
>
|
||||||
<!-- eslint-disable vue/no-v-text-v-html-on-component -->
|
|
||||||
<!-- eslint-disable vue/no-v-html -->
|
|
||||||
<div v-if="style.ready || noIntersectionObserver">
|
|
||||||
<component
|
|
||||||
:is="'style'"
|
|
||||||
v-html="previewTheme(style.key, style.version, style.data)"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<!-- eslint-enable vue/no-v-html -->
|
|
||||||
<!-- eslint-enable vue/no-v-text-v-html-on-component -->
|
|
||||||
<preview :id="'theme-preview-' + style.key" />
|
<preview :id="'theme-preview-' + style.key" />
|
||||||
<h4 class="theme-name">
|
<h4 class="theme-name">
|
||||||
{{ style.name }}
|
{{ style.name }}
|
||||||
|
|
|
||||||
|
|
@ -102,4 +102,20 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.-extra {
|
||||||
|
.action-counter {
|
||||||
|
justify-self: end;
|
||||||
|
margin-right: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chevron-icon {
|
||||||
|
justify-self: end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.extra-button {
|
||||||
|
justify-self: end;
|
||||||
|
justify-content: end;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
/>
|
/>
|
||||||
</component>
|
</component>
|
||||||
<span
|
<span
|
||||||
v-if="!extra && button.counter?.(funcArg) > 0"
|
v-if="button.counter?.(funcArg) > 0"
|
||||||
class="action-counter"
|
class="action-counter"
|
||||||
>
|
>
|
||||||
{{ button.counter?.(funcArg) }}
|
{{ button.counter?.(funcArg) }}
|
||||||
|
|
|
||||||
|
|
@ -110,17 +110,17 @@ const sortTimeline = (timeline) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const getLatestScrobble = (state, user) => {
|
const getLatestScrobble = (state, user) => {
|
||||||
const scrobbles = state.pleromaScrobblesAvailable
|
const scrobblesSupport = state.pleromaScrobblesAvailable
|
||||||
if (!scrobbles) return
|
if (!scrobblesSupport) return
|
||||||
|
|
||||||
if (state.scrobblesNextFetch[user.id] && state.scrobblesNextFetch[user.id] > Date.now()) {
|
if (state.scrobblesNextFetch[user.id] && state.scrobblesNextFetch[user.id] > Date.now()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
state.scrobblesNextFetch[user.id] = Date.now() + 24 * 60 * 60 * 1000
|
state.scrobblesNextFetch[user.id] = Date.now() + 24 * 60 * 60 * 1000
|
||||||
if (!scrobbles) return
|
if (!scrobblesSupport) return
|
||||||
apiService.fetchScrobbles({ accountId: user.id }).then((scrobbles) => {
|
apiService.fetchScrobbles({ accountId: user.id }).then((scrobbles) => {
|
||||||
if (scrobbles?.error?.status === 501) {
|
if (scrobbles?.error) {
|
||||||
state.pleromaScrobblesAvailable = false
|
state.pleromaScrobblesAvailable = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ const mastoApiNotificationTypes = [
|
||||||
'move',
|
'move',
|
||||||
'poll',
|
'poll',
|
||||||
'pleroma:emoji_reaction',
|
'pleroma:emoji_reaction',
|
||||||
'pleroma:chat_mention',
|
|
||||||
'pleroma:report'
|
'pleroma:report'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -29,6 +28,10 @@ const fetchAndUpdate = ({ store, credentials, older = false, since }) => {
|
||||||
const timelineData = rootState.notifications
|
const timelineData = rootState.notifications
|
||||||
const hideMutedPosts = getters.mergedConfig.hideMutedPosts
|
const hideMutedPosts = getters.mergedConfig.hideMutedPosts
|
||||||
|
|
||||||
|
if (store.rootState.instance.pleromaChatMessagesAvailable) {
|
||||||
|
mastoApiNotificationTypes.push('pleroma:chat_mention')
|
||||||
|
}
|
||||||
|
|
||||||
args.includeTypes = mastoApiNotificationTypes
|
args.includeTypes = mastoApiNotificationTypes
|
||||||
args.withMuted = !hideMutedPosts
|
args.withMuted = !hideMutedPosts
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ function isPushSupported () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOrCreateServiceWorker () {
|
function getOrCreateServiceWorker () {
|
||||||
|
if (!isSWSupported()) return
|
||||||
const swType = process.env.HAS_MODULE_SERVICE_WORKER ? 'module' : 'classic'
|
const swType = process.env.HAS_MODULE_SERVICE_WORKER ? 'module' : 'classic'
|
||||||
return navigator.serviceWorker.register('/sw-pleroma.js', { type: swType })
|
return navigator.serviceWorker.register('/sw-pleroma.js', { type: swType })
|
||||||
.catch((err) => console.error('Unable to get or create a service worker.', err))
|
.catch((err) => console.error('Unable to get or create a service worker.', err))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue