Reader/Feed.bjs
authorAlan Knowles <alan@roojs.com>
Thu, 12 May 2016 06:57:52 +0000 (14:57 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 12 May 2016 06:57:52 +0000 (14:57 +0800)
Reader/Feed.js
Reader/templates/Feed.html

Reader/Feed.bjs
Reader/Feed.js
Reader/templates/Feed.html

index 5bbb63a..ccd21b3 100644 (file)
      "listeners" : {
       "render" : "function (_self)\n{\n  _this.articleCtr = this;\n}"
      },
-     "id" : "",
+     "id" : "articleCtr",
      "| function load" : "function(pos) { \n    \n\n    if (pos < 0) {\n        Roo.MessageBox.alert(\"error\", \"show article got < 0\");\n    }\n        \n    //    Roo.select('.hover-nav').show();\n    _this.table.hide(); // hopefully...\n    this.show();\n    \n    var rec = _this.table.store.getAt(pos);\n    if (typeof(rec.data.rss_body) == 'undefined') {\n\n            \n        new Pman.Request({\n            method: 'GET',\n            mask : 'Fetching Article',\n            params : {as_json : 1} ,\n            url : baseURL + '/FeedBody/' + rec.data.id,\n            success : function(res) {\n                Roo.log(res);\n                rec.data.rss_body = res.data;\n                _this.articleCtr.load(pos);\n                \n              \n            }\n        });\n        return;\n        \n    }\n    \n    _this.articleDate.el.update(rec.data.article_id_published_dt.split(' ')[0]);\n\n    _this.articleURL.el.update(String.format('<a href=\"{0}\">{1}</a>',\n            rec.data.article_id_real_url,\n            rec.data.article_id_real_url.split('/')[2] // hopefull will not break.!\n     ));\n     _this.articleTitle.el.update(String.format('{0}', rec.data.article_id_headline));\n    \n    _this.articleBody.el.update(rec.data.rss_body || \"Body has not been loaded\",false, function() {\n        //Roo.log(\"body loaded\");\n        (function() { \n            var w = Roo.lib.Dom.getViewportWidth();\n\n            // resize the images... \n            _this.articleBody.el.select('img', true).each(function(im) {\n                if (im.getWidth() > w) {\n                    var sf = w/im.getWidth()  \n                    im.setSize(w, im.getHeight() * sf);\n                }\n                \n                    \n            });\n        }).defer(100);\n            \n    });\n    // hide the summary...\n    \n    \n    \n    \n    \n    //Roo.get(document.body).unmask();\n    \n    //Roo.select('.rss-art-count').first().update((this.pos +1) +'/' + this.articles.elements.length);\n   \n    // flag it as read...\n    \n    new Pman.Request({\n        method: 'GET',\n        url : baseURL + '/FeedBody/' + rec.data.id,\n        params : { flag_read : 1 }, \n        success : function(res) { }\n    });\n    rec.set('has_read', 1);\n        \n    //Roo.select('.rss-list-article-' +id +\n    //           ' .count').show();\n    \n    //Roo.select('.rss-list-article-' +id +\n    //           ' .count').first().dom.innerHTML =  'Read';\n\n    //Roo.select('.rss-list-article-' +id +\n    //           ' .chevron').first().hide();\n    \n   \n        //Roo.select('header h2').first().dom.innerHTML = this.feed_title + ' - ' +\n        //        art.select('.rss-title').first().dom.innerH\n}",
      "xtype" : "Element",
      "$ xns" : "Roo.bootstrap",
index 1e854c9..d439864 100644 (file)
@@ -172,7 +172,7 @@ Feed = new Roo.XComponent({
     },
     {
      hidden : false,
-     id : '',
+     id : 'articleCtr',
      load : function(pos) { 
          
      
index f443685..1aabcba 100644 (file)
@@ -57,11 +57,11 @@ color: white;" xtype="Roo.bootstrap.Element">name of feed</DIV>
       <DIV>Loading...</DIV>
     </DIV>
   </DIV>
-  <DIV class="" xbuilderid="roo-comp-1020" xtype="Roo.bootstrap.Element">
-    <OL class="breadcrumb breadcrumb" xbuilderid="roo-comp-1022" style="margin-top:50px;" xtype="Roo.bootstrap.Element">
-      <LI class="" xbuilderid="roo-comp-1024" xtype="Roo.bootstrap.Element">Date</LI>
-      <LI class="" xbuilderid="roo-comp-1026" xtype="Roo.bootstrap.Element">articleURL</LI>
-      <LI class="active active" xbuilderid="roo-comp-1028" xtype="Roo.bootstrap.Element">Title</LI>
+  <DIV class="" id="articleCtr" xtype="Roo.bootstrap.Element">
+    <OL class="breadcrumb breadcrumb" xbuilderid="roo-comp-1020" style="margin-top:50px;" xtype="Roo.bootstrap.Element">
+      <LI class="" xbuilderid="roo-comp-1022" xtype="Roo.bootstrap.Element">Date</LI>
+      <LI class="" xbuilderid="roo-comp-1024" xtype="Roo.bootstrap.Element">articleURL</LI>
+      <LI class="active active" xbuilderid="roo-comp-1026" xtype="Roo.bootstrap.Element">Title</LI>
     </OL>
-    <DIV class="container" xbuilderid="roo-comp-1030" xtype="Roo.bootstrap.Container"></DIV>
+    <DIV class="container" xbuilderid="roo-comp-1028" xtype="Roo.bootstrap.Container"></DIV>
   </DIV>