2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
(function(e){function t(t){for(var i,c,o=t[0],d=t[1],l=t[2],u=0,f=[];u<o.length;u++)c=o[u],Object.prototype.hasOwnProperty.call(n,c)&&n[c]&&f.push(n[c][0]),n[c]=0;for(i in d)Object.prototype.hasOwnProperty.call(d,i)&&(e[i]=d[i]);a&&a(t);while(f.length)f.shift()();return s.push.apply(s,l||[]),r()}function r(){for(var e,t=0;t<s.length;t++){for(var r=s[t],i=!0,o=1;o<r.length;o++){var d=r[o];0!==n[d]&&(i=!1)}i&&(s.splice(t--,1),e=c(c.s=r[0]))}return e}var i={},n={app:0},s=[];function c(t){if(i[t])return i[t].exports;var r=i[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,c),r.l=!0,r.exports}c.m=e,c.c=i,c.d=function(e,t,r){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(c.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)c.d(r,i,function(t){return e[t]}.bind(null,i));return r},c.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="/";var o=window["webpackJsonp"]=window["webpackJsonp"]||[],d=o.push.bind(o);o.push=t,o=o.slice();for(var l=0;l<o.length;l++)t(o[l]);var a=d;s.push([0,"chunk-vendors"]),r()})({0:function(e,t,r){e.exports=r("56d7")},"034f":function(e,t,r){"use strict";r("9f4d")},"03ef":function(e,t,r){},"3e02":function(e,t,r){"use strict";r("80d0")},"56d7":function(e,t,r){"use strict";r.r(t);r("e260"),r("e6cf"),r("cca6"),r("a79d");var i=r("2b0e"),n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{attrs:{id:"app"}},[r("Main")],1)},s=[],c=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"page"},[r("FeedsList",{ref:"feedslist",staticClass:"feeds-list"}),r("ArticlesList",{ref:"articlelist",staticClass:"articles-list",attrs:{pyobject:e.pyobject}})],1)},o=[],d=r("5530"),l=(r("7db0"),r("2f62")),a=r("2a3c"),u=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"list-area"},[r("div",{ref:"articlelist",staticClass:"articles-list",style:{"border-color":e.lineColor,background:e.backgroundColor}},e._l(e.infolist,(function(t){return r("div",{key:t.article_index,staticClass:"article-item eaf-rss-reader-article-item",style:{background:e.itemBackgroundColor(t),color:e.itemForegroundColor(t),"border-color":e.lineColor},on:{click:function(r){e.changeCurrentArticleByIndex(t.index),e.markArticleAsRead()}}},[r("div",{staticClass:"article-title"},[e._v("\n "+e._s(t.title)+"\n ")]),r("div",{staticClass:"article-line"},[""!==t.author?r("div",{staticClass:"article-author"},[e._v("\n "+e._s(t.author)+"\n ")]):e._e(),r("div",{staticClass:"article-time"},[e._v("\n "+e._s(e.formatDate(t))+"\n ")])]),r("div",{staticClass:"article-short-description",domProps:{innerHTML:e._s(t.shortDescription)}})])})),0)])},f=[],h=(r("9911"),r("5319"),r("ac1f"),r("4d63"),r("25f0"),{name:"ArticlesList",data:function(){return{num:0,backgroundColor:"",foregroundColor:"",selectColor:"",readColor:"",lineColor:""}},props:{pyobject:Object},computed:Object(d["a"])(Object(d["a"])({},Object(l["b"])(["currentFeedArticleList","infolist"])),Object(l["c"])(["currentFeedIndex","currentArticleIndex"])),mounted:function(){window.changeCurrentArticleByIndex=this.changeCurrentArticleByIndex,window.selectArticleByIndex=this.selectArticleByIndex,window.markArticleAsRead=this.markArticleAsRead,window.markFeedAsRead=this.markFeedAsRead,window.initArticlesListColor=this.initArticlesListColor},created:function(){},methods:{initArticlesListColor:function(e,t,r,i,n){this.backgroundColor=e,this.foregroundColor=t,this.selectColor=r,this.readColor=i,this.lineColor=n},itemBackgroundColor:function(e){return e.index===this.currentArticleIndex?this.selectColor:this.backgroundColor},itemForegroundColor:function(e){return!0===e.isRead?this.readColor:this.foregroundColor},keepSelectVisible:function(){this.$refs.articlelist.children[this.currentArticleIndex].scrollIntoViewIfNeeded(!1)},selectArticleByIndex:function(e){var t=this.infolist.length;e>=t?this.changeCurrentArticleByIndex(t-1):e<=0?this.changeCurrentArticleByIndex(0):this.changeCurrentArticleByIndex(e),this.keepSelectVisible()},changeCurrentArticleByIndex:function(e){this.$store.commit("changeCurrentArticleIndex",e)},markArticleAsRead:function(){this.$store.commit("markArticleAsRead"),this.pyobject.mark_article_as_read(this.currentFeedIndex,this.currentArticleIndex,this.$store.state.feedsList[this.currentFeedIndex].feed_article_list[this.currentArticleIndex].link)},markFeedAsRead:function(){this.$store.commit("markFeedAsRead"),this.pyobject.mark_feed_as_read()},formatDate:function(e){var t=new Date(e.time),r="yyyy-MM-dd hh:mm:ss";if(!t||null==t)return null;var i={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};for(var n in/(y+)/.test(r)&&(r=r.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length))),i)new RegExp("("+n+")").test(r)&&(r=r.replace(RegExp.$1,1===RegExp.$1.length?i[n]:("00"+i[n]).substr((""+i[n]).length)));return r}}}),x=h,C=(r("3e02"),r("2877")),F=Object(C["a"])(x,u,f,!1,null,"1589ea30",null),p=F.exports,g=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"list-area",style:{"border-color":e.lineColor,background:e.backgroundColor}},[r("div",{ref:"feedlist",staticClass:"feeds-list"},[0===e.$store.state.feedsList.length?r("div",{staticClass:"first-guide"},[e._v("\n Press A to add feed url.\n ")]):e._l(e.$store.state.feedsList,(function(t){return r("div",{key:t.feed_index,staticClass:"feed eaf-rss-reader-feed-item",style:{background:e.itemBackgroundColor(t),color:e.itemForegroundColor(t),"border-color":e.lineColor},on:{click:function(r){e.changeCurrentFeedByIndex(t.feed_index),e.cleanArticle()}}},[r("div",{staticClass:"feed-title"},[r("div",{staticClass:"title"},[r("div",[e._v(e._s(t.feed_title))]),r("div",{staticClass:"unread-count"},[e._v("("+e._s(e.unreadCount(t.feed_index))+")")]),""===t.feed_title?r("div",[e._v(" "+e._s(t.feed_subtitle))]):e._e(),""===t.feed_title&&""===t.feed_subtitle?r("div",[e._v("\n "+e._s(t.feed_link)+"\n ")]):e._e()]),r("div",{staticClass:"sub-title"},[r("div",[e._v(e._s(t.feed_subtitle))]),""===t.feed_subtitle?r("div",[e._v(" "+e._s(t.feed_link))]):e._e()])])])}))],2)])},m=[],_=(r("4de4"),{name:"FeedsList",data:function(){return{backgroundColor:"",foregroundColor:"",selectColor:"",readColor:"",lineColor:""}},computed:Object(d["a"])({},Object(l["c"])(["currentFeedIndex","currentArticleIndex"])),mounted:function(){window.selectFeedByIndex=this.selectFeedByIndex,window.changeCurrentFeedByIndex=this.changeCurrentFeedByIndex,window.initFeedsListColor=this.initFeedsListColor},created:function(){},methods:{initFeedsListColor:function(e,t,r,i,n){this.backgroundColor=e,this.foregroundColor=t,this.selectColor=r,this.readColor=i,this.lineColor=n},changeCurrentFeedByIndex:function(e){this.$store.commit("changeCurrentFeedIndex",e)},itemBackgroundColor:function(e){return e.feed_index===this.currentFeedIndex?this.selectColor:this.backgroundColor},itemForegroundColor:function(e){return 0==e.feed_article_list.filter((function(e){return!e.isRead})).length?this.readColor:this.foregroundColor},keepSelectVisible:function(){this.$refs.feedlist.children[this.currentFeedIndex].scrollIntoViewIfNeeded(!1)},selectFeedByIndex:function(e){var t=this.$store.state.feedsList.length;e>=t?this.changeCurrentFeedByIndex(t-1):e<=0?this.changeCurrentFeedByIndex(0):this.changeCurrentFeedByIndex(e),this.keepSelectVisible()},cleanArticle:function(){this.$store.commit("changeCurrentArticleIndex",-1)},unreadCount:function(e){return this.$store.state.feedsList[e].feed_article_list.filter((function(e){return!e.isRead})).length}}}),b=_,A=(r("80b8"),Object(C["a"])(b,g,m,!1,null,"1e9e8412",null)),I=A.exports,v={name:"Main",data:function(){return{pyobject:null}},computed:Object(d["a"])(Object(d["a"])({},Object(l["c"])(["currentFeedIndex","currentArticleIndex","openFeed","openArticle"])),Object(l["b"])(["currentFeedArticleList"])),watch:{currentFeedIndex:{handler:function(e,t){window.pyobject.update_current_feed_index(e)}},currentArticleIndex:{handler:function(e,t){window.pyobject.update_current_article_index(e)}}},components:{ArticlesList:p,FeedsList:I},mounted:function(){window.selectPrevFeed=this.selectPrevFeed,window.selectNextFeed=this.selectNextFeed,window.selectPrevArticle=this.selectPrevArticle,window.selectNextArticle=this.selectNextArticle,window.selectFirstFeed=this.selectFirstFeed,window.selectLastFeed=this.selectLastFeed,window.selectFirstArticle=this.selectFirstArticle,window.selectLastArticle=this.selectLastArticle},created:function(){var e=this;new a["QWebChannel"](qt.webChannelTransport,(function(t){window.pyobject=t.objects.pyobject,e.pyobject=window.pyobject}))},methods:{articleInfoList:function(){var e=this;return this.currentFeedArticleList.find((function(t){return t.title===e.title}))},selectNextFeed:function(){this.$refs.feedslist.selectFeedByIndex(this.currentFeedIndex+1),this.$store.commit("changeCurrentArticleIndex",0)},selectPrevFeed:function(){this.$refs.feedslist.selectFeedByIndex(this.currentFeedIndex-1),this.$store.commit("changeCurrentArticleIndex",0)},selectNextArticle:function(){-1!=this.currentFeedIndex&&this.$refs.articlelist.selectArticleByIndex(this.currentArticleIndex+1)},selectPrevArticle:function(){-1!=this.currentFeedIndex&&this.$refs.articlelist.selectArticleByIndex(this.currentArticleIndex-1)},selectFirstFeed:function(){this.$refs.feedslist.selectFeedByIndex(0),this.$store.commit("changeCurrentArticleIndex",0)},selectLastFeed:function(){var e=this.$store.state.feedsList.length-1;this.$refs.feedslist.selectFeedByIndex(e),this.$store.commit("changeCurrentArticleIndex",0)},selectFirstArticle:function(){-1!=this.currentFeedIndex&&this.$refs.articlelist.selectArticleByIndex(0)},selectLastArticle:function(){if(-1!=this.currentFeedIndex){var e=this.$store.state.feedsList[this.currentFeedIndex].feed_article_list.length-1;this.$refs.articlelist.selectArticleByIndex(e)}}}},y=v,w=(r("c10c"),Object(C["a"])(y,c,o,!1,null,"7d2117d9",null)),L=w.exports,k={components:{Main:L},mounted:function(){window.addFeedsListFiles=this.addFeedsListFiles,window.addFeedsLinkListFiles=this.addFeedsLinkListFiles},created:function(){},methods:{addFeedsListFiles:function(e){this.$store.commit("updateFeedsList",e)},addFeedsLinkListFiles:function(e){this.$store.commit("updateFeedsLinkList",e)}}},j=k,$=(r("034f"),Object(C["a"])(j,n,s,!1,null,null,null)),B=$.exports;r("d81d");i["a"].use(l["a"]);var O=new l["a"].Store({state:{feedsList:[],feedsLinkList:[],currentFeedIndex:-1,currentArticleIndex:-1},mutations:{updateFeedsList:function(e,t){e.feedsList=t},updateFeedsLinkList:function(e,t){e.feedsLinkList=t},changeCurrentFeedIndex:function(e,t){e.currentFeedIndex=t},changeCurrentArticleIndex:function(e,t){e.currentArticleIndex=t},markArticleAsRead:function(e){e.feedsList[e.currentFeedIndex].feed_article_list[e.currentArticleIndex].isRead=!0},markFeedAsRead:function(e){e.feedsList[e.currentFeedIndex].feed_article_list.map((function(e){return e.isRead=!0}))}},actions:{},getters:{currentFeedArticleList:function(e){if(-1!=e.currentFeedIndex)return e.feedsList[e.currentFeedIndex].feed_article_list},infolist:function(e){var t=e.currentFeedIndex;if(-1!=t)return e.feedsList[t].feed_article_list}}});i["a"].config.productionTip=!1,new i["a"]({store:O,render:function(e){return e(B)}}).$mount("#app")},6588:function(e,t,r){},"80b8":function(e,t,r){"use strict";r("03ef")},"80d0":function(e,t,r){},"9f4d":function(e,t,r){},c10c:function(e,t,r){"use strict";r("6588")}});
|
|
//# sourceMappingURL=app.dee86e69.js.map
|