Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ const handleHTML = async () => {
return
}

const [imgs, svgs, uls, anchors, videos, iframes, wechatVideos, details] = await Promise.allSettled(
['img', 'svg', 'ul', 'a', 'video', 'iframe', 'mp-common-videosnap', 'details'].map(tag => {
const [imgs, svgs, uls, anchors, videos, iframes, wechatVideos, details, spans] = await Promise.allSettled(
['img', 'svg', 'ul', 'a', 'video', 'iframe', 'mp-common-videosnap', 'details', 'span'].map(tag => {
return Array.from(articleDetailDom.querySelectorAll(tag)) || []
})
)
Expand All @@ -204,7 +204,8 @@ const handleHTML = async () => {
videos.status === 'fulfilled' && !retentionVideo && handleHTMLVideos(videos.value as HTMLVideoElement[]),
iframes.status === 'fulfilled' && handleHTMLIFrames(iframes.value as HTMLIFrameElement[]),
wechatVideos.status === 'fulfilled' && handleHTMLWechatVideos(wechatVideos.value as HTMLElement[]),
details.status === 'fulfilled' && handleHTMLDetails(details.value as HTMLDetailsElement[])
details.status === 'fulfilled' && handleHTMLDetails(details.value as HTMLDetailsElement[]),
spans.status === 'fulfilled' && handleHTMLSpans(spans.value as HTMLSpanElement[])
])

const handlers: Promise<void>[] = []
Expand Down Expand Up @@ -410,6 +411,14 @@ const handleHTMLDetails = (details: HTMLDetailsElement[]) => {
})
}

const handleHTMLSpans = (spans: HTMLSpanElement[]) => {
spans.forEach(span => {
if (span.textContent.replace(/\u00a0/g, '').trim().length === 0) {
span.style.display = 'none'
}
})
}

const handlePhotoSwipeTopicStyle = async () => {
const swiper = document.querySelector('slax-photo-swipe-topic > .topic-container .swiper')
if (!swiper) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ onUnmounted(() => {})
--style: ' bg-#fff dark:bg-#262626';

.menu {
--style: 'px-12px py-8px rounded-6px whitespace-nowrap cursor-pointer flex items-center active:(scale-105) transition-all duration-250';
--style: 'px-10px py-4px rounded-6px whitespace-nowrap cursor-pointer flex items-center active:(scale-105) transition-all duration-250';

&:hover {
--style: 'bg-#f5f5f3 dark:bg-#333333FF';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ button {
--style: mt-16px flex flex-col items-center justify-stretch;
.title {
--style: w-full text-(14px ellipsis #333333) line-height-21px font-medium overflow-hidden line-clamp-2 break-all;
--style: "font-['PingFangSC']";
}

.link {
Expand Down
69 changes: 3 additions & 66 deletions apps/slax-reader-dweb/layers/core/components/global/ProIcon.vue
Original file line number Diff line number Diff line change
@@ -1,73 +1,10 @@
<template>
<div class="pro-icon" v-if="isSubscribed || isProcessing">
<span v-if="isSubscribed">Pro</span>
<span v-else-if="isProcessing">{{ loadingTitle }}</span>
<div class="pro-icon">
<span>Pro</span>
</div>
</template>

<script lang="ts" setup>
import { useUserStore } from '#layers/core/stores/user'

const { t } = useI18n()

const userStore = useUserStore()
const loadingText = t('component.pro_icon.processing')
const loadingTitle = ref(loadingText)
const loadingInterval = ref<NodeJS.Timeout>()
const checkingInterval = ref<NodeJS.Timeout>()

const isSubscribed = computed(() => {
return !userStore.isSubscriptionExpired
})
const isProcessing = computed(() => {
return userStore.isSubscriptionExpired && userStore.isJustPaid
})

const enableChecking = () => {
loadingInterval.value = setInterval(() => {
const ellipses = loadingTitle.value.replace(loadingText, '')
loadingTitle.value = `${loadingText}${Array.from({ length: (ellipses.length + 1) % 4 })
.map(() => '.')
.join('')}`
}, 800)

checkingInterval.value = setInterval(() => {
userStore.refreshUserInfo()
}, 5000)
}

const disableChecking = () => {
clearInterval(checkingInterval.value)
checkingInterval.value = undefined

clearInterval(loadingInterval.value)
loadingInterval.value = undefined
}

watch(
() => isProcessing.value,
(value, oldValue) => {
if (value === oldValue) {
return
}

if (value) {
enableChecking()
} else {
disableChecking()
}
},
{
immediate: true
}
)

onMounted(() => {})

onUnmounted(() => {
disableChecking()
})
</script>
<script lang="ts" setup></script>

<style lang="scss" scoped>
.pro-icon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default defineNuxtRouteMiddleware((to, from) => {
}

if (!isFromHomepage) {
queryParams.redirect = encodeURIComponent(location?.href)
queryParams.redirect = encodeURIComponent(to.fullPath ? `${location.origin}${to.fullPath}` : location?.href)
}

const queryStr = Object.keys(queryParams)
Expand Down
13 changes: 10 additions & 3 deletions apps/slax-reader-dweb/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,17 @@ export default defineNuxtConfig({
schemaOrg: {
enabled: true,
identity: {
url: `${envConfig.SHARE_BASE_URL || ''}`,
type: 'Organization',
name: 'Slax Reader',
logo: '/images/logo.png',
sameAs: ['https://slax.com/', 'https://note.slax.com/', 'https://r.slax.com/', 'https://x.com/wulujia']
logo: `${envConfig.PUBLIC_BASE_URL || ''}/logo.png`,
url: `${envConfig.PUBLIC_BASE_URL || ''}/en`,
sameAs: ['https://x.com/SlaxReader', 'https://t.me/slax_app', 'https://github.com/slax-lab/slax-reader', 'https://x.com/wulujia'],
contactPoint: [
{
email: 'support@slax.com',
contactType: 'customer support'
}
]
}
},
ogImage: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ watch(
} else if (value) {
addLog('expand')
} else if (value !== !!oldValue) {
debugger
addLog('collapse')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const reportFeedbackContent = async () => {

trackEvent({
event: 'feedback_submit_start',
scope: 'extension'
scope: 'bookmark'
})

isLoading.value = true
Expand Down
Loading