Skip to content

Commit

Permalink
Clean: remove hided pages/widget
Browse files Browse the repository at this point in the history
  • Loading branch information
fs5m8 committed Dec 20, 2022
1 parent 0dbee8c commit caa864a
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 358 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@
"vue-svg-inline-loader": "2.1.5",
"vue-template-compiler": "2.7.14",
"vuedraggable": "2.24.3",
"vuewordcloud": "18.7.12",
"vuex": "3.6.2",
"vuex-persistedstate": "3.2.0",
"web-push": "3.5.0",
Expand Down
63 changes: 2 additions & 61 deletions src/client/app/common/views/components/tag-cloud.vue
Original file line number Diff line number Diff line change
@@ -1,87 +1,28 @@
<template>
<div class="jtivnzhfwquxpsfidertopbmwmchmnmo">
<p class="fetching" v-if="fetching"><fa icon="spinner" pulse fixed-width/>{{ $t('@.loading') }}<mk-ellipsis/></p>
<p class="empty" v-else-if="tags.length == 0"><fa icon="exclamation-circle"/>{{ $t('empty') }}</p>
<div v-else>
<vue-word-cloud
:words="tags.slice(0, 20).map(x => [x.tag, x.count])"
:color="color"
:spacing="1">
<template slot-scope="{word, text, weight}">
<div style="cursor: pointer;" :title="weight">
{{ text }}
</div>
</template>
</vue-word-cloud>
</div>
<p class="empty"><fa icon="exclamation-circle"/>this component has been abolished</p>
</div>
</template>

<script lang="ts">
import Vue from 'vue';
import i18n from '../../../i18n';
import * as VueWordCloud from 'vuewordcloud';
export default Vue.extend({
i18n: i18n('common/views/components/tag-cloud.vue'),
components: {
[VueWordCloud.name]: VueWordCloud
},
data() {
return {
tags: [],
fetching: true,
clock: null
};
},
mounted() {
this.fetch();
this.clock = setInterval(this.fetch, 1000 * 60);
},
beforeDestroy() {
clearInterval(this.clock);
},
methods: {
fetch() {
this.$root.api('hashtags/trend').then(tags => {
this.tags = tags;
this.fetching = false;
});
},
color([, weight]) {
const peak = Math.max.apply(null, this.tags.map(x => x.count));
const w = weight / peak;
if (w > 0.9) {
return this.$store.state.device.darkmode ? '#ff4e69' : '#ff4e69';
} else if (w > 0.5) {
return this.$store.state.device.darkmode ? '#3bc4c7' : '#3bc4c7';
} else {
return this.$store.state.device.darkmode ? '#fff' : '#555';
}
}
}
i18n: i18n('common/views/components/tag-cloud.vue')
});
</script>

<style lang="stylus" scoped>
.jtivnzhfwquxpsfidertopbmwmchmnmo
height 100%
width 100%
> .fetching
> .empty
margin 0
padding 16px
text-align center
color var(--text)
opacity 0.7
> [data-icon]
margin-right 4px
> div
height 100%
width 100%
</style>
89 changes: 0 additions & 89 deletions src/client/app/common/views/components/trends.chart.vue

This file was deleted.

77 changes: 2 additions & 75 deletions src/client/app/common/views/components/trends.vue
Original file line number Diff line number Diff line change
@@ -1,100 +1,27 @@
<template>
<div class="csqvmxybqbycalfhkxvyfrgbrdalkaoc">
<p class="fetching" v-if="fetching"><fa icon="spinner" pulse fixed-width/>{{ $t('@.loading') }}<mk-ellipsis/></p>
<p class="empty" v-else-if="stats.length == 0"><fa icon="exclamation-circle"/>{{ $t('empty') }}</p>
<!-- トランジションを有効にするとなぜかメモリリークする -->
<transition-group v-else tag="div" name="chart">
<div v-for="stat in stats" :key="stat.tag">
<div class="tag">
<router-link :to="`/tags/${ encodeURIComponent(stat.tag) }`" :title="stat.tag">#{{ stat.tag }}</router-link>
<p>{{ $t('count').replace('{}', stat.usersCount) }}</p>
</div>
<x-chart class="chart" :src="stat.chart"/>
</div>
</transition-group>
<p class="empty"><fa icon="exclamation-circle"/>this component has been abolished</p>
</div>
</template>

