From a617aaa0116ad152d3ad161d4748589dcae14033 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 28 May 2018 15:06:32 +0900 Subject: [PATCH] Improve RSS widget --- src/client/app/common/views/widgets/rss.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/client/app/common/views/widgets/rss.vue b/src/client/app/common/views/widgets/rss.vue index 9e2c6b649..eca23d022 100644 --- a/src/client/app/common/views/widgets/rss.vue +++ b/src/client/app/common/views/widgets/rss.vue @@ -19,12 +19,12 @@ import define from '../../../common/define-widget'; export default define({ name: 'rss', props: () => ({ - compact: false + compact: false, + url: 'http://news.yahoo.co.jp/pickup/rss.xml' }) }).extend({ data() { return { - url: 'http://news.yahoo.co.jp/pickup/rss.xml', items: [], fetching: true, clock: null @@ -43,7 +43,7 @@ export default define({ this.save(); }, fetch() { - fetch(`https://api.rss2json.com/v1/api.json?rss_url=${this.url}`, { + fetch(`https://api.rss2json.com/v1/api.json?rss_url=${this.props.url}`, { cache: 'no-cache' }).then(res => { res.json().then(feed => { @@ -53,7 +53,9 @@ export default define({ }); }, setting() { - alert('not implemented yet'); + this.props.url =window.prompt('URL', this.props.url); + this.save(); + this.fetch(); } } });