Mercurial > ambnews-firefox
comparison ambnews/content/ambnews.js @ 5:8cafc4c42c29
Changed page annotations from AmbNews/something to ambnews/something to match the way other paths are done, but it appears that page annotations are case-insensitive anyways, which is cool I guess.
| author | Atul Varma <varmaa@toolness.com> |
|---|---|
| date | Thu, 21 Aug 2008 17:46:17 -0700 |
| parents | f4b6208eadd5 |
| children | f07bf657f483 |
comparison
equal
deleted
inserted
replaced
| 4:f4b6208eadd5 | 5:8cafc4c42c29 |
|---|---|
| 36 }, | 36 }, |
| 37 __getXml: function AmbNews_getXml(url, callback) { | 37 __getXml: function AmbNews_getXml(url, callback) { |
| 38 var feedUrl = AmbNews.url(url); | 38 var feedUrl = AmbNews.url(url); |
| 39 var annSvc = AmbNews.__getAnnSvc(); | 39 var annSvc = AmbNews.__getAnnSvc(); |
| 40 | 40 |
| 41 if (annSvc.pageHasAnnotation(feedUrl, "AmbNews/feed-xml")) { | 41 if (annSvc.pageHasAnnotation(feedUrl, "ambnews/feed-xml")) { |
| 42 var xml = annSvc.getPageAnnotation(feedUrl, "AmbNews/feed-xml"); | 42 var xml = annSvc.getPageAnnotation(feedUrl, "ambnews/feed-xml"); |
| 43 // TODO: Perhaps re-enable this, but only let it live for a | 43 // TODO: Perhaps re-enable this, but only let it live for a |
| 44 // few minutes? | 44 // few minutes? |
| 45 //callback(xml); | 45 //callback(xml); |
| 46 //return; | 46 //return; |
| 47 } | 47 } |
| 52 var onRscFunc = function getXml_onReadyStateChange() { | 52 var onRscFunc = function getXml_onReadyStateChange() { |
| 53 if (request.readyState == 4) { | 53 if (request.readyState == 4) { |
| 54 if (request.status == 200) { | 54 if (request.status == 200) { |
| 55 if (request.responseText) { | 55 if (request.responseText) { |
| 56 annSvc.setPageAnnotation(feedUrl, | 56 annSvc.setPageAnnotation(feedUrl, |
| 57 "AmbNews/feed-xml", | 57 "ambnews/feed-xml", |
| 58 request.responseText, | 58 request.responseText, |
| 59 0, | 59 0, |
| 60 annSvc.EXPIRE_DAYS); | 60 annSvc.EXPIRE_DAYS); |
| 61 callback(request.responseText); | 61 callback(request.responseText); |
| 62 } else | 62 } else |
| 87 (aEvent.target.type == "application/rss+xml" || | 87 (aEvent.target.type == "application/rss+xml" || |
| 88 aEvent.target.type == "application/atom+xml")) { | 88 aEvent.target.type == "application/atom+xml")) { |
| 89 var annSvc = AmbNews.__getAnnSvc(); | 89 var annSvc = AmbNews.__getAnnSvc(); |
| 90 var page = AmbNews.url(aEvent.target.baseURI); | 90 var page = AmbNews.url(aEvent.target.baseURI); |
| 91 var feed = AmbNews.url(aEvent.target.href); | 91 var feed = AmbNews.url(aEvent.target.href); |
| 92 annSvc.setPageAnnotation(page, "AmbNews/feed", | 92 annSvc.setPageAnnotation(page, "ambnews/feed", |
| 93 feed.spec, 0, annSvc.EXPIRE_WEEKS); | 93 feed.spec, 0, annSvc.EXPIRE_WEEKS); |
| 94 } | 94 } |
| 95 }, | 95 }, |
| 96 onLoad: function AmbNews_onLoad(aEvent) { | 96 onLoad: function AmbNews_onLoad(aEvent) { |
| 97 if (aEvent.target.baseURI == "about:blank") { | 97 if (aEvent.target.baseURI == "about:blank") { |
