7c1ef120f98eed12e5d8377536b127b64e41591f
[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   "b78a3223503896721cca1303f776159b" : "Title",
12   "b7436cc90ecf26f15baeead978f09040" : "name of feed",
13   "83ca9a18d9507324a9453c92a7420dd2" : "Report Issue",
14   "eae639a70006feff484a39363c977e24" : "Domain",
15   "44749712dbec183e983dcd78a7736c41" : "Date"
16  },
17  "items" : [
18   {
19    "xtype" : "Body",
20    "$ xns" : "Roo.bootstrap",
21    "items" : [
22     {
23      "String tag" : "div",
24      "xtype" : "Element",
25      "$ xns" : "Roo.bootstrap",
26      "String html" : "name of feed",
27      "String style" : "font-weight: bold;\nfont-size: 22px;\n \nposition: absolute;\nleft: 100px;\ntop: 10px;\nz-Index: 1000;\ncolor: white;"
28     },
29     {
30      "$ String brand_href" : "baseURL + '/Feeds'",
31      "String position" : "fixed-top",
32      "xtype" : "NavHeaderbar",
33      "Boolean inverse" : true,
34      "String brand" : "<i class=\"fa fa-chevron-left\"></i> Feeds",
35      "$ xns" : "Roo.bootstrap",
36      "items" : [
37       {
38        "xtype" : "NavGroup",
39        "String align" : "right",
40        "$ xns" : "Roo.bootstrap",
41        "items" : [
42         {
43          "xtype" : "NavItem",
44          "$ xns" : "Roo.bootstrap",
45          "String html" : "Mark All Read"
46         },
47         {
48          "xtype" : "NavItem",
49          "$ xns" : "Roo.bootstrap",
50          "String html" : "Show Previously Read "
51         },
52         {
53          "xtype" : "NavItem",
54          "$ xns" : "Roo.bootstrap",
55          "String html" : "Report Issue"
56         }
57        ]
58       }
59      ]
60     },
61     {
62      "listeners" : {
63       "render" : "function (_self)\n{\n    _this.table = this;\n    this.store.load({});\n}",
64       "rowclick" : "function (_self, el, rowIndex, e)\n{\n    //var rec = this.store.getAt(rowIndex);\n    Roo.log(rec);\n    _this.articleCtr.load(rowIndex);\n}"
65      },
66      "boolean striped" : true,
67      "boolean hover" : true,
68      "boolean responsive" : true,
69      "xtype" : "Table",
70      "Boolean thead" : false,
71      "$ xns" : "Roo.bootstrap",
72      "String style" : "margin-top:50px",
73      "Boolean RowSelection" : true,
74      "items" : [
75       {
76        "listeners" : {
77         "beforeload" : "function (_self, o)\n{\n    o.params = o.params || {};\n    o.params.feed = 83;\n}"
78        },
79        "xtype" : "Store",
80        "boolean remoteSort" : true,
81        "$ xns" : "Roo.data",
82        "* prop" : "store",
83        "items" : [
84         {
85          "xtype" : "HttpProxy",
86          "$ xns" : "Roo.data",
87          "String method" : "GET",
88          "* prop" : "proxy",
89          "$ String url" : "baseURL + '/Api/Reader_read'"
90         },
91         {
92          "$ 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    ",
93          "xtype" : "JsonReader",
94          "$ xns" : "Roo.data",
95          "* prop" : "reader"
96         }
97        ]
98       },
99       {
100        "String dataIndex" : "article_id_headline",
101        "$ 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 }",
102        "xtype" : "ColumnModel",
103        "$ xns" : "Roo.grid",
104        "* prop" : "cm[]"
105       }
106      ]
107     },
108     {
109      "listeners" : {
110       "render" : "function (_self)\n{\n  _this.articleCtr = this;\n}"
111      },
112      "xtype" : "Element",
113      "| 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.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            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(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            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}",
114      "$ xns" : "Roo.bootstrap",
115      "Boolean hidden" : false,
116      "items" : [
117       {
118        "String tag" : "ol",
119        "String cls" : "breadcrumb",
120        "xtype" : "Element",
121        "$ xns" : "Roo.bootstrap",
122        "items" : [
123         {
124          "listeners" : {
125           "render" : "function (_self)\n{\n  _this.articleDate  = this;\n}"
126          },
127          "String tag" : "li",
128          "xtype" : "Element",
129          "$ xns" : "Roo.bootstrap",
130          "String html" : "Date"
131         },
132         {
133          "listeners" : {
134           "render" : "function (_self)\n{\n  _this.articleURL  = this;\n}"
135          },
136          "String tag" : "li",
137          "xtype" : "Element",
138          "$ xns" : "Roo.bootstrap",
139          "String html" : "Domain"
140         },
141         {
142          "listeners" : {
143           "render" : "function (_self)\n{\n_this.articleTitle = this;\n}"
144          },
145          "String tag" : "li",
146          "String cls" : "active",
147          "xtype" : "Element",
148          "$ xns" : "Roo.bootstrap",
149          "String html" : "Title"
150         }
151        ]
152       },
153       {
154        "listeners" : {
155         "render" : "function (_self)\n{\n  _this.articleBody = this;\n}"
156        },
157        "xtype" : "Container",
158        "$ xns" : "Roo.bootstrap"
159       }
160      ]
161     }
162    ]
163   }
164  ]
165 }