mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 07:24:13 +00:00 
			
		
		
		
	refactor
This commit is contained in:
		
							parent
							
								
									d2623a2ef2
								
							
						
					
					
						commit
						25f15677c3
					
				
					 29 changed files with 5 additions and 109 deletions
				
			
		| 
						 | 
				
			
			@ -154,8 +154,6 @@ export default defineComponent({
 | 
			
		|||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
 | 
			
		||||
		os.api('users/stats', {
 | 
			
		||||
			userId: this.$i.id
 | 
			
		||||
		}).then(stats => {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -53,10 +53,6 @@ export default defineComponent({
 | 
			
		|||
		};
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		menu(account, ev) {
 | 
			
		||||
			os.popupMenu([{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,10 +32,6 @@ export default defineComponent({
 | 
			
		|||
		};
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		generateToken() {
 | 
			
		||||
			os.popup(import('@/components/token-generate-window.vue'), {}, {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -67,10 +67,6 @@ export default defineComponent({
 | 
			
		|||
		};
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		revoke(token) {
 | 
			
		||||
			os.api('i/revoke-token', { tokenId: token.id }).then(() => {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -37,8 +37,6 @@ export default defineComponent({
 | 
			
		|||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
 | 
			
		||||
		this.$watch('localCustomCss', this.apply);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -83,10 +83,6 @@ export default defineComponent({
 | 
			
		|||
		}
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		async setProfile() {
 | 
			
		||||
			const { canceled, result: name } = await os.inputText({
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -33,10 +33,6 @@ export default defineComponent({
 | 
			
		|||
		}
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		async deleteAccount() {
 | 
			
		||||
			{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -99,10 +99,6 @@ export default defineComponent({
 | 
			
		|||
		}
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		chooseUploadFolder() {
 | 
			
		||||
			os.selectDriveFolder(false).then(async folder => {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -111,8 +111,6 @@ export default defineComponent({
 | 
			
		|||
		});
 | 
			
		||||
 | 
			
		||||
		onMounted(() => {
 | 
			
		||||
			context.emit('info', INFO);
 | 
			
		||||
 | 
			
		||||
			watch(emailAddress, () => {
 | 
			
		||||
				saveEmailAddress();
 | 
			
		||||
			});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -195,10 +195,6 @@ export default defineComponent({
 | 
			
		|||
		},
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		async reloadAsk() {
 | 
			
		||||
			const { canceled } = await os.confirm({
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -133,10 +133,6 @@ export default defineComponent({
 | 
			
		|||
			os.api('i/import-blocking', { fileId: file.id }).then(onImportSuccess).catch(onError);
 | 
			
		||||
		};
 | 
			
		||||
 | 
			
		||||
		onMounted(() => {
 | 
			
		||||
			context.emit('info', INFO);
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		return {
 | 
			
		||||
			[symbols.PAGE_INFO]: INFO,
 | 
			
		||||
			excludeMutingUsers,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,7 +14,7 @@
 | 
			
		|||
			</div>
 | 
			
		||||
			<div class="main">
 | 
			
		||||
				<div class="bkzroven">
 | 
			
		||||
					<component :is="component" :key="page" v-bind="pageProps" @info="onInfo"/>
 | 
			
		||||
					<component :is="component" :ref="el => pageChanged(el)" :key="page" v-bind="pageProps"/>
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
| 
						 | 
				
			
			@ -250,8 +250,9 @@ export default defineComponent({
 | 
			
		|||
 | 
			
		||||
		const emailNotConfigured = computed(() => instance.enableEmail && ($i.email == null || !$i.emailVerified));
 | 
			
		||||
 | 
			
		||||
		const onInfo = (info) => {
 | 
			
		||||
			childInfo.value = info;
 | 
			
		||||
		const pageChanged = (page) => {
 | 
			
		||||
			if (page == null) return;
 | 
			
		||||
			childInfo.value = page[symbols.PAGE_INFO];
 | 
			
		||||
		};
 | 
			
		||||
 | 
			
		||||
		return {
 | 
			
		||||
| 
						 | 
				
			
			@ -264,7 +265,7 @@ export default defineComponent({
 | 
			
		|||
			pageProps,
 | 
			
		||||
			component,
 | 
			
		||||
			emailNotConfigured,
 | 
			
		||||
			onInfo,
 | 
			
		||||
			pageChanged,
 | 
			
		||||
			childInfo,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -47,11 +47,6 @@ export default defineComponent({
 | 
			
		|||
		},
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	async created() {
 | 
			
		||||
		this.instanceMutes = this.$i.mutedInstances.join('\n');
 | 
			
		||||
	},
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -73,8 +73,6 @@ export default defineComponent({
 | 
			
		|||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
 | 
			
		||||
		document.cookie = `igi=${this.$i.token}; path=/;` +
 | 
			
		||||
			` max-age=31536000;` +
 | 
			
		||||
			(document.location.protocol.startsWith('https') ? ' secure' : '');
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -67,10 +67,6 @@ export default defineComponent({
 | 
			
		|||
		},
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		async addItem() {
 | 
			
		||||
			const menu = Object.keys(this.menuDef).filter(k => !this.$store.state.menu.includes(k));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -66,10 +66,6 @@ export default defineComponent({
 | 
			
		|||
		}
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		userPage
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -37,10 +37,6 @@ export default defineComponent({
 | 
			
		|||
		}
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		readAllUnreadNotes() {
 | 
			
		||||
			os.api('i/read-all-unread-notes');
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -47,10 +47,6 @@ export default defineComponent({
 | 
			
		|||
		reportError: defaultStore.makeGetterSetter('reportError'),
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		changeDebug(v) {
 | 
			
		||||
			console.log(v);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -45,10 +45,6 @@ export default defineComponent({
 | 
			
		|||
		}
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		installPlugin({ id, meta, ast, token }) {
 | 
			
		||||
			ColdDeviceStorage.set('plugins', ColdDeviceStorage.get('plugins').concat({
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -64,10 +64,6 @@ export default defineComponent({
 | 
			
		|||
		}
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		uninstall(plugin) {
 | 
			
		||||
			ColdDeviceStorage.set('plugins', this.plugins.filter(x => x.id !== plugin.id));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -101,10 +101,6 @@ export default defineComponent({
 | 
			
		|||
		this.ffVisibility = this.$i.ffVisibility;
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		save() {
 | 
			
		||||
			os.api('i/update', {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -132,10 +132,6 @@ export default defineComponent({
 | 
			
		|||
		this.$watch('alwaysMarkNsfw', this.save);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		changeAvatar(e) {
 | 
			
		||||
			selectFile(e.currentTarget || e.target, this.$ts.avatar).then(file => {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -100,10 +100,6 @@ export default defineComponent({
 | 
			
		|||
		}
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		save() {
 | 
			
		||||
			this.$store.set('reactions', this.reactions);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -72,10 +72,6 @@ export default defineComponent({
 | 
			
		|||
		}
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		async change() {
 | 
			
		||||
			const { canceled: canceled1, result: currentPassword } = await os.inputText({
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -96,10 +96,6 @@ export default defineComponent({
 | 
			
		|||
		this.sounds.channel = ColdDeviceStorage.get('sound_channel');
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		async edit(type) {
 | 
			
		||||
			const { canceled, result } = await os.form(this.$t('_sfx.' + type), {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,10 +40,6 @@ export default defineComponent({
 | 
			
		|||
		}
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		parseThemeCode(code) {
 | 
			
		||||
			let theme;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -78,10 +78,6 @@ export default defineComponent({
 | 
			
		|||
		},
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		copyThemeCode() {
 | 
			
		||||
			copyToClipboard(this.selectedThemeCode);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -163,10 +163,6 @@ export default defineComponent({
 | 
			
		|||
			location.reload();
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		onMounted(() => {
 | 
			
		||||
			emit('info', INFO);
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		onActivated(() => {
 | 
			
		||||
			fetchThemes().then(() => {
 | 
			
		||||
				installedThemes.value = getThemes();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -87,10 +87,6 @@ export default defineComponent({
 | 
			
		|||
		this.hardWordMutedNotesCount = (await os.api('i/get-word-muted-notes-count', {})).count;
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$emit('info', this[symbols.PAGE_INFO]);
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	methods: {
 | 
			
		||||
		async save() {
 | 
			
		||||
			this.$store.set('mutedWords', this.softMutedWords.trim().split('\n').map(x => x.trim().split(' ')));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue