Symbian.org/FeedUpdateBroker.js
author ivanl
Wed, 29 Jul 2009 10:14:37 +0100
changeset 15 5e64ec5b1dfe
parent 13 3a1db8573f1e
child 16 6544cc5386ce
permissions -rw-r--r--
1.0rc11 Fixes feed parsing problems Cleanup of dead code
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
     1
///////////////////////////////////////////////////////////////////////////////
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
     2
// The FeedUpdateBroker class implements a simple RSS fetcher and parser.
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
     3
// Adapted from WRTKit RssReader example
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
     4
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
     5
// Constructor.
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
     6
function FeedUpdateBroker() {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
     7
    this.httpReq = null;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
     8
    this.feedAddress = null;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
     9
    this.callback = null;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    10
	this.ignoreContent = false;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    11
	this.cancelled = false;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    12
	this.responseParser = this.handleRssResponse;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    13
	this.startFromItem = 0;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    14
	this.maxItems = 0;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    15
}
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    16
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    17
// Fetches a feed from the specified URL and calls the callback when the feed
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    18
// has been fetched and parsed, or if the process results in an error.
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    19
FeedUpdateBroker.prototype.doFetchFeed = function(){    
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    20
    // create new XML HTTP request
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    21
    this.httpReq = new Ajax();
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    22
    
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    23
    // set callback
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    24
    var self = this;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    25
    this.httpReq.onreadystatechange = function() { self.readyStateChanged(); };
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    26
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    27
    // initiate the request
3
9cbe91927e89 Fix for auto-update caching problem
ivanl
parents: 0
diff changeset
    28
    this.httpReq.open("GET", nocache(this.feedAddress), true);
0
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    29
    this.httpReq.send(null);
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    30
}
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    31
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    32
// has been fetched and parsed, or if the process results in an error.
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    33
FeedUpdateBroker.prototype.fetchFeed = function(feedURL, callback) {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    34
    // remember callback
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    35
    this.callback = callback;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    36
    this.feedAddress = feedURL;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    37
	this.doFetchFeed();
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    38
}
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    39
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    40
// Callback for ready-state change events in the XML HTTP request.
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    41
FeedUpdateBroker.prototype.readyStateChanged = function() {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    42
    // complete request?
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    43
    if (this.httpReq.readyState == 4) {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    44
        // attempt to get response status
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    45
        var responseStatus = null;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    46
        try {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    47
            responseStatus = this.httpReq.status;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    48
        } catch (noStatusException) {}
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    49
        
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    50
		// are we being prompted for login?
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    51
		var text = this.httpReq.responseText;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    52
		if ( isLoginPrompt (text) ) {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    53
			var self = this;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    54
			login(function(){self.doFetchFeed();});
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    55
			return;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    56
		}
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    57
		
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    58
        // handle the response and call the registered callback object
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    59
		var response = this.httpReq.responseXML;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    60
		if (response == null) {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    61
			// if the content type is not set correctly, we get the response as text
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    62
			var xmlparser = new DOMParser();
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    63
		    response = xmlparser.parseFromString(this.httpReq.responseText, "text/xml");
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    64
		}
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    65
        this.callback.feedUpdateCompleted(this.handleResponse(responseStatus, response));
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    66
    }
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    67
}
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    68
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    69
// Handles a completed response.
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    70
FeedUpdateBroker.prototype.handleResponse = function(responseStatus, xmlDoc){
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    71
	if (this.responseParser == null) {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    72
		return this.handleRssResponse(responseStatus, xmlDoc);
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    73
	}
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    74
	else {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    75
		return this.responseParser.call(this, this, responseStatus, xmlDoc);
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    76
	}	
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    77
}
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    78
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    79
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    80
FeedUpdateBroker.prototype.handleRssResponse = function(broker, responseStatus, xmlDoc){
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    81
	if ( this.cancelled ) {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    82
        return { status: "cancelled" };
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    83
	}
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    84
    if (responseStatus == 200 && xmlDoc != null) {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    85
        // node ref for iterating
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    86
        var node;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    87
        
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    88
        // get last modified time - default to current time
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    89
        var lastModified = new Date().getTime();
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    90
        var channelElements = xmlDoc.getElementsByTagName("channel");
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    91
        if (channelElements.length > 0) {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    92
            node = channelElements[0].firstChild;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    93
            while (node != null) {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    94
                if (node.nodeType == Node.ELEMENT_NODE) {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    95
                    if (node.nodeName == "pubDate" ||
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    96
                            node.nodeName == "lastBuildDate" ||
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    97
                            node.nodeName == "dc:date") {
13
3a1db8573f1e cleanup
ivanl
parents: 10
diff changeset
    98
                        lastModified = getTextOfNode(node);
0
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
    99
                        break;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   100
                    }
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   101
                }
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   102
                node = node.nextSibling;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   103
            }
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   104
        }
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   105
        
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   106
        // init feed items array
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   107
        var items = [];
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   108
        
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   109
        // we got the feed XML so now we'll parse it
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   110
        var itemElements = xmlDoc.getElementsByTagName("item");
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   111
		
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   112
        for (var i = this.startFromItem; i < itemElements.length; i++) {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   113
			if ( this.maxItems > 0 && this.maxItems < i ) {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   114
				break;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   115
			}
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   116
            // iterate through child nodes of this item and gather
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   117
            // all the data we need for a feed item
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   118
            var title = null;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   119
            var date = null;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   120
            var description = null;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   121
            var url = null;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   122
            var author = null;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   123
            node = itemElements[i].firstChild;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   124
            while (node != null) {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   125
                if (node.nodeType == Node.ELEMENT_NODE) {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   126
                    if (node.nodeName == "title") {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   127
                        // item title
13
3a1db8573f1e cleanup
ivanl
parents: 10
diff changeset
   128
                        title = getTextOfNode(node);
0
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   129
                    } else if (node.nodeName == "pubDate" || node.nodeName == "dc:date") {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   130
                        // item publishing date
13
3a1db8573f1e cleanup
ivanl
parents: 10
diff changeset
   131
                        date = getTextOfNode(node);
0
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   132
                    } else if (node.nodeName == "description" && !this.ignoreContent ) {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   133
                        // item description
13
3a1db8573f1e cleanup
ivanl
parents: 10
diff changeset
   134
                        description = getTextOfNode(node);
0
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   135
                    } else if (node.nodeName == "link") {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   136
                        // link URL
13
3a1db8573f1e cleanup
ivanl
parents: 10
diff changeset
   137
                        url = getTextOfNode(node);
0
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   138
                    } else if (node.nodeName == "dc:creator" ) {
13
3a1db8573f1e cleanup
ivanl
parents: 10
diff changeset
   139
						author = getTextOfNode(node);
0
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   140
					}
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   141
                }
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   142
                node = node.nextSibling;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   143
            }
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   144
            
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   145
            // create the item and add to the items array
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   146
            items.push({ title: title, date: date, description: description, url: url, author: author });
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   147
        }
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   148
        
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   149
        // update was completed successfully
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   150
        return { status: "ok", lastModified: lastModified, items: items };
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   151
    } else {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   152
        // update failed
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   153
        return { status: "error" };
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   154
    }
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   155
}
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   156
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   157
// Returns the text of a node.
13
3a1db8573f1e cleanup
ivanl
parents: 10
diff changeset
   158
