You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2012/04/20 02:08:14 UTC
[6/7] git commit: jshint all of the code and fixed up the hint +
whitespace tasks in the jakefile
jshint all of the code and fixed up the hint + whitespace tasks in the jakefile
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/b8d02d50
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/b8d02d50
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/b8d02d50
Branch: refs/heads/master
Commit: b8d02d50bfb0ca7cb3ec97e570dccc073016728e
Parents: ef9d378
Author: Fil Maj <ma...@gmail.com>
Authored: Wed Apr 18 17:32:17 2012 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Thu Apr 19 16:38:51 2012 -0700
----------------------------------------------------------------------
.jshintrc | 141 +++++++++++++++
Jakefile | 68 +++-----
README.md | 97 ++++------
lib/android/exec.js | 3 +-
lib/android/platform.js | 6 +-
lib/android/plugin/android/app.js | 4 +-
lib/android/plugin/android/callback.js | 2 +-
lib/android/plugin/android/device.js | 2 +-
lib/android/plugin/android/notification.js | 2 +-
lib/android/plugin/android/polling.js | 2 +-
lib/android/plugin/android/storage.js | 2 +-
lib/blackberry/exec.js | 2 +-
lib/blackberry/platform.js | 2 +-
lib/blackberry/plugin/blackberry/Contact.js | 1 +
lib/blackberry/plugin/blackberry/ContactUtils.js | 6 +
lib/blackberry/plugin/blackberry/DirectoryEntry.js | 2 +-
lib/blackberry/plugin/blackberry/Entry.js | 1 +
lib/blackberry/plugin/blackberry/app.js | 2 +-
lib/blackberry/plugin/blackberry/contacts.js | 2 +-
lib/blackberry/plugin/blackberry/device.js | 2 +-
lib/blackberry/plugin/blackberry/manager.js | 2 +-
lib/blackberry/plugin/blackberry/notification.js | 2 +-
lib/common/builder.js | 2 +
lib/common/channel.js | 12 +-
lib/common/common.js | 2 +-
lib/common/exec.js | 2 +-
lib/common/platform.js | 2 +-
lib/common/plugin/Acceleration.js | 2 +-
lib/common/plugin/Camera.js | 4 +-
lib/common/plugin/CameraConstants.js | 2 +-
lib/common/plugin/CaptureAudioOptions.js | 2 +-
lib/common/plugin/CaptureError.js | 4 +-
lib/common/plugin/CaptureImageOptions.js | 2 +-
lib/common/plugin/CaptureVideoOptions.js | 2 +-
lib/common/plugin/CompassError.js | 2 +-
lib/common/plugin/CompassHeading.js | 2 +-
lib/common/plugin/ConfigurationData.js | 12 +-
lib/common/plugin/Connection.js | 2 +-
lib/common/plugin/Contact.js | 2 +-
lib/common/plugin/ContactAddress.js | 2 +-
lib/common/plugin/ContactError.js | 2 +-
lib/common/plugin/ContactField.js | 2 +-
lib/common/plugin/ContactFindOptions.js | 2 +-
lib/common/plugin/ContactName.js | 2 +-
lib/common/plugin/ContactOrganization.js | 2 +-
lib/common/plugin/Coordinates.js | 2 +-
lib/common/plugin/DirectoryEntry.js | 1 +
lib/common/plugin/DirectoryReader.js | 7 +-
lib/common/plugin/Entry.js | 2 +-
lib/common/plugin/File.js | 2 +-
lib/common/plugin/FileEntry.js | 2 +-
lib/common/plugin/FileError.js | 2 +-
lib/common/plugin/FileReader.js | 2 +-
lib/common/plugin/FileSystem.js | 2 +-
lib/common/plugin/FileTransfer.js | 6 +-
lib/common/plugin/FileTransferError.js | 2 +-
lib/common/plugin/FileUploadOptions.js | 2 +-
lib/common/plugin/FileUploadResult.js | 2 +-
lib/common/plugin/FileWriter.js | 2 +-
lib/common/plugin/Flags.js | 4 +-
lib/common/plugin/LocalFileSystem.js | 2 +-
lib/common/plugin/Media.js | 2 +-
lib/common/plugin/MediaError.js | 2 +-
lib/common/plugin/MediaFile.js | 6 +-
lib/common/plugin/MediaFileData.js | 2 +-
lib/common/plugin/Metadata.js | 4 +-
lib/common/plugin/Position.js | 2 +-
lib/common/plugin/PositionError.js | 2 +-
lib/common/plugin/ProgressEvent.js | 2 +-
lib/common/plugin/accelerometer.js | 2 +-
lib/common/plugin/battery.js | 8 +-
lib/common/plugin/capture.js | 4 +-
lib/common/plugin/compass.js | 10 +-
lib/common/plugin/contacts.js | 2 +-
lib/common/plugin/geolocation.js | 4 +-
lib/common/plugin/network.js | 2 +-
lib/common/plugin/notification.js | 2 +-
lib/common/plugin/requestFileSystem.js | 2 +-
lib/common/plugin/resolveLocalFileSystemURI.js | 1 +
lib/common/utils.js | 16 +-
lib/cordova.js | 8 +-
lib/errgen/exec.js | 76 ++++----
lib/errgen/platform.js | 4 +-
lib/errgen/plugin/errgen/device.js | 6 +-
lib/ios/exec.js | 18 +-
lib/ios/platform.js | 4 +-
lib/ios/plugin/ios/Contact.js | 6 +-
lib/ios/plugin/ios/Entry.js | 4 +-
lib/ios/plugin/ios/FileReader.js | 4 +-
lib/ios/plugin/ios/console.js | 6 +-
lib/ios/plugin/ios/contacts.js | 6 +-
lib/ios/plugin/ios/device.js | 2 +-
lib/ios/plugin/ios/nativecomm.js | 2 +-
lib/ios/plugin/ios/notification.js | 2 +-
lib/playbook/exec.js | 2 +-
lib/playbook/platform.js | 2 +-
lib/playbook/plugin/playbook/device.js | 2 +-
lib/playbook/plugin/playbook/manager.js | 1 +
lib/scripts/bootstrap-errgen.js | 2 +-
lib/scripts/bootstrap-playbook.js | 2 +-
lib/scripts/bootstrap.js | 6 +-
lib/scripts/require.js | 2 +-
lib/test/exec.js | 2 +-
lib/webworks/plugin/webworks/manager.js | 2 +-
lib/wp7/exec.js | 38 ++--
lib/wp7/platform.js | 16 +-
lib/wp7/plugin/wp7/CordovaCommandResult.js | 18 +-
lib/wp7/plugin/wp7/CordovaMediaonStatus.js | 4 +-
lib/wp7/plugin/wp7/DOMStorage.js | 28 ++--
lib/wp7/plugin/wp7/XHRPatch.js | 12 +-
lib/wp7/plugin/wp7/console.js | 5 +-
lib/wp7/plugin/wp7/device.js | 2 +-
lib/wp7/plugin/wp7/resolveLocalFileSystemURI.js | 5 +-
package.json | 3 +-
114 files changed, 480 insertions(+), 362 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/.jshintrc
----------------------------------------------------------------------
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..551ffc6
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,141 @@
+// Defaults as of jshint edition 2011-04-16
+{
+ // If the scan should stop on first error.
+ "passfail": false,
+ // Maximum errors before stopping.
+ "maxerr": 50,
+
+
+ // Predefined globals
+ // If the standard browser globals should be predefined.
+ "browser": true,
+ // If the Node.js environment globals should be predefined.
+ "node": true,
+ // If the Rhino environment globals should be predefined.
+ "rhino": false,
+ // If CouchDB globals should be predefined.
+ "couch": false,
+ // If the Windows Scripting Host environment globals should be predefined.
+ "wsh": false,
+
+ // If jQuery globals should be predefined.
+ "jquery": false,
+ // If Prototype and Scriptaculous globals should be predefined.
+ "prototypejs": false,
+ // If MooTools globals should be predefined.
+ "mootools": false,
+ // If Dojo Toolkit globals should be predefined.
+ "dojo": false,
+
+ // Custom predefined globals.
+ "predef": ["jasmine", "blackberry", "define", "alert", "prompt", "org"],
+
+
+ // Development
+ // If debugger statements should be allowed.
+ "debug": false,
+ // If logging globals should be predefined (console, alert, etc.).
+ "devel": false,
+
+
+ // ECMAScript 5
+ // If ES5 syntax should be allowed.
+ "es5": false,
+ // Require the "use strict"; pragma.
+ "strict": false,
+ // If global "use strict"; should be allowed (also enables strict).
+ "globalstrict": false,
+
+
+ // The Good Parts
+ // If automatic semicolon insertion should be tolerated.
+ "asi": false,
+ // If line breaks should not be checked, e.g. `return [\n] x`.
+ "laxbreak": false,
+ // If bitwise operators (&, |, ^, etc.) should not be allowed.
+ "bitwise": false,
+ // If assignments inside if, for and while should be allowed. Usually
+ // conditions and loops are for comparison, not assignments.
+ "boss": true,
+ // If curly braces around all blocks should be required.
+ "curly": false,
+ // If === should be required.
+ "eqeqeq": false,
+ // If == null comparisons should be tolerated.
+ "eqnull": false,
+ // If eval should be allowed.
+ "evil": true,
+ // If ExpressionStatement should be allowed as Programs.
+ "expr": true,
+ // If `for in` loops must filter with `hasOwnPrototype`.
+ "forin": false,
+ // If immediate invocations must be wrapped in parens, e.g.
+ // `( function(){}() );`.
+ "immed": false,
+ // If use before define should not be tolerated.
+ "latedef": false,
+ // If functions should be allowed to be defined within loops.
+ "loopfunc": true,
+ // If arguments.caller and arguments.callee should be disallowed.
+ "noarg": false,
+ // If the . should not be allowed in regexp literals.
+ "regexp": false,
+ // If unescaped first/last dash (-) inside brackets should be tolerated.
+ "regexdash": false,
+ // If script-targeted URLs should be tolerated.
+ "scripturl": false,
+ // If variable shadowing should be tolerated.
+ "shadow": false,
+ // If `new function () { ... };` and `new Object;` should be tolerated.
+ "supernew": false,
+ // If variables should be declared before used.
+ "undef": true,
+ // If `this` inside a non-constructor function is valid.
+ "validthis": false,
+ // If smarttabs should be tolerated
+ // (http://www.emacswiki.org/emacs/SmartTabs).
+ "smarttabs": false,
+ // If the `__proto__` property should be allowed.
+ "proto": false,
+ // If one case switch statements should be allowed.
+ "onecase": false,
+ // If non-standard (but widely adopted) globals should be predefined.
+ "nonstandard": false,
+ // Allow multiline strings.
+ "multistr": false,
+ // If line breaks should not be checked around commas.
+ "laxcomma": false,
+ // If semicolons may be ommitted for the trailing statements inside of a
+ // one-line blocks.
+ "lastsemic": false,
+ // If the `__iterator__` property should be allowed.
+ "iterator": false,
+ // If only function scope should be used for scope tests.
+ "funcscope": false,
+ // If es.next specific syntax should be allowed.
+ "esnext": false,
+
+
+ // Style preferences
+ // If constructor names must be capitalized.
+ "newcap": false,
+ // If empty blocks should be disallowed.
+ "noempty": false,
+ // If using `new` for side-effects should be disallowed.
+ "nonew": false,
+ // If names should be checked for leading or trailing underscores
+ // (object._attribute would be disallowed).
+ "nomen": false,
+ // If only one var statement per function should be allowed.
+ "onevar": false,
+ // If increment and decrement (`++` and `--`) should not be allowed.
+ "plusplus": false,
+ // If all forms of subscript notation are tolerated.
+ "sub": false,
+ // If trailing whitespace rules apply.
+ "trailing": true,
+ // If strict whitespace rules apply.
+ "white": false,
+ // Specify indentation.
+ "indent": 4
+}
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/Jakefile
----------------------------------------------------------------------
diff --git a/Jakefile b/Jakefile
index 95431cc..f92064a 100644
--- a/Jakefile
+++ b/Jakefile
@@ -3,7 +3,6 @@ var util = require('util'),
fs = require('fs'),
childProcess = require('child_process'),
path = require("path"),
- hint = require('jshint'),
rexp_minified = new RegExp("\\.min\\.js$"),
rexp_src = new RegExp('\\.js$');
@@ -97,61 +96,46 @@ task('set-cwd', [], function() {
}
});
-// Taken shamelessly from Jakefile from https://github.com/marcenuc/sammy
desc('check sources with JSHint');
-task('hint', ['fixtabs'], function () {
- var JSHINT = require('jshint').JSHINT;
-
- function checkFile(file, cbDone) {
- fs.readFile(file, 'utf8', function (err, src) {
- if (err) throw err;
-
- var res = [],
- line;
-
- if (!JSHINT(src)) {
- res.push("\n" + file);
- JSHINT.errors.forEach(function (e) {
- if (e) {
- if (line !== e.line) {
- line = e.line;
- res.push(line + ": " + e.evidence);
- }
- res.push("\t" + e.reason);
- }
- });
- console.log(res.join('\n'));
- }
-
- cbDone();
+task('hint', ['fixwhitespace'], function () {
+ var knownWarnings = ["Redefinition of 'FileReader'", "Redefinition of 'require'", "Read only"];
+ var filterKnownWarnings = function(el, index, array) {
+ var wut = false;
+ knownWarnings.forEach(function(e) {
+ wut = wut && (el.indexOf(e) > -1);
});
- }
-
- forEachFile('lib', function (err, file, stats, cbDone) {
- if (err) throw err;
+ return wut;
+ };
- if (rexp_minified.test(file) || !rexp_src.test(file)) {
- cbDone();
- } else {
- checkFile(file, cbDone);
- }
- }, function() {
- checkFile('Jakefile', complete);
+ childProcess.exec("jshint lib",function(err,stdout,stderr) {
+ var exs = stdout.split('\n');
+ console.log(exs.filter(filterKnownWarnings).join('\n'));
+ complete();
});
}, true);
-desc('converts tabs to four spaces - enforcing style guide ftw!');
-task('fixtabs', function() {
+desc('converts tabs to four spaces, eliminates trailing white space, converts newlines to proper form - enforcing style guide ftw!');
+task('fixwhitespace', function() {
forEachFile('lib', function(err, file, stats, cbDone) {
- if (err) throw err;
+ //if (err) throw err;
if (rexp_minified.test(file) || !rexp_src.test(file)) {
cbDone();
} else {
var src = fs.readFileSync(file, 'utf8');
+
+ // tabs -> four spaces
if (src.indexOf('\t') >= 0) {
src = src.split('\t').join(' ');
- fs.writeFileSync(file, src, 'utf8');
}
+
+ // convert carriage return + line feed to just a line feed
+ src = src.replace(/\r\n/g, '\n');
+
+ // eliminate trailing white space
+ src = src.replace(/ +\n/g, '\n');
+
+ // write it out yo
+ fs.writeFileSync(file, src, 'utf8');
cbDone();
}
}, complete);
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index b8ca0dc..4c4b127 100644
--- a/README.md
+++ b/README.md
@@ -52,10 +52,10 @@ A unified JavaScript layer for [Apache Cordova](http://incubator.apache.org/proj
| |-<platform>/
| | Contains the platform-specific base modules.
| |
- | |-<platform>/plugin
+ | |-<platform>/plugin/<platform>
| | Contains the platform-specific plugin modules.
-The way the resulting `cordova.<platform>.js` files will be built is by combining the scripts in the `lib/scripts` directory with modules from the `lib/common` and `lib/<platform>` directories. For cases where there is the same named module in `lib/common` and `lib/<platform>`, the `lib/<platform>` version wins. For instance, every `lib/<platform>` includes an `exec.js`, and there is also a version in `lib/common`, so the `lib/<platform>` version will always be used. In fact, the `lib/common` one will throw errors, so if you build a new platform and forget `exec.js`, the resulting `cordova.<platform>.js` file will also throw errors.
+The way the resulting `cordova.<platform>.js` files will be built is by combining the scripts in the `lib/scripts` directory with modules from the `lib/common` and `lib/<platform>` directories. For cases where there is the same named module in `lib/common` and `lib/<platform>/plugin/<platform>`, the `lib/<platform>` version wins. For instance, every `lib/<platform>` includes an `exec.js`, and there is also a version in `lib/common`, so the `lib/<platform>` version will always be used. In fact, the `lib/common` one will throw errors, so if you build a new platform and forget `exec.js`, the resulting `cordova.<platform>.js` file will also throw errors.
# Building
@@ -65,19 +65,26 @@ Make sure you have [node.js](http://nodejs.org) installed. It should come pre-in
All of the build tasks can be run via the `jake` node module. Install it globally first by running:
- npm install -g jake
+ sudo npm install -g jake
+
+Every build also runs the scripts through [JSHint](). It is best
+installed globally:
+
+ sudo npm install -g jshint
Then from the repository root run:
jake
-This will run the `build` and `test` tasks by default. All of the available tasks are:
+This will run the `build`, `hint` and `test` tasks by default. All of the available tasks are:
- `build`: creates platform versions of cordova-js and builds them into
- the `pkg/` directory.
-- `test`: runs all of the unit tests inside node.
-- `btest`: creates a server so you can run the tests inside a browser.
+ the `pkg/` directory
+- `test`: runs all of the unit tests inside node
+- `btest`: creates a server so you can run the tests inside a browser
- `clean`: cleans out the `pkg/` directory
+- `hint`: runs all of the script files through JSHint
+- `fixtabs`: converts all tabs to four spaces within the script files
## Known Issues
@@ -118,6 +125,9 @@ Build the .js file and drop it in as a replacement for cordova.js.
### Supported Platforms
- Android
+- iOS
+- BlackBerry
+- Windows Phone 7 Mango
## Ripple
@@ -132,13 +142,14 @@ and then load the upacked extension in chrome in the pkg/chromium folder. Use th
# Adding a New Platform
-1. Write a module that encapsulates your platform's `exec` method and
- call it <platform>.js. The `exec` method is a JavaScript function
+1. Add your platform as a directory under the `lib` folder.
+2. Write a module that encapsulates your platform's `exec` method and
+ call it exec.js. The `exec` method is a JavaScript function
that enables communication from the platform's JavaScript environment
into the platform's native environment. Each platform uses a different
mechanism to enable this bridge. We recommend you check out the other
platform `exec` definitions for inspiration. Drop this into the
- `lib/exec` folder. The `exec` method has the following method
+ `lib/<platform>` folder you created in step 1. The `exec` method has the following method
signature: `function(success, fail, service, action, args)`, with the
following parameters:
- `success`: a success function callback
@@ -151,11 +162,12 @@ and then load the upacked extension in chrome in the pkg/chromium folder. Use th
by the `exec` call
It is required that new platform additions be as consistent as
possible with the existing `service` and `action` labels.
-2. Define your platform definition object and name it <platform>.js. Drop this into the `lib/platform` folder. This file should contain a JSON object with the following properties:
+2. Define your platform definition object and name it platform.js. Drop this into the `lib/<platform>` folder. This file should contain a JSON object with the following properties:
- `id`: a string representing the platform. This should be the same
name the .js file has
- `objects`: the property names defined as children of this property
- are injected into `window`. Each property can have the following
+ are injected into `window`, and also *overrides any existing
+ properties*. Each property can have the following
child properties:
- `path`: a string representing the module ID that will define
this object. For example, the file `lib/plugin/accelerometer.js`
@@ -164,6 +176,9 @@ and then load the upacked extension in chrome in the pkg/chromium folder. Use th
- `children`: in a recursive fashion, can have `path` and
`children` properties of its own that are defined as children of
the parent property object
+ - `merges`: similar to the above `objects` property, this one will
+ not clobber existing objects, instead it will recursively merge
+ this object into the specific target
- `initialize`: a function that fires immediately after the `objects` (see above) are defined in the global scope
The following is a simple example of a platform definition:
@@ -187,49 +202,17 @@ and then load the upacked extension in chrome in the pkg/chromium folder. Use th
}
</pre>
-3. You should probably add a `packager.bundle('<platform>')` call to the `Jakefile`.
+3. You should probably add a `packager.bundle('<platform>')` call to the `Jakefile` under the `build` task.
4. Make sure your native implementation executes the following JavaScript once all of the native side is initialized and ready: `require('cordova/channel').onNativeReady.fire()`.
-
-# Cordova-specific TODOs Before Final Integration
-
-- Add a section about authoring plugins for cordova.
-- Related to above, come up with a consistent sensor plugin API.
- Functions like `getCurrent<data>` and `watch<data>` can be abstracted
- into a nice plugin. Compass, Accel, Geo should all be basically the
- same implementation. For example, on Android geo + accel handle
- calling `start` (starting the listener) in the native code on its own.
- However, Compass requires that JS initiates a `start`. This is dumb.
-- Media (and other plugin) implementations across platforms need to use the established
- cordova/exec callback method (instead of triggering globally-accessible functions to
- dispatch listeners). On iOS, grep for "cast" in the native
- code - you'll see a bunch of invoked JavaScript from native, which
- shouldn't be there.
-- Media needs updates across all platforms. Methods need fixing with
- respect to timing: some methods use milliseconds, some use seconds.
- Some methods not documented (setVolume on Android). Consolidate /
- implement properly across platforms.
-- Normalize `Entry.toURL` return values. iOS returns `"file://localhost" +
- fullPath`, Android returns `"file://" + fullPath`, BlackBerry returns just `fullPath`
-- APIs that are not cross-platform - what
- to do with these?
- - Crypto on Android
- - SMS, telephony, splashscreen on iOS
-- Once-over all of the cordova-docs with the APIs defined in here to
- make sure all is consistent. There were function signature tweaks,
- undocumented procedures, etc.
-
-# TODO / Hacking / Contributing
-
-- implementations:
- - BlackBerry: button + app + contact + file + others (need to once-over)
- - all of Playbook
- - everything for WP7
- - everything for Bada
-- tests for channel, pretty much everything under lib/plugin
-- think about whether to select and load the platform specific modules at
- runtime or at buildtime. what about platform-specific overrides? can
- we at buildtime decide to include only the overrides (to save a few
- kb?). what about specifically denoting modules to include/exclude on a
- per-platform basis?
-- 3rd party plugins could be interesting. Need a little bit more thought about how these will fit into the system. I am thinking a package.json type file to handle per plugin.
-
+5. The deviceready event is important. To make sure that the stock
+ common JavaScript fires this event off, the device and network
+ connection plugins must successfully be instantiated and return
+ information about the connectivity and device information. The
+ success callbacks for these plugins should include calls to
+ `require('cordova/channel').onCordovaInfoReady.fire()` (for device
+ information) and
+ `require('cordova/channel').OnCordovaConnectionReady.fire()` (for
+ network information).
+6. Last but certainly not least: add yourself to the contributors list!
+ It's in the `package.json` file in the root of this repository. You
+ deserve it!
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/android/exec.js
----------------------------------------------------------------------
diff --git a/lib/android/exec.js b/lib/android/exec.js
index b3410bb..67f7f32 100644
--- a/lib/android/exec.js
+++ b/lib/android/exec.js
@@ -25,7 +25,8 @@ module.exports = function(success, fail, service, action, args) {
// If a result was returned
if (r.length > 0) {
- eval("var v="+r+";");
+ var v;
+ eval("v="+r+";");
// If status is OK, then return value back to caller
if (v.status === cordova.callbackStatus.OK) {
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/android/platform.js
----------------------------------------------------------------------
diff --git a/lib/android/platform.js b/lib/android/platform.js
index c393872..7c38206 100644
--- a/lib/android/platform.js
+++ b/lib/android/platform.js
@@ -68,7 +68,7 @@ module.exports = {
var db = null;
try {
db = originalOpenDatabase(name, version, desc, size);
- }
+ }
catch (ex) {
if (ex.code === 18) {
db = null;
@@ -83,7 +83,7 @@ module.exports = {
else {
return db;
}
-
+
};
}
@@ -141,4 +141,4 @@ module.exports = {
}
}
}
-};
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/android/plugin/android/app.js
----------------------------------------------------------------------
diff --git a/lib/android/plugin/android/app.js b/lib/android/plugin/android/app.js
index 1671f86..c0b9769 100644
--- a/lib/android/plugin/android/app.js
+++ b/lib/android/plugin/android/app.js
@@ -67,5 +67,5 @@ module.exports = {
*/
exitApp:function() {
return exec(null, null, "App", "exitApp", []);
- }
-};
+ }
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/android/plugin/android/callback.js
----------------------------------------------------------------------
diff --git a/lib/android/plugin/android/callback.js b/lib/android/plugin/android/callback.js
index d5768a7..d41a164 100644
--- a/lib/android/plugin/android/callback.js
+++ b/lib/android/plugin/android/callback.js
@@ -82,4 +82,4 @@ var port = null,
xmlhttp.send();
};
-module.exports = callback;
+module.exports = callback;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/android/plugin/android/device.js
----------------------------------------------------------------------
diff --git a/lib/android/plugin/android/device.js b/lib/android/plugin/android/device.js
index 7596d2a..fd30d50 100644
--- a/lib/android/plugin/android/device.js
+++ b/lib/android/plugin/android/device.js
@@ -90,4 +90,4 @@ Device.prototype.exitApp = function() {
navigator.app.exitApp();
};
-module.exports = new Device();
+module.exports = new Device();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/android/plugin/android/notification.js
----------------------------------------------------------------------
diff --git a/lib/android/plugin/android/notification.js b/lib/android/plugin/android/notification.js
index 6dfc1a2..750a106 100755
--- a/lib/android/plugin/android/notification.js
+++ b/lib/android/plugin/android/notification.js
@@ -50,4 +50,4 @@ module.exports = {
progressValue : function(value) {
exec(null, null, 'Notification', 'progressValue', [ value ]);
}
-};
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/android/plugin/android/polling.js
----------------------------------------------------------------------
diff --git a/lib/android/plugin/android/polling.js b/lib/android/plugin/android/polling.js
index 36b8e86..0d6e87e 100644
--- a/lib/android/plugin/android/polling.js
+++ b/lib/android/plugin/android/polling.js
@@ -30,4 +30,4 @@ var cordova = require('cordova'),
}
};
-module.exports = polling;
+module.exports = polling;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/android/plugin/android/storage.js
----------------------------------------------------------------------
diff --git a/lib/android/plugin/android/storage.js b/lib/android/plugin/android/storage.js
index 14072a0..f4401fa 100644
--- a/lib/android/plugin/android/storage.js
+++ b/lib/android/plugin/android/storage.js
@@ -1,5 +1,5 @@
var utils = require('cordova/utils'),
- exec = require('cordova/exec');
+ exec = require('cordova/exec'),
channel = require('cordova/channel');
var queryQueue = {};
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/blackberry/exec.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/exec.js b/lib/blackberry/exec.js
index ef59d2f..806aae6 100644
--- a/lib/blackberry/exec.js
+++ b/lib/blackberry/exec.js
@@ -54,4 +54,4 @@ module.exports = function(success, fail, service, action, args) {
} catch (e) {
utils.alert("Error: "+e);
}
-};
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/blackberry/platform.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/platform.js b/lib/blackberry/platform.js
index d98f0e6..895dc6f 100644
--- a/lib/blackberry/platform.js
+++ b/lib/blackberry/platform.js
@@ -176,4 +176,4 @@ module.exports = {
path: 'cordova/plugin/blackberry/Entry'
}
}
-};
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/blackberry/plugin/blackberry/Contact.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/plugin/blackberry/Contact.js b/lib/blackberry/plugin/blackberry/Contact.js
index de1ba17..b37bde0 100644
--- a/lib/blackberry/plugin/blackberry/Contact.js
+++ b/lib/blackberry/plugin/blackberry/Contact.js
@@ -1,5 +1,6 @@
var ContactError = require('cordova/plugin/ContactError'),
ContactUtils = require('cordova/plugin/blackberry/ContactUtils'),
+ ContactAddress = require('cordova/plugin/ContactAddress'),
exec = require('cordova/exec');
// ------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/blackberry/plugin/blackberry/ContactUtils.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/plugin/blackberry/ContactUtils.js b/lib/blackberry/plugin/blackberry/ContactUtils.js
index 1155564..848a601 100644
--- a/lib/blackberry/plugin/blackberry/ContactUtils.js
+++ b/lib/blackberry/plugin/blackberry/ContactUtils.js
@@ -1,3 +1,9 @@
+var ContactAddress = require('cordova/plugin/ContactAddress'),
+ ContactName = require('cordova/plugin/ContactName'),
+ ContactField = require('cordova/plugin/ContactField'),
+ ContactOrganization = require('cordova/plugin/ContactOrganization'),
+ Contact = require('cordova/plugin/Contact');
+
/**
* Mappings for each Contact field that may be used in a find operation. Maps
* W3C Contact fields to one or more fields in a BlackBerry contact object.
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/blackberry/plugin/blackberry/DirectoryEntry.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/plugin/blackberry/DirectoryEntry.js b/lib/blackberry/plugin/blackberry/DirectoryEntry.js
index 76acaf7..3941c05 100644
--- a/lib/blackberry/plugin/blackberry/DirectoryEntry.js
+++ b/lib/blackberry/plugin/blackberry/DirectoryEntry.js
@@ -236,4 +236,4 @@ module.exports = {
fail(FileError.NOT_FOUND_ERR);
}
}
-};
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/blackberry/plugin/blackberry/Entry.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/plugin/blackberry/Entry.js b/lib/blackberry/plugin/blackberry/Entry.js
index cc9626d..d66587f 100644
--- a/lib/blackberry/plugin/blackberry/Entry.js
+++ b/lib/blackberry/plugin/blackberry/Entry.js
@@ -1,6 +1,7 @@
var FileError = require('cordova/plugin/FileError'),
LocalFileSystem = require('cordova/plugin/LocalFileSystem'),
resolveLocalFileSystemURI = require('cordova/plugin/resolveLocalFileSystemURI'),
+ requestFileSystem = require('cordova/plugin/requestFileSystem'),
exec = require('cordova/exec');
module.exports = {
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/blackberry/plugin/blackberry/app.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/plugin/blackberry/app.js b/lib/blackberry/plugin/blackberry/app.js
index 42b5bc5..cf6a003 100644
--- a/lib/blackberry/plugin/blackberry/app.js
+++ b/lib/blackberry/plugin/blackberry/app.js
@@ -47,4 +47,4 @@ module.exports = {
// exit the app
blackberry.app.exit();
}
-};
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/blackberry/plugin/blackberry/contacts.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/plugin/blackberry/contacts.js b/lib/blackberry/plugin/blackberry/contacts.js
index 6a3aec0..a0b0c42 100644
--- a/lib/blackberry/plugin/blackberry/contacts.js
+++ b/lib/blackberry/plugin/blackberry/contacts.js
@@ -59,4 +59,4 @@ module.exports = {
success(contacts);
}
-};
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/blackberry/plugin/blackberry/device.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/plugin/blackberry/device.js b/lib/blackberry/plugin/blackberry/device.js
index 01b41e5..0640678 100644
--- a/lib/blackberry/plugin/blackberry/device.js
+++ b/lib/blackberry/plugin/blackberry/device.js
@@ -20,4 +20,4 @@ channel.onCordovaReady.subscribeOnce(function() {
);
});
-module.exports = me;
+module.exports = me;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/blackberry/plugin/blackberry/manager.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/plugin/blackberry/manager.js b/lib/blackberry/plugin/blackberry/manager.js
index ef353bb..d3a08bc 100644
--- a/lib/blackberry/plugin/blackberry/manager.js
+++ b/lib/blackberry/plugin/blackberry/manager.js
@@ -84,4 +84,4 @@ module.exports = {
resume: org.apache.cordova.JavaPluginManager.resume,
pause: org.apache.cordova.JavaPluginManager.pause,
destroy: org.apache.cordova.JavaPluginManager.destroy
-};
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/blackberry/plugin/blackberry/notification.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/plugin/blackberry/notification.js b/lib/blackberry/plugin/blackberry/notification.js
index 87a9744..d48efbd 100644
--- a/lib/blackberry/plugin/blackberry/notification.js
+++ b/lib/blackberry/plugin/blackberry/notification.js
@@ -50,4 +50,4 @@ module.exports = {
progressValue : function(value) {
exec(null, null, 'Notification', 'progressValue', [ value ]);
}
-};
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/builder.js
----------------------------------------------------------------------
diff --git a/lib/common/builder.js b/lib/common/builder.js
index 4c46cee..872ee5e 100644
--- a/lib/common/builder.js
+++ b/lib/common/builder.js
@@ -1,3 +1,5 @@
+var utils = require('cordova/utils');
+
function each(objects, func, context) {
for (var prop in objects) {
if (objects.hasOwnProperty(prop)) {
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/channel.js
----------------------------------------------------------------------
diff --git a/lib/common/channel.js b/lib/common/channel.js
index bb12b62..8c33a42 100755
--- a/lib/common/channel.js
+++ b/lib/common/channel.js
@@ -83,10 +83,10 @@ var Channel = function(type, opts) {
/**
* cordova Channels that must fire before "deviceready" is fired.
- */
+ */
deviceReadyChannelsArray: [],
deviceReadyChannelsMap: {},
-
+
/**
* Indicate that a feature needs to be initialized before it is ready to be used.
* This holds up Cordova's "deviceready" event until the feature has been initialized
@@ -123,7 +123,7 @@ var Channel = function(type, opts) {
utils = require('cordova/utils');
/**
- * Subscribes the given function to the channel. Any time that
+ * Subscribes the given function to the channel. Any time that
* Channel.fire is called so too will the function.
* Optionally specify an execution context for the function
* and a guid that can be used to stop subscribing to the channel.
@@ -168,7 +168,7 @@ Channel.prototype.subscribeOnce = function(f, c) {
return g;
};
-/**
+/**
* Unsubscribes the function with the given guid from the channel.
*/
Channel.prototype.unsubscribe = function(g) {
@@ -182,7 +182,7 @@ Channel.prototype.unsubscribe = function(g) {
if (this.events.onUnsubscribe) this.events.onUnsubscribe.call(this);
};
-/**
+/**
* Calls all functions subscribed to this channel.
*/
Channel.prototype.fire = function(e) {
@@ -236,4 +236,4 @@ channel.waitForInitialization('onCordovaReady');
channel.waitForInitialization('onCordovaInfoReady');
channel.waitForInitialization('onCordovaConnectionReady');
-module.exports = channel;
+module.exports = channel;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/common.js
----------------------------------------------------------------------
diff --git a/lib/common/common.js b/lib/common/common.js
index e07bf03..e2fbc96 100644
--- a/lib/common/common.js
+++ b/lib/common/common.js
@@ -177,4 +177,4 @@ module.exports = {
path: 'cordova/plugin/resolveLocalFileSystemURI'
}
}
-};
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/exec.js
----------------------------------------------------------------------
diff --git a/lib/common/exec.js b/lib/common/exec.js
index b236903..68d8e46 100644
--- a/lib/common/exec.js
+++ b/lib/common/exec.js
@@ -1 +1 @@
-throw new Error('should have been replaced at build time with platform implementation')
+throw new Error('should have been replaced at build time with platform implementation');
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/platform.js
----------------------------------------------------------------------
diff --git a/lib/common/platform.js b/lib/common/platform.js
index b236903..68d8e46 100644
--- a/lib/common/platform.js
+++ b/lib/common/platform.js
@@ -1 +1 @@
-throw new Error('should have been replaced at build time with platform implementation')
+throw new Error('should have been replaced at build time with platform implementation');
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/Acceleration.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/Acceleration.js b/lib/common/plugin/Acceleration.js
index 834ad01..99a319e 100644
--- a/lib/common/plugin/Acceleration.js
+++ b/lib/common/plugin/Acceleration.js
@@ -5,4 +5,4 @@ var Acceleration = function(x, y, z, timestamp) {
this.timestamp = timestamp || (new Date()).getTime();
};
-module.exports = Acceleration;
+module.exports = Acceleration;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/Camera.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/Camera.js b/lib/common/plugin/Camera.js
index d742974..9f280ad 100644
--- a/lib/common/plugin/Camera.js
+++ b/lib/common/plugin/Camera.js
@@ -75,7 +75,7 @@ cameraExport.getPicture = function(successCallback, errorCallback, options) {
if (typeof options.encodingType == "number") {
encodingType = options.encodingType;
}
-
+
var mediaType = Camera.MediaType.PICTURE;
if (typeof options.mediaType == "number") {
mediaType = options.mediaType;
@@ -102,4 +102,4 @@ cameraExport.getPicture = function(successCallback, errorCallback, options) {
exec(successCallback, errorCallback, "Camera", "takePicture", [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType, mediaType, allowEdit, correctOrientation, saveToPhotoAlbum]);
};
-module.exports = cameraExport;
+module.exports = cameraExport;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/CameraConstants.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/CameraConstants.js b/lib/common/plugin/CameraConstants.js
index b379234..7043ec7 100644
--- a/lib/common/plugin/CameraConstants.js
+++ b/lib/common/plugin/CameraConstants.js
@@ -17,4 +17,4 @@ module.exports = {
CAMERA : 1, // Take picture from camera
SAVEDPHOTOALBUM : 2 // Choose image from picture library (same as PHOTOLIBRARY for Android)
}
-};
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/CaptureAudioOptions.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/CaptureAudioOptions.js b/lib/common/plugin/CaptureAudioOptions.js
index 6f7e253..5c45eb5 100644
--- a/lib/common/plugin/CaptureAudioOptions.js
+++ b/lib/common/plugin/CaptureAudioOptions.js
@@ -10,4 +10,4 @@ var CaptureAudioOptions = function(){
this.mode = null;
};
-module.exports = CaptureAudioOptions;
+module.exports = CaptureAudioOptions;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/CaptureError.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/CaptureError.js b/lib/common/plugin/CaptureError.js
index b217ae4..7055a6f 100644
--- a/lib/common/plugin/CaptureError.js
+++ b/lib/common/plugin/CaptureError.js
@@ -5,7 +5,7 @@ var CaptureError = function(c) {
this.code = c || null;
};
-// Camera or microphone failed to capture image or sound.
+// Camera or microphone failed to capture image or sound.
CaptureError.CAPTURE_INTERNAL_ERR = 0;
// Camera application or audio capture application is currently serving other capture request.
CaptureError.CAPTURE_APPLICATION_BUSY = 1;
@@ -16,4 +16,4 @@ CaptureError.CAPTURE_NO_MEDIA_FILES = 3;
// The requested capture operation is not supported.
CaptureError.CAPTURE_NOT_SUPPORTED = 20;
-module.exports = CaptureError;
+module.exports = CaptureError;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/CaptureImageOptions.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/CaptureImageOptions.js b/lib/common/plugin/CaptureImageOptions.js
index a1138ff..244a1d1 100644
--- a/lib/common/plugin/CaptureImageOptions.js
+++ b/lib/common/plugin/CaptureImageOptions.js
@@ -8,4 +8,4 @@ var CaptureImageOptions = function(){
this.mode = null;
};
-module.exports = CaptureImageOptions;
+module.exports = CaptureImageOptions;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/CaptureVideoOptions.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/CaptureVideoOptions.js b/lib/common/plugin/CaptureVideoOptions.js
index 736d94d..50c66c1 100644
--- a/lib/common/plugin/CaptureVideoOptions.js
+++ b/lib/common/plugin/CaptureVideoOptions.js
@@ -10,4 +10,4 @@ var CaptureVideoOptions = function(){
this.mode = null;
};
-module.exports = CaptureVideoOptions;
+module.exports = CaptureVideoOptions;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/CompassError.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/CompassError.js b/lib/common/plugin/CompassError.js
index baba76d..61f4182 100644
--- a/lib/common/plugin/CompassError.js
+++ b/lib/common/plugin/CompassError.js
@@ -10,4 +10,4 @@ var CompassError = function(err) {
CompassError.COMPASS_INTERNAL_ERR = 0;
CompassError.COMPASS_NOT_SUPPORTED = 20;
-module.exports = CompassError;
+module.exports = CompassError;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/CompassHeading.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/CompassHeading.js b/lib/common/plugin/CompassHeading.js
index 77bd465..16d60f6 100644
--- a/lib/common/plugin/CompassHeading.js
+++ b/lib/common/plugin/CompassHeading.js
@@ -5,4 +5,4 @@ var CompassHeading = function(magneticHeading, trueHeading, headingAccuracy, tim
this.timestamp = (timestamp !== undefined ? timestamp : new Date().getTime());
};
-module.exports = CompassHeading;
+module.exports = CompassHeading;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/ConfigurationData.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/ConfigurationData.js b/lib/common/plugin/ConfigurationData.js
index 838c87c..7c53f1f 100644
--- a/lib/common/plugin/ConfigurationData.js
+++ b/lib/common/plugin/ConfigurationData.js
@@ -2,14 +2,14 @@
* Encapsulates a set of parameters that the capture device supports.
*/
function ConfigurationData() {
- // The ASCII-encoded string in lower case representing the media type.
- this.type = null;
- // The height attribute represents height of the image or video in pixels.
- // In the case of a sound clip this attribute has value 0.
+ // The ASCII-encoded string in lower case representing the media type.
+ this.type = null;
+ // The height attribute represents height of the image or video in pixels.
+ // In the case of a sound clip this attribute has value 0.
this.height = 0;
- // The width attribute represents width of the image or video in pixels.
+ // The width attribute represents width of the image or video in pixels.
// In the case of a sound clip this attribute has value 0
this.width = 0;
}
-module.exports = ConfigurationData;
+module.exports = ConfigurationData;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/Connection.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/Connection.js b/lib/common/plugin/Connection.js
index 8152e03..5bb30f2 100644
--- a/lib/common/plugin/Connection.js
+++ b/lib/common/plugin/Connection.js
@@ -9,4 +9,4 @@ module.exports = {
CELL_3G: "3g",
CELL_4G: "4g",
NONE: "none"
-};
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/Contact.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/Contact.js b/lib/common/plugin/Contact.js
index b48e9c2..1e8c9ce 100644
--- a/lib/common/plugin/Contact.js
+++ b/lib/common/plugin/Contact.js
@@ -174,4 +174,4 @@ Contact.prototype.save = function(successCB, errorCB) {
};
-module.exports = Contact;
+module.exports = Contact;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/ContactAddress.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/ContactAddress.js b/lib/common/plugin/ContactAddress.js
index 9fa3605..d3bd81c 100644
--- a/lib/common/plugin/ContactAddress.js
+++ b/lib/common/plugin/ContactAddress.js
@@ -22,4 +22,4 @@ var ContactAddress = function(pref, type, formatted, streetAddress, locality, re
this.country = country || null;
};
-module.exports = ContactAddress;
+module.exports = ContactAddress;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/ContactError.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/ContactError.js b/lib/common/plugin/ContactError.js
index 324a0cf..8412af1 100644
--- a/lib/common/plugin/ContactError.js
+++ b/lib/common/plugin/ContactError.js
@@ -18,4 +18,4 @@ ContactError.IO_ERROR = 4;
ContactError.NOT_SUPPORTED_ERROR = 5;
ContactError.PERMISSION_DENIED_ERROR = 20;
-module.exports = ContactError;
+module.exports = ContactError;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/ContactField.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/ContactField.js b/lib/common/plugin/ContactField.js
index c2a8ac1..5bfe72f 100644
--- a/lib/common/plugin/ContactField.js
+++ b/lib/common/plugin/ContactField.js
@@ -13,4 +13,4 @@ var ContactField = function(type, value, pref) {
this.pref = (typeof pref != 'undefined' ? pref : false);
};
-module.exports = ContactField;
+module.exports = ContactField;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/ContactFindOptions.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/ContactFindOptions.js b/lib/common/plugin/ContactFindOptions.js
index 036c4c6..5d6c51c 100644
--- a/lib/common/plugin/ContactFindOptions.js
+++ b/lib/common/plugin/ContactFindOptions.js
@@ -10,4 +10,4 @@ var ContactFindOptions = function(filter, multiple) {
this.multiple = (typeof multiple != 'undefined' ? multiple : false);
};
-module.exports = ContactFindOptions;
+module.exports = ContactFindOptions;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/ContactName.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/ContactName.js b/lib/common/plugin/ContactName.js
index 5434e74..49ed391 100644
--- a/lib/common/plugin/ContactName.js
+++ b/lib/common/plugin/ContactName.js
@@ -17,4 +17,4 @@ var ContactName = function(formatted, familyName, givenName, middle, prefix, suf
this.honorificSuffix = suffix || null;
};
-module.exports = ContactName;
+module.exports = ContactName;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/ContactOrganization.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/ContactOrganization.js b/lib/common/plugin/ContactOrganization.js
index 32ec462..f80010a 100644
--- a/lib/common/plugin/ContactOrganization.js
+++ b/lib/common/plugin/ContactOrganization.js
@@ -20,4 +20,4 @@ var ContactOrganization = function(pref, type, name, dept, title) {
this.title = title || null;
};
-module.exports = ContactOrganization;
+module.exports = ContactOrganization;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/Coordinates.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/Coordinates.js b/lib/common/plugin/Coordinates.js
index d783e1c..21a46d6 100644
--- a/lib/common/plugin/Coordinates.js
+++ b/lib/common/plugin/Coordinates.js
@@ -40,4 +40,4 @@ var Coordinates = function(lat, lng, alt, acc, head, vel, altacc) {
this.altitudeAccuracy = (altacc !== undefined) ? altacc : null;
};
-module.exports = Coordinates;
+module.exports = Coordinates;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/DirectoryEntry.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/DirectoryEntry.js b/lib/common/plugin/DirectoryEntry.js
index e9949d0..9eb0838 100644
--- a/lib/common/plugin/DirectoryEntry.js
+++ b/lib/common/plugin/DirectoryEntry.js
@@ -1,6 +1,7 @@
var utils = require('cordova/utils'),
exec = require('cordova/exec'),
Entry = require('cordova/plugin/Entry'),
+ FileError = require('cordova/plugin/FileError'),
DirectoryReader = require('cordova/plugin/DirectoryReader');
/**
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/DirectoryReader.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/DirectoryReader.js b/lib/common/plugin/DirectoryReader.js
index 90e67a4..4db0600 100644
--- a/lib/common/plugin/DirectoryReader.js
+++ b/lib/common/plugin/DirectoryReader.js
@@ -1,4 +1,5 @@
-var exec = require('cordova/exec');
+var exec = require('cordova/exec'),
+ FileError = require('cordova/plugin/FileError') ;
/**
* An interface that lists the files and directories in a directory.
@@ -19,10 +20,10 @@ DirectoryReader.prototype.readEntries = function(successCallback, errorCallback)
for (var i=0; i<result.length; i++) {
var entry = null;
if (result[i].isDirectory) {
- entry = new DirectoryEntry();
+ entry = new (require('cordova/plugin/DirectoryEntry'))();
}
else if (result[i].isFile) {
- entry = new FileEntry();
+ entry = new (require('cordova/plugin/FileEntry'))();
}
entry.isDirectory = result[i].isDirectory;
entry.isFile = result[i].isFile;
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/Entry.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/Entry.js b/lib/common/plugin/Entry.js
index 157518f..8c36121 100644
--- a/lib/common/plugin/Entry.js
+++ b/lib/common/plugin/Entry.js
@@ -200,4 +200,4 @@ Entry.prototype.getParent = function(successCallback, errorCallback) {
exec(win, fail, "File", "getParent", [this.fullPath]);
};
-module.exports = Entry;
+module.exports = Entry;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/File.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/File.js b/lib/common/plugin/File.js
index 7ac22cc..1f2a9b6 100644
--- a/lib/common/plugin/File.js
+++ b/lib/common/plugin/File.js
@@ -15,4 +15,4 @@ var File = function(name, fullPath, type, lastModifiedDate, size){
this.size = size || 0;
};
-module.exports = File;
+module.exports = File;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/FileEntry.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/FileEntry.js b/lib/common/plugin/FileEntry.js
index cbe22c4..fb6cfaa 100644
--- a/lib/common/plugin/FileEntry.js
+++ b/lib/common/plugin/FileEntry.js
@@ -60,4 +60,4 @@ FileEntry.prototype.file = function(successCallback, errorCallback) {
};
-module.exports = FileEntry;
+module.exports = FileEntry;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/FileError.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/FileError.js b/lib/common/plugin/FileError.js
index f61c092..7f538fe 100644
--- a/lib/common/plugin/FileError.js
+++ b/lib/common/plugin/FileError.js
@@ -22,4 +22,4 @@ FileError.QUOTA_EXCEEDED_ERR = 10;
FileError.TYPE_MISMATCH_ERR = 11;
FileError.PATH_EXISTS_ERR = 12;
-module.exports = FileError;
+module.exports = FileError;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/FileReader.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/FileReader.js b/lib/common/plugin/FileReader.js
index 8b634d9..b740635 100644
--- a/lib/common/plugin/FileReader.js
+++ b/lib/common/plugin/FileReader.js
@@ -246,4 +246,4 @@ FileReader.prototype.readAsArrayBuffer = function(file) {
console.log('This method is not supported at this time.');
};
-module.exports = FileReader;
+module.exports = FileReader;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/FileSystem.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/FileSystem.js b/lib/common/plugin/FileSystem.js
index 53636b5..2ae64ae 100644
--- a/lib/common/plugin/FileSystem.js
+++ b/lib/common/plugin/FileSystem.js
@@ -14,4 +14,4 @@ var FileSystem = function(name, root) {
}
};
-module.exports = FileSystem;
+module.exports = FileSystem;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/FileTransfer.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/FileTransfer.js b/lib/common/plugin/FileTransfer.js
index 6749a80..60024df 100644
--- a/lib/common/plugin/FileTransfer.js
+++ b/lib/common/plugin/FileTransfer.js
@@ -52,16 +52,16 @@ FileTransfer.prototype.download = function(source, target, successCallback, erro
var win = function(result) {
var entry = null;
if (result.isDirectory) {
- entry = new DirectoryEntry();
+ entry = new (require('cordova/plugin/DirectoryEntry'))();
}
else if (result.isFile) {
- entry = new FileEntry();
+ entry = new (require('cordova/plugin/FileEntry'))();
}
entry.isDirectory = result.isDirectory;
entry.isFile = result.isFile;
entry.name = result.name;
entry.fullPath = result.fullPath;
- successCallback(entry);
+ successCallback(entry);
};
exec(win, errorCallback, 'FileTransfer', 'download', [source, target]);
};
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/FileTransferError.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/FileTransferError.js b/lib/common/plugin/FileTransferError.js
index e3e7093..8c9a7dd 100644
--- a/lib/common/plugin/FileTransferError.js
+++ b/lib/common/plugin/FileTransferError.js
@@ -10,4 +10,4 @@ FileTransferError.FILE_NOT_FOUND_ERR = 1;
FileTransferError.INVALID_URL_ERR = 2;
FileTransferError.CONNECTION_ERR = 3;
-module.exports = FileTransferError;
+module.exports = FileTransferError;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/FileUploadOptions.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/FileUploadOptions.js b/lib/common/plugin/FileUploadOptions.js
index ff16661..78fa9f9 100644
--- a/lib/common/plugin/FileUploadOptions.js
+++ b/lib/common/plugin/FileUploadOptions.js
@@ -13,4 +13,4 @@ var FileUploadOptions = function(fileKey, fileName, mimeType, params) {
this.params = params || null;
};
-module.exports = FileUploadOptions;
+module.exports = FileUploadOptions;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/FileUploadResult.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/FileUploadResult.js b/lib/common/plugin/FileUploadResult.js
index 740babd..46857ec 100644
--- a/lib/common/plugin/FileUploadResult.js
+++ b/lib/common/plugin/FileUploadResult.js
@@ -8,4 +8,4 @@ var FileUploadResult = function() {
this.response = null;
};
-module.exports = FileUploadResult;
+module.exports = FileUploadResult;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/FileWriter.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/FileWriter.js b/lib/common/plugin/FileWriter.js
index 643dffa..ab2beb2 100644
--- a/lib/common/plugin/FileWriter.js
+++ b/lib/common/plugin/FileWriter.js
@@ -1,5 +1,5 @@
var exec = require('cordova/exec'),
- FileError = require('cordova/plugin/FileError');
+ FileError = require('cordova/plugin/FileError'),
ProgressEvent = require('cordova/plugin/ProgressEvent');
/**
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/Flags.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/Flags.js b/lib/common/plugin/Flags.js
index d918c38..16fe1ab 100644
--- a/lib/common/plugin/Flags.js
+++ b/lib/common/plugin/Flags.js
@@ -1,6 +1,6 @@
/**
* Supplies arguments to methods that lookup or create files and directories.
- *
+ *
* @param create
* {boolean} file or directory if it doesn't exist
* @param exclusive
@@ -12,4 +12,4 @@ function Flags(create, exclusive) {
this.exclusive = exclusive || false;
}
-module.exports = Flags;
+module.exports = Flags;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/LocalFileSystem.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/LocalFileSystem.js b/lib/common/plugin/LocalFileSystem.js
index f71ae62..429c5b0 100644
--- a/lib/common/plugin/LocalFileSystem.js
+++ b/lib/common/plugin/LocalFileSystem.js
@@ -10,4 +10,4 @@ var LocalFileSystem = function() {
LocalFileSystem.TEMPORARY = 0; //temporary, with no guarantee of persistence
LocalFileSystem.PERSISTENT = 1; //persistent
-module.exports = LocalFileSystem;
+module.exports = LocalFileSystem;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/Media.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/Media.js b/lib/common/plugin/Media.js
index 5bf1e83..f30164b 100644
--- a/lib/common/plugin/Media.js
+++ b/lib/common/plugin/Media.js
@@ -184,4 +184,4 @@ Media.onStatus = function(id, msg, value) {
}
};
-module.exports = Media;
+module.exports = Media;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/MediaError.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/MediaError.js b/lib/common/plugin/MediaError.js
index 40ce8f1..e55f33e 100644
--- a/lib/common/plugin/MediaError.js
+++ b/lib/common/plugin/MediaError.js
@@ -13,4 +13,4 @@ MediaError.MEDIA_ERR_NETWORK = 2;
MediaError.MEDIA_ERR_DECODE = 3;
MediaError.MEDIA_ERR_NONE_SUPPORTED = 4;
-module.exports = MediaError;
+module.exports = MediaError;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/MediaFile.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/MediaFile.js b/lib/common/plugin/MediaFile.js
index d8b0964..df271f5 100644
--- a/lib/common/plugin/MediaFile.js
+++ b/lib/common/plugin/MediaFile.js
@@ -19,7 +19,7 @@ utils.extend(MediaFile, File);
/**
* Request capture format data for a specific file and type
- *
+ *
* @param {Function} successCB
* @param {Function} errorCB
*/
@@ -28,7 +28,7 @@ MediaFile.prototype.getFormatData = function(successCallback, errorCallback) {
errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
} else {
exec(successCallback, errorCallback, "Capture", "getFormatData", [this.fullPath, this.type]);
- }
+ }
};
/**
@@ -53,4 +53,4 @@ MediaFile.cast = function(pluginResult) {
return pluginResult;
};
-module.exports = MediaFile;
+module.exports = MediaFile;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/MediaFileData.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/MediaFileData.js b/lib/common/plugin/MediaFileData.js
index 2d2a43a..b3e29ef 100644
--- a/lib/common/plugin/MediaFileData.js
+++ b/lib/common/plugin/MediaFileData.js
@@ -15,4 +15,4 @@ var MediaFileData = function(codecs, bitrate, height, width, duration){
this.duration = duration || 0;
};
-module.exports = MediaFileData;
+module.exports = MediaFileData;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/Metadata.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/Metadata.js b/lib/common/plugin/Metadata.js
index b29cc7c..1e882ad 100644
--- a/lib/common/plugin/Metadata.js
+++ b/lib/common/plugin/Metadata.js
@@ -1,10 +1,10 @@
/**
* Information about the state of the file or directory
- *
+ *
* {Date} modificationTime (readonly)
*/
var Metadata = function(time) {
this.modificationTime = (typeof time != 'undefined'?new Date(time):null);
};
-module.exports = Metadata;
+module.exports = Metadata;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/Position.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/Position.js b/lib/common/plugin/Position.js
index 2651969..33c5be9 100644
--- a/lib/common/plugin/Position.js
+++ b/lib/common/plugin/Position.js
@@ -5,4 +5,4 @@ var Position = function(coords, timestamp) {
this.timestamp = (timestamp !== undefined) ? timestamp : new Date().getTime();
};
-module.exports = Position;
+module.exports = Position;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/PositionError.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/PositionError.js b/lib/common/plugin/PositionError.js
index 07012d6..6f4988d 100644
--- a/lib/common/plugin/PositionError.js
+++ b/lib/common/plugin/PositionError.js
@@ -14,4 +14,4 @@ PositionError.PERMISSION_DENIED = 1;
PositionError.POSITION_UNAVAILABLE = 2;
PositionError.TIMEOUT = 3;
-module.exports = PositionError;
+module.exports = PositionError;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/ProgressEvent.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/ProgressEvent.js b/lib/common/plugin/ProgressEvent.js
index d8e41c1..a5fc883 100644
--- a/lib/common/plugin/ProgressEvent.js
+++ b/lib/common/plugin/ProgressEvent.js
@@ -43,4 +43,4 @@ var ProgressEvent = (function() {
//}
})();
-module.exports = ProgressEvent;
+module.exports = ProgressEvent;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/accelerometer.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/accelerometer.js b/lib/common/plugin/accelerometer.js
index 6f01ab8..29ab721 100644
--- a/lib/common/plugin/accelerometer.js
+++ b/lib/common/plugin/accelerometer.js
@@ -92,4 +92,4 @@ var accelerometer = {
}
};
-module.exports = accelerometer;
+module.exports = accelerometer;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/battery.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/battery.js b/lib/common/plugin/battery.js
index f7ef49b..fa929a9 100644
--- a/lib/common/plugin/battery.js
+++ b/lib/common/plugin/battery.js
@@ -6,7 +6,7 @@ var cordova = require('cordova'),
exec = require('cordova/exec');
function handlers() {
- return battery.channels.batterystatus.numHandlers +
+ return battery.channels.batterystatus.numHandlers +
battery.channels.batterylow.numHandlers +
battery.channels.batterycritical.numHandlers;
}
@@ -49,7 +49,7 @@ Battery.prototype.onUnsubscribe = function() {
/**
* Callback for battery status
- *
+ *
* @param {Object} info keys: level, isPlugged
*/
Battery.prototype._status = function(info) {
@@ -71,7 +71,7 @@ Battery.prototype._status = function(info) {
}
}
me._level = level;
- me._isPlugged = info.isPlugged;
+ me._isPlugged = info.isPlugged;
}
};
@@ -84,4 +84,4 @@ Battery.prototype._error = function(e) {
var battery = new Battery();
-module.exports = battery;
+module.exports = battery;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/capture.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/capture.js b/lib/common/plugin/capture.js
index ba7ae36..ded4b75 100644
--- a/lib/common/plugin/capture.js
+++ b/lib/common/plugin/capture.js
@@ -4,7 +4,7 @@ var exec = require('cordova/exec'),
/**
* Launches a capture of different types.
*
- * @param (DOMString} type
+ * @param (DOMString} type
* @param {Function} successCB
* @param {Function} errorCB
* @param {CaptureVideoOptions} options
@@ -69,4 +69,4 @@ Capture.prototype.captureVideo = function(successCallback, errorCallback, option
};
-module.exports = new Capture();
+module.exports = new Capture();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/compass.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/compass.js b/lib/common/plugin/compass.js
index 02444c2..ce615f9 100644
--- a/lib/common/plugin/compass.js
+++ b/lib/common/plugin/compass.js
@@ -8,7 +8,7 @@ var exec = require('cordova/exec'),
* Asynchronously acquires the current heading.
* @param {Function} successCallback The function to call when the heading
* data is available
- * @param {Function} errorCallback The function to call when there is an error
+ * @param {Function} errorCallback The function to call when there is an error
* getting the heading data.
* @param {CompassOptions} options The options for getting the heading data (not used).
*/
@@ -33,7 +33,7 @@ var exec = require('cordova/exec'),
var ce = new CompassError(code);
errorCallback(ce);
};
-
+
// Get heading
exec(win, fail, "Compass", "getHeading", [options]);
},
@@ -42,7 +42,7 @@ var exec = require('cordova/exec'),
* Asynchronously acquires the heading repeatedly at a given interval.
* @param {Function} successCallback The function to call each time the heading
* data is available
- * @param {Function} errorCallback The function to call when there is an error
+ * @param {Function} errorCallback The function to call when there is an error
* getting the heading data.
* @param {HeadingOptions} options The options for getting the heading data
* such as timeout and the frequency of the watch. For iOS, filter parameter
@@ -76,7 +76,7 @@ var exec = require('cordova/exec'),
compass.getCurrentHeading(successCallback, errorCallback);
}, frequency);
}
-
+
return id;
},
@@ -98,4 +98,4 @@ var exec = require('cordova/exec'),
}
};
-module.exports = compass;
+module.exports = compass;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/contacts.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/contacts.js b/lib/common/plugin/contacts.js
index 7212f7b..b958362 100644
--- a/lib/common/plugin/contacts.js
+++ b/lib/common/plugin/contacts.js
@@ -54,4 +54,4 @@ var contacts = {
}
};
-module.exports = contacts;
+module.exports = contacts;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/geolocation.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/geolocation.js b/lib/common/plugin/geolocation.js
index e1169f6..1b86f02 100644
--- a/lib/common/plugin/geolocation.js
+++ b/lib/common/plugin/geolocation.js
@@ -57,7 +57,7 @@ var geolocation = {
errorCallback(new PositionError(e.code, e.message));
};
- exec(win, fail, "Geolocation", "getLocation", [options.enableHighAccuracy, options.timeout, options.maximumAge]);
+ exec(win, fail, "Geolocation", "getLocation", [options.enableHighAccuracy, options.timeout, options.maximumAge]);
},
/**
* Asynchronously watches the geolocation for changes to geolocation. When a change occurs,
@@ -91,4 +91,4 @@ var geolocation = {
}
};
-module.exports = geolocation;
+module.exports = geolocation;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/network.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/network.js b/lib/common/plugin/network.js
index f5b4fd4..2bfff2d 100644
--- a/lib/common/plugin/network.js
+++ b/lib/common/plugin/network.js
@@ -57,4 +57,4 @@ NetworkConnection.prototype.getInfo = function (successCallback, errorCallback)
exec(successCallback, errorCallback, "NetworkStatus", "getConnectionInfo", []);
};
-module.exports = new NetworkConnection();
+module.exports = new NetworkConnection();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/notification.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/notification.js b/lib/common/plugin/notification.js
index 305ee3d..7618ea6 100644
--- a/lib/common/plugin/notification.js
+++ b/lib/common/plugin/notification.js
@@ -53,4 +53,4 @@ module.exports = {
beep: function(count) {
exec(null, null, "Notification", "beep", [count]);
}
-};
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/requestFileSystem.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/requestFileSystem.js b/lib/common/plugin/requestFileSystem.js
index afee5d7..053ed5e 100644
--- a/lib/common/plugin/requestFileSystem.js
+++ b/lib/common/plugin/requestFileSystem.js
@@ -37,4 +37,4 @@ var requestFileSystem = function(type, size, successCallback, errorCallback) {
}
};
-module.exports = requestFileSystem;
+module.exports = requestFileSystem;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/plugin/resolveLocalFileSystemURI.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/resolveLocalFileSystemURI.js b/lib/common/plugin/resolveLocalFileSystemURI.js
index fbf849b..adb48f1 100644
--- a/lib/common/plugin/resolveLocalFileSystemURI.js
+++ b/lib/common/plugin/resolveLocalFileSystemURI.js
@@ -1,5 +1,6 @@
var DirectoryEntry = require('cordova/plugin/DirectoryEntry'),
FileEntry = require('cordova/plugin/FileEntry'),
+ FileError = require('cordova/plugin/FileError'),
exec = require('cordova/exec');
/**
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/common/utils.js
----------------------------------------------------------------------
diff --git a/lib/common/utils.js b/lib/common/utils.js
index 800ace1..fa2c534 100644
--- a/lib/common/utils.js
+++ b/lib/common/utils.js
@@ -15,12 +15,12 @@ var _self = {
* Does a deep clone of the object.
*/
clone: function(obj) {
- if(!obj) {
+ if(!obj) {
return obj;
}
-
+
var retVal, i;
-
+
if(obj instanceof Array){
retVal = [];
for(i = 0; i < obj.length; ++i){
@@ -28,15 +28,15 @@ var _self = {
}
return retVal;
}
-
+
if (obj instanceof Function) {
return obj;
}
-
+
if(!(obj instanceof Object)){
return obj;
}
-
+
if(obj instanceof Date){
return obj;
}
@@ -79,7 +79,7 @@ var _self = {
*/
extend: (function() {
// proxy used to establish prototype chain
- var F = function() {};
+ var F = function() {};
// extend Child from Parent
return function(Child, Parent) {
F.prototype = Parent.prototype;
@@ -101,4 +101,4 @@ var _self = {
}
};
-module.exports = _self;
+module.exports = _self;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/cordova.js
----------------------------------------------------------------------
diff --git a/lib/cordova.js b/lib/cordova.js
index 7c0e3b9..5deeed5 100644
--- a/lib/cordova.js
+++ b/lib/cordova.js
@@ -93,7 +93,7 @@ function createEvent(type, data) {
if(typeof window.console === "undefined")
{
- window.console = {
+ window.console = {
log:function(){}
};
}
@@ -236,7 +236,7 @@ var cordova = {
console.log("Error: Plugin "+name+" already exists.");
}
},
-
+
addConstructor: function(func) {
channel.onCordovaReady.subscribeOnce(function() {
try {
@@ -248,7 +248,7 @@ var cordova = {
}
};
-/**
+/**
* Legacy variable for plugin support
* TODO: remove in 2.0.
*/
@@ -264,4 +264,4 @@ if (!window.plugins) {
window.plugins = {};
}
-module.exports = cordova;
+module.exports = cordova;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/errgen/exec.js
----------------------------------------------------------------------
diff --git a/lib/errgen/exec.js b/lib/errgen/exec.js
index dc47fcb..e6f657d 100644
--- a/lib/errgen/exec.js
+++ b/lib/errgen/exec.js
@@ -34,74 +34,72 @@
//------------------------------------------------------------------------------
module.exports = function exec(success, fail, service, action, args) {
- var signature = service + "::" + action
+ var signature = service + "::" + action;
//--------------------------------------------------------------------------
function callFail() {
- var args = "<unable to JSONify>"
-
+ var args = "<unable to JSONify>";
+
try {
- args = JSON.stringify(args)
- }
- catch (e) {}
+ args = JSON.stringify(args);
+ } catch (e) {}
- var call = signature + "(" + args + ")"
+ var call = signature + "(" + args + ")";
if (!fail) {
- console.log("failure callback not set for " + call)
- return
+ console.log("failure callback not set for " + call);
+ return;
}
-
+
if (typeof(fail) != 'function') {
- console.log("failure callback not a function for " + call)
- return
+ console.log("failure callback not a function for " + call);
+ return;
}
-
+
try {
- fail("expected errgen failure for " + call)
- }
- catch (e) {
- console.log("exception running failure callback for " + call)
- console.log(" exception: " + e)
- return
+ fail("expected errgen failure for " + call);
+ } catch (e) {
+ console.log("exception running failure callback for " + call);
+ console.log(" exception: " + e);
+ return;
}
}
//--------------------------------------------------------------------------
if (Overrides[signature]) {
- Overrides[signature].call(null, success, fail, args)
- return
+ Overrides[signature].call(null, success, fail, args);
+ return;
}
-
- setTimeout(callFail, 10)
-}
+
+ setTimeout(callFail, 10);
+};
//------------------------------------------------------------------------------
-var Overrides = {}
+var Overrides = {};
//------------------------------------------------------------------------------
function addOverride(func) {
- var name = func.name.replace('__', '::')
- Overrides[name] = func
+ var name = func.name.replace('__', '::');
+ Overrides[name] = func;
}
//------------------------------------------------------------------------------
addOverride(function Accelerometer__setTimeout(success, fail, args) {
- setTimeout(function() {
- fail("Accelerometer::setTimeout")
- }, 10)
-})
+ setTimeout(function() {
+ fail("Accelerometer::setTimeout");
+ }, 10);
+});
//------------------------------------------------------------------------------
addOverride(function Accelerometer__getTimeout(success, fail, args) {
- setTimeout(function() {
- fail("Accelerometer::getTimeout")
- }, 10)
-})
+ setTimeout(function() {
+ fail("Accelerometer::getTimeout");
+ }, 10);
+});
//------------------------------------------------------------------------------
addOverride(function Network_Status__getConnectionInfo(success, fail) {
- setTimeout(function() {
- success("none")
- }, 10)
-})
+ setTimeout(function() {
+ success("none");
+ }, 10);
+});
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/errgen/platform.js
----------------------------------------------------------------------
diff --git a/lib/errgen/platform.js b/lib/errgen/platform.js
index 8677cab..b312505 100644
--- a/lib/errgen/platform.js
+++ b/lib/errgen/platform.js
@@ -18,11 +18,11 @@
*/
// required call to kick off the device ready callback
-require('cordova/plugin/errgen/device')
+require('cordova/plugin/errgen/device');
//------------------------------------------------------------------------------
module.exports = {
id: "errgen",
initialize: function() {},
objects: {}
-}
+};
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/errgen/plugin/errgen/device.js
----------------------------------------------------------------------
diff --git a/lib/errgen/plugin/errgen/device.js b/lib/errgen/plugin/errgen/device.js
index a3b8e6c..80bcd56 100644
--- a/lib/errgen/plugin/errgen/device.js
+++ b/lib/errgen/plugin/errgen/device.js
@@ -26,7 +26,7 @@
//------------------------------------------------------------------------------
function Device() {
window.DeviceInfo = {};
-
+
this.platform = "errgen";
this.version = "any";
this.name = "errgen";
@@ -34,9 +34,9 @@ function Device() {
this.gap = this.phonegap;
this.uuid = "1234-5678-9012-3456";
this.available = true;
-
+
require('cordova/channel').onCordovaInfoReady.fire();
}
//------------------------------------------------------------------------------
-module.exports = window.DeviceInfo = new Device();
+module.exports = window.DeviceInfo = new Device();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/b8d02d50/lib/ios/exec.js
----------------------------------------------------------------------
diff --git a/lib/ios/exec.js b/lib/ios/exec.js
index 4501b01..c2b8594 100644
--- a/lib/ios/exec.js
+++ b/lib/ios/exec.js
@@ -17,14 +17,14 @@ var cordova = require('cordova'),
},
channel = require('cordova/channel');
-module.exports = function() {
+module.exports = function() {
if (!channel.onCordovaInfoReady.fired) {
utils.alert("ERROR: Attempting to call cordova.exec()" +
" before 'deviceready'. Ignoring.");
return;
}
- var successCallback, failCallback, service, action, actionArgs;
+ var successCallback, failCallback, service, action, actionArgs, splitCommand;
var callbackId = null;
if (typeof arguments[0] !== "string") {
// FORMAT ONE
@@ -46,33 +46,33 @@ module.exports = function() {
service = splitCommand.join(".");
actionArgs = Array.prototype.splice.call(arguments, 1);
}
-
+
// Start building the command object.
var command = {
className: service,
methodName: action,
- arguments: []
+ "arguments": []
};
// Register the callbacks and add the callbackId to the positional
// arguments if given.
if (successCallback || failCallback) {
callbackId = service + cordova.callbackId++;
- cordova.callbacks[callbackId] =
+ cordova.callbacks[callbackId] =
{success:successCallback, fail:failCallback};
}
- if (callbackId != null) {
- command.arguments.push(callbackId);
+ if (callbackId !== null) {
+ command["arguments"].push(callbackId);
}
for (var i = 0; i < actionArgs.length; ++i) {
var arg = actionArgs[i];
- if (arg == undefined || arg == null) { // nulls are pushed to the args now (becomes NSNull)
+ if (arg === undefined || arg === null) { // nulls are pushed to the args now (becomes NSNull)
continue; //command.arguments.push(arg);
} else if (typeof(arg) == 'object' && !(arg instanceof Array)) {
command.options = arg;
} else {
- command.arguments.push(arg);
+ command["arguments"].push(arg);
}
}