1 |
d2a8c3fd
|
Marc NICOLAS
|
|
2 |
|
|
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
Ext.namespace('sitools.public.feedsReader');
|
21 |
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
Ext.define('sitools.public.feedsReader.FeedGridFlux', {
|
29 |
|
|
extend : 'Ext.panel.Panel',
|
30 |
|
|
alias : 'widget.appfeedgridflux',
|
31 |
|
|
componentType : "feeds",
|
32 |
|
|
border : false,
|
33 |
|
|
bodyBorder : false,
|
34 |
|
|
|
35 |
|
|
requires : ['sitools.public.feedsReader.AtomFeedReader',
|
36 |
|
|
'sitools.public.feedsReader.RssFeedReader',
|
37 |
|
|
'sitools.public.feedsReader.FeedItemDetails',
|
38 |
|
|
],
|
39 |
|
|
|
40 |
|
|
initComponent : function () {
|
41 |
|
|
|
42 |
|
|
this.layout = "fit";
|
43 |
|
|
|
44 |
|
|
var gridPanel;
|
45 |
|
|
if (this.feedSource !== undefined && this.feedSource === "OPENSEARCH") {
|
46 |
|
|
gridPanel = Ext.create('sitools.user.view.component.datasets.opensearch.OpensearchResultFeedView', this);
|
47 |
|
|
} else {
|
48 |
|
|
|
49 |
|
|
if (this.feedType !== undefined && this.feedType === "atom_1.0") {
|
50 |
|
|
gridPanel = Ext.create('sitools.public.feedsReader.AtomFeedReader', {
|
51 |
|
|
feedGrid : this
|
52 |
|
|
});
|
53 |
|
|
} else {
|
54 |
|
|
gridPanel = Ext.create('sitools.public.feedsReader.RssFeedReader', {
|
55 |
|
|
feedGrid : this
|
56 |
|
|
});
|
57 |
|
|
}
|
58 |
|
|
}
|
59 |
|
|
|
60 |
|
|
this.btnSubscribeRss = Ext.create('Ext.button.Button', {
|
61 |
|
|
text : i18n.get('label.subscribeRss'),
|
62 |
|
|
|
63 |
|
|
cls : 'x-custom-button-color',
|
64 |
|
|
icon : loadUrl.get('APP_URL') + '/client-public/common/res/images/icons/rss.png',
|
65 |
|
|
handler : this.subscribeRss
|
66 |
|
|
});
|
67 |
|
|
|
68 |
|
|
this.bbar = {
|
69 |
|
|
xtype : 'toolbar',
|
70 |
|
|
cls : "services-toolbar",
|
71 |
|
|
defaults : {
|
72 |
|
|
scope : this
|
73 |
|
|
},
|
74 |
|
|
items : [ this.btnSubscribeRss ]
|
75 |
|
|
};
|
76 |
|
|
|
77 |
|
|
this.items = [ gridPanel ];
|
78 |
|
|
|
79 |
|
|
this.callParent(arguments);
|
80 |
|
|
},
|
81 |
|
|
|
82 |
|
|
clickOnRow : function (self, rowIndex, e) {
|
83 |
|
|
e.stopEvent();
|
84 |
|
|
var rec = self.store.getAt(rowIndex);
|
85 |
|
|
if (Ext.isEmpty(rec)) {
|
86 |
|
|
return;
|
87 |
|
|
}
|
88 |
|
|
|
89 |
|
|
if (Ext.isEmpty(window) || Ext.isEmpty(window.SitoolsDesk)) {
|
90 |
|
|
|
91 |
|
|
var component = Ext.create('sitools.public.feedsReader.FeedItemDetails', {
|
92 |
|
|
record : rec
|
93 |
|
|
});
|
94 |
|
|
|
95 |
|
|
var win = Ext.create('Ext.window.Window', {
|
96 |
|
|
stateful : false,
|
97 |
|
|
title : i18n.get('label.viewFeedDetail'),
|
98 |
|
|
width : 400,
|
99 |
|
|
height : 600,
|
100 |
|
|
shim : false,
|
101 |
|
|
animCollapse : false,
|
102 |
|
|
constrainHeader : true,
|
103 |
|
|
layout : 'fit',
|
104 |
|
|
modal : true
|
105 |
|
|
});
|
106 |
|
|
win.add(component);
|
107 |
|
|
win.show();
|
108 |
|
|
} else {
|
109 |
|
|
var componentCfg = {
|
110 |
|
|
record : rec
|
111 |
|
|
};
|
112 |
|
|
var jsObj = sitools.public.feedsReader.FeedItemDetails;
|
113 |
|
|
|
114 |
|
|
var windowConfig = {
|
115 |
|
|
id : "viewFeedDetail",
|
116 |
|
|
title : i18n.get('label.viewFeedDetail'),
|
117 |
|
|
saveToolbar : false
|
118 |
|
|
};
|
119 |
|
|
SitoolsDesk.addDesktopWindow(windowConfig, componentCfg, jsObj, true);
|
120 |
|
|
}
|
121 |
|
|
},
|
122 |
|
|
|
123 |
|
|
_getSettings : function () {
|
124 |
|
|
return {
|
125 |
|
|
objectName : "feedsReader"
|
126 |
|
|
};
|
127 |
|
|
},
|
128 |
|
|
|
129 |
|
|
subscribeRss : function () {
|
130 |
|
|
window.open(this.urlFeed, '_blank');
|
131 |
|
|
}
|
132 |
|
|
});
|