function getTextOfNode(node) {
0
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   159
    var buf = "";
6
5e0dece09f96 1.0rc10
ivanl
parents: 4
diff changeset
   160
	// iterate through all child elements and collect all text to the buffer
5e0dece09f96 1.0rc10
ivanl
parents: 4
diff changeset
   161
	var child = node.firstChild;
5e0dece09f96 1.0rc10
ivanl
parents: 4
diff changeset
   162
	while (child != null) {
5e0dece09f96 1.0rc10
ivanl
parents: 4
diff changeset
   163
		if (child.nodeType == Node.TEXT_NODE || child.nodeType == Node.CDATA_SECTION_NODE) {
5e0dece09f96 1.0rc10
ivanl
parents: 4
diff changeset
   164
			// append text to buffer
5e0dece09f96 1.0rc10
ivanl
parents: 4
diff changeset
   165
			if (buf != "") {
5e0dece09f96 1.0rc10
ivanl
parents: 4
diff changeset
   166
				buf += " ";
5e0dece09f96 1.0rc10
ivanl
parents: 4
diff changeset
   167
			}
15
5e64ec5b1dfe 1.0rc11
ivanl
parents: 13
diff changeset
   168
			buf += child.nodeValue;
6
5e0dece09f96 1.0rc10
ivanl
parents: 4
diff changeset
   169
		}
5e0dece09f96 1.0rc10
ivanl
parents: 4
diff changeset
   170
		child = child.nextSibling;
5e0dece09f96 1.0rc10
ivanl
parents: 4
diff changeset
   171
	}
4
ivanl
parents: 3
diff changeset
   172
	
10
07ac2f6a36a9 1.0rc10 Fixes annoyances and buglets in reading forums and blog.
ivanl
parents: 6
diff changeset
   173
	return buf;
0
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   174
}
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   175
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   176
FeedUpdateBroker.prototype.cancel = function() {
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   177
	this.cancelled = true;
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   178
	this.httpReq.abort();
54498df70f5d Adding Symbian.org Widget 1.0rc3 source
ivanl
parents:
diff changeset
   179
}