X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..refs/heads/old:/examples/feed-viewer/FeedViewer.js?ds=inline diff --git a/examples/feed-viewer/FeedViewer.js b/examples/feed-viewer/FeedViewer.js index af41b63b..fdc07994 100644 --- a/examples/feed-viewer/FeedViewer.js +++ b/examples/feed-viewer/FeedViewer.js @@ -1,83 +1,83 @@ /*! - * Ext JS Library 3.1.1 - * Copyright(c) 2006-2010 Ext JS, LLC - * licensing@extjs.com - * http://www.extjs.com/license + * Ext JS Library 3.3.1 + * Copyright(c) 2006-2010 Sencha Inc. + * licensing@sencha.com + * http://www.sencha.com/license */ -FeedViewer = {}; - -Ext.onReady(function(){ - Ext.QuickTips.init(); - - Ext.state.Manager.setProvider(new Ext.state.SessionProvider({state: Ext.appState})); - - var tpl = Ext.Template.from('preview-tpl', { - compiled:true, - getBody : function(v, all){ - return Ext.util.Format.stripScripts(v || all.description); - } - }); - FeedViewer.getTemplate = function(){ - return tpl; - } - - var feeds = new FeedPanel(); - var mainPanel = new MainPanel(); - - feeds.on('feedselect', function(feed){ - mainPanel.loadFeed(feed); - }); - - var viewport = new Ext.Viewport({ - layout:'border', - items:[ - new Ext.BoxComponent({ // raw element - region:'north', - el: 'header', - height:32 - }), - feeds, - mainPanel - ] - }); - - // add some default feeds - feeds.addFeed({ - url:'http://feeds.feedburner.com/extblog', - text: 'ExtJS.com Blog' - }, false, true); - - feeds.addFeed({ - url:'http://extjs.com/forum/external.php?type=RSS2', - text: 'ExtJS.com Forums' - }, true); - - feeds.addFeed({ - url:'http://feeds.feedburner.com/ajaxian', - text: 'Ajaxian' - }, true); - - Ext.get('header').on('click', function() { - viewport.focus(); - }); - - feeds.focus(); -}); - -// This is a custom event handler passed to preview panels so link open in a new windw -FeedViewer.LinkInterceptor = { - render: function(p){ - p.body.on({ - 'mousedown': function(e, t){ // try to intercept the easy way - t.target = '_blank'; - }, - 'click': function(e, t){ // if they tab + enter a link, need to do it old fashioned way - if(String(t.target).toLowerCase() != '_blank'){ - e.stopEvent(); - window.open(t.href); - } - }, - delegate:'a' - }); - } +FeedViewer = {}; + +Ext.onReady(function(){ + Ext.QuickTips.init(); + + Ext.state.Manager.setProvider(new Ext.state.SessionProvider({state: Ext.appState})); + + var tpl = Ext.Template.from('preview-tpl', { + compiled:true, + getBody : function(v, all){ + return Ext.util.Format.stripScripts(v || all.description); + } + }); + FeedViewer.getTemplate = function(){ + return tpl; + } + + var feeds = new FeedPanel(); + var mainPanel = new MainPanel(); + + feeds.on('feedselect', function(feed){ + mainPanel.loadFeed(feed); + }); + + var viewport = new Ext.Viewport({ + layout:'border', + items:[ + new Ext.BoxComponent({ // raw element + region:'north', + el: 'header', + height:32 + }), + feeds, + mainPanel + ] + }); + + // add some default feeds + feeds.addFeed({ + url:'http://feeds.feedburner.com/extblog', + text: 'ExtJS.com Blog' + }, false, true); + + feeds.addFeed({ + url:'http://extjs.com/forum/external.php?type=RSS2', + text: 'ExtJS.com Forums' + }, true); + + feeds.addFeed({ + url:'http://feeds.feedburner.com/ajaxian', + text: 'Ajaxian' + }, true); + + Ext.get('header').on('click', function() { + viewport.focus(); + }); + + feeds.focus(); +}); + +// This is a custom event handler passed to preview panels so link open in a new windw +FeedViewer.LinkInterceptor = { + render: function(p){ + p.body.on({ + 'mousedown': function(e, t){ // try to intercept the easy way + t.target = '_blank'; + }, + 'click': function(e, t){ // if they tab + enter a link, need to do it old fashioned way + if(String(t.target).toLowerCase() != '_blank'){ + e.stopEvent(); + window.open(t.href); + } + }, + delegate:'a' + }); + } }; \ No newline at end of file