incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject bada-wac commit: [CB-1038] Updating JS to latest to use refactored device module.
Date Thu, 12 Jul 2012 20:55:52 GMT
Updated Branches:
  refs/heads/master 4c14da258 -> b6a50a02d


[CB-1038] Updating JS to latest to use refactored device module.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-bada-wac/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-bada-wac/commit/b6a50a02
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-bada-wac/tree/b6a50a02
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-bada-wac/diff/b6a50a02

Branch: refs/heads/master
Commit: b6a50a02dfd0ed819c3cb4063996aee4e719920f
Parents: 4c14da2
Author: Fil Maj <maj.fil@gmail.com>
Authored: Thu Jul 12 13:58:20 2012 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Thu Jul 12 13:58:20 2012 -0700

----------------------------------------------------------------------
 Res/js/cordova.js |  428 +++++++++++++++++++++---------------------------
 1 files changed, 188 insertions(+), 240 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-bada-wac/blob/b6a50a02/Res/js/cordova.js
----------------------------------------------------------------------
diff --git a/Res/js/cordova.js b/Res/js/cordova.js
index 726957b..338a9b1 100644
--- a/Res/js/cordova.js
+++ b/Res/js/cordova.js
@@ -1,6 +1,6 @@
-// commit 722ce5820b6fc3e371245927e00c7f9745eb041a
+// commit fc6866c92d076b9163f4c388f073c5962d115bc3
 
