mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-11-01 07:35:57 +09:00
wip
This commit is contained in:
parent
e98626dbbc
commit
b5068aae05
@ -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: {
|
||||
(this as any).os.new(MkDriveWindow, {
|
||||
folder: folder
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
},
|
||||
|
||||
move(target) {
|
||||
|
@ -39,11 +39,9 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
onClick() {
|
||||
document.body.appendChild(new MkImagesImageDialog({
|
||||
propsData: {
|
||||
(this as any).os.new(MkImagesImageDialog, {
|
||||
image: this.image
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -12,11 +12,9 @@ import MkMessagingRoomWindow from './messaging-room-window.vue';
|
||||
export default Vue.extend({
|
||||
methods: {
|
||||
navigate(user) {
|
||||
document.body.appendChild(new MkMessagingRoomWindow({
|
||||
propsData: {
|
||||
(this as any).os.new(MkMessagingRoomWindow, {
|
||||
user: user
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -148,34 +148,26 @@ export default Vue.extend({
|
||||
});
|
||||
},
|
||||
reply() {
|
||||
document.body.appendChild(new MkPostFormWindow({
|
||||
propsData: {
|
||||
(this as any).os.new(MkPostFormWindow, {
|
||||
reply: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
},
|
||||
repost() {
|
||||
document.body.appendChild(new MkRepostFormWindow({
|
||||
propsData: {
|
||||
(this as any).os.new(MkRepostFormWindow, {
|
||||
post: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
},
|
||||
react() {
|
||||
document.body.appendChild(new MkReactionPicker({
|
||||
propsData: {
|
||||
(this as any).os.new(MkReactionPicker, {
|
||||
source: this.$refs.reactButton,
|
||||
post: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
},
|
||||
menu() {
|
||||
document.body.appendChild(new MkPostMenu({
|
||||
propsData: {
|
||||
(this as any).os.new(MkPostMenu, {
|
||||
source: this.$refs.menuButton,
|
||||
post: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -186,34 +186,26 @@ export default Vue.extend({
|
||||
}
|
||||
},
|
||||
reply() {
|
||||
document.body.appendChild(new MkPostFormWindow({
|
||||
propsData: {
|
||||
(this as any).os.new(MkPostFormWindow, {
|
||||
reply: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
},
|
||||
repost() {
|
||||
document.body.appendChild(new MkRepostFormWindow({
|
||||
propsData: {
|
||||
(this as any).os.new(MkRepostFormWindow, {
|
||||
post: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
},
|
||||
react() {
|
||||
document.body.appendChild(new MkReactionPicker({
|
||||
propsData: {
|
||||
(this as any).os.new(MkReactionPicker, {
|
||||
source: this.$refs.reactButton,
|
||||
post: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
},
|
||||
menu() {
|
||||
document.body.appendChild(new MkPostMenu({
|
||||
propsData: {
|
||||
(this as any).os.new(MkPostMenu, {
|
||||
source: this.$refs.menuButton,
|
||||
post: this.p
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
},
|
||||
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: {
|
||||
(this as any).os.new(MkMessagingRoomWindow, {
|
||||
user: user
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
},
|
||||
func() {
|
||||
if (this.props.design == 1) {
|
||||
|
@ -36,21 +36,15 @@ export default Vue.extend({
|
||||
},
|
||||
methods: {
|
||||
showFollowing() {
|
||||
document.body.appendChild(new MkFollowingWindow({
|
||||
parent: this,
|
||||
propsData: {
|
||||
(this as any).os.new(MkFollowingWindow, {
|
||||
user: this.user
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
},
|
||||
|
||||
showFollowers() {
|
||||
document.body.appendChild(new MkFollowersWindow({
|
||||
parent: this,
|
||||
propsData: {
|
||||
(this as any).os.new(MkFollowersWindow, {
|
||||
user: this.user
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
},
|
||||
|
||||
mute() {
|
||||
|
@ -87,18 +87,6 @@ export default (callback: (launch: (api: (os: MiOS) => API) => [Vue, MiOS]) => v
|
||||
// アプリ基底要素マウント
|
||||
document.body.innerHTML = '<div id="app"></div>';
|
||||
|
||||
const launch = (api: (os: MiOS) => API) => {
|
||||
os.apis = api(os);
|
||||
Vue.mixin({
|
||||
data() {
|
||||
return {
|
||||
os,
|
||||
api: os.api,
|
||||
apis: os.apis
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
const app = new Vue({
|
||||
router: new VueRouter({
|
||||
mode: 'history'
|
||||
@ -112,7 +100,25 @@ export default (callback: (launch: (api: (os: MiOS) => API) => [Vue, MiOS]) => v
|
||||
});
|
||||
},
|
||||
render: createEl => createEl(App)
|
||||
}).$mount('#app');
|
||||
});
|
||||
|
||||
os.app = app;
|
||||
|
||||
const launch = (api: (os: MiOS) => API) => {
|
||||
os.apis = api(os);
|
||||
|
||||
Vue.mixin({
|
||||
data() {
|
||||
return {
|
||||
os,
|
||||
api: os.api,
|
||||
apis: os.apis
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// マウント
|
||||
app.$mount('#app');
|
||||
|
||||
return [app, os] as [Vue, MiOS];
|
||||
};
|
||||
|
@ -154,22 +154,18 @@ export default Vue.extend({
|
||||
});
|
||||
},
|
||||
react() {
|
||||
document.body.appendChild(new MkReactionPicker({
|
||||
propsData: {
|
||||
(this as any).os.new(MkReactionPicker, {
|
||||
source: this.$refs.reactButton,
|
||||
post: this.p,
|
||||
compact: true
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
},
|
||||
menu() {
|
||||
document.body.appendChild(new MkPostMenu({
|
||||
propsData: {
|
||||
(this as any).os.new(MkPostMenu, {
|
||||
source: this.$refs.menuButton,
|
||||
post: this.p,
|
||||
compact: true
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -169,22 +169,18 @@ export default Vue.extend({
|
||||
});
|
||||
},
|
||||
react() {
|
||||
document.body.appendChild(new MkReactionPicker({
|
||||
propsData: {
|
||||
(this as any).os.new(MkReactionPicker, {
|
||||
source: this.$refs.reactButton,
|
||||
post: this.p,
|
||||
compact: true
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
},
|
||||
menu() {
|
||||
document.body.appendChild(new MkPostMenu({
|
||||
propsData: {
|
||||
(this as any).os.new(MkPostMenu, {
|
||||
source: this.$refs.menuButton,
|
||||
post: this.p,
|
||||
compact: true
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -53,11 +53,9 @@ export default Vue.extend({
|
||||
id: notification.id
|
||||
});
|
||||
|
||||
document.body.appendChild(new MkNotify({
|
||||
propsData: {
|
||||
(this as any).os.new(MkNotify, {
|
||||
notification
|
||||
}
|
||||
}).$mount().$el);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user