You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2013/05/17 19:53:19 UTC

[01/26] js commit: [Tizen, Tizen SDK 2.0 (Magnolia)] - Accelerometer

Updated Branches:
  refs/heads/3.0.0 bb10068e8 -> 8ac64ca00


[Tizen, Tizen SDK 2.0 (Magnolia)] - Accelerometer

Adapt Accelerometer, namespace, variables names, cleanup


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/34156064
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/34156064
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/34156064

Branch: refs/heads/3.0.0
Commit: 34156064546ff2bdefc76daa2b4aa910a0e4297f
Parents: d263377
Author: pplaquette <pp...@apache.org>
Authored: Wed Apr 17 11:12:55 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri Apr 19 11:07:13 2013 +0200

----------------------------------------------------------------------
 lib/tizen/plugin/tizen/Accelerometer.js |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/34156064/lib/tizen/plugin/tizen/Accelerometer.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Accelerometer.js b/lib/tizen/plugin/tizen/Accelerometer.js
index ef903f3..f6d6d20 100644
--- a/lib/tizen/plugin/tizen/Accelerometer.js
+++ b/lib/tizen/plugin/tizen/Accelerometer.js
@@ -19,22 +19,29 @@
  *
 */
 
-var callback = null;
+var accelerometerCallback = null;
 
 module.exports = {
+
     start: function (successCallback, errorCallback) {
-        window.removeEventListener("devicemotion", callback);
-        callback = function (motion) {
+
+        if (accelerometerCallback) {
+            window.removeEventListener("devicemotion", accelerometerCallback, true);
+        }
+
+        accelerometerCallback = function (motion) {
             successCallback({
                 x: motion.accelerationIncludingGravity.x,
                 y: motion.accelerationIncludingGravity.y,
                 z: motion.accelerationIncludingGravity.z,
-                timestamp: motion.timeStamp
+                timestamp: motion.interval
             });
         };
-        window.addEventListener("devicemotion", callback);
+        window.addEventListener("devicemotion", accelerometerCallback, true);
     },
+
     stop: function (successCallback, errorCallback) {
-        window.removeEventListener("devicemotion", callback);
+        window.removeEventListener("devicemotion", accelerometerCallback, true);
+        accelerometerCallback = null;
     }
 };


[18/26] js commit: Merge branch 'master' into magnolia

Posted by st...@apache.org.
Merge branch 'master' into magnolia

Conflicts:
	lib/tizen/plugin/tizen/Device.js


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/2142edd0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/2142edd0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/2142edd0

Branch: refs/heads/3.0.0
Commit: 2142edd00727380b4f39bc7368e1966eb562672e
Parents: 8bcf44f 757fa3c
Author: pplaquette <pp...@apache.org>
Authored: Fri May 17 14:53:49 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri May 17 14:53:49 2013 +0200

----------------------------------------------------------------------
 .jshintrc                                          |    2 +-
 Jakefile                                           |   91 ++--
 VERSION                                            |    2 +-
 build/packager.js                                  |   23 +-
 lib/bada/plugin/bada/device.js                     |    2 +-
 lib/blackberry/platform.js                         |    5 +-
 lib/blackberry/plugin/air/device.js                |    2 +-
 lib/blackberry/plugin/qnx/InAppBrowser.js          |   86 ---
 lib/blackberry/plugin/qnx/battery.js               |   40 -
 lib/blackberry/plugin/qnx/camera.js                |   32 -
 lib/blackberry/plugin/qnx/capture.js               |   76 --
 lib/blackberry/plugin/qnx/compass.js               |  162 -----
 lib/blackberry/plugin/qnx/device.js                |   41 --
 lib/blackberry/plugin/qnx/file.js                  |  424 -----------
 lib/blackberry/plugin/qnx/fileTransfer.js          |  205 ------
 lib/blackberry/plugin/qnx/magnetometer.js          |   45 --
 lib/blackberry/plugin/qnx/manager.js               |   60 --
 lib/blackberry/plugin/qnx/network.js               |   28 -
 lib/blackberry/plugin/qnx/platform.js              |   44 --
 lib/blackberry10/exec.js                           |   49 ++
 lib/blackberry10/platform.js                       |   37 +
 lib/blackberry10/plugin/DirectoryEntry.js          |   57 ++
 lib/blackberry10/plugin/DirectoryReader.js         |   47 ++
 lib/blackberry10/plugin/Entry.js                   |  112 +++
 lib/blackberry10/plugin/FileEntry.js               |   47 ++
 lib/blackberry10/plugin/FileReader.js              |   90 +++
 lib/blackberry10/plugin/FileSystem.js              |   27 +
 lib/blackberry10/plugin/FileWriter.js              |  120 ++++
 .../plugin/blackberry10/InAppBrowser.js            |   86 +++
 lib/blackberry10/plugin/blackberry10/capture.js    |   76 ++
 lib/blackberry10/plugin/blackberry10/compass.js    |  162 +++++
 lib/blackberry10/plugin/blackberry10/event.js      |  102 +++
 lib/blackberry10/plugin/blackberry10/exception.js  |   74 ++
 .../plugin/blackberry10/fileTransfer.js            |  202 ++++++
 lib/blackberry10/plugin/blackberry10/fileUtils.js  |   47 ++
 .../plugin/blackberry10/magnetometer.js            |   45 ++
 lib/blackberry10/plugin/blackberry10/media.js      |  189 +++++
 lib/blackberry10/plugin/blackberry10/utils.js      |  556 +++++++++++++++
 lib/blackberry10/plugin/blackberry10/vibrate.js    |   31 +
 lib/blackberry10/plugin/requestFileSystem.js       |   38 +
 .../plugin/resolveLocalFileSystemURI.js            |   55 ++
 lib/common/plugin/CaptureAudioOptions.js           |    2 -
 lib/common/plugin/CaptureImageOptions.js           |    2 -
 lib/common/plugin/CaptureVideoOptions.js           |    2 -
 lib/common/plugin/device.js                        |    6 +-
 lib/common/plugin/logger.js                        |   48 +-
 lib/common/plugin/notification.js                  |    8 +-
 lib/firefoxos/plugin/firefoxos/device.js           |    2 +-
 lib/ios/exec.js                                    |   18 +-
 lib/ios/plugin/ios/logger/plugininit.js            |    2 +-
 lib/scripts/bootstrap-blackberry.js                |   20 +-
 lib/scripts/bootstrap-blackberry10.js              |  136 ++++
 lib/scripts/plugin_loader.js                       |   36 +-
 lib/scripts/require.js                             |   21 +-
 lib/tizen/plugin/tizen/Device.js                   |    4 +-
 lib/windows8/platform.js                           |    4 +-
 lib/windows8/plugin/windows8/DeviceProxy.js        |    2 +-
 lib/windowsphone/plugin/file/symbols.js            |    2 -
 .../plugin/windowsphone/notification/plugininit.js |   23 -
 test/blackberry/qnx/test.battery.js                |   72 --
 test/blackberry/qnx/test.camera.js                 |   59 --
 test/blackberry/qnx/test.capture.js                |  222 ------
 test/blackberry/qnx/test.compass.js                |   61 --
 test/blackberry/qnx/test.device.js                 |   48 --
 test/blackberry/qnx/test.fileTransfer.js           |   85 ---
 test/blackberry/qnx/test.magnetometer.js           |   80 --
 test/blackberry/qnx/test.manager.js                |   56 --
 test/blackberry/qnx/test.network.js                |   39 -
 test/blackberry/qnx/test.platform.js               |  123 ----
 test/blackberry/test.exec.js                       |   16 +-
 test/blackberry/test.platform.js                   |   25 +-
 test/blackberry10/test.capture.js                  |  222 ++++++
 test/blackberry10/test.compass.js                  |   61 ++
 test/blackberry10/test.event.js                    |  188 +++++
 test/blackberry10/test.magnetometer.js             |   80 ++
 test/runner.js                                     |    2 +-
 test/test.notification.js                          |    6 +-
 test/test.require.js                               |    2 +-
 78 files changed, 3124 insertions(+), 2280 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/2142edd0/lib/tizen/plugin/tizen/Device.js
----------------------------------------------------------------------
diff --cc lib/tizen/plugin/tizen/Device.js
index 15be7fe,75b12fe..daeb5ec
--- a/lib/tizen/plugin/tizen/Device.js
+++ b/lib/tizen/plugin/tizen/Device.js
@@@ -22,43 -22,36 +22,43 @@@
  /*global tizen:false */
  var channel = require('cordova/channel');
  
 -// Tell cordova channel to wait on the CordovaInfoReady event
 -channel.waitForInitialization('onCordovaInfoReady');
 +console.log("TIZEN DEVICE START");
 +
 +
- // Tell cordova channel to wait on the CordovaInfoReady event
++// Tell cordova channel to wait on the CordovaInfoReady event - PPL is this useful?
 +//channel.waitForInitialization('onCordovaInfoReady');
  
  function Device() {
      this.version = null;
      this.uuid = null;
      this.name = null;
 +    this.model = null;
-     this.cordova = "2.5.0";
+     this.cordova = CORDOVA_JS_BUILD_LABEL;
      this.platform = "Tizen";
 +   
 +    this.getDeviceInfo();
 +}
  
 -    var me = this;
 +Device.prototype.getDeviceInfo = function() {
 +    
 +    var deviceCapabilities =  tizen.systeminfo.getCapabilities();
 +    
 +    if (deviceCapabilities) {
 +        
 +        this.version = deviceCapabilities.platformVersion;
 +        this.uuid = deviceCapabilities.duid;
 +        this.model = deviceCapabilities.platformName;
 +        this.name = this.model;
  
 -    function onSuccessCallback(sysInfoProp) {
 -        me.name = sysInfoProp.model;
 -        me.uuid = sysInfoProp.imei;
 -        me.version = sysInfoProp.version;
          channel.onCordovaInfoReady.fire();
 -    }
 +     }
 +     else {
 +         console.log("error initializing cordova: ");
 +     }
 +};
  
 -    function onErrorCallback(error) {
 -        console.log("error initializing cordova: " + error);
 -    }
 +module.exports = new Device();
  
 -    channel.onCordovaReady.subscribe(function() {
 -        me.getDeviceInfo(onSuccessCallback, onErrorCallback);
 -    });
 -}
 +console.log("TIZEN DEVICE END");
  
 -Device.prototype.getDeviceInfo = function(success, fail, args) {
 -    tizen.systeminfo.getPropertyValue("Device", success, fail);
 -};
  
 -module.exports = new Device();


[17/26] js commit: [CB-3393] plugin_loader fix for pages in subdirectories.

Posted by st...@apache.org.
[CB-3393] plugin_loader fix for pages in subdirectories.


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/1a148c0a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/1a148c0a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/1a148c0a

Branch: refs/heads/3.0.0
Commit: 1a148c0af8b9e7bcc76d3096889ac1c1d4ad77e4
Parents: 757fa3c
Author: Fil Maj <ma...@gmail.com>
Authored: Thu May 16 19:26:51 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Thu May 16 19:26:51 2013 -0700

----------------------------------------------------------------------
 lib/scripts/plugin_loader.js |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/1a148c0a/lib/scripts/plugin_loader.js
----------------------------------------------------------------------
diff --git a/lib/scripts/plugin_loader.js b/lib/scripts/plugin_loader.js
index 357f8a7..892bd76 100644
--- a/lib/scripts/plugin_loader.js
+++ b/lib/scripts/plugin_loader.js
@@ -54,7 +54,7 @@
     // See plugman's plugin_loader.js for the details of this object.
     // This function is only called if the really is a plugins array that isn't empty.
     // Otherwise the XHR response handler will just call finishPluginLoading().
