CB-10636 Add JSHint for plugins

This commit is contained in:
daserge
2016-02-19 15:39:28 +03:00
parent 555d55ac8a
commit ea1253963b
12 changed files with 83 additions and 48 deletions
+14 -10
View File
@@ -19,10 +19,7 @@
*
*/
var cordova = require('cordova'),
channel = require('cordova/channel'),
modulemapper = require('cordova/modulemapper'),
urlutil = require('cordova/urlutil');
var modulemapper = require('cordova/modulemapper');
var browserWrap,
popup,
@@ -69,8 +66,7 @@ var IAB = {
open: function (win, lose, args) {
var strUrl = args[0],
target = args[1],
features = args[2],
url;
features = args[2];
if (target === "_self" || !target) {
window.location = strUrl;
@@ -193,7 +189,9 @@ var IAB = {
if (browserWrap && popup) {
try {
popup.contentWindow.eval(code);
hasCallback && win([]);
if (hasCallback) {
win([]);
}
} catch(e) {
console.error('Error occured while trying to injectScriptCode: ' + JSON.stringify(e));
}
@@ -203,19 +201,25 @@ var IAB = {
injectScriptFile: function (win, fail, args) {
var msg = 'Browser cordova-plugin-inappbrowser injectScriptFile is not yet implemented';
console.warn(msg);
fail && fail(msg);
if (fail) {
fail(msg);
}
},
injectStyleCode: function (win, fail, args) {
var msg = 'Browser cordova-plugin-inappbrowser injectStyleCode is not yet implemented';
console.warn(msg);
fail && fail(msg);
if (fail) {
fail(msg);
}
},
injectStyleFile: function (win, fail, args) {
var msg = 'Browser cordova-plugin-inappbrowser injectStyleFile is not yet implemented';
console.warn(msg);
fail && fail(msg);
if (fail) {
fail(msg);
}
}
};