From 6a5c6280ffd3ffe820beb23294f1c2c1f5deb9cf Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 7 Oct 2017 03:36:46 +0900 Subject: :v: --- src/web/app/common/scripts/get-post-summary.js | 35 -------------------------- 1 file changed, 35 deletions(-) delete mode 100644 src/web/app/common/scripts/get-post-summary.js (limited to 'src/web/app/common') diff --git a/src/web/app/common/scripts/get-post-summary.js b/src/web/app/common/scripts/get-post-summary.js deleted file mode 100644 index 83eda8f6b4..0000000000 --- a/src/web/app/common/scripts/get-post-summary.js +++ /dev/null @@ -1,35 +0,0 @@ -const summarize = post => { - let summary = post.text ? post.text : ''; - - // メディアが添付されているとき - if (post.media) { - summary += ` (${post.media.length}つのメディア)`; - } - - // 投票が添付されているとき - if (post.poll) { - summary += ' (投票)'; - } - - // 返信のとき - if (post.reply_to_id) { - if (post.reply_to) { - summary += ` RE: ${summarize(post.reply_to)}`; - } else { - summary += ' RE: ...'; - } - } - - // Repostのとき - if (post.repost_id) { - if (post.repost) { - summary += ` RP: ${summarize(post.repost)}`; - } else { - summary += ' RP: ...'; - } - } - - return summary.trim(); -}; - -export default summarize; -- cgit v1.2.3-freya From 5f40e7eaa46fd8a3f60d2306a21364e38db73012 Mon Sep 17 00:00:00 2001 From: こぴなたみぽ Date: Sun, 22 Oct 2017 14:11:28 +0900 Subject: オフラインでも画像を表示できるようにbase64にして埋め込むようにした MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/web/app/common/tags/error.tag | 2 +- webpack/module/rules/base64.ts | 19 +++++++++++++++++++ webpack/module/rules/index.ts | 2 ++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 webpack/module/rules/base64.ts (limited to 'src/web/app/common') diff --git a/src/web/app/common/tags/error.tag b/src/web/app/common/tags/error.tag index e4e0272a49..a06f17cd1c 100644 --- a/src/web/app/common/tags/error.tag +++ b/src/web/app/common/tags/error.tag @@ -1,5 +1,5 @@ - +

%i18n:common.tags.mk-error.title%

%i18n:common.tags.mk-error.description%

%i18n:common.tags.mk-error.thanks%

diff --git a/webpack/module/rules/base64.ts b/webpack/module/rules/base64.ts new file mode 100644 index 0000000000..529816bd20 --- /dev/null +++ b/webpack/module/rules/base64.ts @@ -0,0 +1,19 @@ +/** + * Replace base64 symbols + */ + +import * as fs from 'fs'; +const StringReplacePlugin = require('string-replace-webpack-plugin'); + +export default () => ({ + enforce: 'pre', + test: /\.(tag|js)$/, + exclude: /node_modules/, + loader: StringReplacePlugin.replace({ + replacements: [{ + pattern: /%base64:(.+?)%/g, replacement: (_, key) => { + return fs.readFileSync(__dirname + '/../../../src/web/' + key, 'base64'); + } + }] + }) +}); diff --git a/webpack/module/rules/index.ts b/webpack/module/rules/index.ts index 2707a9c2f1..9c1262b3d6 100644 --- a/webpack/module/rules/index.ts +++ b/webpack/module/rules/index.ts @@ -1,4 +1,5 @@ import i18n from './i18n'; +import base64 from './base64'; import themeColor from './theme-color'; import tag from './tag'; import stylus from './stylus'; @@ -6,6 +7,7 @@ import typescript from './typescript'; export default (lang, locale) => [ i18n(lang, locale), + base64(), themeColor(), tag(), stylus(), -- cgit v1.2.3-freya From 27f98578c527a1a73c45be228eb979436d2e5ec3 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 25 Oct 2017 08:01:20 +0900 Subject: :v: --- locales/en.yml | 2 +- locales/ja.yml | 2 +- src/web/app/common/tags/error.tag | 12 +++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src/web/app/common') diff --git a/locales/en.yml b/locales/en.yml index 1df3001e5a..d4dfbf76bf 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -64,7 +64,7 @@ common: mk-error: title: "Unable to connect to the server" - description: "インターネット回線に問題があるか、サーバーがダウンまたはメンテナンスしている可能性があります。しばらくしてから再度お試しください。" + description: "There is a problem with Internet connection, or the server may be down or maintaining. Please {try again} later." thanks: "Thank you for using Misskey." mk-forkit: diff --git a/locales/ja.yml b/locales/ja.yml index 451650ef76..9a8490deca 100644 --- a/locales/ja.yml +++ b/locales/ja.yml @@ -64,7 +64,7 @@ common: mk-error: title: "サーバーに接続できません" - description: "インターネット回線に問題があるか、サーバーがダウンまたはメンテナンスしている可能性があります。しばらくしてから再度お試しください。" + description: "インターネット回線に問題があるか、サーバーがダウンまたはメンテナンスしている可能性があります。しばらくしてから{再度お試し}ください。" thanks: "いつもMisskeyをご利用いただきありがとうございます。" mk-forkit: diff --git a/src/web/app/common/tags/error.tag b/src/web/app/common/tags/error.tag index a06f17cd1c..7a2976541d 100644 --- a/src/web/app/common/tags/error.tag +++ b/src/web/app/common/tags/error.tag @@ -1,7 +1,13 @@

%i18n:common.tags.mk-error.title%

-

%i18n:common.tags.mk-error.description%

+

{ + '%i18n:common.tags.mk-error.description%'.substr(0, '%i18n:common.tags.mk-error.description%'.indexOf('{')) + }{ + '%i18n:common.tags.mk-error.description%'.match(/\{(.+?)\}/)[1] + }{ + '%i18n:common.tags.mk-error.description%'.substr('%i18n:common.tags.mk-error.description%'.indexOf('}') + 1) + }

%i18n:common.tags.mk-error.thanks%