Reader/Feed.bjs
authorAlan Knowles <alan@roojs.com>
Thu, 24 Dec 2015 04:48:43 +0000 (12:48 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 24 Dec 2015 04:48:43 +0000 (12:48 +0800)
Reader/Feed.js
Reader/templates/Feed.html

Reader/Feed.bjs
Reader/Feed.js

index dfe13f3..4f46cce 100644 (file)
     },
     {
      "xtype" : "Container",
-     "| function loadArticle" : "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.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                url : baseURL + '/FeedBody/' + id,\n                success : function(res) {\n                    rec.data.rss_body = res.responseText;\n                    _this.article_ctr.showArticle(pos);\n                    \n                  \n                }\n            });\n            return;\n            \n        }\n    \n        abody.update(art.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                Roo.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        Roo.Ajax.request({\n            method: 'GET',\n            url : baseURL + '/FeedBody/' + id,\n            params : { flag_read : 1 }, \n            success : function(res) { },\n            scope : this\n        });\n        \n        Roo.select('.rss-list-article-' +id +\n                   ' .count').first().dom.innerHTML =  'Read';\n\n        Roo.select('.rss-list-article-' +id).addClass('rss-list-article-read-status-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}",
+     "| function loadArticle" : "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.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            url : baseURL + '/FeedBody/' + id,\n            success : function(res) {\n                rec.data.rss_body = res.responseText;\n                _this.article_ctr.showArticle(pos);\n                \n              \n            }\n        });\n        return;\n        \n    }\n\nabody.update(art.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            Roo.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    Roo.Ajax.request({\n        method: 'GET',\n        url : baseURL + '/FeedBody/' + id,\n        params : { flag_read : 1 }, \n        success : function(res) { },\n        scope : this\n    });\n    \n    Roo.select('.rss-list-article-' +id +\n               ' .count').first().dom.innerHTML =  'Read';\n\n    Roo.select('.rss-list-article-' +id).addClass('rss-list-article-read-status-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}",
      "$ xns" : "Roo.bootstrap",
      "Boolean hidden" : true
     }
index ad28a12..96db9ee 100644 (file)
@@ -169,72 +169,72 @@ Feed = new Roo.XComponent({
          if (typeof(rec.data.rss_body) == 'undefined') {
      
                  
-                 new Pman.Request({
-                     method: 'GET',
-                     mask : 'Fetching Article',
-                     url : baseURL + '/FeedBody/' + id,
-                     success : function(res) {
-                         rec.data.rss_body = res.responseText;
-                         _this.article_ctr.showArticle(pos);
-                         
-                       
+             new Pman.Request({
+                 method: 'GET',
+                 mask : 'Fetching Article',
+                 url : baseURL + '/FeedBody/' + id,
+                 success : function(res) {
+                     rec.data.rss_body = res.responseText;
+                     _this.article_ctr.showArticle(pos);
+                     
+                   
+                 }
+             });
+             return;
+             
+         }
+     
+     abody.update(art.rss_body || "Body has not been loaded",false, function() {
+             //Roo.log("body loaded");
+             (function() { 
+                 var w = Roo.lib.Dom.getViewportWidth();
+     
+                 Roo.select('img', true).each(function(im) {
+                     if (im.getWidth() > w) {
+                         var sf = w/im.getWidth()  
+                         im.setSize(w, im.getHeight() * sf);
                      }
+                     
+                         
                  });
-                 return;
+             }).defer(100);
                  
-             }
+         });
+         // hide the summary...
          
-             abody.update(art.rss_body || "Body has not been loaded",false, function() {
-                 //Roo.log("body loaded");
-                 (function() { 
-                     var w = Roo.lib.Dom.getViewportWidth();
          
-                     Roo.select('img', true).each(function(im) {
-                         if (im.getWidth() > w) {
-                             var sf = w/im.getWidth()  
-                             im.setSize(w, im.getHeight() * sf);
-                         }
-                         
-                             
-                     });
-                 }).defer(100);
-                     
-             });
-             // hide the summary...
-             
-             
-             
-             
-             
-             Roo.get(document.body).unmask();
-             
-             Roo.select('.rss-art-count').first().update((this.pos +1) +'/' + this.articles.elements.length);
-            
-             // flag it as read...
-             
-             Roo.Ajax.request({
-                 method: 'GET',
-                 url : baseURL + '/FeedBody/' + id,
-                 params : { flag_read : 1 }, 
-                 success : function(res) { },
-                 scope : this
-             });
-             
-             Roo.select('.rss-list-article-' +id +
-                        ' .count').first().dom.innerHTML =  'Read';
+         
+         
+         
+         Roo.get(document.body).unmask();
+         
+         Roo.select('.rss-art-count').first().update((this.pos +1) +'/' + this.articles.elements.length);
+        
+         // flag it as read...
+         
+         Roo.Ajax.request({
+             method: 'GET',
+             url : baseURL + '/FeedBody/' + id,
+             params : { flag_read : 1 }, 
+             success : function(res) { },
+             scope : this
+         });
+         
+         Roo.select('.rss-list-article-' +id +
+                    ' .count').first().dom.innerHTML =  'Read';
      
-             Roo.select('.rss-list-article-' +id).addClass('rss-list-article-read-status-1');
-             
-             Roo.select('.rss-list-article-' +id +
-                        ' .count').show();
-             
-             Roo.select('.rss-list-article-' +id +
-                        ' .count').first().dom.innerHTML =  'Read';
+         Roo.select('.rss-list-article-' +id).addClass('rss-list-article-read-status-1');
+         
+         Roo.select('.rss-list-article-' +id +
+                    ' .count').show();
+         
+         Roo.select('.rss-list-article-' +id +
+                    ' .count').first().dom.innerHTML =  'Read';
      
-             Roo.select('.rss-list-article-' +id +
-                        ' .chevron').first().hide();
-             
-            
+         Roo.select('.rss-list-article-' +id +
+                    ' .chevron').first().hide();
+         
+        
              //Roo.select('header h2').first().dom.innerHTML = this.feed_title + ' - ' +
              //        art.select('.rss-title').first().dom.innerH
      },