1eaee4df0028bd2ab54f1cc25a7917c82edfad9b
[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}"
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      "xtype" : "Element",
110      "| 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(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}",
111      "$ xns" : "Roo.bootstrap",
112      "Boolean hidden" : false,
113      "items" : [
114       {
115        "String tag" : "ol",
116        "String cls" : "breadcrumb",
117        "xtype" : "Element",
118        "$ xns" : "Roo.bootstrap",
119        "items" : [
120         {
121          "String tag" : "li",
122          "String cls" : "breadcrumb",
123          "xtype" : "Element",
124          "$ xns" : "Roo.bootstrap",
125          "String html" : "Date"
126         },
127         {
128          "String tag" : "li",
129          "String cls" : "breadcrumb",
130          "xtype" : "Element",
131          "$ xns" : "Roo.bootstrap",
132          "String html" : "Domain"
133         },
134         {
135          "String tag" : "li",
136          "String cls" : "breadcrumb",
137          "xtype" : "Element",
138          "$ xns" : "Roo.bootstrap",
139          "String html" : "Title"
140         }
141        ]
142       }
143      ]
144     }
145    ]
146   }
147  ]
148 }