From 201f48d7e4e3df27ab4adde7b6b11c0f72d3e21a Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Feb 2017 17:58:37 +0900 Subject: [PATCH] :v: --- src/web/app/desktop/mixins.js | 42 +++++++++++++++++++++++++++++++++++ src/web/app/desktop/mixins.ls | 38 ------------------------------- src/web/app/desktop/script.js | 2 +- 3 files changed, 43 insertions(+), 39 deletions(-) create mode 100644 src/web/app/desktop/mixins.js delete mode 100644 src/web/app/desktop/mixins.ls diff --git a/src/web/app/desktop/mixins.js b/src/web/app/desktop/mixins.js new file mode 100644 index 0000000000..4a14b81763 --- /dev/null +++ b/src/web/app/desktop/mixins.js @@ -0,0 +1,42 @@ +const riot = require('riot'); + +module.exports = me => { + if (me) require('./scripts/stream')(me); + + require('./scripts/user-preview'); + require('./scripts/open-window'); + + riot.mixin('notify', { + notify: require('./scripts/notify') + }); + + const dialog = require('./scripts/dialog'); + + riot.mixin('dialog', { + dialog: dialog + }); + + riot.mixin('NotImplementedException', { + NotImplementedException: () => { + return dialog('Not implemented yet', '要求された操作は実装されていません。
Misskeyの開発に参加する', [{ + text: 'OK' + }]); + } + }); + + riot.mixin('input-dialog', { + inputDialog: require('./scripts/input-dialog') + }); + + riot.mixin('update-avatar', { + updateAvatar: require('./scripts/update-avatar') + }); + + riot.mixin('update-banner', { + updateBanner: require('./scripts/update-banner') + }); + + riot.mixin('autocomplete', { + Autocomplete: require('./scripts/autocomplete') + }); +}; diff --git a/src/web/app/desktop/mixins.ls b/src/web/app/desktop/mixins.ls deleted file mode 100644 index cb5680ccec..0000000000 --- a/src/web/app/desktop/mixins.ls +++ /dev/null @@ -1,38 +0,0 @@ -riot = require \riot - -module.exports = (me) ~> - if me? - (require './scripts/stream') me - - require './scripts/user-preview' - - require './scripts/open-window' - - riot.mixin \notify do - notify: require './scripts/notify' - - dialog = require './scripts/dialog' - - riot.mixin \dialog do - dialog: dialog - - riot.mixin \NotImplementedException do - NotImplementedException: ~> - dialog do - 'Not implemented yet' - '要求された操作は実装されていません。
Misskeyの開発に参加する' - [ - text: \OK - ] - - riot.mixin \input-dialog do - input-dialog: require './scripts/input-dialog' - - riot.mixin \update-avatar do - update-avatar: require './scripts/update-avatar' - - riot.mixin \update-banner do - update-banner: require './scripts/update-banner' - - riot.mixin \autocomplete do - Autocomplete: require './scripts/autocomplete' diff --git a/src/web/app/desktop/script.js b/src/web/app/desktop/script.js index 92a4598305..b240e9ab98 100644 --- a/src/web/app/desktop/script.js +++ b/src/web/app/desktop/script.js @@ -6,7 +6,7 @@ require('chart.js'); require('./tags'); const riot = require('riot'); const boot = require('../boot'); -const mixins = require('./mixins.ls'); +const mixins = require('./mixins'); const route = require('./router'); const fuckAdBlock = require('./scripts/fuck-ad-block');