-// File generated at :: Tue Jun 12 2012 14:40:27 GMT-0700 (Pacific Daylight Time)
+// File generated at :: Thu Jul 12 2012 13:40:57 GMT-0700 (PDT)
 
 /*
  Licensed to the Apache Software Foundation (ASF) under one
@@ -23,7 +23,7 @@
 
 ;(function() {
 
-// file: lib\scripts\require.js
+// file: lib/scripts/require.js
 var require,
     define;
 
@@ -190,7 +190,9 @@ var cordova = {
     fireDocumentEvent: function(type, data) {
         var evt = createEvent(type, data);
         if (typeof documentEventHandlers[type] != 'undefined') {
-            documentEventHandlers[type].fire(evt);
+            setTimeout(function() {
+                documentEventHandlers[type].fire(evt);
+            }, 0);
         } else {
             document.dispatchEvent(evt);
         }
@@ -198,7 +200,9 @@ var cordova = {
     fireWindowEvent: function(type, data) {
         var evt = createEvent(type,data);
         if (typeof windowEventHandlers[type] != 'undefined') {
-            windowEventHandlers[type].fire(evt);
+            setTimeout(function() {
+                windowEventHandlers[type].fire(evt);
+            }, 0);
         } else {
             window.dispatchEvent(evt);
         }
@@ -361,7 +365,7 @@ module.exports = cordova;
 
 });
 
-// file: lib\common\builder.js
+// file: lib/common/builder.js
 define("cordova/builder", function(require, exports, module) {
 var utils = require('cordova/utils');
 
@@ -454,7 +458,7 @@ module.exports = {
 
 });
 
-// file: lib\common\channel.js
+// file: lib/common/channel.js
 define("cordova/channel", function(require, exports, module) {
 var utils = require('cordova/utils');
 
@@ -709,14 +713,13 @@ channel.create('onDestroy');
 
 // Channels that must fire before "deviceready" is fired.
 channel.waitForInitialization('onCordovaReady');
-channel.waitForInitialization('onCordovaInfoReady');
 channel.waitForInitialization('onCordovaConnectionReady');
 
 module.exports = channel;
 
 });
 
-// file: lib\common\common.js
+// file: lib/common/common.js
 define("cordova/common", function(require, exports, module) {
 module.exports = {
     objects: {
@@ -844,6 +847,9 @@ module.exports = {
         Coordinates: {
             path: 'cordova/plugin/Coordinates'
         },
+        device: {
+            path: 'cordova/plugin/device'
+        },
         DirectoryEntry: {
             path: 'cordova/plugin/DirectoryEntry'
         },
@@ -924,7 +930,7 @@ module.exports = {
 
 });
 
-// file: lib\bada\exec.js
+// file: lib/bada/exec.js
 define("cordova/exec", function(require, exports, module) {
 var plugins = {
     "Device": require('cordova/plugin/bada/device'),
@@ -951,7 +957,7 @@ module.exports = function(success, fail, service, action, args) {
 
 });
 
-// file: lib\bada\platform.js
+// file: lib/bada/platform.js
 define("cordova/platform", function(require, exports, module) {
 module.exports = {
     id: "bada",
@@ -990,7 +996,7 @@ module.exports = {
 
 });
 
-// file: lib\common\plugin\Acceleration.js
+// file: lib/common/plugin/Acceleration.js
 define("cordova/plugin/Acceleration", function(require, exports, module) {
 var Acceleration = function(x, y, z, timestamp) {
     this.x = x;
@@ -1003,7 +1009,7 @@ module.exports = Acceleration;
 
 });
 
-// file: lib\common\plugin\Camera.js
+// file: lib/common/plugin/Camera.js
 define("cordova/plugin/Camera", function(require, exports, module) {
 var exec = require('cordova/exec'),
     Camera = require('cordova/plugin/CameraConstants');
@@ -1115,12 +1121,12 @@ cameraExport.getPicture = function(successCallback, errorCallback,
options) {
 
 cameraExport.cleanup = function(successCallback, errorCallback) {
     exec(successCallback, errorCallback, "Camera", "cleanup", []);
-}
+};
 
 module.exports = cameraExport;
 });
 
-// file: lib\common\plugin\CameraConstants.js
+// file: lib/common/plugin/CameraConstants.js
 define("cordova/plugin/CameraConstants", function(require, exports, module) {
 module.exports = {
   DestinationType:{
@@ -1151,7 +1157,7 @@ module.exports = {
 };
 });
 
-// file: lib\common\plugin\CameraPopoverOptions.js
+// file: lib/common/plugin/CameraPopoverOptions.js
 define("cordova/plugin/CameraPopoverOptions", function(require, exports, module) {
 var Camera = require('cordova/plugin/CameraConstants');
 
@@ -1171,7 +1177,7 @@ var CameraPopoverOptions = function(x,y,width,height,arrowDir){
 module.exports = CameraPopoverOptions;
 });
 
-// file: lib\common\plugin\CaptureAudioOptions.js
+// file: lib/common/plugin/CaptureAudioOptions.js
 define("cordova/plugin/CaptureAudioOptions", function(require, exports, module) {
 /**
  * Encapsulates all audio capture operation configuration options.
@@ -1188,7 +1194,7 @@ var CaptureAudioOptions = function(){
 module.exports = CaptureAudioOptions;
 });
 
-// file: lib\common\plugin\CaptureError.js
+// file: lib/common/plugin/CaptureError.js
 define("cordova/plugin/CaptureError", function(require, exports, module) {
 /**
  * The CaptureError interface encapsulates all errors in the Capture API.
@@ -1211,7 +1217,7 @@ CaptureError.CAPTURE_NOT_SUPPORTED = 20;
 module.exports = CaptureError;
 });
 
-// file: lib\common\plugin\CaptureImageOptions.js
+// file: lib/common/plugin/CaptureImageOptions.js
 define("cordova/plugin/CaptureImageOptions", function(require, exports, module) {
 /**
  * Encapsulates all image capture operation configuration options.
@@ -1226,7 +1232,7 @@ var CaptureImageOptions = function(){
 module.exports = CaptureImageOptions;
 });
 
-// file: lib\common\plugin\CaptureVideoOptions.js
+// file: lib/common/plugin/CaptureVideoOptions.js
 define("cordova/plugin/CaptureVideoOptions", function(require, exports, module) {
 /**
  * Encapsulates all video capture operation configuration options.
@@ -1243,7 +1249,7 @@ var CaptureVideoOptions = function(){
 module.exports = CaptureVideoOptions;
 });
 
-// file: lib\common\plugin\CompassError.js
+// file: lib/common/plugin/CompassError.js
 define("cordova/plugin/CompassError", function(require, exports, module) {
 /**
  *  CompassError.
@@ -1260,7 +1266,7 @@ CompassError.COMPASS_NOT_SUPPORTED = 20;
 module.exports = CompassError;
 });
 
-// file: lib\common\plugin\CompassHeading.js
+// file: lib/common/plugin/CompassHeading.js
 define("cordova/plugin/CompassHeading", function(require, exports, module) {
 var CompassHeading = function(magneticHeading, trueHeading, headingAccuracy, timestamp) {
   this.magneticHeading = (magneticHeading !== undefined ? magneticHeading : null);
@@ -1272,7 +1278,7 @@ var CompassHeading = function(magneticHeading, trueHeading, headingAccuracy,
tim
 module.exports = CompassHeading;
 });
 
-// file: lib\common\plugin\ConfigurationData.js
+// file: lib/common/plugin/ConfigurationData.js
 define("cordova/plugin/ConfigurationData", function(require, exports, module) {
 /**
  * Encapsulates a set of parameters that the capture device supports.
@@ -1291,7 +1297,7 @@ function ConfigurationData() {
 module.exports = ConfigurationData;
 });
 
-// file: lib\common\plugin\Connection.js
+// file: lib/common/plugin/Connection.js
 define("cordova/plugin/Connection", function(require, exports, module) {
 /**
  * Network status
@@ -1307,7 +1313,7 @@ module.exports = {
 };
 });
 
-// file: lib\common\plugin\Contact.js
+// file: lib/common/plugin/Contact.js
 define("cordova/plugin/Contact", function(require, exports, module) {
 var exec = require('cordova/exec'),
     ContactError = require('cordova/plugin/ContactError'),
@@ -1489,7 +1495,7 @@ module.exports = Contact;
 
 });
 
-// file: lib\common\plugin\ContactAddress.js
+// file: lib/common/plugin/ContactAddress.js
 define("cordova/plugin/ContactAddress", function(require, exports, module) {
 /**
 * Contact address.
@@ -1518,7 +1524,7 @@ var ContactAddress = function(pref, type, formatted, streetAddress,
locality, re
 module.exports = ContactAddress;
 });
 
-// file: lib\common\plugin\ContactError.js
+// file: lib/common/plugin/ContactError.js
 define("cordova/plugin/ContactError", function(require, exports, module) {
 /**
  *  ContactError.
@@ -1543,7 +1549,7 @@ ContactError.PERMISSION_DENIED_ERROR = 20;
 module.exports = ContactError;
 });
 
-// file: lib\common\plugin\ContactField.js
+// file: lib/common/plugin/ContactField.js
 define("cordova/plugin/ContactField", function(require, exports, module) {
 /**
 * Generic contact field.
@@ -1563,7 +1569,7 @@ var ContactField = function(type, value, pref) {
 module.exports = ContactField;
 });
 
-// file: lib\common\plugin\ContactFindOptions.js
+// file: lib/common/plugin/ContactFindOptions.js
 define("cordova/plugin/ContactFindOptions", function(require, exports, module) {
 /**
  * ContactFindOptions.
@@ -1580,7 +1586,7 @@ var ContactFindOptions = function(filter, multiple) {
 module.exports = ContactFindOptions;
 });
 
-// file: lib\common\plugin\ContactName.js
+// file: lib/common/plugin/ContactName.js
 define("cordova/plugin/ContactName", function(require, exports, module) {
 /**
 * Contact name.
@@ -1604,7 +1610,7 @@ var ContactName = function(formatted, familyName, givenName, middle,
prefix, suf
 module.exports = ContactName;
 });
 
-// file: lib\common\plugin\ContactOrganization.js
+// file: lib/common/plugin/ContactOrganization.js
 define("cordova/plugin/ContactOrganization", function(require, exports, module) {
 /**
 * Contact organization.
@@ -1631,7 +1637,7 @@ var ContactOrganization = function(pref, type, name, dept, title) {
 module.exports = ContactOrganization;
 });
 
-// file: lib\common\plugin\Coordinates.js
+// file: lib/common/plugin/Coordinates.js
 define("cordova/plugin/Coordinates", function(require, exports, module) {
 /**
  * This class contains position information.
@@ -1684,7 +1690,7 @@ module.exports = Coordinates;
 
 });
 
-// file: lib\common\plugin\DirectoryEntry.js
+// file: lib/common/plugin/DirectoryEntry.js
 define("cordova/plugin/DirectoryEntry", function(require, exports, module) {
 var utils = require('cordova/utils'),
     exec = require('cordova/exec'),
@@ -1699,7 +1705,7 @@ var utils = require('cordova/utils'),
  * {boolean} isDirectory always true (readonly)
  * {DOMString} name of the directory, excluding the path leading to it (readonly)
  * {DOMString} fullPath the absolute full path to the directory (readonly)
- * {FileSystem} filesystem on which the directory resides (readonly)
+ * TODO: implement this!!! {FileSystem} filesystem on which the directory resides (readonly)
  */
 var DirectoryEntry = function(name, fullPath) {
      DirectoryEntry.__super__.constructor.apply(this, [false, true, name, fullPath]);
@@ -1770,7 +1776,7 @@ module.exports = DirectoryEntry;
 
 });
 
