X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/f5240829880f87e0cf581c6a296e436fdef0ef80..HEAD:/examples/key-feed-viewer/viewer/FeedWindow.js diff --git a/examples/key-feed-viewer/viewer/FeedWindow.js b/examples/key-feed-viewer/viewer/FeedWindow.js new file mode 100644 index 00000000..3aee858a --- /dev/null +++ b/examples/key-feed-viewer/viewer/FeedWindow.js @@ -0,0 +1,147 @@ +/* + +This file is part of Ext JS 4 + +Copyright (c) 2011 Sencha Inc + +Contact: http://www.sencha.com/contact + +GNU General Public License Usage +This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. + +If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. + +*/ +/** + * @class FeedViewer.FeedWindow + * @extends Ext.window.Window + * + * Shows a dialog for creating and validating a new feed. + * + * @constructor + * Create a new Feed Window + * @param {Object} config The config object + */ + +Ext.define('FeedViewer.FeedWindow', { + extend: 'Ext.window.Window', + + alias: 'widget.feedwindow', + + plain: true, + + defaultFeeds: [ + ['http://rss.cnn.com/rss/edition.rss', 'CNN Top Stories'], + ['http://sports.espn.go.com/espn/rss/news', 'ESPN Top News'], + ['http://news.google.com/news?ned=us&topic=t&output=rss', 'Sci/Tech - Google News'], + ['http://rss.news.yahoo.com/rss/software', 'Yahoo Software News'] + ], + + initComponent: function(){ + this.addEvents( + /** + * @event feedvalid + * @param {FeedViewer.FeedWindow} this + * @param {String} title + * @param {String} url + * @param {String} description + */ + 'feedvalid' + ); + + this.form = Ext.create('widget.form', { + bodyPadding: '12 10 10', + border: false, + unstyled: true, + items: [{ + anchor: '100%', + itemId: 'feed', + fieldLabel: 'Enter the URL of the feed to add', + labelAlign: 'top', + msgTarget: 'under', + xtype: 'combo', + store: this.defaultFeeds, + getInnerTpl: function(){ + return '