Newer
Older
import HomeStreamManager from '../common/scripts/streaming/home-stream-manager';
import chooseDriveFile from './api/choose-drive-file';
import dialog from './api/dialog';
import input from './api/input';
import MkSelectDrive from './views/pages/selectdrive.vue';
import MkDrive from './views/pages/drive.vue';
/**
* Fuck AD Block
*/
fuckAdBlock();
/**
* Init Notification
*/
if ('Notification' in window) {
// 許可を得ていなかったらリクエスト
}, {
path: '/i/drive', component: MkDrive
}, {
path: '/i/drive/folder/:folder', component: MkDrive
}, {
path: '/selectdrive', component: MkSelectDrive
function registerNotifications(stream: HomeStreamManager) {
if (stream.hasConnection) {
attach(stream.borrow());
}
stream.on('connected', connection => {
attach(connection);
function attach(connection) {
connection.on('drive_file_created', file => {
const _n = composeNotification('drive_file_created', file);
const n = new Notification(_n.title, {
body: _n.body,
icon: _n.icon
const _n = composeNotification('mention', post);
const n = new Notification(_n.title, {
body: _n.body,
icon: _n.icon
const _n = composeNotification('reply', post);
const n = new Notification(_n.title, {
body: _n.body,
icon: _n.icon
const _n = composeNotification('quote', post);
const n = new Notification(_n.title, {
body: _n.body,
icon: _n.icon
connection.on('unread_messaging_message', message => {
const _n = composeNotification('unread_messaging_message', message);
const n = new Notification(_n.title, {
body: _n.body,
icon: _n.icon
/*(riot as any).mount(document.body.appendChild(document.createElement('mk-messaging-room-window')), {
};
setTimeout(n.close.bind(n), 7000);
});
}