Updated cordova.android.js for CB-1950 - InAppBrowser events

This commit is contained in:
Shazron Abdullah 2012-11-30 05:47:37 -08:00
parent 432aec62a9
commit 00e5ff1964
2 changed files with 346 additions and 366 deletions

View File

@ -1,6 +1,6 @@
// commit 54335c8f70223b053f4c039185d13cb95801d043 // commit 832eb92dbc908e9544bed202878906fba49667c7
// File generated at :: Mon Nov 26 2012 16:05:15 GMT-0500 (EST) // File generated at :: Fri Nov 30 2012 05:23:45 GMT-0800 (PST)
/* /*
Licensed to the Apache Software Foundation (ASF) under one Licensed to the Apache Software Foundation (ASF) under one
@ -3323,18 +3323,55 @@ define("cordova/plugin/InAppBrowser", function(require, exports, module) {
var exec = require('cordova/exec'); var exec = require('cordova/exec');
var InAppBrowser = { function InAppBrowser()
open : function(strUrl, strWindowName, strWindowFeatures) { {
exec(null, null, "InAppBrowser", "open", [strUrl, strWindowName, strWindowFeatures]); var _channel = require('cordova/channel');
return InAppBrowser; this.channels = {
}, 'loadstart': _channel.create('loadstart'),
close : function() { 'loadstop' : _channel.create('loadstop'),
exec(null, null, "InAppBrowser", "close", []); 'exit' : _channel.create('exit')
};
}
InAppBrowser.prototype._eventHandler = function(event)
{
if (event.type in this.channels) {
this.channels[event.type].fire(event);
} }
}; }
InAppBrowser.open = function(strUrl, strWindowName, strWindowFeatures)
{
var iab = new InAppBrowser();
var cb = function(eventname) {
iab._eventHandler(eventname);
}
exec(cb, null, "InAppBrowser", "open", [strUrl, strWindowName, strWindowFeatures]);
return iab;
}
InAppBrowser.prototype.close = function(eventname, f)
{
exec(null, null, "InAppBrowser", "close", []);
}
InAppBrowser.prototype.addEventListener = function(eventname, f)
{
if (eventname in this.channels) {
this.channels[eventname].subscribe(f);
}
}
InAppBrowser.prototype.removeEventListener = function(eventname, f)
{
if (eventname in this.channels) {
this.channels[eventname].unsubscribe(f);
}
}
module.exports = InAppBrowser.open; module.exports = InAppBrowser.open;
}); });
// file: lib/common/plugin/LocalFileSystem.js // file: lib/common/plugin/LocalFileSystem.js

File diff suppressed because it is too large Load Diff