diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-10-07 03:36:46 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-10-07 03:36:46 +0900 |
| commit | 6a5c6280ffd3ffe820beb23294f1c2c1f5deb9cf (patch) | |
| tree | eb9006394a36bfa80bd255e9d86a524060c37828 /src/web | |
| parent | Merge pull request #817 from syuilo/greenkeeper/@types/mongodb-2.2.13 (diff) | |
| download | sharkey-6a5c6280ffd3ffe820beb23294f1c2c1f5deb9cf.tar.gz sharkey-6a5c6280ffd3ffe820beb23294f1c2c1f5deb9cf.tar.bz2 sharkey-6a5c6280ffd3ffe820beb23294f1c2c1f5deb9cf.zip | |
:v:
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/app/common/scripts/get-post-summary.js | 35 | ||||
| -rw-r--r-- | src/web/app/desktop/script.js | 2 | ||||
| -rw-r--r-- | src/web/app/desktop/tags/notifications.tag | 2 | ||||
| -rw-r--r-- | src/web/app/desktop/tags/pages/home.tag | 2 | ||||
| -rw-r--r-- | src/web/app/mobile/tags/notification-preview.tag | 2 | ||||
| -rw-r--r-- | src/web/app/mobile/tags/notification.tag | 2 | ||||
| -rw-r--r-- | src/web/app/mobile/tags/notifications.tag | 2 | ||||
| -rw-r--r-- | src/web/app/mobile/tags/page/home.tag | 2 | ||||
| -rw-r--r-- | src/web/app/mobile/tags/post-detail.tag | 2 | ||||
| -rw-r--r-- | src/web/app/mobile/tags/timeline.tag | 2 | ||||
| -rw-r--r-- | src/web/app/mobile/tags/user.tag | 2 |
11 files changed, 10 insertions, 45 deletions
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; diff --git a/src/web/app/desktop/script.js b/src/web/app/desktop/script.js index 2e81147943..e3dc8b7d96 100644 --- a/src/web/app/desktop/script.js +++ b/src/web/app/desktop/script.js @@ -11,7 +11,7 @@ import * as riot from 'riot'; import init from '../init'; import route from './router'; import fuckAdBlock from './scripts/fuck-ad-block'; -import getPostSummary from '../common/scripts/get-post-summary'; +import getPostSummary from '../../../common/get-post-summary'; /** * init diff --git a/src/web/app/desktop/tags/notifications.tag b/src/web/app/desktop/tags/notifications.tag index 21e4fe7fa5..4747d1c0f4 100644 --- a/src/web/app/desktop/tags/notifications.tag +++ b/src/web/app/desktop/tags/notifications.tag @@ -207,7 +207,7 @@ </style> <script> - import getPostSummary from '../../common/scripts/get-post-summary'; + import getPostSummary from '../../../../common/get-post-summary'; this.getPostSummary = getPostSummary; this.mixin('i'); diff --git a/src/web/app/desktop/tags/pages/home.tag b/src/web/app/desktop/tags/pages/home.tag index 124a2eefa3..a56c546059 100644 --- a/src/web/app/desktop/tags/pages/home.tag +++ b/src/web/app/desktop/tags/pages/home.tag @@ -8,7 +8,7 @@ </style> <script> import Progress from '../../../common/scripts/loading'; - import getPostSummary from '../../../common/scripts/get-post-summary'; + import getPostSummary from '../../../../../common/get-post-summary'; this.mixin('i'); this.mixin('api'); diff --git a/src/web/app/mobile/tags/notification-preview.tag b/src/web/app/mobile/tags/notification-preview.tag index 077ae78463..36b4f5eda7 100644 --- a/src/web/app/mobile/tags/notification-preview.tag +++ b/src/web/app/mobile/tags/notification-preview.tag @@ -110,7 +110,7 @@ </style> <script> - import getPostSummary from '../../common/scripts/get-post-summary'; + import getPostSummary from '../../../../common/get-post-summary'; this.getPostSummary = getPostSummary; this.notification = this.opts.notification; </script> diff --git a/src/web/app/mobile/tags/notification.tag b/src/web/app/mobile/tags/notification.tag index 3663709525..416493ee23 100644 --- a/src/web/app/mobile/tags/notification.tag +++ b/src/web/app/mobile/tags/notification.tag @@ -163,7 +163,7 @@ </style> <script> - import getPostSummary from '../../common/scripts/get-post-summary'; + import getPostSummary from '../../../../common/get-post-summary'; this.getPostSummary = getPostSummary; this.notification = this.opts.notification; </script> diff --git a/src/web/app/mobile/tags/notifications.tag b/src/web/app/mobile/tags/notifications.tag index 2f314769db..9985b3351c 100644 --- a/src/web/app/mobile/tags/notifications.tag +++ b/src/web/app/mobile/tags/notifications.tag @@ -78,7 +78,7 @@ </style> <script> - import getPostSummary from '../../common/scripts/get-post-summary'; + import getPostSummary from '../../../../common/get-post-summary'; this.getPostSummary = getPostSummary; this.mixin('api'); diff --git a/src/web/app/mobile/tags/page/home.tag b/src/web/app/mobile/tags/page/home.tag index efb5068a57..6f7369798e 100644 --- a/src/web/app/mobile/tags/page/home.tag +++ b/src/web/app/mobile/tags/page/home.tag @@ -9,7 +9,7 @@ <script> import ui from '../../scripts/ui-event'; import Progress from '../../../common/scripts/loading'; - import getPostSummary from '../../../common/scripts/get-post-summary'; + import getPostSummary from '../../../../../common/get-post-summary'; import openPostForm from '../../scripts/open-post-form'; this.mixin('i'); diff --git a/src/web/app/mobile/tags/post-detail.tag b/src/web/app/mobile/tags/post-detail.tag index dc032fe964..4be1a8080a 100644 --- a/src/web/app/mobile/tags/post-detail.tag +++ b/src/web/app/mobile/tags/post-detail.tag @@ -264,7 +264,7 @@ </style> <script> import compile from '../../common/scripts/text-compiler'; - import getPostSummary from '../../common/scripts/get-post-summary'; + import getPostSummary from '../../../../common/get-post-summary'; import openPostForm from '../scripts/open-post-form'; this.mixin('api'); diff --git a/src/web/app/mobile/tags/timeline.tag b/src/web/app/mobile/tags/timeline.tag index 2b0948ac34..80debbf66e 100644 --- a/src/web/app/mobile/tags/timeline.tag +++ b/src/web/app/mobile/tags/timeline.tag @@ -464,7 +464,7 @@ </style> <script> import compile from '../../common/scripts/text-compiler'; - import getPostSummary from '../../common/scripts/get-post-summary'; + import getPostSummary from '../../../../common/get-post-summary'; import openPostForm from '../scripts/open-post-form'; this.mixin('api'); diff --git a/src/web/app/mobile/tags/user.tag b/src/web/app/mobile/tags/user.tag index f29f0a0c86..cc34074218 100644 --- a/src/web/app/mobile/tags/user.tag +++ b/src/web/app/mobile/tags/user.tag @@ -428,7 +428,7 @@ </style> <script> - import summary from '../../common/scripts/get-post-summary'; + import summary from '../../../../common/get-post-summary'; this.post = this.opts.post; this.text = summary(this.post); |