3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js">FeedViewer = {};
\r
10 Ext.onReady(function(){
\r
11 Ext.QuickTips.init();
\r
13 Ext.state.Manager.setProvider(new Ext.state.SessionProvider({state: Ext.appState}));
\r
15 var tpl = Ext.Template.from('preview-tpl', {
\r
17 getBody : function(v, all){
\r
18 return Ext.util.Format.stripScripts(v || all.description);
\r
21 FeedViewer.getTemplate = function(){
\r
25 var feeds = new FeedPanel();
\r
26 var mainPanel = new MainPanel();
\r
28 feeds.on('feedselect', function(feed){
\r
29 mainPanel.loadFeed(feed);
\r
32 var viewport = new Ext.Viewport({
\r
35 new Ext.BoxComponent({ // raw element
\r
45 // add some default feeds
\r
47 url:'http://feeds.feedburner.com/extblog',
\r
48 text: 'ExtJS.com Blog'
\r
52 url:'http://extjs.com/forum/external.php?type=RSS2',
\r
53 text: 'ExtJS.com Forums'
\r
57 url:'http://feeds.feedburner.com/ajaxian',
\r
61 Ext.get('header').on('click', function() {
\r
68 // This is a custom event handler passed to preview panels so link open in a new windw
\r
69 FeedViewer.LinkInterceptor = {
\r
70 render: function(p){
\r
72 'mousedown': function(e, t){ // try to intercept the easy way
\r
73 t.target = '_blank';
\r
75 'click': function(e, t){ // if they tab + enter a link, need to do it old fashioned way
\r
76 if(String(t.target).toLowerCase() != '_blank'){
\r
78 window.open(t.href);
\r