Reader/Feed.bjs
[web.Reader] / Reader / Feed.bjs
1 {
2  "name" : "Feed",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/web.Reader/Reader/Feed.bjs",
6  "permname" : "",
7  "modOrder" : "",
8  "strings" : {
9   "8287b137f969bcae66ca51f7abf14308" : "Show Previously Read ",
10   "d9cd9f7b44e0493c9604e9f8fb7a6c07" : "Mark All Read",
11   "b7436cc90ecf26f15baeead978f09040" : "name of feed",
12   "83ca9a18d9507324a9453c92a7420dd2" : "Report Issue"
13  },
14  "items" : [
15   {
16    "xtype" : "Body",
17    "$ xns" : "Roo.bootstrap",
18    "items" : [
19     {
20      "String tag" : "div",
21      "xtype" : "Element",
22      "$ xns" : "Roo.bootstrap",
23      "String html" : "name of feed",
24      "String style" : "font-weight: bold;\nfont-size: 22px;\n \nposition: absolute;\nleft: 100px;\ntop: 10px;\nz-Index: 1000;\ncolor: white;"
25     },
26     {
27      "$ String brand_href" : "baseURL + '/Feeds'",
28      "String position" : "fixed-top",
29      "xtype" : "NavHeaderbar",
30      "Boolean inverse" : true,
31      "String brand" : "<i class=\"fa fa-chevron-left\"></i> Feeds",
32      "$ xns" : "Roo.bootstrap",
33      "items" : [
34       {
35        "xtype" : "NavGroup",
36        "String align" : "right",
37        "$ xns" : "Roo.bootstrap",
38        "items" : [
39         {
40          "xtype" : "NavItem",
41          "$ xns" : "Roo.bootstrap",
42          "String html" : "Mark All Read"
43         },
44         {
45          "xtype" : "NavItem",
46          "$ xns" : "Roo.bootstrap",
47          "String html" : "Show Previously Read "
48         },
49         {
50          "xtype" : "NavItem",
51          "$ xns" : "Roo.bootstrap",
52          "String html" : "Report Issue"
53         }
54        ]
55       }
56      ]
57     },
58     {
59      "listeners" : {
60       "render" : "function (_self)\n{\n    _this.table = this;\n    this.store.load({});\n}",
61       "rowclick" : "function (_self, el, rowIndex, e)\n{\n    var rec = this.store.getAt(rowIndex);\n    Roo.log(rec);\n}"
62      },
63      "boolean striped" : true,
64      "boolean hover" : true,
65      "boolean responsive" : true,
66      "xtype" : "Table",
67      "Boolean thead" : false,
68      "$ xns" : "Roo.bootstrap",
69      "String style" : "margin-top:50px",
70      "Boolean RowSelection" : true,
71      "items" : [
72       {
73        "listeners" : {
74         "beforeload" : "function (_self, o)\n{\n    o.params = o.params || {};\n    o.params.feed = 83;\n}"
75        },
76        "xtype" : "Store",
77        "boolean remoteSort" : true,
78        "$ xns" : "Roo.data",
79        "* prop" : "store",
80        "items" : [
81         {
82          "xtype" : "HttpProxy",
83          "$ xns" : "Roo.data",
84          "String method" : "GET",
85          "* prop" : "proxy",
86          "$ String url" : "baseURL + '/Api/Reader_read'"
87         },
88         {
89          "$ Array fields" : "[\n        \"id\",\n            \"article_id\",\n            \"has_read\",\n            \"article_id_id\" ,\n            \"article_id_published_dt\" ,\n            \"article_id_headline\" ,\n            \"article_id_body\" ,\n            \"article_id_real_url\" ,\n            'article_id_body_txt'\n        ]\n    ",
90          "xtype" : "JsonReader",
91          "$ xns" : "Roo.data",
92          "* prop" : "reader"
93         }
94        ]
95       },
96       {
97        "String dataIndex" : "article_id_headline",
98        "$ Function renderer" : "function(v,x,r) {\n   \n   return String.format(\n            '<h3>{0}</h3><small>{1}</small><i class=\"rss-list-body\">{2}</i>' + \n                '{3}<i class=\"fa fa-chevron-right\"></i>',\n        r.data.article_id_headline,\n        r.data.article_id_published_dt,\n        r.data.article_id_body_txt,\n        r.data.has_read * 1 ? '<span class=\"badge\">Read</span>' : ''\n    );\n            \n \n }",
99        "xtype" : "ColumnModel",
100        "$ xns" : "Roo.grid",
101        "* prop" : "cm[]"
102       }
103      ]
104     },
105     {
106      "xtype" : "Container",
107      "| 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(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            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}",
108      "$ xns" : "Roo.bootstrap",
109      "Boolean hidden" : true
110     }
111    ]
112   }
113  ]
114 }