-// file: lib\common\plugin\DirectoryReader.js
+// file: lib/common/plugin/DirectoryReader.js
 define("cordova/plugin/DirectoryReader", function(require, exports, module) {
 var exec = require('cordova/exec'),
     FileError = require('cordova/plugin/FileError') ;
@@ -1817,7 +1823,7 @@ module.exports = DirectoryReader;
 
 });
 
-// file: lib\common\plugin\Entry.js
+// file: lib/common/plugin/Entry.js
 define("cordova/plugin/Entry", function(require, exports, module) {
 var exec = require('cordova/exec'),
     FileError = require('cordova/plugin/FileError'),
@@ -2039,7 +2045,7 @@ Entry.prototype.getParent = function(successCallback, errorCallback)
{
 module.exports = Entry;
 });
 
-// file: lib\common\plugin\File.js
+// file: lib/common/plugin/File.js
 define("cordova/plugin/File", function(require, exports, module) {
 /**
  * Constructor.
@@ -2061,7 +2067,7 @@ var File = function(name, fullPath, type, lastModifiedDate, size){
 module.exports = File;
 });
 
-// file: lib\common\plugin\FileEntry.js
+// file: lib/common/plugin/FileEntry.js
 define("cordova/plugin/FileEntry", function(require, exports, module) {
 var utils = require('cordova/utils'),
     exec = require('cordova/exec'),
@@ -2128,7 +2134,7 @@ FileEntry.prototype.file = function(successCallback, errorCallback)
{
 module.exports = FileEntry;
 });
 
-// file: lib\common\plugin\FileError.js
+// file: lib/common/plugin/FileError.js
 define("cordova/plugin/FileError", function(require, exports, module) {
 /**
  * FileError
@@ -2157,7 +2163,7 @@ FileError.PATH_EXISTS_ERR = 12;
 module.exports = FileError;
 });
 
-// file: lib\common\plugin\FileReader.js
+// file: lib/common/plugin/FileReader.js
 define("cordova/plugin/FileReader", function(require, exports, module) {
 var exec = require('cordova/exec'),
     FileError = require('cordova/plugin/FileError'),
@@ -2410,7 +2416,7 @@ FileReader.prototype.readAsArrayBuffer = function(file) {
 module.exports = FileReader;
 });
 
-// file: lib\common\plugin\FileSystem.js
+// file: lib/common/plugin/FileSystem.js
 define("cordova/plugin/FileSystem", function(require, exports, module) {
 var DirectoryEntry = require('cordova/plugin/DirectoryEntry');
 
@@ -2424,18 +2430,18 @@ var DirectoryEntry = require('cordova/plugin/DirectoryEntry');
 var FileSystem = function(name, root) {
     this.name = name || null;
     if (root) {
-        console.log('root.name ' + name);
-        console.log('root.root ' + root);
         this.root = new DirectoryEntry(root.name, root.fullPath);
     }
 };
 
 module.exports = FileSystem;
+
 });
 
-// file: lib\common\plugin\FileTransfer.js
+// file: lib/common/plugin/FileTransfer.js
 define("cordova/plugin/FileTransfer", function(require, exports, module) {
-var exec = require('cordova/exec');
+var exec = require('cordova/exec'),
+    FileTransferError = require('cordova/plugin/FileTransferError');
 
 /**
  * FileTransfer uploads a file to a remote server.
@@ -2454,6 +2460,8 @@ var FileTransfer = function() {};
 * @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults
to false
 */
 FileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback,
options, trustAllHosts) {
+    // sanity parameter checking
+    if (!filePath || !server) throw new Error("FileTransfer.upload requires filePath and
server URL parameters at the minimum.");
     // check for options
     var fileKey = null;
     var fileName = null;
@@ -2475,7 +2483,12 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback,
erro
         }
     }
 
-    exec(successCallback, errorCallback, 'FileTransfer', 'upload', [filePath, server, fileKey,
fileName, mimeType, params, trustAllHosts, chunkedMode]);
+    var fail = function(e) {
+        var error = new FileTransferError(e.code, e.source, e.target, e.http_status);
+        errorCallback(error);
+    };
+
+    exec(successCallback, fail, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName,
mimeType, params, trustAllHosts, chunkedMode]);
 };
 
 /**
@@ -2486,6 +2499,8 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback,
erro
  * @param errorCallback {Function}    Callback to be invoked upon error
  */
 FileTransfer.prototype.download = function(source, target, successCallback, errorCallback)
{
+    // sanity parameter checking
+    if (!source || !target) throw new Error("FileTransfer.download requires source URI and
target URI parameters at the minimum.");
     var win = function(result) {
         var entry = null;
         if (result.isDirectory) {
@@ -2500,6 +2515,12 @@ FileTransfer.prototype.download = function(source, target, successCallback,
erro
         entry.fullPath = result.fullPath;
         successCallback(entry);
     };
+
+    var fail = function(e) {
+        var error = new FileTransferError(e.code, e.source, e.target, e.http_status);
+        errorCallback(error);
+    };
+
     exec(win, errorCallback, 'FileTransfer', 'download', [source, target]);
 };
 
@@ -2507,14 +2528,17 @@ module.exports = FileTransfer;
 
 });
 
-// file: lib\common\plugin\FileTransferError.js
+// file: lib/common/plugin/FileTransferError.js
 define("cordova/plugin/FileTransferError", function(require, exports, module) {
 /**
  * FileTransferError
  * @constructor
  */
-var FileTransferError = function(code) {
+var FileTransferError = function(code, source, target, status) {
     this.code = code || null;
+    this.source = source || null;
+    this.target = target || null;
+    this.http_status = status || null;
 };
 
 FileTransferError.FILE_NOT_FOUND_ERR = 1;
@@ -2522,9 +2546,10 @@ FileTransferError.INVALID_URL_ERR = 2;
 FileTransferError.CONNECTION_ERR = 3;
 
 module.exports = FileTransferError;
+
 });
 
-// file: lib\common\plugin\FileUploadOptions.js
+// file: lib/common/plugin/FileUploadOptions.js
 define("cordova/plugin/FileUploadOptions", function(require, exports, module) {
 /**
  * Options to customize the HTTP request used to upload files.
@@ -2544,7 +2569,7 @@ var FileUploadOptions = function(fileKey, fileName, mimeType, params)
{
 module.exports = FileUploadOptions;
 });
 
-// file: lib\common\plugin\FileUploadResult.js
+// file: lib/common/plugin/FileUploadResult.js
 define("cordova/plugin/FileUploadResult", function(require, exports, module) {
 /**
  * FileUploadResult
@@ -2559,7 +2584,7 @@ var FileUploadResult = function() {
 module.exports = FileUploadResult;
 });
 
-// file: lib\common\plugin\FileWriter.js
+// file: lib/common/plugin/FileWriter.js
 define("cordova/plugin/FileWriter", function(require, exports, module) {
 var exec = require('cordova/exec'),
     FileError = require('cordova/plugin/FileError'),
@@ -2817,7 +2842,7 @@ module.exports = FileWriter;
 
 });
 
-// file: lib\common\plugin\Flags.js
+// file: lib/common/plugin/Flags.js
 define("cordova/plugin/Flags", function(require, exports, module) {
 /**
  * Supplies arguments to methods that lookup or create files and directories.
@@ -2836,7 +2861,7 @@ function Flags(create, exclusive) {
 module.exports = Flags;
 });
 
-// file: lib\common\plugin\LocalFileSystem.js
+// file: lib/common/plugin/LocalFileSystem.js
 define("cordova/plugin/LocalFileSystem", function(require, exports, module) {
 var exec = require('cordova/exec');
 
@@ -2853,7 +2878,7 @@ LocalFileSystem.PERSISTENT = 1; //persistent
 module.exports = LocalFileSystem;
 });
 
-// file: lib\common\plugin\Media.js
+// file: lib/common/plugin/Media.js
 define("cordova/plugin/Media", function(require, exports, module) {
 var utils = require('cordova/utils'),
     exec = require('cordova/exec');
@@ -3044,7 +3069,7 @@ Media.onStatus = function(id, msg, value) {
 module.exports = Media;
 });
 
-// file: lib\common\plugin\MediaError.js
+// file: lib/common/plugin/MediaError.js
 define("cordova/plugin/MediaError", function(require, exports, module) {
 /**
  * This class contains information about any Media errors.
@@ -3064,7 +3089,7 @@ MediaError.MEDIA_ERR_NONE_SUPPORTED = 4;
 module.exports = MediaError;
 });
 
-// file: lib\common\plugin\MediaFile.js
+// file: lib/common/plugin/MediaFile.js
 define("cordova/plugin/MediaFile", function(require, exports, module) {
 var utils = require('cordova/utils'),
     exec = require('cordova/exec'),
@@ -3125,7 +3150,7 @@ module.exports = MediaFile;
 
 });
 
-// file: lib\common\plugin\MediaFileData.js
+// file: lib/common/plugin/MediaFileData.js
 define("cordova/plugin/MediaFileData", function(require, exports, module) {
 /**
  * MediaFileData encapsulates format information of a media file.
@@ -3147,7 +3172,7 @@ var MediaFileData = function(codecs, bitrate, height, width, duration){
 module.exports = MediaFileData;
 });
 
-// file: lib\common\plugin\Metadata.js
+// file: lib/common/plugin/Metadata.js
 define("cordova/plugin/Metadata", function(require, exports, module) {
 /**
  * Information about the state of the file or directory
@@ -3161,7 +3186,7 @@ var Metadata = function(time) {
 module.exports = Metadata;
 });
 
-// file: lib\common\plugin\Position.js
+// file: lib/common/plugin/Position.js
 define("cordova/plugin/Position", function(require, exports, module) {
 var Coordinates = require('cordova/plugin/Coordinates');
 
@@ -3178,7 +3203,7 @@ module.exports = Position;
 
 });
 
-// file: lib\common\plugin\PositionError.js
+// file: lib/common/plugin/PositionError.js
 define("cordova/plugin/PositionError", function(require, exports, module) {
 /**
  * Position error object
@@ -3199,7 +3224,7 @@ PositionError.TIMEOUT = 3;
 module.exports = PositionError;
 });
 
-// file: lib\common\plugin\ProgressEvent.js
+// file: lib/common/plugin/ProgressEvent.js
 define("cordova/plugin/ProgressEvent", function(require, exports, module) {
 // If ProgressEvent exists in global context, use it already, otherwise use our own polyfill
 // Feature test: See if we can instantiate a native ProgressEvent;
@@ -3249,7 +3274,7 @@ var ProgressEvent = (function() {
 module.exports = ProgressEvent;
 });
 
-// file: lib\common\plugin\accelerometer.js
+// file: lib/common/plugin/accelerometer.js
 define("cordova/plugin/accelerometer", function(require, exports, module) {
 /**
  * This class provides access to device accelerometer data.
@@ -3406,7 +3431,7 @@ module.exports = accelerometer;
 
 });
 
-// file: lib\bada\plugin\bada\Accelerometer.js
+// file: lib/bada/plugin/bada/Accelerometer.js
 define("cordova/plugin/bada/Accelerometer", function(require, exports, module) {
 var Acceleration = require('cordova/plugin/Acceleration');
 
@@ -3446,7 +3471,7 @@ module.exports = {
 
 });
 
-// file: lib\bada\plugin\bada\Camera.js
+// file: lib/bada/plugin/bada/Camera.js
 define("cordova/plugin/bada/Camera", function(require, exports, module) {
 module.exports = {
     _mainCamera: null,
@@ -3509,7 +3534,7 @@ module.exports = {
 
 });
 
-// file: lib\bada\plugin\bada\Capture.js
+// file: lib/bada/plugin/bada/Capture.js
 define("cordova/plugin/bada/Capture", function(require, exports, module) {
 module.exports = {
     startVideoCapture: function(success, fail, options) {
@@ -3584,7 +3609,7 @@ module.exports = {
 
 });
 
-// file: lib\bada\plugin\bada\Compass.js
+// file: lib/bada/plugin/bada/Compass.js
 define("cordova/plugin/bada/Compass", function(require, exports, module) {
 var CompassHeading = require('cordova/plugin/CompassHeading');
 
@@ -3608,7 +3633,7 @@ module.exports = {
 
 });
 
-// file: lib\bada\plugin\bada\Contacts.js
+// file: lib/bada/plugin/bada/Contacts.js
 define("cordova/plugin/bada/Contacts", function(require, exports, module) {
 var allowedAddressTypes = ["WORK", "HOME", "PREF"];
 
@@ -3868,157 +3893,7 @@ module.exports = {
 
 });
 
-// file: lib\bada\plugin\bada\File.js
-define("cordova/plugin/bada/File", function(require, exports, module) {
-var LocalFileSystem = require('cordova/plugin/LocalFileSystem'),
-    FileSystem = require('cordova/plugin/FileSystem');
-
-module.exports = {
-    /*
-     * @params: [type, size]
-     */
-    requestFileSystem: function(success, fail, params) {
-        console.log("File.requestFileSystem");
-        var type = params[0];
-        var name = "wgt-private";
-
-        if(type === LocalFileSystem.TEMPORARY) {
-            name = "wgt-private-tmp";
-        }
-        var resolveSuccess = function(dir) {
-            success({name: name, root: {name: name, fullPath: dir.fullPath}});
-        };
-        var resolveError = function(e) {
-            fail(e);
-        };
-        deviceapis.filesystem.resolve(resolveSuccess, resolveError, name, 'r');
-    },
-    /*
-     * @params: [fullPath, path, options]
-     */
-    getDirectory: function(success, fail, params) {
-        console.log("File.getDirectory");
-        var fullPath = params[0],
-            path = params[1],
-            options = params[2];
-        var resolveSuccess = function(dir) {
-            dir.createDirectory(path);
-        };
-        var resolveError = function(e) {
-            fail(e);
-        };
-        deviceapis.filesystem.resolve(resolveSuccess, resolveError, fullPath, 'rw');
-    },
-    /*
-     * @params: fullPath
-     */
-    removeRecursively: function(success, fail, params) {
-        console.log("File.removeRecursively");
-
-    },
-    /*
-     * @params: fullPath, path, options
-     */
-    getFile: function(success, fail, params) {
-        console.log("File.getFile");
-
-    },
-    /*
-     * @params: fullPath, path, options
-     */
-    readEntries: function(success, fail, params) {
-        console.log("File.readEntries");
-    },
-    /*
-     * @params: fullPath
-     */
-    getFileMetadata: function(success, fail, params) {
-        console.log("File.getFileMetadata");
-    },
-    /*
-     * @params: fullPath
-     */
-    getMetadata: function(success, fail, params) {
-        console.log("File.getMetadata");
-    },
-    /*
-     * @params: fullPath, metadataObject
-     */
-    setMetadata: function(success, fail, params) {
-        console.log("File.setMetadata");
-    },
-    /*
-     * @params: [fileName, enc]
-     */
-    readAsText: function(success, fail, params) {
-        console.log("File.readAsText");
-    },
-    /*
-     * @params: [srcPath, parent.fullPath, name]
-     */
-    moveTo: function(success, fail, params) {
-        console.log("File.moveTo");
-    },
-    /*
-     * @params: [srcPath, parent.fullPath, name]
-     */
-    copyTo: function(success, fail, params) {
-        console.log("File.copyTo");
-    },
-    /*
-     * @params: [fullPath]
-     */
-    remove: function(success, fail, params) {
-        console.log("File.remove");
-    },
-    /*
-     * @params: [fullPath]
-     */
-    getParent: function(success, fail, params) {
-        console.log("File.getParent");
-    },
-    /*
-     * @params: fileName
-     */
-    readAsDataURL: function(success, fail, params) {
-        console.log("File.readAsDataURL");
-    },
-    /*
-     * @params: fileName, text, position
-     */
-    write: function(success, fail, params) {
-        console.log("File.write");
-    },
-    /*
-     * @params: fileName, size
-     */
-    truncate: function(success, fail, params) {
-        console.log("File.truncate");
-    }
-};
-
-});
-
-// file: lib\bada\plugin\bada\FileTransfer.js
-define("cordova/plugin/bada/FileTransfer", function(require, exports, module) {
-module.exports = {
-    /*
-     * @params: filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode
-     */
-    upload: function(success, fail, params) {
-        console.log("FileTransfer.upload");
-    },
-    /*
-     * @params: source, target
-     */
-    download: function(success, fail, params) {
-        console.log("FileTransfer.download");
-    }
-};
-
-});
-
-// file: lib\bada\plugin\bada\NetworkStatus.js
+// file: lib/bada/plugin/bada/NetworkStatus.js
 define("cordova/plugin/bada/NetworkStatus", function(require, exports, module) {
 var channel = require('cordova/channel'),
     Connection = require("cordova/plugin/Connection");
@@ -4063,7 +3938,7 @@ module.exports = {
 
 });
 
-// file: lib\bada\plugin\bada\Notification.js
+// file: lib/bada/plugin/bada/Notification.js
 define("cordova/plugin/bada/Notification", function(require, exports, module) {
 module.exports = {
     alert: function(message, alertCallback, title, buttonName) {
@@ -4118,12 +3993,15 @@ module.exports = {
 
 });
 
-// file: lib\bada\plugin\bada\device.js
+// file: lib/bada/plugin/bada/device.js
 define("cordova/plugin/bada/device", function(require, exports, module) {
-var channel = require('cordova/channel');
+var channel = require('cordova/channel'),
+    utils = require('cordova/utils');
 
-function Device() {
+// Tell cordova channel to wait on the CordovaInfoReady event
+channel.waitForInitialization('onCordovaInfoReady');
 
+function Device() {
     this.platform = null;
     this.version = null;
     this.name = null;
@@ -4141,11 +4019,10 @@ function Device() {
            me.cordova  = device.cordova;
 
            channel.onCordovaInfoReady.fire();
-           //console.log("CordovaInfoReady "+JSON.stringify(device));
        },
        function (e) {
            me.available = false;
-           console.log("error initializing cordova: " + e);
+           utils.alert("error initializing cordova: " + e);
        });
     });
 }
@@ -4207,7 +4084,7 @@ module.exports = new Device();
 
 });
 
-// file: lib\common\plugin\battery.js
+// file: lib/common/plugin/battery.js
 define("cordova/plugin/battery", function(require, exports, module) {
 /**
  * This class contains information about the current battery status.
@@ -4298,7 +4175,7 @@ var battery = new Battery();
 module.exports = battery;
 });
 
-// file: lib\common\plugin\capture.js
+// file: lib/common/plugin/capture.js
 define("cordova/plugin/capture", function(require, exports, module) {
 var exec = require('cordova/exec'),
     MediaFile = require('cordova/plugin/MediaFile');
@@ -4375,7 +4252,7 @@ module.exports = new Capture();
 
 });
 
-// file: lib\common\plugin\compass.js
+// file: lib/common/plugin/compass.js
 define("cordova/plugin/compass", function(require, exports, module) {
 var exec = require('cordova/exec'),
     utils = require('cordova/utils'),
@@ -4480,7 +4357,7 @@ var exec = require('cordova/exec'),
 module.exports = compass;
 });
 
-// file: lib\common\plugin\console-via-logger.js
+// file: lib/common/plugin/console-via-logger.js
 define("cordova/plugin/console-via-logger", function(require, exports, module) {
 //------------------------------------------------------------------------------
 
@@ -4651,7 +4528,7 @@ for (var key in console) {
 
 });
 
-// file: lib\common\plugin\contacts.js
+// file: lib/common/plugin/contacts.js
 define("cordova/plugin/contacts", function(require, exports, module) {
 var exec = require('cordova/exec'),
     ContactError = require('cordova/plugin/ContactError'),
@@ -4714,7 +4591,75 @@ module.exports = contacts;
 
 });
 
-// file: lib\common\plugin\geolocation.js
+// file: lib/common/plugin/device.js
+define("cordova/plugin/device", function(require, exports, module) {
+var channel = require('cordova/channel'),
+    utils = require('cordova/utils'),
+    exec = require('cordova/exec');
+
+// Tell cordova channel to wait on the CordovaInfoReady event
+channel.waitForInitialization('onCordovaInfoReady');
+
+/**
+ * This represents the mobile device, and provides properties for inspecting the model, version,
UUID of the
+ * phone, etc.
+ * @constructor
+ */
+function Device() {
+    this.available = false;
+    this.platform = null;
+    this.version = null;
+    this.name = null;
+    this.uuid = null;
+    this.cordova = null;
+
+    var me = this;
+
+    channel.onCordovaReady.subscribeOnce(function() {
+        me.getInfo(function(info) {
+            me.available = true;
+            me.platform = info.platform;
+            me.version = info.version;
+            me.name = info.name;
+            me.uuid = info.uuid;
+            me.cordova = info.cordova;
+            channel.onCordovaInfoReady.fire();
+        },function(e) {
+            me.available = false;
+            utils.alert("[ERROR] Error initializing Cordova: " + e);
+        });
+    });
+}
+
+/**
+ * Get device info
+ *
+ * @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 getting the
heading data. (OPTIONAL)
+ */
+Device.prototype.getInfo = function(successCallback, errorCallback) {
+
+    // successCallback required
+    if (typeof successCallback !== "function") {
+        console.log("Device Error: successCallback is not a function");
+        return;
+    }
+
+    // errorCallback optional
+    if (errorCallback && (typeof errorCallback !== "function")) {
+        console.log("Device Error: errorCallback is not a function");
+        return;
+    }
+
+    // Get info
+    exec(successCallback, errorCallback, "Device", "getDeviceInfo", []);
+};
+
+module.exports = new Device();
+
+});
+
+// file: lib/common/plugin/geolocation.js
 define("cordova/plugin/geolocation", function(require, exports, module) {
 var utils = require('cordova/utils'),
     exec = require('cordova/exec'),
@@ -4912,7 +4857,7 @@ module.exports = geolocation;
 
 });
 
-// file: lib\common\plugin\logger.js
+// file: lib/common/plugin/logger.js
 define("cordova/plugin/logger", function(require, exports, module) {
 //------------------------------------------------------------------------------
 // The logger module exports the following properties/functions:
@@ -5139,7 +5084,7 @@ document.addEventListener("deviceready", logger.__onDeviceReady, false);
 
 });
 
-// file: lib\common\plugin\network.js
+// file: lib/common/plugin/network.js
 define("cordova/plugin/network", function(require, exports, module) {
 var exec = require('cordova/exec'),
     cordova = require('cordova'),
@@ -5203,7 +5148,7 @@ NetworkConnection.prototype.getInfo = function (successCallback, errorCallback)
 module.exports = new NetworkConnection();
 });
 
-// file: lib\common\plugin\notification.js
+// file: lib/common/plugin/notification.js
 define("cordova/plugin/notification", function(require, exports, module) {
 var exec = require('cordova/exec');
 
@@ -5263,7 +5208,7 @@ module.exports = {
 };
 });
 
-// file: lib\common\plugin\requestFileSystem.js
+// file: lib/common/plugin/requestFileSystem.js
 define("cordova/plugin/requestFileSystem", function(require, exports, module) {
 var FileError = require('cordova/plugin/FileError'),
     FileSystem = require('cordova/plugin/FileSystem'),
@@ -5307,7 +5252,7 @@ var requestFileSystem = function(type, size, successCallback, errorCallback)
{
 module.exports = requestFileSystem;
 });
 
-// file: lib\common\plugin\resolveLocalFileSystemURI.js
+// file: lib/common/plugin/resolveLocalFileSystemURI.js
 define("cordova/plugin/resolveLocalFileSystemURI", function(require, exports, module) {
 var DirectoryEntry = require('cordova/plugin/DirectoryEntry'),
     FileEntry = require('cordova/plugin/FileEntry'),
@@ -5360,11 +5305,14 @@ module.exports = function(uri, successCallback, errorCallback) {
 
 });
 
-// file: lib\common\plugin\splashscreen.js
+// file: lib/common/plugin/splashscreen.js
 define("cordova/plugin/splashscreen", function(require, exports, module) {
 var exec = require('cordova/exec');
 
 var splashscreen = {
+    show:function() {
+        exec(null, null, "SplashScreen", "show", []);
+    },
     hide:function() {
         exec(null, null, "SplashScreen", "hide", []);
     }
@@ -5373,7 +5321,7 @@ var splashscreen = {
 module.exports = splashscreen;
 });
 
-// file: lib\common\utils.js
+// file: lib/common/utils.js
 define("cordova/utils", function(require, exports, module) {
 var utils = exports;
 
@@ -5567,7 +5515,7 @@ function formatted(object, formatChar) {
 
 window.cordova = require('cordova');
 
-// file: lib\scripts\bootstrap.js
+// file: lib/scripts/bootstrap.js
 (function (context) {
     var channel = require("cordova/channel"),
         _self = {
@@ -5621,8 +5569,8 @@ window.cordova = require('cordova');
 
 }(window));
 
-// file: lib\scripts\bootstrap-bada.js
+// file: lib/scripts/bootstrap-bada.js
 require('cordova/channel').onNativeReady.fire();
 
 
-})();
+})();
\ No newline at end of file


Mime
View raw message