mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 12:39:59 +01:00
wip
This commit is contained in:
parent
067159723e
commit
f5cee1658c
@ -67,6 +67,16 @@ export default class MiOS extends EventEmitter {
|
||||
|
||||
private isMetaFetching = false;
|
||||
|
||||
public app: Vue;
|
||||
|
||||
public new(vm, props) {
|
||||
const w = new vm({
|
||||
parent: this.app,
|
||||
propsData: props
|
||||
}).$mount();
|
||||
document.body.appendChild(w.$el);
|
||||
}
|
||||
|
||||
/**
|
||||
* A signing user
|
||||
*/
|
||||
|
@ -376,11 +376,9 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
newWindow(folder) {
|
||||
document.body.appendChild(new MkDriveWindow({
|
||||
propsData: {
|
||||
folder: folder
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkDriveWindow, {
|
||||
folder: folder
|
||||
});
|
||||
},
|
||||
|
||||
move(target) {
|
||||
|
@ -39,11 +39,9 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
onClick() {
|
||||
document.body.appendChild(new MkImagesImageDialog({
|
||||
propsData: {
|
||||
image: this.image
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkImagesImageDialog, {
|
||||
image: this.image
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -12,11 +12,9 @@ import MkMessagingRoomWindow from './messaging-room-window.vue';
|
||||
export default Vue.extend({
|
||||
methods: {
|
||||
navigate(user) {
|
||||
document.body.appendChild(new MkMessagingRoomWindow({
|
||||
propsData: {
|
||||
user: user
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkMessagingRoomWindow, {
|
||||
user: user
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -148,34 +148,26 @@ export default Vue.extend({
|
||||
});
|
||||
},
|
||||
reply() {
|
||||
document.body.appendChild(new MkPostFormWindow({
|
||||
propsData: {
|
||||
reply: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkPostFormWindow, {
|
||||
reply: this.p
|
||||
});
|
||||
},
|
||||
repost() {
|
||||
document.body.appendChild(new MkRepostFormWindow({
|
||||
propsData: {
|
||||
post: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkRepostFormWindow, {
|
||||
post: this.p
|
||||
});
|
||||
},
|
||||
react() {
|
||||
document.body.appendChild(new MkReactionPicker({
|
||||
propsData: {
|
||||
source: this.$refs.reactButton,
|
||||
post: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkReactionPicker, {
|
||||
source: this.$refs.reactButton,
|
||||
post: this.p
|
||||
});
|
||||
},
|
||||
menu() {
|
||||
document.body.appendChild(new MkPostMenu({
|
||||
propsData: {
|
||||
source: this.$refs.menuButton,
|
||||
post: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkPostMenu, {
|
||||
source: this.$refs.menuButton,
|
||||
post: this.p
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -186,34 +186,26 @@ export default Vue.extend({
|
||||
}
|
||||
},
|
||||
reply() {
|
||||
document.body.appendChild(new MkPostFormWindow({
|
||||
propsData: {
|
||||
reply: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkPostFormWindow, {
|
||||
reply: this.p
|
||||
});
|
||||
},
|
||||
repost() {
|
||||
document.body.appendChild(new MkRepostFormWindow({
|
||||
propsData: {
|
||||
post: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkRepostFormWindow, {
|
||||
post: this.p
|
||||
});
|
||||
},
|
||||
react() {
|
||||
document.body.appendChild(new MkReactionPicker({
|
||||
propsData: {
|
||||
source: this.$refs.reactButton,
|
||||
post: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkReactionPicker, {
|
||||
source: this.$refs.reactButton,
|
||||
post: this.p
|
||||
});
|
||||
},
|
||||
menu() {
|
||||
document.body.appendChild(new MkPostMenu({
|
||||
propsData: {
|
||||
source: this.$refs.menuButton,
|
||||
post: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkPostMenu, {
|
||||
source: this.$refs.menuButton,
|
||||
post: this.p
|
||||
});
|
||||
},
|
||||
onKeydown(e) {
|
||||
let shouldBeCancel = true;
|
||||
|
@ -70,11 +70,11 @@ export default Vue.extend({
|
||||
},
|
||||
drive() {
|
||||
this.close();
|
||||
document.body.appendChild(new MkDriveWindow().$mount().$el);
|
||||
(this as any).os.new(MkDriveWindow);
|
||||
},
|
||||
settings() {
|
||||
this.close();
|
||||
document.body.appendChild(new MkSettingsWindow().$mount().$el);
|
||||
(this as any).os.new(MkSettingsWindow);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -79,7 +79,7 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
messaging() {
|
||||
document.body.appendChild(new MkMessagingWindow().$mount().$el);
|
||||
(this as any).os.new(MkMessagingWindow);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -17,11 +17,9 @@ export default define({
|
||||
}).extend({
|
||||
methods: {
|
||||
navigate(user) {
|
||||
document.body.appendChild(new MkMessagingRoomWindow({
|
||||
propsData: {
|
||||
user: user
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkMessagingRoomWindow, {
|
||||
user: user
|
||||
});
|
||||
},
|
||||
func() {
|
||||
if (this.props.design == 1) {
|
||||
|
@ -36,21 +36,15 @@ export default Vue.extend({
|
||||
},
|
||||
methods: {
|
||||
showFollowing() {
|
||||
document.body.appendChild(new MkFollowingWindow({
|
||||
parent: this,
|
||||
propsData: {
|
||||
user: this.user
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkFollowingWindow, {
|
||||
user: this.user
|
||||
});
|
||||
},
|
||||
|
||||
showFollowers() {
|
||||
document.body.appendChild(new MkFollowersWindow({
|
||||
parent: this,
|
||||
propsData: {
|
||||
user: this.user
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkFollowersWindow, {
|
||||
user: this.user
|
||||
});
|
||||
},
|
||||
|
||||
mute() {
|
||||
|
@ -87,8 +87,26 @@ export default (callback: (launch: (api: (os: MiOS) => API) => [Vue, MiOS]) => v
|
||||
// アプリ基底要素マウント
|
||||
document.body.innerHTML = '<div id="app"></div>';
|
||||
|
||||
const app = new Vue({
|
||||
router: new VueRouter({
|
||||
mode: 'history'
|
||||
}),
|
||||
created() {
|
||||
this.$watch('os.i', i => {
|
||||
// キャッシュ更新
|
||||
localStorage.setItem('me', JSON.stringify(i));
|
||||
}, {
|
||||
deep: true
|
||||
});
|
||||
},
|
||||
render: createEl => createEl(App)
|
||||
});
|
||||
|
||||
os.app = app;
|
||||
|
||||
const launch = (api: (os: MiOS) => API) => {
|
||||
os.apis = api(os);
|
||||
|
||||
Vue.mixin({
|
||||
data() {
|
||||
return {
|
||||
@ -99,20 +117,8 @@ export default (callback: (launch: (api: (os: MiOS) => API) => [Vue, MiOS]) => v
|
||||
}
|
||||
});
|
||||
|
||||
const app = new Vue({
|
||||
router: new VueRouter({
|
||||
mode: 'history'
|
||||
}),
|
||||
created() {
|
||||
this.$watch('os.i', i => {
|
||||
// キャッシュ更新
|
||||
localStorage.setItem('me', JSON.stringify(i));
|
||||
}, {
|
||||
deep: true
|
||||
});
|
||||
},
|
||||
render: createEl => createEl(App)
|
||||
}).$mount('#app');
|
||||
// マウント
|
||||
app.$mount('#app');
|
||||
|
||||
return [app, os] as [Vue, MiOS];
|
||||
};
|
||||
|
@ -154,22 +154,18 @@ export default Vue.extend({
|
||||
});
|
||||
},
|
||||
react() {
|
||||
document.body.appendChild(new MkReactionPicker({
|
||||
propsData: {
|
||||
source: this.$refs.reactButton,
|
||||
post: this.p,
|
||||
compact: true
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkReactionPicker, {
|
||||
source: this.$refs.reactButton,
|
||||
post: this.p,
|
||||
compact: true
|
||||
});
|
||||
},
|
||||
menu() {
|
||||
document.body.appendChild(new MkPostMenu({
|
||||
propsData: {
|
||||
source: this.$refs.menuButton,
|
||||
post: this.p,
|
||||
compact: true
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkPostMenu, {
|
||||
source: this.$refs.menuButton,
|
||||
post: this.p,
|
||||
compact: true
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -169,22 +169,18 @@ export default Vue.extend({
|
||||
});
|
||||
},
|
||||
react() {
|
||||
document.body.appendChild(new MkReactionPicker({
|
||||
propsData: {
|
||||
source: this.$refs.reactButton,
|
||||
post: this.p,
|
||||
compact: true
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkReactionPicker, {
|
||||
source: this.$refs.reactButton,
|
||||
post: this.p,
|
||||
compact: true
|
||||
});
|
||||
},
|
||||
menu() {
|
||||
document.body.appendChild(new MkPostMenu({
|
||||
propsData: {
|
||||
source: this.$refs.menuButton,
|
||||
post: this.p,
|
||||
compact: true
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkPostMenu, {
|
||||
source: this.$refs.menuButton,
|
||||
post: this.p,
|
||||
compact: true
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -53,11 +53,9 @@ export default Vue.extend({
|
||||
id: notification.id
|
||||
});
|
||||
|
||||
document.body.appendChild(new MkNotify({
|
||||
propsData: {
|
||||
notification
|
||||
}
|
||||
}).$mount().$el);
|
||||
(this as any).os.new(MkNotify, {
|
||||
notification
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user