home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 March / PCWorld_2005-03_cd.bin / komunikace / kmeleon / kmeleon09.exe / aggreg8.jar / content / aggreg8.js < prev    next >
Text File  |  2004-11-30  |  3KB  |  121 lines

  1. // namespaces, just in case
  2. const XLinkNS = "http://www.w3.org/1999/xlink";
  3. const XULNS   = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
  4. const XMLNS   = "http://www.w3.org/XML/1998/namespace";
  5. const XHTMLNS = "http://www.w3.org/1999/xhtml";
  6.  
  7. const USER_AGENT = "Aggreg8 RSS aggregator";
  8.  
  9. const RESULT_OK = 0;
  10. const RESULT_PARSE_ERROR = 1;
  11. const RESULT_NOT_RSS = 2;
  12. const RESULT_NOT_FOUND = 3;
  13. const RESULT_NOT_AVAILABLE = 4;
  14. const RESULT_ERROR_FAILURE = 5;
  15.  
  16. var resultStrArray = null;
  17.  
  18. // XUL Object
  19. var strRes // stringbundle Object
  20. var bookmarksTree;
  21. var rssItemListBox;
  22. var rssStatusDeck;
  23. var rssStatusImage;
  24. var rssStatusLabel;
  25. var rssTitleLabel;
  26. var rssItemListPopup;
  27.  
  28. var rssObject;
  29. var httpReq;
  30. var prefObserverRssReaderFolder;
  31. var responseXML;
  32. var lastResource;
  33. var rssLoading = false;
  34. var rssReaderFolderID = "";
  35. var enableTooltip = true;
  36. var popupTimeoutId=0;
  37.  
  38. function onLoad(){
  39.     //refreshDisplaytree();    
  40.     return true;
  41. }
  42.  
  43. function onLoadDisplay()  {
  44.     //refreshDisplaytreefromframe();        
  45.     return true;
  46. }
  47.  
  48.  
  49.  
  50. function switchRSSFeedDisplay()
  51. {
  52.  
  53.     
  54.     var exTree = document.getElementById( "rssfeed-tree" );
  55.     var selectedItem = exTree.contentView.getItemAtIndex(exTree.currentIndex);
  56.     
  57.     aggreg8dump("Switching content in Main Window");
  58.     
  59.     
  60.     if(selectedItem.firstChild.firstChild.getAttribute("_type")=="feeds")
  61.     {
  62.     var newURL = selectedItem.firstChild.firstChild.getAttribute("url");
  63.     aggreg8dump("Found URL");
  64.     document.getElementById( "rss-feed-text-description" ).setAttribute( "src", "" );
  65.     aggreg8dump("Downloading Feed");
  66.     var progress_meter = document.getElementById( "progress-meter" );
  67.     aggreg8dump("progress meter found");
  68.     progress_meter.setAttribute( "value", "0%");
  69.     progress_meter.setAttribute( "mode", "undetermined");    
  70.     
  71.     aggreg8dump("observe_isloaded :" + newURL + " : start");
  72.     httpGet(newURL);
  73.     aggreg8dump("Loaded :" + newURL + " : start");
  74.     //must fix the progress meter
  75.     //delete all the contsants that are not needed
  76.     //observe_isloaded(newURL);
  77.     }//end if statement
  78.     else
  79.     {
  80.  
  81.     }
  82.     
  83.     
  84. }
  85.  
  86.  
  87. function doAbout() {
  88.  
  89.     window.open('chrome://aggreg8/content/about.xul','aboutaggreg8','chrome,resizable,width=700,height=550,screenX=50,screenY=50'); 
  90.  
  91. }
  92.  
  93.  
  94. function refreshdisplay(frame) {
  95.     var ibrowser =  document.getElementById(frame);
  96.     ibrowser.reloadWithFlags("LOAD_FLAGS_BYPASS_CACHE");
  97. }
  98.  
  99. function showrss()
  100. {
  101.  
  102. //document.getElementById( "rss-frame" ).setAttribute( "maxheight","100");
  103. try{
  104.  
  105.     var exTree = document.getElementById( "rssfeed-tree" );
  106.     var selectedItem = exTree.contentView.getItemAtIndex(exTree.currentIndex);
  107.  
  108.     
  109.     var newURL = selectedItem.firstChild.firstChild.getAttribute("url");
  110.  
  111.     document.getElementById( "rss-feed-text-description" ).setAttribute( "src", newURL );
  112.  
  113. }catch(e)
  114.     {
  115.         aggreg8dump(e);
  116.     }
  117.  
  118.  
  119.  
  120. }
  121.