Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.1 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*!
  2. * Ext JS Library 3.3.1
  3. * Copyright(c) 2006-2010 Sencha Inc.
  4. * licensing@sencha.com
  5. * http://www.sencha.com/license
  6. */
  7. FeedViewer = {};
  8. Ext.onReady(function(){
  9. Ext.QuickTips.init();
  10. Ext.state.Manager.setProvider(new Ext.state.SessionProvider({state: Ext.appState}));
  11. var tpl = Ext.Template.from('preview-tpl', {
  12. compiled:true,
  13. getBody : function(v, all){
  14. return Ext.util.Format.stripScripts(v || all.description);
  15. }
  16. });
  17. FeedViewer.getTemplate = function(){
  18. return tpl;
  19. }
  20. var feeds = new FeedPanel();
  21. var mainPanel = new MainPanel();
  22. feeds.on('feedselect', function(feed){
  23. mainPanel.loadFeed(feed);
  24. });
  25. var viewport = new Ext.Viewport({
  26. layout:'border',
  27. items:[
  28. new Ext.BoxComponent({ // raw element
  29. region:'north',
  30. el: 'header',
  31. height:32
  32. }),
  33. feeds,
  34. mainPanel
  35. ]
  36. });
  37. // add some default feeds
  38. feeds.addFeed({
  39. url:'http://feeds.feedburner.com/extblog',
  40. text: 'ExtJS.com Blog'
  41. }, false, true);
  42. feeds.addFeed({
  43. url:'http://extjs.com/forum/external.php?type=RSS2',
  44. text: 'ExtJS.com Forums'
  45. }, true);
  46. feeds.addFeed({
  47. url:'http://feeds.feedburner.com/ajaxian',
  48. text: 'Ajaxian'
  49. }, true);
  50. Ext.get('header').on('click', function() {
  51. viewport.focus();
  52. });
  53. feeds.focus();
  54. });
  55. // This is a custom event handler passed to preview panels so link open in a new windw
  56. FeedViewer.LinkInterceptor = {
  57. render: function(p){
  58. p.body.on({
  59. 'mousedown': function(e, t){ // try to intercept the easy way
  60. t.target = '_blank';
  61. },
  62. 'click': function(e, t){ // if they tab + enter a link, need to do it old fashioned way
  63. if(String(t.target).toLowerCase() != '_blank'){
  64. e.stopEvent();
  65. window.open(t.href);
  66. }
  67. },
  68. delegate:'a'
  69. });
  70. }
  71. };