-    function handlePluginsObject(modules) {
+    function handlePluginsObject(modules, path) {
         // First create the callback for when all plugins are loaded.
         var mapper = context.cordova.require('cordova/modulemapper');
         onScriptLoadingComplete = function() {
@@ -88,11 +88,21 @@
 
         // Now inject the scripts.
         for (var i = 0; i < modules.length; i++) {
-            injectScript(modules[i].file);
+            injectScript(path + modules[i].file);
         }
     }
 
-
+    // Find the root of the app
+    var path = '';
+    var scripts = document.getElementsByTagName('script');
+    var term = 'cordova.js';
+    for (var n = scripts.length-1; n>-1; n--) {
+        var src = scripts[n].src;
+        if (src.indexOf(term) == (src.length - term.length)) {
+            path = src.substring(0, src.length - term.length);
+            break;
+        }
+    }
     // Try to XHR the cordova_plugins.json file asynchronously.
     var xhr = new XMLHttpRequest();
     xhr.onload = function() {
@@ -105,7 +115,7 @@
             // obj will be undefined.
         }
         if (Array.isArray(obj) && obj.length > 0) {
-            handlePluginsObject(obj);
+            handlePluginsObject(obj, path);
         } else {
             finishPluginLoading();
         }
@@ -113,8 +123,9 @@
     xhr.onerror = function() {
         finishPluginLoading();
     };
+    var plugins_json = path + 'cordova_plugins.json';
     try { // we commented we were going to try, so let us actually try and catch
-        xhr.open('GET', 'cordova_plugins.json', true); // Async
+        xhr.open('GET', plugins_json, true); // Async
         xhr.send();
     } catch(err){
         finishPluginLoading();


[11/26] js commit: [Tizen, Tisen SDK 2.0 (Magnolia)]

Posted by st...@apache.org.
[Tizen, Tisen SDK 2.0 (Magnolia)]

Adapt Camera to New SDK

Application Service manager was renamed ApplicationControl
Applyed related Changes
plus some cleaning, renaming ...


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/c139ba07
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/c139ba07
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/c139ba07

Branch: refs/heads/3.0.0
Commit: c139ba07796f015973be03956f6998f6820f95f1
Parents: cbb57b6
Author: pplaquette <pp...@apache.org>
Authored: Wed Apr 17 11:20:03 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri Apr 19 11:07:14 2013 +0200

----------------------------------------------------------------------
 lib/tizen/plugin/tizen/Camera.js |   75 ++++++++++++++++++++-------------
 1 files changed, 46 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/c139ba07/lib/tizen/plugin/tizen/Camera.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Camera.js b/lib/tizen/plugin/tizen/Camera.js
index 0a21c19..f88b6fc 100644
--- a/lib/tizen/plugin/tizen/Camera.js
+++ b/lib/tizen/plugin/tizen/Camera.js
@@ -22,12 +22,13 @@
 /*global tizen:false */
 var Camera = require('cordova/plugin/CameraConstants');
 
-function makeReplyCallback(successCallback, errorCallback) {
+function cameraMakeReplyCallback(successCallback, errorCallback) {
     return {
         onsuccess: function(reply) {
             if (reply.length > 0) {
                 successCallback(reply[0].value);
-            } else {
+            }
+            else {
                 errorCallback('Picture selection aborted');
             }
         },
@@ -43,6 +44,7 @@ module.exports = {
             sourceType = args[2],
             encodingType = args[5],
             mediaType = args[6];
+
             // Not supported
             /*
             quality = args[0]
@@ -53,34 +55,49 @@ module.exports = {
             saveToPhotoAlbum = args[9]
             */
 
-        if (destinationType !== Camera.DestinationType.FILE_URI) {
-            errorCallback('DestinationType not supported');
-            return;
-        }
-        if (mediaType !== Camera.MediaType.PICTURE) {
-            errorCallback('MediaType not supported');
-            return;
-        }
+            if (destinationType !== Camera.DestinationType.FILE_URI) {
+                errorCallback('DestinationType not supported');
+                return;
+            }
 
-        var mimeType;
-        if (encodingType === Camera.EncodingType.JPEG) {
-            mimeType = 'image/jpeg';
-        } else if (encodingType === Camera.EncodingType.PNG) {
-            mimeType = 'image/png';
-        } else {
-            mimeType = 'image/*';
-        }
+            if (mediaType !== Camera.MediaType.PICTURE) {
+                errorCallback('MediaType not supported');
+                return;
+            }
 
-        var serviceId;
-        if (sourceType === Camera.PictureSourceType.CAMERA) {
-            serviceId = 'http://tizen.org/appsvc/operation/create_content';
-        } else {
-            serviceId = 'http://tizen.org/appsvc/operation/pick';
-        }
+            var mimeType;
+            if (encodingType === Camera.EncodingType.JPEG) {
+                mimeType = 'image/jpeg';
+            }
+            else if (encodingType === Camera.EncodingType.PNG) {
+                mimeType = 'image/png';
+            }
+            else {
+                mimeType = 'image/*';
+            }
+
+            var serviceId;
+            if (sourceType === Camera.PictureSourceType.CAMERA) {
+                serviceId = 'http://tizen.org/appcontrol/operation/create_content';
+            }
+            else {
+                serviceId = 'http://tizen.org/appcontrol/operation/pick';
+            }
 
-        var service = new tizen.ApplicationService(serviceId, null, mimeType, null);
-        tizen.application.launchService(service, null, null,
-                function(error) { errorCallback(error.message); },
-                makeReplyCallback(successCallback, errorCallback));
-    }
+            var serviceControl = new tizen.ApplicationControl(
+                                serviceId,
+                                null,
+                                mimeType,
+                                null);
+
+            tizen.application.launchAppControl(
+                    serviceControl,
+                    null,
+                    null,
+                    function(error) {
+                        errorCallback(error.message);
+                    },
+                    cameraMakeReplyCallback(successCallback, errorCallback)
+            );
+        }
 };


[02/26] js commit: [Tizen, Tizen SDK 2.0, Device.js)

Posted by st...@apache.org.
[Tizen, Tizen SDK 2.0, Device.js)

1 - getDeviceInfo method of Device now fires channel.onCordovaInfoReady
2 - Device Constructor calls getDeviceInfo()


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/d263377d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/d263377d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/d263377d

Branch: refs/heads/3.0.0
Commit: d263377de2f0c738f9bc88e0914ffac93be50736
Parents: 03d3382
Author: pplaquette <pp...@apache.org>
Authored: Wed Apr 10 16:21:23 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri Apr 19 11:07:13 2013 +0200

----------------------------------------------------------------------
 lib/tizen/plugin/tizen/Device.js |   29 +++++++++++++++++++++++------
 1 files changed, 23 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/d263377d/lib/tizen/plugin/tizen/Device.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Device.js b/lib/tizen/plugin/tizen/Device.js
index c97c04e..6c80f92 100644
--- a/lib/tizen/plugin/tizen/Device.js
+++ b/lib/tizen/plugin/tizen/Device.js
@@ -32,14 +32,31 @@ function Device() {
     this.model = null;
     this.cordova = "2.5.0";
     this.platform = "Tizen";
+    
+   
+    this.getDeviceInfo()
+    
 }
 
-Device.prototype.getDeviceInfo = function(success, fail, args) {
-    var systemInfo =  tizen.systeminfo.getCapabilities();
-   
-    this.version = systemInfo.platformVersion;
-    this.uuid = systemInfo.duid;
-    this.model = systemInfo.platformName;
+Device.prototype.getDeviceInfo = function() {
+    
+    var deviceCapabilities =  tizen.systeminfo.getCapabilities();
+    
+    if (deviceCapabilities) {
+        
+        this.version = deviceCapabilities.platformVersion;
+        this.uuid = deviceCapabilities.duid;
+        this.model = deviceCapabilities.platformName;
+    
+        channel.onCordovaInfoReady.fire();
+     }
+     else {
+         console.log("error initializing cordova: ");
+     }
+
+
 };
 
 module.exports = new Device();
+
+


[24/26] js commit: removed compass code

Posted by st...@apache.org.
removed compass code


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/54961ec3
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/54961ec3
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/54961ec3

Branch: refs/heads/3.0.0
Commit: 54961ec34178d171bb9086cff2cf72fe8340de21
Parents: 8af2f2b
Author: Steven Gill <st...@gmail.com>
Authored: Tue May 14 15:41:36 2013 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Fri May 17 10:39:57 2013 -0700

----------------------------------------------------------------------
 lib/common/plugin/CompassError.js    |   34 ----------
 lib/common/plugin/CompassHeading.js  |   29 --------
 lib/common/plugin/compass.js         |  102 -----------------------------
 lib/common/plugin/compass/symbols.js |   26 -------
 4 files changed, 0 insertions(+), 191 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/54961ec3/lib/common/plugin/CompassError.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/CompassError.js b/lib/common/plugin/CompassError.js
deleted file mode 100644
index 7b5b485..0000000
--- a/lib/common/plugin/CompassError.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- *  CompassError.
- *  An error code assigned by an implementation when an error has occurred
- * @constructor
- */
-var CompassError = function(err) {
-    this.code = (err !== undefined ? err : null);
-};
-
-CompassError.COMPASS_INTERNAL_ERR = 0;
-CompassError.COMPASS_NOT_SUPPORTED = 20;
-
-module.exports = CompassError;

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/54961ec3/lib/common/plugin/CompassHeading.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/CompassHeading.js b/lib/common/plugin/CompassHeading.js
deleted file mode 100644
index 70343ee..0000000
--- a/lib/common/plugin/CompassHeading.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var CompassHeading = function(magneticHeading, trueHeading, headingAccuracy, timestamp) {
-  this.magneticHeading = magneticHeading;
-  this.trueHeading = trueHeading;
-  this.headingAccuracy = headingAccuracy;
-  this.timestamp = timestamp || new Date().getTime();
-};
-
-module.exports = CompassHeading;

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/54961ec3/lib/common/plugin/compass.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/compass.js b/lib/common/plugin/compass.js
deleted file mode 100644
index 896c706..0000000
--- a/lib/common/plugin/compass.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck'),
-    exec = require('cordova/exec'),
-    utils = require('cordova/utils'),
-    CompassHeading = require('cordova/plugin/CompassHeading'),
-    CompassError = require('cordova/plugin/CompassError'),
-    timers = {},
-    compass = {
-        /**
-         * 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
-         * getting the heading data.
-         * @param {CompassOptions} options The options for getting the heading data (not used).
-         */
-        getCurrentHeading:function(successCallback, errorCallback, options) {
-            argscheck.checkArgs('fFO', 'compass.getCurrentHeading', arguments);
-
-            var win = function(result) {
-                var ch = new CompassHeading(result.magneticHeading, result.trueHeading, result.headingAccuracy, result.timestamp);
-                successCallback(ch);
-            };
-            var fail = errorCallback && function(code) {
-                var ce = new CompassError(code);
-                errorCallback(ce);
-            };
-
-            // Get heading
-            exec(win, fail, "Compass", "getHeading", [options]);
-        },
-
-        /**
-         * 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
-         * 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
-         * specifies to watch via a distance filter rather than time.
-         */
-        watchHeading:function(successCallback, errorCallback, options) {
-            argscheck.checkArgs('fFO', 'compass.watchHeading', arguments);
-            // Default interval (100 msec)
-            var frequency = (options !== undefined && options.frequency !== undefined) ? options.frequency : 100;
-            var filter = (options !== undefined && options.filter !== undefined) ? options.filter : 0;
-
-            var id = utils.createUUID();
-            if (filter > 0) {
-                // is an iOS request for watch by filter, no timer needed
-                timers[id] = "iOS";
-                compass.getCurrentHeading(successCallback, errorCallback, options);
-            } else {
-                // Start watch timer to get headings
-                timers[id] = window.setInterval(function() {
-                    compass.getCurrentHeading(successCallback, errorCallback);
-                }, frequency);
-            }
-
-            return id;
-        },
-
-        /**
-         * Clears the specified heading watch.
-         * @param {String} watchId The ID of the watch returned from #watchHeading.
-         */
-        clearWatch:function(id) {
-            // Stop javascript timer & remove from timer list
-            if (id && timers[id]) {
-                if (timers[id] != "iOS") {
-                    clearInterval(timers[id]);
-                } else {
-                    // is iOS watch by filter so call into device to stop
-                    exec(null, null, "Compass", "stopHeading", []);
-                }
-                delete timers[id];
-            }
-        }
-    };
-
-module.exports = compass;

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/54961ec3/lib/common/plugin/compass/symbols.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/compass/symbols.js b/lib/common/plugin/compass/symbols.js
deleted file mode 100644
index 0ebfd9c..0000000
--- a/lib/common/plugin/compass/symbols.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-
-var modulemapper = require('cordova/modulemapper');
-
-modulemapper.clobbers('cordova/plugin/CompassHeading', 'CompassHeading');
-modulemapper.clobbers('cordova/plugin/CompassError', 'CompassError');
-modulemapper.clobbers('cordova/plugin/compass', 'navigator.compass');


[13/26] js commit: [Tizen, Tizen SDk 2.0 (Magnolia)] - Notification

Posted by st...@apache.org.
[Tizen, Tizen SDk 2.0 (Magnolia)] - Notification

Add basic support for Prompt() based on using window.prompt()


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/a7aaeee4
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/a7aaeee4
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/a7aaeee4

Branch: refs/heads/3.0.0
Commit: a7aaeee48d48a94c7f2e0d7a3bc628654da05b70
Parents: a26b43d
Author: pplaquette <pp...@apache.org>
Authored: Wed Apr 17 15:28:55 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri Apr 19 11:07:14 2013 +0200

----------------------------------------------------------------------
 lib/tizen/plugin/tizen/Notification.js |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/a7aaeee4/lib/tizen/plugin/tizen/Notification.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Notification.js b/lib/tizen/plugin/tizen/Notification.js
index 3819fcd..b5c90c6 100644
--- a/lib/tizen/plugin/tizen/Notification.js
+++ b/lib/tizen/plugin/tizen/Notification.js
@@ -124,6 +124,24 @@ module.exports = {
            element.addEventListener("click", createListener(element), false);
        }
     },
+    
+    prompt: function (message, promptCallback, title, buttonLabels) {
+        console.log ("message" , message);
+        console.log ("confirmCallback" , promptCallback);
+        console.log ("title" , title);
+        console.log ("buttonLabels" , buttonLabels);
+
+        //a temporary implementation using window.prompt()
+        // note taht buttons are cancel ok (in that order)
+        // gonna to return based on having OK  / Cancel
+        // ok is 1, cancel is 2
+
+        var result = prompt(message);
+        
+        if (promptCallback && (typeof promptCallback == "function")) {
+            promptCallback((result === null) ? 2 : 1, result);
+        }
+    },
 
     vibrate: function(milliseconds) {
         console.log ("milliseconds" , milliseconds);


[03/26] js commit: [Tizen, Tizen SDK 2.0, Devices.js]

Posted by st...@apache.org.
[Tizen, Tizen SDK 2.0, Devices.js]

re-implement Device.js, getDeviceInfo() for Tizen SDK 2.0


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/03d33825
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/03d33825
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/03d33825

Branch: refs/heads/3.0.0
Commit: 03d338256aa726406f758e4a02d4eb658f166e66
Parents: b23bc1c
Author: pplaquette <pp...@apache.org>
Authored: Wed Apr 10 15:17:46 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri Apr 19 11:07:13 2013 +0200

----------------------------------------------------------------------
 lib/tizen/plugin/tizen/Device.js |   26 ++++++--------------------
 1 files changed, 6 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/03d33825/lib/tizen/plugin/tizen/Device.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Device.js b/lib/tizen/plugin/tizen/Device.js
index 71408ef..c97c04e 100644
--- a/lib/tizen/plugin/tizen/Device.js
+++ b/lib/tizen/plugin/tizen/Device.js
@@ -23,7 +23,7 @@
 var channel = require('cordova/channel');
 
 // Tell cordova channel to wait on the CordovaInfoReady event
-channel.waitForInitialization('onCordovaInfoReady');
+//channel.waitForInitialization('onCordovaInfoReady');
 
 function Device() {
     this.version = null;
@@ -32,28 +32,14 @@ function Device() {
     this.model = null;
     this.cordova = "2.5.0";
     this.platform = "Tizen";
-
-    var me = this;
-
-    function onSuccessCallback(sysInfoProp) {
-        me.name = sysInfoProp.model;
-        me.model = sysInfoProp.model;
-        me.uuid = sysInfoProp.imei;
-        me.version = sysInfoProp.version;
-        channel.onCordovaInfoReady.fire();
-    }
-
-    function onErrorCallback(error) {
-        console.log("error initializing cordova: " + error);
-    }
-
-    channel.onCordovaReady.subscribe(function() {
-        me.getDeviceInfo(onSuccessCallback, onErrorCallback);
-    });
 }
 
 Device.prototype.getDeviceInfo = function(success, fail, args) {
-    tizen.systeminfo.getPropertyValue("Device", success, fail);
+    var systemInfo =  tizen.systeminfo.getCapabilities();
+   
+    this.version = systemInfo.platformVersion;
+    this.uuid = systemInfo.duid;
+    this.model = systemInfo.platformName;
 };
 
 module.exports = new Device();


[16/26] js commit: [Tizen, Tizen SDK 2.0 (Magnolia)] - several changes

Posted by st...@apache.org.
[Tizen, Tizen SDK 2.0 (Magnolia)] - several changes

add a few console.log ( they will typically be removed from final release)

revert exec to previous version so file can work.(inspiration from bada relying on using require and a plugins array was not a good idea
as it was leading to have circular reference that cound not get solved)

added missing function for files  and file transfer( there are not yet implemented  and mark with my Trigram PPL, as to be implemented , often i just copy an existing similar function )

Added comments in File and File Transfer


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/8bcf44f3
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/8bcf44f3
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/8bcf44f3

Branch: refs/heads/3.0.0
Commit: 8bcf44f309e43f61589538131bdadf8f7b5bdec9
Parents: ba4dff6
Author: pplaquette <pp...@apache.org>
Authored: Mon May 13 17:50:27 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Mon May 13 17:50:27 2013 +0200

----------------------------------------------------------------------
 lib/tizen/exec.js                       |   57 +++-
 lib/tizen/platform.js                   |   12 +
 lib/tizen/plugin/tizen/Accelerometer.js |    7 +-
 lib/tizen/plugin/tizen/Battery.js       |    4 +
 lib/tizen/plugin/tizen/Camera.js        |    5 +
 lib/tizen/plugin/tizen/Compass.js       |    7 +-
 lib/tizen/plugin/tizen/Contact.js       |   16 +-
 lib/tizen/plugin/tizen/ContactUtils.js  |    8 +-
 lib/tizen/plugin/tizen/Device.js        |    8 +-
 lib/tizen/plugin/tizen/File.js          |  651 ++++++++++++++++++--------
 lib/tizen/plugin/tizen/FileTransfer.js  |  193 +++++---
 lib/tizen/plugin/tizen/Media.js         |   79 +++-
 lib/tizen/plugin/tizen/NetworkStatus.js |   13 +-
 lib/tizen/plugin/tizen/Notification.js  |    5 +
 14 files changed, 757 insertions(+), 308 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/8bcf44f3/lib/tizen/exec.js
----------------------------------------------------------------------
diff --git a/lib/tizen/exec.js b/lib/tizen/exec.js
index 11a3be5..a47ce50 100644
--- a/lib/tizen/exec.js
+++ b/lib/tizen/exec.js
@@ -33,15 +33,34 @@
  * @param {String} action       Action to be run in cordova
  * @param {String[]} [args]     Zero or more arguments to pass to the method
  */
+/**
+ * Execute a cordova command.  It is up to the native side whether this action
+ * is synchronous or asynchronous.  The native side can return:
+ *      Synchronous: PluginResult object as a JSON string
+ *      Asynchronous: Empty string ""
+ * If async, the native side will cordova.callbackSuccess or cordova.callbackError,
+ * depending upon the result of the action.
+ *
+ * @param {Function} successCB  The success callback
+ * @param {Function} failCB     The fail callback
+ * @param {String} service      The name of the service to use
+ * @param {String} action       Action to be run in cordova
+ * @param {String[]} [args]     Zero or more arguments to pass to the method
+ */
+
+console.log("TIZEN EXEC START");
 
-var tizen = require('cordova/plugin/tizen/manager'),
+
+var manager = require('cordova/plugin/tizen/manager'),
     cordova = require('cordova'),
     utils = require('cordova/utils');
 
+console.log("TIZEN EXEC START 2");
+
 module.exports = function(successCB, failCB, service, action, args) {
 
     try {
-        var v = tizen.exec(successCB, failCB, service, action, args);
+        var v = manager.exec(successCB, failCB, service, action, args);
 
         // If status is OK, then return value back to caller
         if (v.status == cordova.callbackStatus.OK) {
@@ -78,3 +97,37 @@ module.exports = function(successCB, failCB, service, action, args) {
         utils.alert("Error: " + e);
     }
 };
+
+console.log("TIZEN EXEC END ");
+
+/*
+var plugins = {
+    "Device": require('cordova/plugin/tizen/Device'),
+    "NetworkStatus": require('cordova/plugin/tizen/NetworkStatus'),
+    "Accelerometer": require('cordova/plugin/tizen/Accelerometer'),
+    "Battery": require('cordova/plugin/tizen/Battery'),
+    "Compass": require('cordova/plugin/tizen/Compass'),
+    //"Capture": require('cordova/plugin/tizen/Capture'), not yet available
+    "Camera": require('cordova/plugin/tizen/Camera'),
+    "FileTransfer": require('cordova/plugin/tizen/FileTransfer'),
+    "Media": require('cordova/plugin/tizen/Media'),
+    "Notification": require('cordova/plugin/tizen/Notification')
+};
+
+console.log("TIZEN EXEC START");
+
+module.exports = function(success, fail, service, action, args) {
+    try {
+        console.log("exec: " + service + "." + action);
+        plugins[service][action](success, fail, args);
+    }
+    catch(e) {
+        console.log("missing exec: " + service + "." + action);
+        console.log(args);
+        console.log(e);
+        console.log(e.stack);
+    }
+};
+
+console.log("TIZEN EXEC START");
+*/

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/8bcf44f3/lib/tizen/platform.js
----------------------------------------------------------------------
diff --git a/lib/tizen/platform.js b/lib/tizen/platform.js
index 1860b57..82aed6e 100644
--- a/lib/tizen/platform.js
+++ b/lib/tizen/platform.js
@@ -19,9 +19,15 @@
  *
 */
 
+console.log("TIZEN PLATFORM START");
+
+
 module.exports = {
     id: "tizen",
     initialize: function() {
+
+        console.log("TIZEN PLATFORM initialize start");
+
         var modulemapper = require('cordova/modulemapper');
 
         //modulemapper.loadMatchingModules(/cordova.*\/plugininit$/);
@@ -29,5 +35,11 @@ module.exports = {
         modulemapper.loadMatchingModules(/cordova.*\/symbols$/);
 
         modulemapper.mapModules(window);
+
+        console.log("TIZEN PLATFORM initialize end");
+
     }
 };
+
+console.log("TIZEN PLATFORM START");
+

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/8bcf44f3/lib/tizen/plugin/tizen/Accelerometer.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Accelerometer.js b/lib/tizen/plugin/tizen/Accelerometer.js
index f6d6d20..4006c5c 100644
--- a/lib/tizen/plugin/tizen/Accelerometer.js
+++ b/lib/tizen/plugin/tizen/Accelerometer.js
@@ -21,6 +21,8 @@
 
 var accelerometerCallback = null;
 
+console.log("TIZEN ACCELEROMETER START");
+
 module.exports = {
 
     start: function (successCallback, errorCallback) {
@@ -34,7 +36,7 @@ module.exports = {
                 x: motion.accelerationIncludingGravity.x,
                 y: motion.accelerationIncludingGravity.y,
                 z: motion.accelerationIncludingGravity.z,
-                timestamp: motion.interval
+                timestamp: new Date().getTime()
             });
         };
         window.addEventListener("devicemotion", accelerometerCallback, true);
@@ -45,3 +47,6 @@ module.exports = {
         accelerometerCallback = null;
     }
 };
+
+console.log("TIZEN ACCELEROMETER END");
+

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/8bcf44f3/lib/tizen/plugin/tizen/Battery.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Battery.js b/lib/tizen/plugin/tizen/Battery.js
index 12b678b..a3aae49 100644
--- a/lib/tizen/plugin/tizen/Battery.js
+++ b/lib/tizen/plugin/tizen/Battery.js
@@ -22,6 +22,8 @@
 /*global tizen:false */
 var batteryListenerId = null;
 
+console.log("TIZEN BATTERY START");
+
 module.exports = {
     start: function(successCallback, errorCallback) {
         var batterySuccessCallback = function(power) {
@@ -42,3 +44,5 @@ module.exports = {
         batteryListenerId = null;
     }
 };
+
+console.log("TIZEN BATTERY END");

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/8bcf44f3/lib/tizen/plugin/tizen/Camera.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Camera.js b/lib/tizen/plugin/tizen/Camera.js
index f88b6fc..1449f7b 100644
--- a/lib/tizen/plugin/tizen/Camera.js
+++ b/lib/tizen/plugin/tizen/Camera.js
@@ -22,6 +22,9 @@
 /*global tizen:false */
 var Camera = require('cordova/plugin/CameraConstants');
 
+
+console.log("TIZEN CAMERA START");
+
 function cameraMakeReplyCallback(successCallback, errorCallback) {
     return {
         onsuccess: function(reply) {
@@ -101,3 +104,5 @@ module.exports = {
             );
         }
 };
+
+console.log("TIZEN CAMERA END");

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/8bcf44f3/lib/tizen/plugin/tizen/Compass.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Compass.js b/lib/tizen/plugin/tizen/Compass.js
index b7fd029..105c6d7 100644
--- a/lib/tizen/plugin/tizen/Compass.js
+++ b/lib/tizen/plugin/tizen/Compass.js
@@ -20,11 +20,13 @@
 */
 
 var CompassError = require('cordova/plugin/CompassError'),
-    CompassHeading = require('cordova/plugin/CompassHeadings');
+    CompassHeading = require('cordova/plugin/CompassHeading');
 
 var compassCallback = null,
     compassReady = false;
 
+console.log("TIZEN COMPASS START");
+
 module.exports = {
     getHeading: function(successCallback, errorCallback) {
 
@@ -47,3 +49,6 @@ module.exports = {
         }
     }
 };
+
+console.log("TIZEN COMPASS END");
+

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/8bcf44f3/lib/tizen/plugin/tizen/Contact.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Contact.js b/lib/tizen/plugin/tizen/Contact.js
index 466cc1a..0aebb2b 100644
--- a/lib/tizen/plugin/tizen/Contact.js
+++ b/lib/tizen/plugin/tizen/Contact.js
@@ -20,14 +20,22 @@
 */
 
 /*global tizen:false */
+//var ContactError = require('cordova/plugin/ContactError'),
+//    ContactUtils = require('cordova/plugin/tizen/ContactUtils');
+
+// ------------------
+// Utility functions
+// ------------------
+
+
+console.log("TIZEN CONTACT START");
+
+
 var ContactError = require('cordova/plugin/ContactError'),
     ContactUtils = require('cordova/plugin/tizen/ContactUtils'),
     utils = require('cordova/utils'),
     exec = require('cordova/exec');
 
-// ------------------
-// Utility functions
-// ------------------
 
 
 /**
@@ -535,3 +543,5 @@ module.exports = {
         }
     }
 };
+
+console.log("TIZEN CONTACT END");

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/8bcf44f3/lib/tizen/plugin/tizen/ContactUtils.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/ContactUtils.js b/lib/tizen/plugin/tizen/ContactUtils.js
index 7283998..042dc80 100644
--- a/lib/tizen/plugin/tizen/ContactUtils.js
+++ b/lib/tizen/plugin/tizen/ContactUtils.js
@@ -20,12 +20,14 @@
 */
 
 /*global tizen:false */
-var ContactAddress = require('cordova/plugin/ContactAddress'),
+var Contact = require('cordova/plugin/Contact'),
+    ContactAddress = require('cordova/plugin/ContactAddress'),
     ContactName = require('cordova/plugin/ContactName'),
     ContactField = require('cordova/plugin/ContactField'),
     ContactOrganization = require('cordova/plugin/ContactOrganization'),
-    utils = require('cordova/utils'),
-    Contact = require('cordova/plugin/Contact');
+    utils = require('cordova/utils');
+
+
 
 /**
  * Mappings for each Contact field that may be used in a find operation. Maps

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/8bcf44f3/lib/tizen/plugin/tizen/Device.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Device.js b/lib/tizen/plugin/tizen/Device.js
index ae63d38..15be7fe 100644
--- a/lib/tizen/plugin/tizen/Device.js
+++ b/lib/tizen/plugin/tizen/Device.js
@@ -22,6 +22,9 @@
 /*global tizen:false */
 var channel = require('cordova/channel');
 
+console.log("TIZEN DEVICE START");
+
+
 // Tell cordova channel to wait on the CordovaInfoReady event
 //channel.waitForInitialization('onCordovaInfoReady');
 
@@ -45,7 +48,8 @@ Device.prototype.getDeviceInfo = function() {
         this.version = deviceCapabilities.platformVersion;
         this.uuid = deviceCapabilities.duid;
         this.model = deviceCapabilities.platformName;
-    
+        this.name = this.model;
+
         channel.onCordovaInfoReady.fire();
      }
      else {
@@ -55,4 +59,6 @@ Device.prototype.getDeviceInfo = function() {
 
 module.exports = new Device();
 
+console.log("TIZEN DEVICE END");
+
 

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/8bcf44f3/lib/tizen/plugin/tizen/File.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/File.js b/lib/tizen/plugin/tizen/File.js
index 645bb79..3de7335 100644
--- a/lib/tizen/plugin/tizen/File.js
+++ b/lib/tizen/plugin/tizen/File.js
@@ -19,6 +19,9 @@
  *
 */
 
+
+console.log("TIZEN FILE START");
+
 /*global WebKitBlobBuilder:false */
 var FileError = require('cordova/plugin/FileError'),
     DirectoryEntry = require('cordova/plugin/DirectoryEntry'),
@@ -44,332 +47,564 @@ function makeEntry(entry) {
 }
 
 module.exports = {
-    /* requestFileSystem */
+    /* common/equestFileSystem.js, args = [type, size] */
     requestFileSystem: function(successCallback, errorCallback, args) {
         var type = args[0],
             size = args[1];
 
-        nativeRequestFileSystem(type, size, function(nativeFs) {
-            successCallback(new FileSystem(getFileSystemName(nativeFs), makeEntry(nativeFs.root)));
-        }, function(error) {
-            errorCallback(error.code);
-        });
+        nativeRequestFileSystem(
+            type,
+            size,
+            function(nativeFs) {
+                successCallback(new FileSystem(getFileSystemName(nativeFs), makeEntry(nativeFs.root)));
+            },
+            function(error) {
+                errorCallback(error.code);
+            }
+        );
     },
 
-    /* resolveLocalFileSystemURI */
+    /* common/resolveLocalFileSystemURI.js, args= [uri] */
     resolveLocalFileSystemURI: function(successCallback, errorCallback, args) {
         var uri = args[0];
 
-        nativeResolveLocalFileSystemURI(uri, function(entry) {
-            successCallback(makeEntry(entry));
-        }, function(error) {
-            errorCallback(error.code);
-        });
+        nativeResolveLocalFileSystemURI(
+            uri,
+            function(entry) {
+                successCallback(makeEntry(entry));
+            },
+            function(error) {
+                errorCallback(error.code);
+            }
+        );
     },
 
-    /* DirectoryReader */
+    /* common/DirectoryReader.js, args = [this.path] */
     readEntries: function(successCallback, errorCallback, args) {
         var uri = args[0];
 
-        nativeResolveLocalFileSystemURI(uri, function(dirEntry) {
-            var reader = dirEntry.createReader();
-            reader.readEntries(function(entries) {
-                var retVal = [];
-                for (var i = 0; i < entries.length; i++) {
-                    retVal.push(makeEntry(entries[i]));
-                }
-                successCallback(retVal);
-            }, function(error) {
+        nativeResolveLocalFileSystemURI(
+            uri,
+            function(dirEntry) {
+                var reader = dirEntry.createReader();
+
+                reader.readEntries(
+                    function(entries) {
+                        var retVal = [];
+                        for (var i = 0; i < entries.length; i++) {
+                            retVal.push(makeEntry(entries[i]));
+                        }
+                        successCallback(retVal);
+                    },
+                    function(error) {
+                        errorCallback(error.code);
+                    }
+                );
+            },
+            function(error) {
                 errorCallback(error.code);
-            });
-        }, function(error) {
-            errorCallback(error.code);
-        });
+            }
+        );
     },
 
-    /* Entry */
+    /* common/Entry.js , args = [this.fullPath] */
     getMetadata: function(successCallback, errorCallback, args) {
         var uri = args[0];
 
-        nativeResolveLocalFileSystemURI(uri, function(entry) {
-            entry.getMetadata(function(metaData) {
-                successCallback(metaData.modificationTime);
-            }, function(error) {
+        nativeResolveLocalFileSystemURI(
+            uri,
+            function(entry) {
+                entry.getMetadata(
+                    function(metaData) {
+                        successCallback(metaData.modificationTime);
+                    },
+                    function(error) {
+                        errorCallback(error.code);
+                    }
+                );
+            },
+            function(error) {
                 errorCallback(error.code);
-            });
-        }, function(error) {
-            errorCallback(error.code);
-        });
+            }
+        );
+    },
+
+    /* args = [this.fullPath, metadataObject] */
+    /* PPL to be implemented */
+    setMetadata: function(successCallback, errorCallback, args) {
+        var uri = args[0],
+            metadata = args[1];
+
+        if (errorCallback) {
+            errorCallback(FileError.NOT_FOUND_ERR);
+        }
     },
 
+
+    /* args = [srcPath, parent.fullPath, name] */
     moveTo: function(successCallback, errorCallback, args) {
         var srcUri = args[0],
             parentUri = args[1],
             name = args[2];
 
-        nativeResolveLocalFileSystemURI(srcUri, function(source) {
-            nativeResolveLocalFileSystemURI(parentUri, function(parent) {
-                source.moveTo(parent, name, function(entry) {
-                    successCallback(makeEntry(entry));
-                }, function(error) {
-                    errorCallback(error.code);
-                });
-            }, function(error) {
+        nativeResolveLocalFileSystemURI(
+            srcUri,
+            function(source) {
+                nativeResolveLocalFileSystemURI(
+                    parentUri,
+                    function(parent) {
+                        source.moveTo(
+                            parent,
+                            name,
+                            function(entry) {
+                                successCallback(makeEntry(entry));
+                            },
+                            function(error) {
+                                errorCallback(error.code);
+                        }
+                        );
+                    },
+                    function(error) {
+                        errorCallback(error.code);
+                    }
+                );
+            },
+            function(error) {
                 errorCallback(error.code);
-            });
-        }, function(error) {
-            errorCallback(error.code);
-        });
+            }
+        );
     },
 
+    /* args = [srcPath, parent.fullPath, name] */
     copyTo: function(successCallback, errorCallback, args) {
         var srcUri = args[0],
             parentUri = args[1],
             name = args[2];
 
-        nativeResolveLocalFileSystemURI(srcUri, function(source) {
-            nativeResolveLocalFileSystemURI(parentUri, function(parent) {
-                source.copyTo(parent, name, function(entry) {
-                    successCallback(makeEntry(entry));
-                }, function(error) {
-                    errorCallback(error.code);
-                });
-            }, function(error) {
+        nativeResolveLocalFileSystemURI(
+            srcUri,
+            function(source) {
+                nativeResolveLocalFileSystemURI(
+                    parentUri,
+                    function(parent) {
+                        source.copyTo(
+                            parent,
+                            name,
+                            function(entry) {
+                                successCallback(makeEntry(entry));
+                            },
+                            function(error) {
+                                errorCallback(error.code);
+                            }
+                        );
+                    },
+                    function(error) {
+                        errorCallback(error.code);
+                    }
+                );
+            },
+            function(error) {
                 errorCallback(error.code);
-            });
-        }, function(error) {
-            errorCallback(error.code);
-        });
+            }
+        );
     },
 
+
+    /* args = [this.fullPath] */
     remove: function(successCallback, errorCallback, args) {
         var uri = args[0];
 
-        nativeResolveLocalFileSystemURI(uri, function(entry) {
-            if (entry.fullPath === "/") {
-                errorCallback(FileError.NO_MODIFICATION_ALLOWED_ERR);
-            } else {
-                entry.remove(successCallback, function(error) {
-                    errorCallback(error.code);
-                });
+        nativeResolveLocalFileSystemURI(
+            uri,
+            function(entry) {
+                if (entry.fullPath === "/") {
+                    errorCallback(FileError.NO_MODIFICATION_ALLOWED_ERR);
+                }
+                else {
+                    entry.remove(
+                        successCallback,
+                        function(error) {
+                            errorCallback(error.code);
+                        }
+                    );
+                }
+            },
+            function(error) {
+                errorCallback(error.code);
             }
-        }, function(error) {
-            errorCallback(error.code);
-        });
+        );
     },
 
+    /* args = [this.fullPath] */
     getParent: function(successCallback, errorCallback, args) {
         var uri = args[0];
 
-        nativeResolveLocalFileSystemURI(uri, function(entry) {
-            entry.getParent(function(entry) {
-                successCallback(makeEntry(entry));
-            }, function(error) {
+        nativeResolveLocalFileSystemURI(
+            uri,
+            function(entry) {
+                entry.getParent(
+                    function(entry) {
+                        successCallback(makeEntry(entry));
+                    },
+                    function(error) {
+                        errorCallback(error.code);
+                    }
+                );
+            },
+            function(error) {
                 errorCallback(error.code);
-            });
-        }, function(error) {
-            errorCallback(error.code);
-        });
+            }
+        );
     },
 
-    /* FileEntry */
+    /* common/FileEntry.js, args = [this.fullPath] */
     getFileMetadata: function(successCallback, errorCallback, args) {
         var uri = args[0];
 
-        nativeResolveLocalFileSystemURI(uri, function(entry) {
-            entry.file(function(file) {
-                var retVal = new File(file.name, decodeURI(entry.toURL()), file.type, file.lastModifiedDate, file.size);
-                successCallback(retVal);
-            }, function(error) {
+        nativeResolveLocalFileSystemURI(
+            uri,
+            function(entry) {
+                entry.file(
+                    function(file) {
+                        var retVal = new File(file.name, decodeURI(entry.toURL()), file.type, file.lastModifiedDate, file.size);
+                        successCallback(retVal);
+                    },
+                    function(error) {
+                        errorCallback(error.code);
+                    }
+                );
+            },
+            function(error) {
                 errorCallback(error.code);
-            });
-        }, function(error) {
-            errorCallback(error.code);
-        });
+            }
+        );
     },
 
-    /* DirectoryEntry */
+    /* common/DirectoryEntry.js , args = [this.fullPath, path, options] */
     getDirectory: function(successCallback, errorCallback, args) {
         var uri = args[0],
             path = args[1],
             options = args[2];
 
-        nativeResolveLocalFileSystemURI(uri, function(entry) {
-            entry.getDirectory(path, options, function(entry) {
-                successCallback(makeEntry(entry));
-            }, function(error) {
-                if (error.code === FileError.INVALID_MODIFICATION_ERR) {
-                    if (options.create) {
-                        errorCallback(FileError.PATH_EXISTS_ERR);
-                    } else {
-                        errorCallback(FileError.ENCODING_ERR);
+        nativeResolveLocalFileSystemURI(
+            uri,
+            function(entry) {
+                entry.getDirectory(
+                    path,
+                    options,
+                    function(entry) {
+                        successCallback(makeEntry(entry));
+                    },
+                    function(error) {
+                        if (error.code === FileError.INVALID_MODIFICATION_ERR) {
+                            if (options.create) {
+                                errorCallback(FileError.PATH_EXISTS_ERR);
+                            }
+                            else {
+                                errorCallback(FileError.ENCODING_ERR);
+                            }
+                        }
+                        else {
+                            errorCallback(error.code);
+                        }
                     }
-                } else {
-                    errorCallback(error.code);
-                }
-            });
-        }, function(error) {
-            errorCallback(error.code);
-        });
+                );
+            },
+            function(error) {
+                errorCallback(error.code);
+            }
+        );
     },
 
+    /* args = [this.fullPath] */
     removeRecursively: function(successCallback, errorCallback, args) {
         var uri = args[0];
 
-        nativeResolveLocalFileSystemURI(uri, function(entry) {
-            if (entry.fullPath === "/") {
-                errorCallback(FileError.NO_MODIFICATION_ALLOWED_ERR);
-            } else {
-                entry.removeRecursively(successCallback, function(error) {
-                    errorCallback(error.code);
-                });
+        nativeResolveLocalFileSystemURI(
+            uri,
+            function(entry) {
+                if (entry.fullPath === "/") {
+                    errorCallback(FileError.NO_MODIFICATION_ALLOWED_ERR);
+                }
+                else {
+                    entry.removeRecursively(
+                        successCallback,
+                        function(error) {
+                            errorCallback(error.code);
+                        }
+                    );
+                }
+            },
+            function(error) {
+                errorCallback(error.code);
             }
-        }, function(error) {
-            errorCallback(error.code);
-        });
+        );
     },
 
+    /* args = [this.fullPath, path, options] */
     getFile: function(successCallback, errorCallback, args) {
         var uri = args[0],
             path = args[1],
             options = args[2];
 
-        nativeResolveLocalFileSystemURI(uri, function(entry) {
-            entry.getFile(path, options, function(entry) {
-                successCallback(makeEntry(entry));
-            }, function(error) {
-                if (error.code === FileError.INVALID_MODIFICATION_ERR) {
-                    if (options.create) {
-                        errorCallback(FileError.PATH_EXISTS_ERR);
-                    } else {
-                        errorCallback(FileError.ENCODING_ERR);
+        nativeResolveLocalFileSystemURI(
+            uri,
+            function(entry) {
+                entry.getFile(
+                    path,
+                    options,
+                    function(entry) {
+                        successCallback(makeEntry(entry));
+                    },
+                    function(error) {
+                        if (error.code === FileError.INVALID_MODIFICATION_ERR) {
+                            if (options.create) {
+                                errorCallback(FileError.PATH_EXISTS_ERR);
+                            }
+                            else {
+                                errorCallback(FileError.ENCODING_ERR);
+                            }
+                        }
+                        else {
+                            errorCallback(error.code);
+                        }
                     }
-                } else {
-                    errorCallback(error.code);
-                }
-            });
-        }, function(error) {
-            errorCallback(error.code);
-        });
+                );
+            },
+            function(error) {
+                errorCallback(error.code);
+            }
+        );
     },
 
-    /* FileReader */
+    /* common/FileReader.js, args = execArgs = [filepath, encoding, file.start, file.end] */
     readAsText: function(successCallback, errorCallback, args) {
         var uri = args[0],
             encoding = args[1];
 
-        nativeResolveLocalFileSystemURI(uri, function(entry) {
-            var onLoadEnd = function(evt) {
-                    if (!evt.target.error) {
-                        successCallback(evt.target.result);
+        nativeResolveLocalFileSystemURI(
+            uri,
+            function(entry) {
+                var onLoadEnd = function(evt) {
+                        if (!evt.target.error) {
+                            successCallback(evt.target.result);
+                        }
+                    },
+                    onError = function(evt) {
+                        errorCallback(evt.target.error.code);
+                    };
+
+                var reader = new NativeFileReader();
+
+                reader.onloadend = onLoadEnd;
+                reader.onerror = onError;
+
+                entry.file(
+                    function(file) {
+                        reader.readAsText(file, encoding);
+                    },
+                    function(error) {
+                        errorCallback(error.code);
                     }
+                );
             },
-                onError = function(evt) {
-                    errorCallback(evt.target.error.code);
-            };
+            function(error) {
+                errorCallback(error.code);
+            }
+        );
+    },
 
-            var reader = new NativeFileReader();
+    /* args = execArgs = [this._fileName, file.start, file.end] */
+    readAsDataURL: function(successCallback, errorCallback, args) {
+        var uri = args[0];
 
-            reader.onloadend = onLoadEnd;
-            reader.onerror = onError;
-            entry.file(function(file) {
-                reader.readAsText(file, encoding);
-            }, function(error) {
+        nativeResolveLocalFileSystemURI(
+            uri,
+            function(entry) {
+                var onLoadEnd = function(evt) {
+                        if (!evt.target.error) {
+                            successCallback(evt.target.result);
+                        }
+                    },
+                    onError = function(evt) {
+                        errorCallback(evt.target.error.code);
+                    };
+
+                var reader = new NativeFileReader();
+
+                reader.onloadend = onLoadEnd;
+                reader.onerror = onError;
+                entry.file(
+                    function(file) {
+                        reader.readAsDataURL(file);
+                    },
+                    function(error) {
+                        errorCallback(error.code);
+                    }
+                );
+            },
+            function(error) {
                 errorCallback(error.code);
-            });
-        }, function(error) {
-            errorCallback(error.code);
-        });
+            }
+        );
     },
 
-    readAsDataURL: function(successCallback, errorCallback, args) {
+    /* args = execArgs =  [this._fileName, file.start, file.end] */
+    /* PPL, to Be implemented , for now it is pasted from readAsText...*/
+    readAsBinaryString: function(successCallback, errorCallback, args) {
         var uri = args[0];
 
-        nativeResolveLocalFileSystemURI(uri, function(entry) {
-            var onLoadEnd = function(evt) {
-                    if (!evt.target.error) {
-                        successCallback(evt.target.result);
+        nativeResolveLocalFileSystemURI(
+            uri,
+            function(entry) {
+                var onLoadEnd = function(evt) {
+                        if (!evt.target.error) {
+                            successCallback(evt.target.result);
+                        }
+                    },
+                    onError = function(evt) {
+                        errorCallback(evt.target.error.code);
+                    };
+
+                var reader = new NativeFileReader();
+
+                reader.onloadend = onLoadEnd;
+                reader.onerror = onError;
+
+                entry.file(
+                    function(file) {
+                        reader.readAsDataURL(file);
+                    },
+                    function(error) {
+                        errorCallback(error.code);
                     }
+                );
             },
-                onError = function(evt) {
-                    errorCallback(evt.target.error.code);
-            };
+            function(error) {
+                errorCallback(error.code);
+            }
+        );
+    },
+
+
+    /* args = execArgs =  [this._fileName, file.start, file.end] */
+    /* PPL, to Be implemented , for now it is pasted from readAsText...*/
+    readAsArrayBuffer: function(successCallback, errorCallback, args) {
+        var uri = args[0];
 
-            var reader = new NativeFileReader();
+        nativeResolveLocalFileSystemURI(
+            uri,
+            function(entry) {
+                var onLoadEnd = function(evt) {
+                        if (!evt.target.error) {
+                        successCallback(evt.target.result);
+                        }
+                    },
+                    onError = function(evt) {
+                        errorCallback(evt.target.error.code);
+                    };
+
+                var reader = new NativeFileReader();
 
-            reader.onloadend = onLoadEnd;
-            reader.onerror = onError;
-            entry.file(function(file) {
-                reader.readAsDataURL(file);
-            }, function(error) {
+                reader.onloadend = onLoadEnd;
+                reader.onerror = onError;
+
+                entry.file(
+                    function(file) {
+                        reader.readAsDataURL(file);
+                    },
+                    function(error) {
+                        errorCallback(error.code);
+                    }
+                );
+            },
+            function(error) {
                 errorCallback(error.code);
-            });
-        }, function(error) {
-            errorCallback(error.code);
-        });
+            }
+        );
     },
 
-    /* FileWriter */
+    /* common/FileWriter.js, args = [this.fileName, text, this.position] */
     write: function(successCallback, errorCallback, args) {
         var uri = args[0],
             text = args[1],
             position = args[2];
 
-        nativeResolveLocalFileSystemURI(uri, function(entry) {
-            var onWriteEnd = function(evt) {
-                    if(!evt.target.error) {
-                        successCallback(evt.target.position - position);
-                    } else {
+        nativeResolveLocalFileSystemURI(
+            uri,
+            function(entry) {
+                var onWriteEnd = function(evt) {
+                        if(!evt.target.error) {
+                            successCallback(evt.target.position - position);
+                        }
+                        else {
+                            errorCallback(evt.target.error.code);
+                        }
+                    },
+                    onError = function(evt) {
                         errorCallback(evt.target.error.code);
-                    }
-            },
-                onError = function(evt) {
-                    errorCallback(evt.target.error.code);
-            };
+                    };
 
-            entry.createWriter(function(writer) {
-                var blob = new WebKitBlobBuilder();
-                blob.append(text);
+                entry.createWriter(
+                    function(writer) {
+                        var blob = new WebKitBlobBuilder();
+                        blob.append(text);
 
-                writer.onwriteend = onWriteEnd;
-                writer.onerror = onError;
+                        writer.onwriteend = onWriteEnd;
+                        writer.onerror = onError;
 
-                writer.seek(position);
-                writer.write(blob.getBlob('text/plain'));
-            }, function(error) {
+                        writer.seek(position);
+                        writer.write(blob.getBlob('text/plain'));
+                    },
+                    function(error) {
+                        errorCallback(error.code);
+                    }
+                );
+            },
+            function(error) {
                 errorCallback(error.code);
-            });
-        }, function(error) {
-            errorCallback(error.code);
-        });
+            }
+        );
     },
 
+    /* args = [this.fileName, size] */
     truncate: function(successCallback, errorCallback, args) {
         var uri = args[0],
             size = args[1];
 
-        nativeResolveLocalFileSystemURI(uri, function(entry) {
-            var onWriteEnd = function(evt) {
-                    if(!evt.target.error) {
-                        successCallback(evt.target.length);
-                    } else {
+        nativeResolveLocalFileSystemURI(
+            uri,
+            function(entry) {
+                var onWriteEnd = function(evt) {
+                        if(!evt.target.error) {
+                            successCallback(evt.target.length);
+                        }
+                        else {
+                            errorCallback(evt.target.error.code);
+                        }
+                    },
+                    onError = function(evt) {
                         errorCallback(evt.target.error.code);
+                    };
+
+                entry.createWriter(
+                    function(writer) {
+                        writer.onwriteend = onWriteEnd;
+                        writer.onerror = onError;
+                        writer.truncate(size);
+                    },
+                    function(error) {
+                        errorCallback(error.code);
                     }
+                );
             },
-                onError = function(evt) {
-                    errorCallback(evt.target.error.code);
-            };
-
-            entry.createWriter(function(writer) {
-                writer.onwriteend = onWriteEnd;
-                writer.onerror = onError;
-
-                writer.truncate(size);
-            }, function(error) {
+            function(error) {
                 errorCallback(error.code);
-            });
-        }, function(error) {
-            errorCallback(error.code);
-        });
+            }
+        );
     }
 };
+
+
+console.log("TIZEN FILE END");
+

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/8bcf44f3/lib/tizen/plugin/tizen/FileTransfer.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/FileTransfer.js b/lib/tizen/plugin/tizen/FileTransfer.js
index 6dda07c..c8d885c 100644
--- a/lib/tizen/plugin/tizen/FileTransfer.js
+++ b/lib/tizen/plugin/tizen/FileTransfer.js
@@ -20,6 +20,10 @@
 */
 
 /*global WebKitBlobBuilder:false */
+
+
+console.log("TIZEN FILE TRANSFER START");
+
 var FileEntry = require('cordova/plugin/FileEntry'),
     FileTransferError = require('cordova/plugin/FileTransferError'),
     FileUploadResult = require('cordova/plugin/FileUploadResult');
@@ -37,6 +41,7 @@ function getFileName(filePath) {
 }
 
 module.exports = {
+    /* common/FileTransfer.js, args = [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode, headers, this._id, httpMethod] */
     upload: function(successCallback, errorCallback, args) {
         var filePath = args[0],
             server = args[1],
@@ -47,66 +52,77 @@ module.exports = {
             /*trustAllHosts = args[6],*/
             chunkedMode = args[7];
 
-        nativeResolveLocalFileSystemURI(filePath, function(entry) {
-            entry.file(function(file) {
-                function uploadFile(blobFile) {
-                    var fd = new FormData();
-
-                    fd.append(fileKey, blobFile, fileName);
-                    for (var prop in params) {
-                        if(params.hasOwnProperty(prop)) {
-                            fd.append(prop, params[prop]);
-                        }
-                    }
-
-                    var xhr = new XMLHttpRequest();
-                    xhr.open("POST", server);
-                    xhr.onload = function(evt) {
-                        if (xhr.status == 200) {
-                            var result = new FileUploadResult();
-                            result.bytesSent = file.size;
-                            result.responseCode = xhr.status;
-                            result.response = xhr.response;
-                            successCallback(result);
-                        } else if (xhr.status == 404) {
-                            errorCallback(new FileTransferError(FileTransferError.INVALID_URL_ERR));
-                        } else {
-                            errorCallback(new FileTransferError(FileTransferError.CONNECTION_ERR));
+        nativeResolveLocalFileSystemURI(
+            filePath,
+            function(entry) {
+                entry.file(
+                    function(file) {
+                        function uploadFile(blobFile) {
+                            var fd = new FormData();
+
+                            fd.append(fileKey, blobFile, fileName);
+
+                            for (var prop in params) {
+                                if(params.hasOwnProperty(prop)) {
+                                    fd.append(prop, params[prop]);
+                                }
+                            }
+                            var xhr = new XMLHttpRequest();
+
+                            xhr.open("POST", server);
+
+                            xhr.onload = function(evt) {
+                                if (xhr.status == 200) {
+                                    var result = new FileUploadResult();
+                                    result.bytesSent = file.size;
+                                    result.responseCode = xhr.status;
+                                    result.response = xhr.response;
+                                    successCallback(result);
+                                }
+                                else if (xhr.status == 404) {
+                                    errorCallback(new FileTransferError(FileTransferError.INVALID_URL_ERR));
+                                }
+                                else {
+                                    errorCallback(new FileTransferError(FileTransferError.CONNECTION_ERR));
+                                }
+                            };
+
+                            xhr.ontimeout = function(evt) {
+                                errorCallback(new FileTransferError(FileTransferError.CONNECTION_ERR));
+                            };
+
+                            xhr.send(fd);
                         }
-                    };
-                    xhr.ontimeout = function(evt) {
-                        errorCallback(new FileTransferError(FileTransferError.CONNECTION_ERR));
-                    };
 
-                    xhr.send(fd);
-                }
+                        var bytesPerChunk;
 
-                var bytesPerChunk;
-                if (chunkedMode === true) {
-                    bytesPerChunk = 1024 * 1024; // 1MB chunk sizes.
-                } else {
-                    bytesPerChunk = file.size;
-                }
-                var start = 0;
-                var end = bytesPerChunk;
-                while (start < file.size) {
-                    var chunk = file.webkitSlice(start, end, mimeType);
-                    uploadFile(chunk);
-                    start = end;
-                    end = start + bytesPerChunk;
-                }
+                        if (chunkedMode === true) {
+                            bytesPerChunk = 1024 * 1024; // 1MB chunk sizes.
+                        }
+                        else {
+                            bytesPerChunk = file.size;
+                        }
+                        var start = 0;
+                        var end = bytesPerChunk;
+                        while (start < file.size) {
+                            var chunk = file.webkitSlice(start, end, mimeType);
+                            uploadFile(chunk);
+                            start = end;
+                            end = start + bytesPerChunk;
+                        }
+                    },
+                    function(error) {
+                        errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));
+                    }
+                );
             },
             function(error) {
                 errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));
             }
-            );
-        },
-        function(error) {
-            errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));
-        }
         );
     },
 
+    /* args = [source, target, trustAllHosts, this._id, headers] */
     download: function(successCallback, errorCallback, args) {
         var url = args[0],
             filePath = args[1];
@@ -114,42 +130,56 @@ module.exports = {
         var xhr = new XMLHttpRequest();
 
         function writeFile(fileEntry) {
-            fileEntry.createWriter(function(writer) {
-                writer.onwriteend = function(evt) {
-                    if (!evt.target.error) {
-                        successCallback(new FileEntry(fileEntry.name, fileEntry.toURL()));
-                    } else {
+            fileEntry.createWriter(
+                function(writer) {
+                    writer.onwriteend = function(evt) {
+                        if (!evt.target.error) {
+                            successCallback(new FileEntry(fileEntry.name, fileEntry.toURL()));
+                        } else {
+                            errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));
+                        }
+                    };
+
+                    writer.onerror = function(evt) {
                         errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));
-                    }
-                };
+                    };
 
-                writer.onerror = function(evt) {
-                    errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));
-                };
+                    var builder = new WebKitBlobBuilder();
+                    builder.append(xhr.response);
 
-                var builder = new WebKitBlobBuilder();
-                builder.append(xhr.response);
-                var blob = builder.getBlob();
-                writer.write(blob);
-            },
-            function(error) {
-                errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));
-            });
+                    var blob = builder.getBlob();
+                    writer.write(blob);
+                },
+                function(error) {
+                    errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));
+                }
+            );
         }
 
         xhr.onreadystatechange = function () {
             if (xhr.readyState == xhr.DONE) {
                 if (xhr.status == 200 && xhr.response) {
-                    nativeResolveLocalFileSystemURI(getParentPath(filePath), function(dir) {
-                        dir.getFile(getFileName(filePath), {create: true}, writeFile, function(error) {
+                    nativeResolveLocalFileSystemURI(
+                        getParentPath(filePath),
+                        function(dir) {
+                            dir.getFile(
+                                getFileName(filePath),
+                                {create: true},
+                                writeFile,
+                                function(error) {
+                                    errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));
+                                }
+                            );
+                        },
+                        function(error) {
                             errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));
-                        });
-                    }, function(error) {
-                        errorCallback(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR));
-                    });
-                } else if (xhr.status == 404) {
+                        }
+                    );
+                }
+                else if (xhr.status == 404) {
                     errorCallback(new FileTransferError(FileTransferError.INVALID_URL_ERR));
-                } else {
+                }
+                else {
                     errorCallback(new FileTransferError(FileTransferError.CONNECTION_ERR));
                 }
             }
@@ -158,5 +188,16 @@ module.exports = {
         xhr.open("GET", url, true);
         xhr.responseType = "arraybuffer";
         xhr.send();
+    },
+
+
+    /* args = [this._id]); */
+    abort: function(successCallback, errorCallback, args) {
+        errorCallback(FileTransferError.ABORT_ERR);
     }
+
 };
+
+
+console.log("TIZEN FILE TRANSFER END");
+

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/8bcf44f3/lib/tizen/plugin/tizen/Media.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Media.js b/lib/tizen/plugin/tizen/Media.js
index 68f5b05..8502f42 100644
--- a/lib/tizen/plugin/tizen/Media.js
+++ b/lib/tizen/plugin/tizen/Media.js
@@ -23,55 +23,87 @@
 var MediaError = require('cordova/plugin/MediaError'),
     audioObjects = {};
 
+console.log("TIZEN MEDIA START");
+
 module.exports = {
+
+
     create: function (successCallback, errorCallback, args) {
         var id = args[0], src = args[1];
+
         console.log("media::create() - id =" + id + ", src =" + src);
+
         audioObjects[id] = new Audio(src);
+
         audioObjects[id].onStalledCB = function () {
             console.log("media::onStalled()");
-             audioObjects[id].timer = window.setTimeout(function () {
-                    audioObjects[id].pause();
-                    if (audioObjects[id].currentTime !== 0)
-                        audioObjects[id].currentTime = 0;
-                    console.log("media::onStalled() - MEDIA_ERROR -> " + MediaError.MEDIA_ERR_ABORTED);
-                    var err = new MediaError(MediaError.MEDIA_ERR_ABORTED, "Stalled");
-                    Media.onStatus(id, Media.MEDIA_ERROR, err);
-                }, 2000);
+
+            audioObjects[id].timer = window.setTimeout(
+                    function () {
+                        audioObjects[id].pause();
+
+                        if (audioObjects[id].currentTime !== 0)
+                            audioObjects[id].currentTime = 0;
+
+                        console.log("media::onStalled() - MEDIA_ERROR -> " + MediaError.MEDIA_ERR_ABORTED);
+
+                        var err = new MediaError(MediaError.MEDIA_ERR_ABORTED, "Stalled");
+
+                        Media.onStatus(id, Media.MEDIA_ERROR, err);
+                    },
+                    2000);
         };
+
         audioObjects[id].onEndedCB = function () {
             console.log("media::onEndedCB() - MEDIA_STATE -> MEDIA_STOPPED");
+
             Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_STOPPED);
         };
+
         audioObjects[id].onErrorCB = function () {
             console.log("media::onErrorCB() - MEDIA_ERROR -> " + event.srcElement.error);
+
             Media.onStatus(id, Media.MEDIA_ERROR, event.srcElement.error);
         };
+
         audioObjects[id].onPlayCB = function () {
             console.log("media::onPlayCB() - MEDIA_STATE -> MEDIA_STARTING");
+
             Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_STARTING);
         };
+
         audioObjects[id].onPlayingCB = function () {
             console.log("media::onPlayingCB() - MEDIA_STATE -> MEDIA_RUNNING");
+
             Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_RUNNING);
         };
+
         audioObjects[id].onDurationChangeCB = function () {
             console.log("media::onDurationChangeCB() - MEDIA_DURATION -> " +  audioObjects[id].duration);
+
             Media.onStatus(id, Media.MEDIA_DURATION, audioObjects[id].duration);
         };
+
         audioObjects[id].onTimeUpdateCB = function () {
             console.log("media::onTimeUpdateCB() - MEDIA_POSITION -> " +  audioObjects[id].currentTime);
+
             Media.onStatus(id, Media.MEDIA_POSITION, audioObjects[id].currentTime);
         };
+
         audioObjects[id].onCanPlayCB = function () {
             console.log("media::onCanPlayCB()");
+
             window.clearTimeout(audioObjects[id].timer);
+
             audioObjects[id].play();
         };
       },
+
     startPlayingAudio: function (successCallback, errorCallback, args) {
         var id = args[0], src = args[1], options = args[2];
+
         console.log("media::startPlayingAudio() - id =" + id + ", src =" + src + ", options =" + options);
+
         audioObjects[id].addEventListener('canplay', audioObjects[id].onCanPlayCB);
         audioObjects[id].addEventListener('ended', audioObjects[id].onEndedCB);
         audioObjects[id].addEventListener('timeupdate', audioObjects[id].onTimeUpdateCB);
@@ -80,16 +112,24 @@ module.exports = {
         audioObjects[id].addEventListener('play', audioObjects[id].onPlayCB);
         audioObjects[id].addEventListener('error', audioObjects[id].onErrorCB);
         audioObjects[id].addEventListener('stalled', audioObjects[id].onStalledCB);
+
         audioObjects[id].play();
     },
+
     stopPlayingAudio: function (successCallback, errorCallback, args) {
         var id = args[0];
+
         window.clearTimeout(audioObjects[id].timer);
+
         audioObjects[id].pause();
+
         if (audioObjects[id].currentTime !== 0)
             audioObjects[id].currentTime = 0;
+
         console.log("media::stopPlayingAudio() - MEDIA_STATE -> MEDIA_STOPPED");
+
         Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_STOPPED);
+
         audioObjects[id].removeEventListener('canplay', audioObjects[id].onCanPlayCB);
         audioObjects[id].removeEventListener('ended', audioObjects[id].onEndedCB);
         audioObjects[id].removeEventListener('timeupdate', audioObjects[id].onTimeUpdateCB);
@@ -99,35 +139,50 @@ module.exports = {
         audioObjects[id].removeEventListener('error', audioObjects[id].onErrorCB);
         audioObjects[id].removeEventListener('error', audioObjects[id].onStalledCB);
     },
+
     seekToAudio: function (successCallback, errorCallback, args) {
+
         var id = args[0], milliseconds = args[1];
+
         console.log("media::seekToAudio()");
-         audioObjects[id].currentTime = milliseconds;
+
+        audioObjects[id].currentTime = milliseconds;
         successCallback( audioObjects[id].currentTime);
     },
+
     pausePlayingAudio: function (successCallback, errorCallback, args) {
         var id = args[0];
+
         console.log("media::pausePlayingAudio() - MEDIA_STATE -> MEDIA_PAUSED");
+
         audioObjects[id].pause();
+
         Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_PAUSED);
     },
+
     getCurrentPositionAudio: function (successCallback, errorCallback, args) {
         var id = args[0];
         console.log("media::getCurrentPositionAudio()");
         successCallback(audioObjects[id].currentTime);
     },
+
     release: function (successCallback, errorCallback, args) {
         var id = args[0];
         window.clearTimeout(audioObjects[id].timer);
         console.log("media::release()");
     },
+
     setVolume: function (successCallback, errorCallback, args) {
         var id = args[0], volume = args[1];
+
         console.log("media::setVolume()");
+
         audioObjects[id].volume = volume;
     },
+
     startRecordingAudio: function (successCallback, errorCallback, args) {
         var id = args[0], src = args[1];
+
         console.log("media::startRecordingAudio() - id =" + id + ", src =" + src);
 
         function gotStreamCB(stream) {
@@ -147,10 +202,16 @@ module.exports = {
         }
         successCallback();
     },
+
     stopRecordingAudio: function (successCallback, errorCallback, args) {
         var id = args[0];
+
         console.log("media::stopRecordingAudio() - id =" + id);
+
         audioObjects[id].pause();
         successCallback();
     }
 };
+
+console.log("TIZEN MEDIA END");
+

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/8bcf44f3/lib/tizen/plugin/tizen/NetworkStatus.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/NetworkStatus.js b/lib/tizen/plugin/tizen/NetworkStatus.js
index d2d0d93..b51832b 100644
--- a/lib/tizen/plugin/tizen/NetworkStatus.js
+++ b/lib/tizen/plugin/tizen/NetworkStatus.js
@@ -22,6 +22,8 @@
 /*global tizen:false */
 var Connection = require('cordova/plugin/Connection');
 
+console.log("TIZEN CONNECTION AKA NETWORK STATUS START");
+
 module.exports = {
     getConnectionInfo: function (successCallback, errorCallback) {
 
@@ -62,13 +64,16 @@ module.exports = {
             connectionCB();
         }
 
+        deviceCapabilities = tizen.systeminfo.getCapabilities();
+
 
-        if (tizen.systeminfo.isSupported("WIFI_NETWORK")) {
+        if (deviceCapabilities.wifi) {
             tizen.systeminfo.getPropertyValue("WIFI_NETWORK", wifiSuccessCB, errorCB);
         }
 
-        if (tizen.systeminfo.isSupported("CELLULAR_NETWORK")) {
-            tizen.systeminfo.getPropertyValue("CELLULAR_NETWORK", cellularSuccessCB, errorCB);
-        }
+        tizen.systeminfo.getPropertyValue("CELLULAR_NETWORK", cellularSuccessCB, errorCB);
+
     }
 };
+
+console.log("TIZEN CONNECTION AKA NETWORK STATUS END");

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/8bcf44f3/lib/tizen/plugin/tizen/Notification.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Notification.js b/lib/tizen/plugin/tizen/Notification.js
index 6c34b0c..4f6ca22 100644
--- a/lib/tizen/plugin/tizen/Notification.js
+++ b/lib/tizen/plugin/tizen/Notification.js
@@ -24,6 +24,10 @@ var SoundBeat = require('cordova/plugin/tizen/SoundBeat');
 /* TODO: get resource path from app environment? */
 var soundBeat = new SoundBeat(["./sounds/beep.wav"]);
 
+
+console.log("TIZEN NOTIFICATION START");
+
+
 module.exports = {
 
     alert: function(message, alertCallback, title, buttonName) {
@@ -160,4 +164,5 @@ module.exports = {
     }
 };
 
+console.log("TIZEN NOTIFICATION END");
 


[04/26] js commit: [Tizen] - Device.js

Posted by st...@apache.org.
[Tizen] - Device.js

add model field
(name is not yet removed)


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/b23bc1cd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/b23bc1cd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/b23bc1cd

Branch: refs/heads/3.0.0
Commit: b23bc1cd770a6be6c9d0a8560d6b839408a974c9
Parents: c524f9f
Author: pplaquette <pp...@apache.org>
Authored: Tue Apr 9 14:56:32 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri Apr 19 11:07:13 2013 +0200

----------------------------------------------------------------------
 lib/tizen/plugin/tizen/Device.js |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/b23bc1cd/lib/tizen/plugin/tizen/Device.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Device.js b/lib/tizen/plugin/tizen/Device.js
index 8e5f83a..71408ef 100644
--- a/lib/tizen/plugin/tizen/Device.js
+++ b/lib/tizen/plugin/tizen/Device.js
@@ -29,6 +29,7 @@ function Device() {
     this.version = null;
     this.uuid = null;
     this.name = null;
+    this.model = null;
     this.cordova = "2.5.0";
     this.platform = "Tizen";
 
@@ -36,6 +37,7 @@ function Device() {
 
     function onSuccessCallback(sysInfoProp) {
         me.name = sysInfoProp.model;
+        me.model = sysInfoProp.model;
         me.uuid = sysInfoProp.imei;
         me.version = sysInfoProp.version;
         channel.onCordovaInfoReady.fire();


[22/26] js commit: Merge branch 'magnolia'

Posted by st...@apache.org.
Merge branch 'magnolia'


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/ac7968e9
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/ac7968e9
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/ac7968e9

Branch: refs/heads/3.0.0
Commit: ac7968e9e5671b3eab4ab01743fd95c8e7703bb2
Parents: 1a148c0 1484b8e
Author: pplaquette <pp...@apache.org>
Authored: Fri May 17 16:21:26 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri May 17 16:21:26 2013 +0200

----------------------------------------------------------------------
 Jakefile                                |    1 -
 lib/tizen/exec.js                       |   57 +++-
 lib/tizen/platform.js                   |   15 +
 lib/tizen/plugin/tizen/Accelerometer.js |   24 +-
 lib/tizen/plugin/tizen/Battery.js       |   19 +-
 lib/tizen/plugin/tizen/Camera.js        |   80 ++--
 lib/tizen/plugin/tizen/Compass.js       |   32 +-
 lib/tizen/plugin/tizen/Contact.js       |  152 ++++---
 lib/tizen/plugin/tizen/ContactUtils.js  |  118 ++---
 lib/tizen/plugin/tizen/Device.js        |   45 +-
 lib/tizen/plugin/tizen/File.js          |  651 ++++++++++++++++++--------
 lib/tizen/plugin/tizen/FileTransfer.js  |  193 +++++---
 lib/tizen/plugin/tizen/Media.js         |   79 +++-
 lib/tizen/plugin/tizen/NetworkStatus.js |   46 ++-
 lib/tizen/plugin/tizen/Notification.js  |   23 +
 15 files changed, 1023 insertions(+), 512 deletions(-)
----------------------------------------------------------------------



[19/26] js commit: [CB3396] [Tizen, Tizen SDK 2.0 (Magnolia)]

Posted by st...@apache.org.
[CB3396] [Tizen, Tizen SDK 2.0 (Magnolia)]

remove several console.log messages
(keep them in comments for now)


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/46797951
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/46797951
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/46797951

Branch: refs/heads/3.0.0
Commit: 467979516d2dda6ae9e909d88950523377403c7a
Parents: 2142edd
Author: pplaquette <pp...@apache.org>
Authored: Fri May 17 16:07:58 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri May 17 16:07:58 2013 +0200

----------------------------------------------------------------------
 Jakefile                                |    1 -
 lib/tizen/exec.js                       |    6 +++---
 lib/tizen/platform.js                   |    4 ++--
 lib/tizen/plugin/tizen/Accelerometer.js |    4 ++--
 lib/tizen/plugin/tizen/Battery.js       |    4 ++--
 lib/tizen/plugin/tizen/Compass.js       |    4 ++--
 lib/tizen/plugin/tizen/Contact.js       |    4 ++--
 lib/tizen/plugin/tizen/File.js          |    4 ++--
 lib/tizen/plugin/tizen/FileTransfer.js  |    4 ++--
 lib/tizen/plugin/tizen/NetworkStatus.js |    4 ++--
 lib/tizen/plugin/tizen/Notification.js  |    4 ++--
 11 files changed, 21 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/46797951/Jakefile
----------------------------------------------------------------------
diff --git a/Jakefile b/Jakefile
index c6bb633..0ac574c 100644
--- a/Jakefile
+++ b/Jakefile
@@ -115,7 +115,6 @@ task('build', ['clean', 'hint'], function () {
 
         packager.generate("windows8", version,true);
         packager.generate("blackberry", version);
-        packager.generate("blackberry10", version);
         packager.generate("firefoxos", version);
         packager.generate("ios", version);
         packager.generate("windowsphone", version,true);

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/46797951/lib/tizen/exec.js
----------------------------------------------------------------------
diff --git a/lib/tizen/exec.js b/lib/tizen/exec.js
index a47ce50..f7ae520 100644
--- a/lib/tizen/exec.js
+++ b/lib/tizen/exec.js
@@ -48,14 +48,14 @@
  * @param {String[]} [args]     Zero or more arguments to pass to the method
  */
 
-console.log("TIZEN EXEC START");
+//console.log("TIZEN EXEC START");
 
 
 var manager = require('cordova/plugin/tizen/manager'),
     cordova = require('cordova'),
     utils = require('cordova/utils');
 
-console.log("TIZEN EXEC START 2");
+//console.log("TIZEN EXEC START bis");
 
 module.exports = function(successCB, failCB, service, action, args) {
 
@@ -98,7 +98,7 @@ module.exports = function(successCB, failCB, service, action, args) {
     }
 };
 
-console.log("TIZEN EXEC END ");
+//console.log("TIZEN EXEC END ");
 
 /*
 var plugins = {

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/46797951/lib/tizen/platform.js
----------------------------------------------------------------------
diff --git a/lib/tizen/platform.js b/lib/tizen/platform.js
index 82aed6e..61d7b39 100644
--- a/lib/tizen/platform.js
+++ b/lib/tizen/platform.js
@@ -19,7 +19,7 @@
  *
 */
 
-console.log("TIZEN PLATFORM START");
+//console.log("TIZEN PLATFORM START");
 
 
 module.exports = {
@@ -41,5 +41,5 @@ module.exports = {
     }
 };
 
-console.log("TIZEN PLATFORM START");
+//console.log("TIZEN PLATFORM START");
 

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/46797951/lib/tizen/plugin/tizen/Accelerometer.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Accelerometer.js b/lib/tizen/plugin/tizen/Accelerometer.js
index 4006c5c..18be54c 100644
--- a/lib/tizen/plugin/tizen/Accelerometer.js
+++ b/lib/tizen/plugin/tizen/Accelerometer.js
@@ -21,7 +21,7 @@
 
 var accelerometerCallback = null;
 
-console.log("TIZEN ACCELEROMETER START");
+//console.log("TIZEN ACCELEROMETER START");
 
 module.exports = {
 
@@ -48,5 +48,5 @@ module.exports = {
     }
 };
 
-console.log("TIZEN ACCELEROMETER END");
+//console.log("TIZEN ACCELEROMETER END");
 

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/46797951/lib/tizen/plugin/tizen/Battery.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Battery.js b/lib/tizen/plugin/tizen/Battery.js
index a3aae49..f380a6d 100644
--- a/lib/tizen/plugin/tizen/Battery.js
+++ b/lib/tizen/plugin/tizen/Battery.js
@@ -22,7 +22,7 @@
 /*global tizen:false */
 var batteryListenerId = null;
 
-console.log("TIZEN BATTERY START");
+//console.log("TIZEN BATTERY START");
 
 module.exports = {
     start: function(successCallback, errorCallback) {
@@ -45,4 +45,4 @@ module.exports = {
     }
 };
 
-console.log("TIZEN BATTERY END");
+//console.log("TIZEN BATTERY END");

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/46797951/lib/tizen/plugin/tizen/Compass.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Compass.js b/lib/tizen/plugin/tizen/Compass.js
index 105c6d7..4f7c634 100644
--- a/lib/tizen/plugin/tizen/Compass.js
+++ b/lib/tizen/plugin/tizen/Compass.js
@@ -25,7 +25,7 @@ var CompassError = require('cordova/plugin/CompassError'),
 var compassCallback = null,
     compassReady = false;
 
-console.log("TIZEN COMPASS START");
+//console.log("TIZEN COMPASS START");
 
 module.exports = {
     getHeading: function(successCallback, errorCallback) {
@@ -50,5 +50,5 @@ module.exports = {
     }
 };
 
-console.log("TIZEN COMPASS END");
+//console.log("TIZEN COMPASS END");
 

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/46797951/lib/tizen/plugin/tizen/Contact.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Contact.js b/lib/tizen/plugin/tizen/Contact.js
index 0aebb2b..148a0e8 100644
--- a/lib/tizen/plugin/tizen/Contact.js
+++ b/lib/tizen/plugin/tizen/Contact.js
@@ -28,7 +28,7 @@
 // ------------------
 
 
-console.log("TIZEN CONTACT START");
+//console.log("TIZEN CONTACT START");
 
 
 var ContactError = require('cordova/plugin/ContactError'),
@@ -544,4 +544,4 @@ module.exports = {
     }
 };
 
-console.log("TIZEN CONTACT END");
+//console.log("TIZEN CONTACT END");

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/46797951/lib/tizen/plugin/tizen/File.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/File.js b/lib/tizen/plugin/tizen/File.js
index 3de7335..29583f8 100644
--- a/lib/tizen/plugin/tizen/File.js
+++ b/lib/tizen/plugin/tizen/File.js
@@ -20,7 +20,7 @@
 */
 
 
-console.log("TIZEN FILE START");
+//console.log("TIZEN FILE START");
 
 /*global WebKitBlobBuilder:false */
 var FileError = require('cordova/plugin/FileError'),
@@ -606,5 +606,5 @@ module.exports = {
 };
 
 
-console.log("TIZEN FILE END");
+//console.log("TIZEN FILE END");
 

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/46797951/lib/tizen/plugin/tizen/FileTransfer.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/FileTransfer.js b/lib/tizen/plugin/tizen/FileTransfer.js
index c8d885c..8a59254 100644
--- a/lib/tizen/plugin/tizen/FileTransfer.js
+++ b/lib/tizen/plugin/tizen/FileTransfer.js
@@ -22,7 +22,7 @@
 /*global WebKitBlobBuilder:false */
 
 
-console.log("TIZEN FILE TRANSFER START");
+//console.log("TIZEN FILE TRANSFER START");
 
 var FileEntry = require('cordova/plugin/FileEntry'),
     FileTransferError = require('cordova/plugin/FileTransferError'),
@@ -199,5 +199,5 @@ module.exports = {
 };
 
 
-console.log("TIZEN FILE TRANSFER END");
+//console.log("TIZEN FILE TRANSFER END");
 

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/46797951/lib/tizen/plugin/tizen/NetworkStatus.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/NetworkStatus.js b/lib/tizen/plugin/tizen/NetworkStatus.js
index b51832b..4ae75c3 100644
--- a/lib/tizen/plugin/tizen/NetworkStatus.js
+++ b/lib/tizen/plugin/tizen/NetworkStatus.js
@@ -22,7 +22,7 @@
 /*global tizen:false */
 var Connection = require('cordova/plugin/Connection');
 
-console.log("TIZEN CONNECTION AKA NETWORK STATUS START");
+//console.log("TIZEN CONNECTION AKA NETWORK STATUS START");
 
 module.exports = {
     getConnectionInfo: function (successCallback, errorCallback) {
@@ -76,4 +76,4 @@ module.exports = {
     }
 };
 
-console.log("TIZEN CONNECTION AKA NETWORK STATUS END");
+//console.log("TIZEN CONNECTION AKA NETWORK STATUS END");

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/46797951/lib/tizen/plugin/tizen/Notification.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Notification.js b/lib/tizen/plugin/tizen/Notification.js
index 4f6ca22..a14834f 100644
--- a/lib/tizen/plugin/tizen/Notification.js
+++ b/lib/tizen/plugin/tizen/Notification.js
@@ -25,7 +25,7 @@ var SoundBeat = require('cordova/plugin/tizen/SoundBeat');
 var soundBeat = new SoundBeat(["./sounds/beep.wav"]);
 
 
-console.log("TIZEN NOTIFICATION START");
+//console.log("TIZEN NOTIFICATION START");
 
 
 module.exports = {
@@ -164,5 +164,5 @@ module.exports = {
     }
 };
 
-console.log("TIZEN NOTIFICATION END");
+//console.log("TIZEN NOTIFICATION END");
 


[09/26] js commit: [Tizen, Tizen SDK 2.0 (Magnolia)] - Notification

Posted by st...@apache.org.
[Tizen, Tizen SDK 2.0 (Magnolia)] - Notification

update


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/17eef89a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/17eef89a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/17eef89a

Branch: refs/heads/3.0.0
Commit: 17eef89a7db4ed33f3fa9d9f3d175e920ee182f9
Parents: a7aaeee
Author: pplaquette <pp...@apache.org>
Authored: Thu Apr 18 13:33:38 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri Apr 19 11:07:14 2013 +0200

----------------------------------------------------------------------
 lib/tizen/plugin/tizen/Notification.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/17eef89a/lib/tizen/plugin/tizen/Notification.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Notification.js b/lib/tizen/plugin/tizen/Notification.js
index b5c90c6..cda1ed0 100644
--- a/lib/tizen/plugin/tizen/Notification.js
+++ b/lib/tizen/plugin/tizen/Notification.js
@@ -124,7 +124,7 @@ module.exports = {
            element.addEventListener("click", createListener(element), false);
        }
     },
-    
+
     prompt: function (message, promptCallback, title, buttonLabels) {
         console.log ("message" , message);
         console.log ("confirmCallback" , promptCallback);
@@ -137,7 +137,7 @@ module.exports = {
         // ok is 1, cancel is 2
 
         var result = prompt(message);
-        
+
         if (promptCallback && (typeof promptCallback == "function")) {
             promptCallback((result === null) ? 2 : 1, result);
         }


[14/26] js commit: [Tizen, Tizen SDK 2.0 (Magnolia)]

Posted by st...@apache.org.
[Tizen, Tizen SDK 2.0 (Magnolia)]

Adapt to new SDK

Cordova Connection manager

Constants where change to majuscule
plus cleaning, renaming etc...


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/a26b43df
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/a26b43df
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/a26b43df

Branch: refs/heads/3.0.0
Commit: a26b43dfe6ff6d9ed30868301d39e23cc2bbc9b7
Parents: 4ad9875
Author: pplaquette <pp...@apache.org>
Authored: Wed Apr 17 11:34:34 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri Apr 19 11:07:14 2013 +0200

----------------------------------------------------------------------
 lib/tizen/plugin/tizen/NetworkStatus.js |   39 +++++++++++++++++--------
 1 files changed, 26 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/a26b43df/lib/tizen/plugin/tizen/NetworkStatus.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/NetworkStatus.js b/lib/tizen/plugin/tizen/NetworkStatus.js
index 46abe05..d2d0d93 100644
--- a/lib/tizen/plugin/tizen/NetworkStatus.js
+++ b/lib/tizen/plugin/tizen/NetworkStatus.js
@@ -24,38 +24,51 @@ var Connection = require('cordova/plugin/Connection');
 
 module.exports = {
     getConnectionInfo: function (successCallback, errorCallback) {
+
         var cncType = Connection.NONE;
         var infoCount = 0;
+        var deviceCapabilities = null;
+
 
-        function infoCB() {
+        function connectionCB() {
             infoCount++;
-            if (infoCount > 1)
-               successCallback(cncType);
+
+            if (infoCount > 1) {
+                if (successCallback) {
+                    successCallback(cncType);
+                }
+            }
         }
 
         function errorCB(error) {
-           console.log("Error: " + error.code + "," + error.name + "," + error.message);
-           infoCB();
+            console.log("Error: " + error.code + "," + error.name + "," + error.message);
+
+            if (errorCallback) {
+                errorCallback();
+            }
         }
 
         function wifiSuccessCB(wifi) {
-            if ((wifi.status === "ON")  && (wifi.ipAddress.length !== 0))
+            if ((wifi.status === "ON")  && (wifi.ipAddress.length !== 0)) {
                 cncType = Connection.WIFI;
-            infoCB();
+            }
+            connectionCB();
         }
 
         function cellularSuccessCB(cell) {
-            if ((cncType === Connection.NONE) && (cell.status === "ON") && (cell.ipAddress.length !== 0))
+            if ((cncType === Connection.NONE) && (cell.status === "ON") && (cell.ipAddress.length !== 0)) {
                 cncType = Connection.CELL_2G;
-            infoCB();
+            }
+            connectionCB();
         }
 
-        if (tizen.systeminfo.isSupported('WifiNetwork')) {
-            tizen.systeminfo.getPropertyValue('WifiNetwork', wifiSuccessCB, errorCB);
+
+        if (tizen.systeminfo.isSupported("WIFI_NETWORK")) {
+            tizen.systeminfo.getPropertyValue("WIFI_NETWORK", wifiSuccessCB, errorCB);
         }
 
-        if (tizen.systeminfo.isSupported('CellularNetwork')) {
-            tizen.systeminfo.getPropertyValue('CellularNetwork', cellularSuccessCB, errorCB);
+        if (tizen.systeminfo.isSupported("CELLULAR_NETWORK")) {
+            tizen.systeminfo.getPropertyValue("CELLULAR_NETWORK", cellularSuccessCB, errorCB);
         }
     }
 };


[07/26] js commit: [Tizen, Tizen SDK 2.0 (Magnolia)]

Posted by st...@apache.org.
[Tizen, Tizen SDK 2.0 (Magnolia)]

Adapt Battery to Magnolia
New Tizen SDK Api have introduce one changes "Power" was changed for "BATTERY"
perform some cleanup


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/cbb57b66
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/cbb57b66
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/cbb57b66

Branch: refs/heads/3.0.0
Commit: cbb57b665b1f4666926491c01253ebd6657f792d
Parents: 3415606
Author: pplaquette <pp...@apache.org>
Authored: Wed Apr 17 11:17:32 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri Apr 19 11:07:14 2013 +0200

----------------------------------------------------------------------
 lib/tizen/plugin/tizen/Battery.js |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/cbb57b66/lib/tizen/plugin/tizen/Battery.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Battery.js b/lib/tizen/plugin/tizen/Battery.js
index a3c35c4..12b678b 100644
--- a/lib/tizen/plugin/tizen/Battery.js
+++ b/lib/tizen/plugin/tizen/Battery.js
@@ -20,24 +20,25 @@
 */
 
 /*global tizen:false */
-var id = null;
+var batteryListenerId = null;
 
 module.exports = {
     start: function(successCallback, errorCallback) {
-        var tizenSuccessCallback = function(power) {
+        var batterySuccessCallback = function(power) {
             if (successCallback) {
                 successCallback({level: Math.round(power.level * 100), isPlugged: power.isCharging});
             }
         };
 
-        if (id === null) {
-            id = tizen.systeminfo.addPropertyValueChangeListener("Power", tizenSuccessCallback);
+        if (batteryListenerId === null) {
+            batteryListenerId = tizen.systeminfo.addPropertyValueChangeListener("BATTERY", batterySuccessCallback);
         }
-        tizen.systeminfo.getPropertyValue("Power", tizenSuccessCallback, errorCallback);
+
+        tizen.systeminfo.getPropertyValue("BATTERY", batterySuccessCallback, errorCallback);
     },
 
     stop: function(successCallback, errorCallback) {
-        tizen.systeminfo.removePropertyValueChangeListener(id);
-        id = null;
+        tizen.systeminfo.removePropertyValueChangeListener(batteryListenerId);
+        batteryListenerId = null;
     }
 };


[08/26] js commit: [Tizen, Tizen SDK 2.0 (Magnolia)] - Contacts API

Posted by st...@apache.org.
[Tizen, Tizen SDK 2.0 (Magnolia)] - Contacts API

Adapt the conversion functions both ways
 - cordova to tizen contact object
 - tizen to cordova contact objects

On the tizen side
 -"categories" were removed
 -Several fields were renamed
 -"isdefault" fields were added to mark as favorite (previously it was a 'pref' in a types array
  (ContactPhoneAddress, ContactEmailAddress, ContactAddress)
 -"organization" was replaced by an array of "organizations"
 -"note" became "notes"
 - the addressbookId was added in the Contact object, so we can get the container address book rather that hoping, or guessing, finding it in several address books when there are several address book on a device or reducing to the default address book
 - ContactName object is now having a suffix that can be mapped to cordova contact name object suffix


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/717ca76d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/717ca76d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/717ca76d

Branch: refs/heads/3.0.0
Commit: 717ca76dabd039e3b4021072f6cfcad6948dffe5
Parents: 92eb8d3
Author: pplaquette <pp...@apache.org>
Authored: Thu Apr 18 13:43:51 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri Apr 19 11:07:14 2013 +0200

----------------------------------------------------------------------
 lib/tizen/plugin/tizen/Contact.js      |  136 ++++++++++++++++-----------
 lib/tizen/plugin/tizen/ContactUtils.js |  112 ++++++++--------------
 2 files changed, 125 insertions(+), 123 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/717ca76d/lib/tizen/plugin/tizen/Contact.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Contact.js b/lib/tizen/plugin/tizen/Contact.js
index 45c3762..466cc1a 100644
--- a/lib/tizen/plugin/tizen/Contact.js
+++ b/lib/tizen/plugin/tizen/Contact.js
@@ -62,20 +62,30 @@ var findByUniqueId = function(id) {
 
 var traceTizenContact = function (tizenContact) {
     console.log("cordova/plugin/tizen/Contact/  tizenContact.id " + tizenContact.id);
+    console.log("cordova/plugin/tizen/Contact/  tizenContact.personId " + tizenContact.personId);     //Tizen 2.0
+    console.log("cordova/plugin/tizen/Contact/  tizenContact.addressBookId " + tizenContact.addressBookId);  //Tizen 2.0
+
     console.log("cordova/plugin/tizen/Contact/  tizenContact.lastUpdated " + tizenContact.lastUpdated);
+    console.log("cordova/plugin/tizen/Contact/  tizenContact.isFavorite " + tizenContact.isFavorite);  //Tizen 2.0
+
     console.log("cordova/plugin/tizen/Contact/  tizenContact.name " + tizenContact.name);
-    console.log("cordova/plugin/tizen/Contact/  tizenContact.account " + tizenContact.account);
+
+    //console.log("cordova/plugin/tizen/Contact/  tizenContact.account " + tizenContact.account);  //Tizen 2.0
+
     console.log("cordova/plugin/tizen/Contact/  tizenContact.addresses " + tizenContact.addresses);
     console.log("cordova/plugin/tizen/Contact/  tizenContact.photoURI " + tizenContact.photoURI);
     console.log("cordova/plugin/tizen/Contact/  tizenContact.phoneNumbers " + tizenContact.phoneNumbers);
     console.log("cordova/plugin/tizen/Contact/  tizenContact.emails " + tizenContact.emails);
     console.log("cordova/plugin/tizen/Contact/  tizenContact.birthday " + tizenContact.birthday);
-    console.log("cordova/plugin/tizen/Contact/  tizenContact.organization " + tizenContact.organization);
+    console.log("cordova/plugin/tizen/Contact/  tizenContact.anniversaries " + tizenContact.anniversaries);
+
+    console.log("cordova/plugin/tizen/Contact/  tizenContact.organizations " + tizenContact.organizations);
     console.log("cordova/plugin/tizen/Contact/  tizenContact.notes " + tizenContact.notes);
-    console.log("cordova/plugin/tizen/Contact/  tizenContact.urls " + tizenContact.isFavorite);
-    console.log("cordova/plugin/tizen/Contact/  tizenContact.isFavorite " + tizenContact.isFavorite);
+    console.log("cordova/plugin/tizen/Contact/  tizenContact.urls " + tizenContact.urls);
     console.log("cordova/plugin/tizen/Contact/  tizenContact.ringtonesURI " + tizenContact.ringtonesURI);
-    console.log("cordova/plugin/tizen/Contact/  tizenContact.categories " + tizenContact.categories);
+    console.log("cordova/plugin/tizen/Contact/  tizenContact.groupIds " + tizenContact.groupIds);    //Tizen 2.0
+
+    //console.log("cordova/plugin/tizen/Contact/  tizenContact.categories " + tizenContact.categories);  //Tizen 2.0
 };
 
 
@@ -174,6 +184,16 @@ var saveToDevice = function(contact) {
                 tizenContact.name.prefix = contact.name.honorificPrefix;
             }
         }
+
+        //Tizen 2.0
+        if (contact.name.honorificSuffix) {
+            if (tizenContact.name === null) {
+                tizenContact.name = new tizen.ContactName();
+            }
+            if (tizenContact.name !== null) {
+                tizenContact.name.suffix = contact.name.honorificSuffix;
+            }
+        }
     }
 
     // nickname
@@ -193,18 +213,18 @@ var saveToDevice = function(contact) {
         tizenContact.name.nicknames = [];
     }
 
-    // note
+    // notes - Tizen 2.0 (was note)
     if (contact.note !== null) {
-        if (tizenContact.note === null) {
-            tizenContact.note = [];
+        if (tizenContact.notes === null) {
+            tizenContact.notes = [];
         }
-        if (tizenContact.note !== null) {
-            tizenContact.note[0] = contact.note;
+        if (tizenContact.notes !== null) {
+            tizenContact.notes[0] = contact.note;
         }
     }
 
     // photos
-    if (contact.photos && utils.isArray(contact.emails) && contact.emails.length > 0) {
+    if (contact.photos && utils.isArray(contact.photos) && contact.photos.length > 0) {
         tizenContact.photoURI = contact.photos[0];
     }
 
@@ -217,7 +237,7 @@ var saveToDevice = function(contact) {
         }
     }
 
-    // Tizen supports many addresses
+    // Tizen supports many email addresses
     if (utils.isArray(contact.emails)) {
 
         // if this is an update, re initialize email addresses
@@ -232,15 +252,12 @@ var saveToDevice = function(contact) {
 
             emailTypes.push (contact.emails[i].type);
 
-            if (contact.emails[i].pref) {
-                emailTypes.push ("PREF");
-            }
-
             emails.push(
                 new tizen.ContactEmailAddress(
                     contact.emails[i].value,
-                    emailTypes)
-            );
+                    emailTypes,
+                    contact.emails[i].pref));    //Tizen 2.0
+
         }
         tizenContact.emails = emails.length > 0 ? emails : [];
     }
@@ -259,26 +276,25 @@ var saveToDevice = function(contact) {
 
         for (i = 0; i < contact.phoneNumbers.length; i += 1) {
 
-            if (!contact.phoneNumbers[i] || !contact.phoneNumbers[i].value) {
+            if (!contact.phoneNumbers[i]) {
                 continue;
             }
 
-             var phoneTypes = [];
-             phoneTypes.push (contact.phoneNumbers[i].type);
+            var phoneTypes = [];
+            phoneTypes.push (contact.phoneNumbers[i].type);
 
-             if (contact.phoneNumbers[i].pref) {
-                 phoneTypes.push ("PREF");
-             }
 
             phoneNumbers.push(
                 new tizen.ContactPhoneNumber(
                     contact.phoneNumbers[i].value,
-                    phoneTypes)
+                    phoneTypes,
+                    contact.phoneNumbers[i].pref)    //Tizen 2.0
             );
         }
 
         tizenContact.phoneNumbers = phoneNumbers.length > 0 ? phoneNumbers : [];
-    } else {
+    }
+    else {
         tizenContact.phoneNumbers = [];
     }
 
@@ -293,17 +309,13 @@ var saveToDevice = function(contact) {
         for ( i = 0; i < contact.addresses.length; i += 1) {
             address = contact.addresses[i];
 
-            if (!address || address.id === undefined || address.pref === undefined || address.type === undefined || address.formatted === undefined) {
+            if (!address) {
                 continue;
             }
 
             var addressTypes = [];
             addressTypes.push (address.type);
 
-            if (address.pref) {
-                addressTypes.push ("PREF");
-            }
-
             addresses.push(
                 new tizen.ContactAddress({
                          country:                   address.country,
@@ -312,17 +324,19 @@ var saveToDevice = function(contact) {
                          streetAddress:             address.streetAddress,
                          additionalInformation:     "",
                          postalCode:                address.postalCode,
+                         isDefault:                    address.pref, //Tizen 2.0
                          types :                    addressTypes
                 }));
 
         }
         tizenContact.addresses = addresses.length > 0 ? addresses : [];
 
-    } else{
+    }
+    else{
         tizenContact.addresses = [];
     }
 
-    // copy first url found to BlackBerry 'webpage' field
+    // copy first url found to cordova 'urls' field
     if (utils.isArray(contact.urls)) {
         // if this is an update, re-initialize web page
         if (update) {
@@ -341,22 +355,41 @@ var saveToDevice = function(contact) {
             urls.push( new tizen.ContactWebSite(url.value, url.type));
         }
         tizenContact.urls = urls.length > 0 ? urls : [];
-    } else{
+    }
+    else{
         tizenContact.urls = [];
     }
 
-    if (utils.isArray(contact.organizations && contact.organizations.length > 0) ) {
-        // if this is an update, re-initialize org attributes
-        var organization = contact.organizations[0];
-
-         tizenContact.organization = new tizen.ContacOrganization({
-             name:          organization.name,
-             department:    organization.department,
-             office:        "",
-             title:         organization.title,
-             role:          "",
-             logoURI:       ""
-         });
+    if (utils.isArray(contact.organizations) && contact.organizations.length > 0 ) {
+         // if this is an update, re-initialize addresses
+        if (update) {
+        }
+
+        var organizations = [],
+            organization = null;
+
+        for ( i = 0; i < contact.organizations.length; i += 1) {
+            organization = contact.organizations[i];
+
+            if (!organization) {
+                continue;
+            }
+
+            organizations.push(
+                new tizen.ContactOrganization({
+                    name:          organization.name,
+                    department:    organization.department,
+                    title:         organization.title,
+                    role:          "",
+                    logoURI:       ""
+                }));
+
+        }
+        tizenContact.organizations = organizations.length > 0 ? organizations : [];
+
+    }
+    else{
+        tizenContact.organizations = [];
     }
 
     // categories
@@ -408,7 +441,6 @@ var createTizenAddress = function(address) {
         return null;
     }
 
-
     var tizenAddress = new tizen.ContactAddress();
 
     if (tizenAddress === null) {
@@ -417,15 +449,12 @@ var createTizenAddress = function(address) {
 
     typesAr.push(address.type);
 
-    if (address.pref) {
-        typesAr.push("PREF");
-    }
-
     tizenAddress.country = address.country || "";
     tizenAddress.region = address.region || "";
     tizenAddress.city = address.locality || "";
     tizenAddress.streetAddress = address.streetAddress || "";
     tizenAddress.postalCode = address.postalCode || "";
+    tizenAddress.isDefault = address.pref || false;   //Tizen SDK 2.0
     tizenAddress.types = typesAr || "";
 
     return tizenAddress;
@@ -482,11 +511,12 @@ module.exports = {
                 tizenContact = findByUniqueId(this.id);
             }
 
-
             // if contact was found, remove it
             if (tizenContact) {
+                //var addressBook =  tizen.contact.getDefaultAddressBook();
+                var addressBook =  tizen.contact.getAddressBook(tizenContact.addressBookId);   //Tizen SDk 2.0
 
-                tizen.contact.getDefaultAddressBook().remove(tizenContact.id);
+                addressBook.remove(tizenContact.id);
 
                 if (typeof success === 'function') {
                     successCB(this);

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/717ca76d/lib/tizen/plugin/tizen/ContactUtils.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/ContactUtils.js b/lib/tizen/plugin/tizen/ContactUtils.js
index de1c7aa..ca81a15 100644
--- a/lib/tizen/plugin/tizen/ContactUtils.js
+++ b/lib/tizen/plugin/tizen/ContactUtils.js
@@ -47,11 +47,10 @@ var fieldMappings = {
     "phoneNumbers" : ["phoneNumbers.number","phoneNumbers.types"],
     "emails" : ["emails.types", "emails.email"],
     "addresses" : ["addresses.country","addresses.region","addresses.city","addresses.streetAddress","addresses.postalCode","addresses.country","addresses.types"],
-    "organizations" : ["organization.name","organization.department","organization.office", "organization.title"],
+    "organizations" : ["organizations.name","organizations.department","organizations.office", "organizations.title"],
     "birthday" : ["birthday"],
     "note" : ["notes"],
     "photos" : ["photoURI"],
-    "categories" : ["categories"],
     "urls" : ["urls.url", "urls.type"]
 };
 
@@ -82,14 +81,17 @@ var createContactAddress = function(type, tizenAddress) {
         return null;
     }
 
+    var isDefault = tizenAddress.isDefault;            //Tizen 2.0
     var streetAddress = tizenAddress.streetAddress;
     var locality = tizenAddress.city || "";
     var region = tizenAddress.region || "";
     var postalCode = tizenAddress.postalCode || "";
     var country = tizenAddress.country || "";
+
+    //TODO improve formatted
     var formatted = streetAddress + ", " + locality + ", " + region + ", " + postalCode + ", " + country;
 
-    var contact = new ContactAddress(null, type, formatted, streetAddress, locality, region, postalCode, country);
+    var contact = new ContactAddress(isDefault, type, formatted, streetAddress, locality, region, postalCode, country);
 
     return contact;
 };
@@ -170,7 +172,6 @@ module.exports = {
     },
 
 
-
     /**
      * Creates a Contact object from a Tizen Contact object, copying only
      * the fields specified.
@@ -200,7 +201,8 @@ module.exports = {
         // nothing to do
         if (!fields || !(utils.isArray(fields)) || fields.length === 0) {
             return contact;
-        } else if (fields.length === 1 && fields[0] === "*") {
+        }
+        else if (fields.length === 1 && fields[0] === "*") {
             // Cordova enhancement to allow fields value of ["*"] to indicate
             // all supported fields.
             fields = allFields;
@@ -218,7 +220,6 @@ module.exports = {
 
             // name
             if (field.indexOf('name') === 0) {
-
                 var formattedName = (tizenContact.name.prefix || "");
 
                 if (tizenContact.name.firstName) {
@@ -236,67 +237,64 @@ module.exports = {
                     formattedName += (tizenContact.name.lastName || "");
                 }
 
+                //Tizen 2.0
+                if (tizenContact.name.suffix) {
+                    formattedName += ' ';
+                    formattedName += (tizenContact.name.suffix || "");
+                }
+
                 contact.name = new ContactName(
                         formattedName,
                         tizenContact.name.lastName,
                         tizenContact.name.firstName,
                         tizenContact.name.middleName,
                         tizenContact.name.prefix,
-                        null);
+                        tizenContact.name.suffix);
             }
-
-            // phoneNumbers
+            // phoneNumbers - Tizen 2.0
             else if (field.indexOf('phoneNumbers') === 0) {
-
                 var phoneNumbers = [];
 
                 for (index = 0 ; index < tizenContact.phoneNumbers.length ; ++index) {
-
                     phoneNumbers.push(
-                            new ContactField(
-                                    'PHONE',
-                                    tizenContact.phoneNumbers[index].number,
-                                    ((tizenContact.phoneNumbers[index].types[1]) &&  (tizenContact.emails[index].types[1] === "PREF") ) ? true : false));
+                        new ContactField(
+                            'PHONE',
+                            tizenContact.phoneNumbers[index].number,
+                            tizenContact.phoneNumbers[index].isDefault));
                 }
-
-
                 contact.phoneNumbers = phoneNumbers.length > 0 ? phoneNumbers : null;
             }
 
-            // emails
+            // emails - Tizen 2.0
             else if (field.indexOf('emails') === 0) {
-
                 var emails = [];
 
                 for (index = 0 ; index < tizenContact.emails.length ; ++index) {
-
                     emails.push(
                         new ContactField(
                             'EMAILS',
                             tizenContact.emails[index].email,
-                            ((tizenContact.emails[index].types[1]) &&  (tizenContact.emails[index].types[1] === "PREF") ) ? true : false));
+                            tizenContact.emails[index].isDefault));
                 }
                 contact.emails = emails.length > 0 ? emails : null;
             }
 
-            // addresses
+            // addresses Tizen 2.0
             else if (field.indexOf('addresses') === 0) {
-
                 var addresses = [];
+                
                 for (index = 0 ; index < tizenContact.addresses.length ; ++index) {
-
                     addresses.push(
-                            new ContactAddress(
-                                    ((tizenContact.addresses[index].types[1] &&  tizenContact.addresses[index].types[1] === "PREF") ? true : false),
-                                    tizenContact.addresses[index].types[0] ? tizenContact.addresses[index].types[0] : "HOME",
-                                    null,
-                                    tizenContact.addresses[index].streetAddress,
-                                    tizenContact.addresses[index].city,
-                                    tizenContact.addresses[index].region,
-                                    tizenContact.addresses[index].postalCode,
-                                    tizenContact.addresses[index].country ));
+                         new ContactAddress(
+                            tizenContact.addresses[index].isDefault,
+                            tizenContact.addresses[index].types[0] ? tizenContact.addresses[index].types[0] : "HOME",
+                            null,
+                            tizenContact.addresses[index].streetAddress,
+                            tizenContact.addresses[index].city,
+                            tizenContact.addresses[index].region,
+                            tizenContact.addresses[index].postalCode,
+                            tizenContact.addresses[index].country ));
                 }
-
                 contact.addresses = addresses.length > 0 ? addresses : null;
             }
 
@@ -307,52 +305,28 @@ module.exports = {
                 }
             }
 
-            // note only one in Tizen Contact
+            // note only one in Tizen Contact -Tizen 2.0
             else if (field.indexOf('note') === 0) {
-                if (tizenContact.note) {
-                    contact.note = tizenContact.note[0];
+                if (tizenContact.notes) {
+                    contact.note = tizenContact.notes[0];
                 }
             }
-
-            // organizations
+            // organizations Tizen 2.0
             else if (field.indexOf('organizations') === 0) {
-
                 var organizations = [];
-
-                // there's only one organization in a Tizen Address
-
-                if (tizenContact.organization) {
+                
+                for (index = 0 ; index < tizenContact.organizations.length ; ++index) {
                     organizations.push(
                             new ContactOrganization(
-                                    true,
+                                    (index === 0),
                                     'WORK',
-                                    tizenContact.organization.name,
-                                    tizenContact.organization.department,
-                                    tizenContact.organization.jobTitle));
+                                    tizenContact.organizations.name,
+                                    tizenContact.organizations.department,
+                                    tizenContact.organizations.jobTitle));
                 }
-
                 contact.organizations = organizations.length > 0 ? organizations : null;
             }
 
-            // categories
-            else if (field.indexOf('categories') === 0) {
-
-                var categories = [];
-
-                if (tizenContact.categories) {
-
-                    for (index = 0 ; index < tizenContact.categories.length ; ++index) {
-                        categories.push(
-                                new ContactField(
-                                        'MAIN',
-                                        tizenContact.categories,
-                                        (index === 0) ));
-                    }
-
-                    contact.categories = categories.length > 0 ? categories : null;
-                }
-            }
-
             // urls
             else if (field.indexOf('urls') === 0) {
                 var urls = [];
@@ -366,7 +340,6 @@ module.exports = {
                                         (index === 0)));
                     }
                 }
-
                 contact.urls = urls.length > 0 ? urls : null;
             }
 
@@ -377,7 +350,6 @@ module.exports = {
                 if (tizenContact.photoURI) {
                     photos.push(new ContactField('URI', tizenContact.photoURI, true));
                 }
-
                 contact.photos = photos.length > 0 ? photos : null;
             }
         }


[05/26] js commit: [Tizen, Tizen SDk 2.0 (Magnolia)] - Notification

Posted by st...@apache.org.
[Tizen, Tizen SDk 2.0 (Magnolia)] - Notification

Change a callback name in a temporary console trace


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/6b40200d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/6b40200d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/6b40200d

Branch: refs/heads/3.0.0
Commit: 6b40200df61b11af0af82e5f6af30e7130e4f4a8
Parents: 17eef89
Author: pplaquette <pp...@apache.org>
Authored: Thu Apr 18 13:36:02 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri Apr 19 11:07:14 2013 +0200

----------------------------------------------------------------------
 lib/tizen/plugin/tizen/Notification.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/6b40200d/lib/tizen/plugin/tizen/Notification.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Notification.js b/lib/tizen/plugin/tizen/Notification.js
index cda1ed0..6c34b0c 100644
--- a/lib/tizen/plugin/tizen/Notification.js
+++ b/lib/tizen/plugin/tizen/Notification.js
@@ -127,7 +127,7 @@ module.exports = {
 
     prompt: function (message, promptCallback, title, buttonLabels) {
         console.log ("message" , message);
-        console.log ("confirmCallback" , promptCallback);
+        console.log ("promptCallback" , promptCallback);
         console.log ("title" , title);
         console.log ("buttonLabels" , buttonLabels);
 


[25/26] js commit: removed notification code from cordova.js

Posted by st...@apache.org.
removed notification code from cordova.js


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/6ec24b1b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/6ec24b1b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/6ec24b1b

Branch: refs/heads/3.0.0
Commit: 6ec24b1b02ff43166d78413009c98cb0554a4552
Parents: 54961ec
Author: Steven Gill <st...@gmail.com>
Authored: Thu May 16 14:29:30 2013 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Fri May 17 10:42:30 2013 -0700

----------------------------------------------------------------------
 lib/android/plugin/android/notification.js |   74 --------------
 lib/android/plugin/notification/symbols.js |   25 -----
 lib/common/plugin/notification.js          |  118 -----------------------
 lib/common/plugin/notification/symbols.js  |   24 -----
 lib/ios/plugin/ios/notification.js         |   28 ------
 lib/ios/plugin/notification/symbols.js     |   25 -----
 6 files changed, 0 insertions(+), 294 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/6ec24b1b/lib/android/plugin/android/notification.js
----------------------------------------------------------------------
diff --git a/lib/android/plugin/android/notification.js b/lib/android/plugin/android/notification.js
deleted file mode 100644
index 8936a5c..0000000
--- a/lib/android/plugin/android/notification.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-
-/**
- * Provides Android enhanced notification API.
- */
-module.exports = {
-    activityStart : function(title, message) {
-        // If title and message not specified then mimic Android behavior of
-        // using default strings.
-        if (typeof title === "undefined" && typeof message == "undefined") {
-            title = "Busy";
-            message = 'Please wait...';
-        }
-
-        exec(null, null, 'Notification', 'activityStart', [ title, message ]);
-    },
-
-    /**
-     * Close an activity dialog
-     */
-    activityStop : function() {
-        exec(null, null, 'Notification', 'activityStop', []);
-    },
-
-    /**
-     * Display a progress dialog with progress bar that goes from 0 to 100.
-     *
-     * @param {String}
-     *            title Title of the progress dialog.
-     * @param {String}
-     *            message Message to display in the dialog.
-     */
-    progressStart : function(title, message) {
-        exec(null, null, 'Notification', 'progressStart', [ title, message ]);
-    },
-
-    /**
-     * Close the progress dialog.
-     */
-    progressStop : function() {
-        exec(null, null, 'Notification', 'progressStop', []);
-    },
-
-    /**
-     * Set the progress dialog value.
-     *
-     * @param {Number}
-     *            value 0-100
-     */
-    progressValue : function(value) {
-        exec(null, null, 'Notification', 'progressValue', [ value ]);
-    }
-};

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/6ec24b1b/lib/android/plugin/notification/symbols.js
----------------------------------------------------------------------
diff --git a/lib/android/plugin/notification/symbols.js b/lib/android/plugin/notification/symbols.js
deleted file mode 100644
index c639dc2..0000000
--- a/lib/android/plugin/notification/symbols.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-
-var modulemapper = require('cordova/modulemapper');
-
-modulemapper.clobbers('cordova/plugin/notification', 'navigator.notification');
-modulemapper.merges('cordova/plugin/android/notification', 'navigator.notification');

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/6ec24b1b/lib/common/plugin/notification.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/notification.js b/lib/common/plugin/notification.js
deleted file mode 100644
index 919e050..0000000
--- a/lib/common/plugin/notification.js
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-var platform = require('cordova/platform');
-
-/**
- * Provides access to notifications on the device.
- */
-
-module.exports = {
-
-    /**
-     * Open a native alert dialog, with a customizable title and button text.
-     *
-     * @param {String} message              Message to print in the body of the alert
-     * @param {Function} completeCallback   The callback that is called when user clicks on a button.
-     * @param {String} title                Title of the alert dialog (default: Alert)
-     * @param {String} buttonLabel          Label of the close button (default: OK)
-     */
-    alert: function(message, completeCallback, title, buttonLabel) {
-        var _title = (title || "Alert");
-        var _buttonLabel = (buttonLabel || "OK");
-        exec(completeCallback, null, "Notification", "alert", [message, _title, _buttonLabel]);
-    },
-
-    /**
-     * Open a native confirm dialog, with a customizable title and button text.
-     * The result that the user selects is returned to the result callback.
-     *
-     * @param {String} message              Message to print in the body of the alert
-     * @param {Function} resultCallback     The callback that is called when user clicks on a button.
-     * @param {String} title                Title of the alert dialog (default: Confirm)
-     * @param {Array} buttonLabels          Array of the labels of the buttons (default: ['OK', 'Cancel'])
-     */
-    confirm: function(message, resultCallback, title, buttonLabels) {
-        var _title = (title || "Confirm");
-        var _buttonLabels = (buttonLabels || ["OK", "Cancel"]);
-
-        // Strings are deprecated!
-        if (typeof _buttonLabels === 'string') {
-            console.log("Notification.confirm(string, function, string, string) is deprecated.  Use Notification.confirm(string, function, string, array).");
-        }
-
-        // Some platforms take an array of button label names.
-        // Other platforms take a comma separated list.
-        // For compatibility, we convert to the desired type based on the platform.
-        if (platform.id == "android" || platform.id == "ios" || platform.id == "windowsphone" || platform.id == "blackberry10") {
-            if (typeof _buttonLabels === 'string') {
-                var buttonLabelString = _buttonLabels;
-                _buttonLabels = _buttonLabels.split(","); // not crazy about changing the var type here
-            }
-        } else {
-            if (Array.isArray(_buttonLabels)) {
-                var buttonLabelArray = _buttonLabels;
-                _buttonLabels = buttonLabelArray.toString();
-            }
-        }
-        exec(resultCallback, null, "Notification", "confirm", [message, _title, _buttonLabels]);
-    },
-
-    /**
-     * Open a native prompt dialog, with a customizable title and button text.
-     * The following results are returned to the result callback:
-     *  buttonIndex     Index number of the button selected.
-     *  input1          The text entered in the prompt dialog box.
-     *
-     * @param {String} message              Dialog message to display (default: "Prompt message")
-     * @param {Function} resultCallback     The callback that is called when user clicks on a button.
-     * @param {String} title                Title of the dialog (default: "Prompt")
-     * @param {Array} buttonLabels          Array of strings for the button labels (default: ["OK","Cancel"])
-     * @param {String} defaultText          Textbox input value (default: "Default text")
-     */
-    prompt: function(message, resultCallback, title, buttonLabels, defaultText) {
-        var _message = (message || "Prompt message");
-        var _title = (title || "Prompt");
-        var _buttonLabels = (buttonLabels || ["OK","Cancel"]);
-        var _defaultText = (defaultText || "Default text");
-        exec(resultCallback, null, "Notification", "prompt", [_message, _title, _buttonLabels, _defaultText]);
-    },
-
-    /**
-     * Causes the device to vibrate.
-     *
-     * @param {Integer} mills       The number of milliseconds to vibrate for.
-     */
-    vibrate: function(mills) {
-        exec(null, null, "Notification", "vibrate", [mills]);
-    },
-
-    /**
-     * Causes the device to beep.
-     * On Android, the default notification ringtone is played "count" times.
-     *
-     * @param {Integer} count       The number of beeps.
-     */
-    beep: function(count) {
-        exec(null, null, "Notification", "beep", [count]);
-    }
-};

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/6ec24b1b/lib/common/plugin/notification/symbols.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/notification/symbols.js b/lib/common/plugin/notification/symbols.js
deleted file mode 100644
index e4d249b..0000000
--- a/lib/common/plugin/notification/symbols.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-
-var modulemapper = require('cordova/modulemapper');
-
-modulemapper.defaults('cordova/plugin/notification', 'navigator.notification');

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/6ec24b1b/lib/ios/plugin/ios/notification.js
----------------------------------------------------------------------
diff --git a/lib/ios/plugin/ios/notification.js b/lib/ios/plugin/ios/notification.js
deleted file mode 100644
index 98b317c..0000000
--- a/lib/ios/plugin/ios/notification.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var Media = require('cordova/plugin/Media');
-
-module.exports = {
-    beep:function(count) {
-        (new Media('beep.wav')).play();
-    }
-};

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/6ec24b1b/lib/ios/plugin/notification/symbols.js
----------------------------------------------------------------------
diff --git a/lib/ios/plugin/notification/symbols.js b/lib/ios/plugin/notification/symbols.js
deleted file mode 100644
index c80f18d..0000000
--- a/lib/ios/plugin/notification/symbols.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-
-var modulemapper = require('cordova/modulemapper');
-
-modulemapper.clobbers('cordova/plugin/notification', 'navigator.notification');
-modulemapper.merges('cordova/plugin/ios/notification', 'navigator.notification');


[12/26] js commit: [Tizen, Tien SDK 2.0 (Magnolia)]

Posted by st...@apache.org.
[Tizen, Tien SDK 2.0 (Magnolia)]

adapt to new sdk

System Info API where changed

now the information is obtained threaw a synchronous call, getCapabilities()
returning a SystemInfoDeviceCapability variable

name is deprecated

device version = deviceCapabilities.platformVersion;
device uuid = deviceCapabilities.duid;
device model = deviceCapabilities.platformName;


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/4ad9875c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/4ad9875c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/4ad9875c

Branch: refs/heads/3.0.0
Commit: 4ad9875c1739e7f91e751505c20a397dd91f293d
Parents: 3a386e5
Author: pplaquette <pp...@apache.org>
Authored: Wed Apr 17 11:25:35 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri Apr 19 11:07:14 2013 +0200

----------------------------------------------------------------------
 lib/tizen/plugin/tizen/Device.js |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/4ad9875c/lib/tizen/plugin/tizen/Device.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Device.js b/lib/tizen/plugin/tizen/Device.js
index 6c80f92..ae63d38 100644
--- a/lib/tizen/plugin/tizen/Device.js
+++ b/lib/tizen/plugin/tizen/Device.js
@@ -32,10 +32,8 @@ function Device() {
     this.model = null;
     this.cordova = "2.5.0";
     this.platform = "Tizen";
-    
    
-    this.getDeviceInfo()
-    
+    this.getDeviceInfo();
 }
 
 Device.prototype.getDeviceInfo = function() {
@@ -53,8 +51,6 @@ Device.prototype.getDeviceInfo = function() {
      else {
          console.log("error initializing cordova: ");
      }
-
-
 };
 
 module.exports = new Device();


[23/26] js commit: Removed accelerometer code

Posted by st...@apache.org.
Removed accelerometer code


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/8af2f2bd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/8af2f2bd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/8af2f2bd

Branch: refs/heads/3.0.0
Commit: 8af2f2bdfa5e34b08006f4a0c8a5e2b820e62468
Parents: ac7968e
Author: Steven Gill <st...@gmail.com>
Authored: Tue May 14 15:37:37 2013 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Fri May 17 10:39:57 2013 -0700

----------------------------------------------------------------------
 lib/common/plugin/Acceleration.js          |   29 ----
 lib/common/plugin/accelerometer.js         |  170 -----------------------
 lib/common/plugin/accelerometer/symbols.js |   25 ----
 3 files changed, 0 insertions(+), 224 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/8af2f2bd/lib/common/plugin/Acceleration.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/Acceleration.js b/lib/common/plugin/Acceleration.js
deleted file mode 100644
index d1669b5..0000000
--- a/lib/common/plugin/Acceleration.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var Acceleration = function(x, y, z, timestamp) {
-    this.x = x;
-    this.y = y;
-    this.z = z;
-    this.timestamp = timestamp || (new Date()).getTime();
-};
-
-module.exports = Acceleration;

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/8af2f2bd/lib/common/plugin/accelerometer.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/accelerometer.js b/lib/common/plugin/accelerometer.js
deleted file mode 100644
index da50487..0000000
--- a/lib/common/plugin/accelerometer.js
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * This class provides access to device accelerometer data.
- * @constructor
- */
-var argscheck = require('cordova/argscheck'),
-    utils = require("cordova/utils"),
-    exec = require("cordova/exec"),
-    Acceleration = require('cordova/plugin/Acceleration');
-
-// Is the accel sensor running?
-var running = false;
-
-// Keeps reference to watchAcceleration calls.
-var timers = {};
-
-// Array of listeners; used to keep track of when we should call start and stop.
-var listeners = [];
-
-// Last returned acceleration object from native
-var accel = null;
-
-// Tells native to start.
-function start() {
-    exec(function(a) {
-        var tempListeners = listeners.slice(0);
-        accel = new Acceleration(a.x, a.y, a.z, a.timestamp);
-        for (var i = 0, l = tempListeners.length; i < l; i++) {
-            tempListeners[i].win(accel);
-        }
-    }, function(e) {
-        var tempListeners = listeners.slice(0);
-        for (var i = 0, l = tempListeners.length; i < l; i++) {
-            tempListeners[i].fail(e);
-        }
-    }, "Accelerometer", "start", []);
-    running = true;
-}
-
-// Tells native to stop.
-function stop() {
-    exec(null, null, "Accelerometer", "stop", []);
-    running = false;
-}
-
-// Adds a callback pair to the listeners array
-function createCallbackPair(win, fail) {
-    return {win:win, fail:fail};
-}
-
-// Removes a win/fail listener pair from the listeners array
-function removeListeners(l) {
-    var idx = listeners.indexOf(l);
-    if (idx > -1) {
-        listeners.splice(idx, 1);
-        if (listeners.length === 0) {
-            stop();
-        }
-    }
-}
-
-var accelerometer = {
-    /**
-     * Asynchronously acquires the current acceleration.
-     *
-     * @param {Function} successCallback    The function to call when the acceleration data is available
-     * @param {Function} errorCallback      The function to call when there is an error getting the acceleration data. (OPTIONAL)
-     * @param {AccelerationOptions} options The options for getting the accelerometer data such as timeout. (OPTIONAL)
-     */
-    getCurrentAcceleration: function(successCallback, errorCallback, options) {
-        argscheck.checkArgs('fFO', 'accelerometer.getCurrentAcceleration', arguments);
-
-        var p;
-        var win = function(a) {
-            removeListeners(p);
-            successCallback(a);
-        };
-        var fail = function(e) {
-            removeListeners(p);
-            errorCallback && errorCallback(e);
-        };
-
-        p = createCallbackPair(win, fail);
-        listeners.push(p);
-
-        if (!running) {
-            start();
-        }
-    },
-
-    /**
-     * Asynchronously acquires the acceleration repeatedly at a given interval.
-     *
-     * @param {Function} successCallback    The function to call each time the acceleration data is available
-     * @param {Function} errorCallback      The function to call when there is an error getting the acceleration data. (OPTIONAL)
-     * @param {AccelerationOptions} options The options for getting the accelerometer data such as timeout. (OPTIONAL)
-     * @return String                       The watch id that must be passed to #clearWatch to stop watching.
-     */
-    watchAcceleration: function(successCallback, errorCallback, options) {
-        argscheck.checkArgs('fFO', 'accelerometer.watchAcceleration', arguments);
-        // Default interval (10 sec)
-        var frequency = (options && options.frequency && typeof options.frequency == 'number') ? options.frequency : 10000;
-
-        // Keep reference to watch id, and report accel readings as often as defined in frequency
-        var id = utils.createUUID();
-
-        var p = createCallbackPair(function(){}, function(e) {
-            removeListeners(p);
-            errorCallback && errorCallback(e);
-        });
-        listeners.push(p);
-
-        timers[id] = {
-            timer:window.setInterval(function() {
-                if (accel) {
-                    successCallback(accel);
-                }
-            }, frequency),
-            listeners:p
-        };
-
-        if (running) {
-            // If we're already running then immediately invoke the success callback
-            // but only if we have retrieved a value, sample code does not check for null ...
-            if (accel) {
-                successCallback(accel);
-            }
-        } else {
-            start();
-        }
-
-        return id;
-    },
-
-    /**
-     * Clears the specified accelerometer watch.
-     *
-     * @param {String} id       The id of the watch returned from #watchAcceleration.
-     */
-    clearWatch: function(id) {
-        // Stop javascript timer & remove from timer list
-        if (id && timers[id]) {
-            window.clearInterval(timers[id].timer);
-            removeListeners(timers[id].listeners);
-            delete timers[id];
-        }
-    }
-};
-
-module.exports = accelerometer;

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/8af2f2bd/lib/common/plugin/accelerometer/symbols.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/accelerometer/symbols.js b/lib/common/plugin/accelerometer/symbols.js
deleted file mode 100644
index 1c6818e..0000000
--- a/lib/common/plugin/accelerometer/symbols.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-
-var modulemapper = require('cordova/modulemapper');
-
-modulemapper.defaults('cordova/plugin/Acceleration', 'Acceleration');
-modulemapper.defaults('cordova/plugin/accelerometer', 'navigator.accelerometer');


[20/26] js commit: [CB-3396] [Tizen, Tizen SDK 2.0 (Magnolia)]

Posted by st...@apache.org.
[CB-3396] [Tizen, Tizen SDK 2.0 (Magnolia)]

remove several console.log messages specific to tizen
(keep them in comments for now)


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/06c9d997
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/06c9d997
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/06c9d997

Branch: refs/heads/3.0.0
Commit: 06c9d99726643e7abb55a4c46e1a81f6f64cbc0b
Parents: 4679795
Author: pplaquette <pp...@apache.org>
Authored: Fri May 17 16:09:26 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri May 17 16:09:26 2013 +0200

----------------------------------------------------------------------
 lib/tizen/plugin/tizen/Camera.js |    4 ++--
 lib/tizen/plugin/tizen/Device.js |    4 ++--
 lib/tizen/plugin/tizen/Media.js  |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/06c9d997/lib/tizen/plugin/tizen/Camera.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Camera.js b/lib/tizen/plugin/tizen/Camera.js
index 1449f7b..06e134c 100644
--- a/lib/tizen/plugin/tizen/Camera.js
+++ b/lib/tizen/plugin/tizen/Camera.js
@@ -23,7 +23,7 @@
 var Camera = require('cordova/plugin/CameraConstants');
 
 
-console.log("TIZEN CAMERA START");
+//console.log("TIZEN CAMERA START");
 
 function cameraMakeReplyCallback(successCallback, errorCallback) {
     return {
@@ -105,4 +105,4 @@ module.exports = {
         }
 };
 
-console.log("TIZEN CAMERA END");
+//console.log("TIZEN CAMERA END");

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/06c9d997/lib/tizen/plugin/tizen/Device.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Device.js b/lib/tizen/plugin/tizen/Device.js
index daeb5ec..8b88dfb 100644
--- a/lib/tizen/plugin/tizen/Device.js
+++ b/lib/tizen/plugin/tizen/Device.js
@@ -22,7 +22,7 @@
 /*global tizen:false */
 var channel = require('cordova/channel');
 
-console.log("TIZEN DEVICE START");
+//console.log("TIZEN DEVICE START");
 
 
 // Tell cordova channel to wait on the CordovaInfoReady event - PPL is this useful?
@@ -59,6 +59,6 @@ Device.prototype.getDeviceInfo = function() {
 
 module.exports = new Device();
 
-console.log("TIZEN DEVICE END");
+//console.log("TIZEN DEVICE END");
 
 

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/06c9d997/lib/tizen/plugin/tizen/Media.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Media.js b/lib/tizen/plugin/tizen/Media.js
index 8502f42..e3161d2 100644
--- a/lib/tizen/plugin/tizen/Media.js
+++ b/lib/tizen/plugin/tizen/Media.js
@@ -23,7 +23,7 @@
 var MediaError = require('cordova/plugin/MediaError'),
     audioObjects = {};
 
-console.log("TIZEN MEDIA START");
+//console.log("TIZEN MEDIA START");
 
 module.exports = {
 
@@ -213,5 +213,5 @@ module.exports = {
     }
 };
 
-console.log("TIZEN MEDIA END");
+//console.log("TIZEN MEDIA END");
 


[21/26] js commit: [CB-3396] [Tizen , Tizen SDK 2.0 (Magnolia)]

Posted by st...@apache.org.
[CB-3396] [Tizen , Tizen SDK 2.0 (Magnolia)]

remove a few more console messages from platform.js
(keeping them in comments for now)

note that CB 33-96 commit were previously titled as [ Tizen, Tizen SDK 2.0 (Magnolia)]
or  [ Tizen, Tizen SDK 2.0 ] before I had a JIRA Ticket


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/1484b8eb
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/1484b8eb
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/1484b8eb

Branch: refs/heads/3.0.0
Commit: 1484b8eb2df0a0782ef316237c7e719460c8edf2
Parents: 06c9d99
Author: pplaquette <pp...@apache.org>
Authored: Fri May 17 16:17:46 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri May 17 16:17:46 2013 +0200

----------------------------------------------------------------------
 lib/tizen/platform.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/1484b8eb/lib/tizen/platform.js
----------------------------------------------------------------------
diff --git a/lib/tizen/platform.js b/lib/tizen/platform.js
index 61d7b39..afaa691 100644
--- a/lib/tizen/platform.js
+++ b/lib/tizen/platform.js
@@ -26,7 +26,7 @@ module.exports = {
     id: "tizen",
     initialize: function() {
 
-        console.log("TIZEN PLATFORM initialize start");
+        //console.log("TIZEN PLATFORM initialize start");
 
         var modulemapper = require('cordova/modulemapper');
 
@@ -36,7 +36,7 @@ module.exports = {
 
         modulemapper.mapModules(window);
 
-        console.log("TIZEN PLATFORM initialize end");
+        //console.log("TIZEN PLATFORM initialize end");
 
     }
 };


[10/26] js commit: [Tizen, Tizen SDK 2.0 (Magnolia)]

Posted by st...@apache.org.
[Tizen, Tizen SDK 2.0 (Magnolia)]

Adapt to new SDK
using CompassHeading object , and constructor
plus cleaning, a few renamings


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/3a386e57
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/3a386e57
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/3a386e57

Branch: refs/heads/3.0.0
Commit: 3a386e57c9365bd72d1cd2faf3687a7402b2182a
Parents: c139ba0
Author: pplaquette <pp...@apache.org>
Authored: Wed Apr 17 11:23:22 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri Apr 19 11:07:14 2013 +0200

----------------------------------------------------------------------
 lib/tizen/plugin/tizen/Compass.js |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/3a386e57/lib/tizen/plugin/tizen/Compass.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/Compass.js b/lib/tizen/plugin/tizen/Compass.js
index 74cb48e..b7fd029 100644
--- a/lib/tizen/plugin/tizen/Compass.js
+++ b/lib/tizen/plugin/tizen/Compass.js
@@ -20,26 +20,27 @@
 */
 
 var CompassError = require('cordova/plugin/CompassError'),
-    callback = null, ready = false;
+    CompassHeading = require('cordova/plugin/CompassHeadings');
+
+var compassCallback = null,
+    compassReady = false;
 
 module.exports = {
     getHeading: function(successCallback, errorCallback) {
+
         if (window.DeviceOrientationEvent !== undefined) {
-            callback = function (orientation) {
+
+            compassCallback = function (orientation) {
                 var heading = 360 - orientation.alpha;
-                if (ready) {
-                    successCallback({
-                        magneticHeading: heading,
-                        trueHeading: heading,
-                        headingAccuracy: 0,
-                        timestamp: orientation.timeStamp
-                    });
-                    window.removeEventListener("deviceorientation", callback);
+
+                if (compassReady) {
+                    successCallback( new CompassHeading (heading, heading, 0, 0));
+                    window.removeEventListener("deviceorientation", compassCallback, true);
                 }
-                ready = true;
+                compassReady = true;
             };
-            ready = false; // workaround invalid first event value returned by WRT
-            window.addEventListener("deviceorientation", callback);
+            compassReady = false; // workaround invalid first event value returned by WRT
+            window.addEventListener("deviceorientation", compassCallback, true);
         }
         else {
             errorCallback(CompassError.COMPASS_NOT_SUPPORTED);


[26/26] js commit: Merge branch '3.0.0' of https://git-wip-us.apache.org/repos/asf/cordova-js into 3.0.0

Posted by st...@apache.org.
Merge branch '3.0.0' of https://git-wip-us.apache.org/repos/asf/cordova-js into 3.0.0


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/8ac64ca0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/8ac64ca0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/8ac64ca0

Branch: refs/heads/3.0.0
Commit: 8ac64ca00579d246cb3c3f6691a06ea3e8e096ed
Parents: 6ec24b1 bb10068
Author: Steven Gill <st...@gmail.com>
Authored: Fri May 17 10:53:05 2013 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Fri May 17 10:53:05 2013 -0700

----------------------------------------------------------------------

----------------------------------------------------------------------



[15/26] js commit: [Tizen, Tizen SDK 2.0 (Magnolia)] - ContactUtils.js

Posted by st...@apache.org.
[Tizen, Tizen SDK 2.0 (Magnolia)] - ContactUtils.js

fix white space warning


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/ba4dff62
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/ba4dff62
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/ba4dff62

Branch: refs/heads/3.0.0
Commit: ba4dff62ba3f91f802c9cbf3df7f6cd9be8fdd5a
Parents: 717ca76
Author: pplaquette <pp...@apache.org>
Authored: Fri Apr 19 11:10:23 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri Apr 19 11:10:23 2013 +0200

----------------------------------------------------------------------
 lib/tizen/plugin/tizen/ContactUtils.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/ba4dff62/lib/tizen/plugin/tizen/ContactUtils.js
----------------------------------------------------------------------
diff --git a/lib/tizen/plugin/tizen/ContactUtils.js b/lib/tizen/plugin/tizen/ContactUtils.js
index ca81a15..7283998 100644
--- a/lib/tizen/plugin/tizen/ContactUtils.js
+++ b/lib/tizen/plugin/tizen/ContactUtils.js
@@ -282,7 +282,7 @@ module.exports = {
             // addresses Tizen 2.0
             else if (field.indexOf('addresses') === 0) {
                 var addresses = [];
-                
+
                 for (index = 0 ; index < tizenContact.addresses.length ; ++index) {
                     addresses.push(
                          new ContactAddress(
@@ -314,7 +314,7 @@ module.exports = {
             // organizations Tizen 2.0
             else if (field.indexOf('organizations') === 0) {
                 var organizations = [];
-                
+
                 for (index = 0 ; index < tizenContact.organizations.length ; ++index) {
                     organizations.push(
                             new ContactOrganization(


[06/26] js commit: [Tizen, Tizen SDK 2.0 (Magnolia)] - platform.js

Posted by st...@apache.org.
[Tizen, Tizen SDK 2.0 (Magnolia)] - platform.js

added, in comment, for now the load instruction for plugins
related to Cordova plugin evolution


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/92eb8d37
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/92eb8d37
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/92eb8d37

Branch: refs/heads/3.0.0
Commit: 92eb8d37ba1250801179ed29ab2ec6b34963d9f9
Parents: 6b40200
Author: pplaquette <pp...@apache.org>
Authored: Thu Apr 18 13:40:54 2013 +0200
Committer: pplaquette <pp...@apache.org>
Committed: Fri Apr 19 11:07:14 2013 +0200

----------------------------------------------------------------------
 lib/tizen/platform.js |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/92eb8d37/lib/tizen/platform.js
----------------------------------------------------------------------
diff --git a/lib/tizen/platform.js b/lib/tizen/platform.js
index 924813f..1860b57 100644
--- a/lib/tizen/platform.js
+++ b/lib/tizen/platform.js
@@ -24,7 +24,10 @@ module.exports = {
     initialize: function() {
         var modulemapper = require('cordova/modulemapper');
 
+        //modulemapper.loadMatchingModules(/cordova.*\/plugininit$/);
+
         modulemapper.loadMatchingModules(/cordova.*\/symbols$/);
+
         modulemapper.mapModules(window);
     }
 };