From 4c955557bf4a2712653c1f2a7f02e9729eca64cf Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Feb 2017 17:45:32 +0900 Subject: [PATCH] :v: --- src/web/app/desktop/script.js | 2 +- src/web/app/desktop/scripts/fuck-ad-block.js | 18 ++++++++++++++++++ src/web/app/desktop/scripts/fuck-ad-block.ls | 19 ------------------- 3 files changed, 19 insertions(+), 20 deletions(-) create mode 100644 src/web/app/desktop/scripts/fuck-ad-block.js delete mode 100644 src/web/app/desktop/scripts/fuck-ad-block.ls diff --git a/src/web/app/desktop/script.js b/src/web/app/desktop/script.js index b63f712f62..92a4598305 100644 --- a/src/web/app/desktop/script.js +++ b/src/web/app/desktop/script.js @@ -8,7 +8,7 @@ const riot = require('riot'); const boot = require('../boot'); const mixins = require('./mixins.ls'); const route = require('./router'); -const fuckAdBlock = require('./scripts/fuck-ad-block.ls'); +const fuckAdBlock = require('./scripts/fuck-ad-block'); /** * Boot diff --git a/src/web/app/desktop/scripts/fuck-ad-block.js b/src/web/app/desktop/scripts/fuck-ad-block.js new file mode 100644 index 0000000000..38208d34c0 --- /dev/null +++ b/src/web/app/desktop/scripts/fuck-ad-block.js @@ -0,0 +1,18 @@ +require('fuckadblock'); +const dialog = require('./dialog'); + +module.exports = () => { + if (fuckAdBlock === undefined) { + adBlockDetected(); + } else { + fuckAdBlock.onDetected(adBlockDetected); + } +}; + +function adBlockDetected() { + dialog('広告ブロッカーを無効にしてください', + 'Misskeyは広告を掲載していませんが、広告をブロックする機能が有効だと一部の機能が利用できなかったり、不具合が発生する場合があります。', + [{ + text: 'OK' + }]); +} diff --git a/src/web/app/desktop/scripts/fuck-ad-block.ls b/src/web/app/desktop/scripts/fuck-ad-block.ls deleted file mode 100644 index 7990f58f1f..0000000000 --- a/src/web/app/desktop/scripts/fuck-ad-block.ls +++ /dev/null @@ -1,19 +0,0 @@ -# FUCK AD BLOCK -#================================ - -require \fuckadblock -dialog = require './dialog.ls' - -module.exports = ~> - if fuck-ad-block == undefined - ad-block-detected! - else - fuck-ad-block.on-detected ad-block-detected - -function ad-block-detected - dialog do - '広告ブロッカーを無効にしてください' - 'Misskeyは広告を掲載していませんが、広告をブロックする機能が有効だと一部の機能が利用できなかったり、不具合が発生する場合があります。' - [ - text: \OK - ]