<script lang="ts">
import Vue from 'vue';
import i18n from '../../../i18n';
import XChart from './trends.chart.vue';
export default Vue.extend({
i18n: i18n('common/views/components/trends.vue'),
components: {
XChart
},
data() {
return {
stats: [],
fetching: true,
clock: null
};
},
mounted() {
this.fetch();
this.clock = setInterval(this.fetch, 1000 * 60);
},
beforeDestroy() {
clearInterval(this.clock);
},
methods: {
fetch() {
this.$root.api('hashtags/trend').then(stats => {
this.stats = stats;
this.fetching = false;
});
}
}
i18n: i18n('common/views/components/trends.vue')
});
</script>

<style lang="stylus" scoped>
.csqvmxybqbycalfhkxvyfrgbrdalkaoc
> .fetching
> .empty
margin 0
padding 16px
text-align center
color var(--text)
opacity 0.7
> [data-icon]
margin-right 4px
> div
.chart-move
transition transform 1s ease
> div
display flex
align-items center
padding 14px 16px
&:not(:last-child)
border-bottom solid 1px var(--faceDivider)
> .tag
flex 1
overflow hidden
font-size 14px
color var(--text)
> a
display block
width 100%
white-space nowrap
overflow hidden
text-overflow ellipsis
color inherit
> p
margin 0
font-size 75%
opacity 0.7
> .chart
height 30px
</style>
48 changes: 0 additions & 48 deletions src/client/app/common/views/pages/featured.vue

This file was deleted.

26 changes: 17 additions & 9 deletions src/client/app/common/views/widgets/hashtags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<ui-container :show-header="!props.compact">
<template #header><fa icon="hashtag"/>{{ $t('title') }}</template>

<div class="mkw-hashtags--body" :data-mobile="platform == 'mobile'">
<mk-trends/>
<div class="mkw-hashtags--body">
<p class="empty"><fa icon="exclamation-circle"/>this widget has been abolished</p>
</div>
</ui-container>
</div>
Expand All @@ -20,12 +20,20 @@ export default define({
compact: false
})
}).extend({
i18n: i18n('common/views/widgets/hashtags.vue'),
methods: {
func() {
this.props.compact = !this.props.compact;
this.save();
}
}
i18n: i18n('common/views/widgets/hashtags.vue')
});
</script>

<style lang="stylus" scoped>
.mkw-hashtags
.mkw-hashtags--body
> .empty
margin 0
padding 16px
text-align center
color var(--text)
> [data-icon]
margin-right 4px
</style>
2 changes: 0 additions & 2 deletions src/client/app/desktop/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ init(async (launch, os) => {
{ path: '/notes/:note', name: 'note', component: () => import('../common/views/deck/deck.note-column.vue').then(m => m.default) },
{ path: '/search', component: () => import('../common/views/deck/deck.search-column.vue').then(m => m.default) },
{ path: '/tags/:tag', name: 'tag', component: () => import('../common/views/deck/deck.hashtag-column.vue').then(m => m.default) },
{ path: '/featured', name: 'featured', component: DeckColumn, props: route => ({ component: () => import('../common/views/pages/featured.vue').then(m => m.default), platform: 'deck' }) },
{ path: '/explore', name: 'explore', component: DeckColumn, props: route => ({ component: () => import('../common/views/pages/explore.vue').then(m => m.default) }) },
{ path: '/explore/tags/:tag', name: 'explore-tag', component: DeckColumn, props: route => ({ component: () => import('../common/views/pages/explore.vue').then(m => m.default), tag: route.params.tag }) },
{ path: '/i/favorites', component: DeckColumn, props: route => ({ component: () => import('../common/views/pages/favorites.vue').then(m => m.default), platform: 'deck' }) },
Expand All @@ -163,7 +162,6 @@ init(async (launch, os) => {
{ path: '/notes/:note', name: 'note', component: () => import('./views/home/note.vue').then(m => m.default) },
{ path: '/search', component: () => import('./views/home/search.vue').then(m => m.default) },
{ path: '/tags/:tag', name: 'tag', component: () => import('./views/home/tag.vue').then(m => m.default) },
{ path: '/featured', name: 'featured', component: () => import('../common/views/pages/featured.vue').then(m => m.default), props: { platform: 'desktop' } },
{ path: '/explore', name: 'explore', component: () => import('../common/views/pages/explore.vue').then(m => m.default) },
{ path: '/explore/tags/:tag', name: 'explore-tag', props: true, component: () => import('../common/views/pages/explore.vue').then(m => m.default) },
{ path: '/i/favorites', component: () => import('../common/views/pages/favorites.vue').then(m => m.default), props: { platform: 'desktop' } },
Expand Down
Loading

0 comments on commit caa864a

Please sign in to comment.