1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Feed = new Roo.XComponent({
8 'fd27f9886a23f23ce97aa3f81c993949' :"<i class=\"fa fa-chevron-left\"></i> Back",
9 '40c829f4b6cdd8753135704af571192f' :"articleURL",
10 '8287b137f969bcae66ca51f7abf14308' :"Show Previously Read ",
11 'd9cd9f7b44e0493c9604e9f8fb7a6c07' :"Mark All Read",
12 'b78a3223503896721cca1303f776159b' :"Title",
13 'b7436cc90ecf26f15baeead978f09040' :"name of feed",
14 '83ca9a18d9507324a9453c92a7420dd2' :"Report Issue",
15 '44749712dbec183e983dcd78a7736c41' :"Date"
18 part : ["Reader", "Feed" ],
22 name : "unnamed module",
31 '|xns' : 'Roo.bootstrap',
35 html : _this._strings['b7436cc90ecf26f15baeead978f09040'] /* name of feed */,
36 preventDefault : true,
37 style : 'font-weight: bold;\nfont-size: 22px;\n \nposition: static;\nleft: 100px;\ntop: 10px;\nz-Index: 2000;\ncolor: white;',
40 '|xns' : 'Roo.bootstrap',
43 click : function (_self, e)
45 if (_this.table.el.hasClass('hidden')) {
46 _this.table.show(); // hopefully...
47 _this.articleCtr.show();
54 position : 'fixed-top',
56 '|xns' : 'Roo.bootstrap',
57 xtype : 'NavHeaderbar',
62 '|xns' : 'Roo.bootstrap',
66 html : _this._strings['d9cd9f7b44e0493c9604e9f8fb7a6c07'] /* Mark All Read */,
68 '|xns' : 'Roo.bootstrap',
72 html : _this._strings['8287b137f969bcae66ca51f7abf14308'] /* Show Previously Read */,
74 '|xns' : 'Roo.bootstrap',
78 html : _this._strings['83ca9a18d9507324a9453c92a7420dd2'] /* Report Issue */,
80 '|xns' : 'Roo.bootstrap',
86 html : _this._strings['fd27f9886a23f23ce97aa3f81c993949'] /* <i class="fa fa-chevron-left"></i> Back */,
87 preventDefault : true,
89 '|xns' : 'Roo.bootstrap',
92 click : function (_self, e)
94 if (_this.table.el.hasClass('hidden')) {
95 _this.table.show(); // hopefully...
96 _this.articleCtr.show();
109 style : 'margin-top:50px',
112 '|xns' : 'Roo.bootstrap',
115 render : function (_self)
120 rowclick : function (_self, el, rowIndex, e)
122 //var rec = this.store.getAt(rowIndex);
124 _this.articleCtr.load(rowIndex);
133 beforeload : function (_self, o)
135 o.params = o.params || {};
141 url : baseURL + '/Api/Reader_read',
152 "article_id_published_dt" ,
153 "article_id_headline" ,
155 "article_id_real_url" ,
156 'article_id_body_txt'
165 dataIndex : 'article_id_headline',
166 renderer : function(v,x,r) {
168 var hr = r.data.has_read * 1 ? '<span class="badge">Read</span>' : '';
170 return String.format(
171 '<h3>{0}</h3><small>{1}</small><i class="rss-list-body">{2}</i>' +
172 hr + '<i class="fa fa-chevron-right"></i>',
173 r.data.article_id_headline,
174 r.data.article_id_published_dt,
175 r.data.article_id_body_txt
182 xtype : 'ColumnModel'
189 load : function(pos) {
193 Roo.MessageBox.alert("error", "show article got < 0");
196 // Roo.select('.hover-nav').show();
197 _this.table.hide(); // hopefully...
200 var rec = _this.table.store.getAt(pos);
201 if (typeof(rec.data.rss_body) == 'undefined') {
206 mask : 'Fetching Article',
207 params : {as_json : 1} ,
208 url : baseURL + '/FeedBody/' + rec.data.id,
209 success : function(res) {
211 rec.data.rss_body = res.data;
212 _this.articleCtr.load(pos);
221 _this.articleDate.el.update(rec.data.article_id_published_dt.split(' ')[0]);
223 _this.articleURL.el.update(String.format('<a href="{0}">{1}</a>',
224 rec.data.article_id_real_url,
225 rec.data.article_id_real_url.split('/')[2] // hopefull will not break.!
227 _this.articleTitle.el.update(String.format('{0}', rec.data.article_id_headline));
229 _this.articleBody.el.update(rec.data.rss_body || "Body has not been loaded",false, function() {
230 //Roo.log("body loaded");
232 var w = Roo.lib.Dom.getViewportWidth();
234 // resize the images...
235 _this.articleBody.el.select('img', true).each(function(im) {
236 if (im.getWidth() > w) {
237 var sf = w/im.getWidth()
238 im.setSize(w, im.getHeight() * sf);
246 // hide the summary...
252 //Roo.get(document.body).unmask();
254 //Roo.select('.rss-art-count').first().update((this.pos +1) +'/' + this.articles.elements.length);
256 // flag it as read...
260 url : baseURL + '/FeedBody/' + rec.data.id,
261 params : { flag_read : 1 },
262 success : function(res) { }
264 rec.set('has_read', 1);
266 //Roo.select('.rss-list-article-' +id +
267 // ' .count').show();
269 //Roo.select('.rss-list-article-' +id +
270 // ' .count').first().dom.innerHTML = 'Read';
272 //Roo.select('.rss-list-article-' +id +
273 // ' .chevron').first().hide();
276 //Roo.select('header h2').first().dom.innerHTML = this.feed_title + ' - ' +
277 // art.select('.rss-title').first().dom.innerH
280 '|xns' : 'Roo.bootstrap',
283 render : function (_self)
285 _this.articleCtr = this;
291 style : 'margin-top:50px;',
294 '|xns' : 'Roo.bootstrap',
298 html : _this._strings['44749712dbec183e983dcd78a7736c41'] /* Date */,
301 '|xns' : 'Roo.bootstrap',
304 render : function (_self)
306 _this.articleDate = this;
311 html : _this._strings['40c829f4b6cdd8753135704af571192f'] /* articleURL */,
314 '|xns' : 'Roo.bootstrap',
317 render : function (_self)
319 _this.articleURL = this;
325 html : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
328 '|xns' : 'Roo.bootstrap',
331 render : function (_self)
333 _this.articleTitle = this;
341 '|xns' : 'Roo.bootstrap',
344 render : function (_self)
346 _this.articleBody = this;