incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [4/9] js commit: sync with apache/incubator-cordova-js
Date Wed, 17 Oct 2012 20:38:34 GMT
sync with apache/incubator-cordova-js


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

Branch: refs/heads/master
Commit: 40ef5295c0427d9de77f43e0b1904d4761f75330
Parents: deafc22
Author: mingfeng <mingfengwang01@gmail.com>
Authored: Tue Oct 16 12:46:00 2012 +0800
Committer: mingfeng <mingfengwang01@gmail.com>
Committed: Tue Oct 16 12:46:00 2012 +0800

----------------------------------------------------------------------
 .jshintrc                                          |    2 +-
 lib/common/commandProxy.js                         |   46 +++++++
 lib/windows8/exec.js                               |   92 +++++----------
 lib/windows8/platform.js                           |   45 +++++++
 lib/windows8/plugin/windows8/AccelerometerProxy.js |   38 ++++++-
 lib/windows8/plugin/windows8/CameraProxy.js        |   26 ++++-
 lib/windows8/plugin/windows8/CaptureProxy.js       |   27 +++++
 lib/windows8/plugin/windows8/CompassProxy.js       |   26 ++++-
 lib/windows8/plugin/windows8/DeviceProxy.js        |   38 ++++++-
 lib/windows8/plugin/windows8/FileProxy.js          |   32 +++++-
 lib/windows8/plugin/windows8/FileTransferProxy.js  |   24 ++++
 lib/windows8/plugin/windows8/MediaProxy.js         |   25 ++++
 lib/windows8/plugin/windows8/NetworkStatusProxy.js |   25 ++++-
 lib/windows8/plugin/windows8/NotificationProxy.js  |   27 ++++-
 lib/windows8/plugin/windows8/console.js            |   25 ++++-
 lib/windows8/plugin/windows8/device.js             |   36 ------
 lib/windows8/plugin/windows8/geolocation.js        |   23 ++++
 17 files changed, 442 insertions(+), 115 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/40ef5295/.jshintrc
----------------------------------------------------------------------
diff --git a/.jshintrc b/.jshintrc
index 2fa61bc..e4a920e 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -28,7 +28,7 @@
   "dojo": false,
 
   // Custom predefined globals.
-  "predef": ["jasmine", "blackberry", "define", "alert", "prompt", "org", "deviceapis", "Osp"],
+  "predef": ["jasmine", "blackberry", "define", "alert", "prompt", "org", "deviceapis", "Osp",
"_cordovaExec", "WinJS", "Windows", "MSApp"],
 
 
   // Development

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/40ef5295/lib/common/commandProxy.js
----------------------------------------------------------------------
diff --git a/lib/common/commandProxy.js b/lib/common/commandProxy.js
new file mode 100644
index 0000000..e640003
--- /dev/null
+++ b/lib/common/commandProxy.js
@@ -0,0 +1,46 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+
+// internal map of proxy function
+var CommandProxyMap = {};
+
+module.exports = {
+
+    // example: cordova.commandProxy.add("Accelerometer",{getCurrentAcceleration: function(successCallback,
errorCallback, options) {...},...);
+    add:function(id,proxyObj) {
+        console.log("adding proxy for " + id);
+        CommandProxyMap[id] = proxyObj;
+        return proxyObj;
+    },
+
+    // cordova.commandProxy.remove("Accelerometer");
+    remove:function(id) {
+        var proxy = CommandProxyMap[id];
+        delete CommandProxyMap[id];
+        CommandProxyMap[id] = null;
+        return proxy;
+    },
+
+    get:function(service,action) {
+        return ( CommandProxyMap[service] ? CommandProxyMap[service][action] : null );
+    }
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/40ef5295/lib/windows8/exec.js
----------------------------------------------------------------------
diff --git a/lib/windows8/exec.js b/lib/windows8/exec.js
index 49a2712..5eb331f 100644
--- a/lib/windows8/exec.js
+++ b/lib/windows8/exec.js
@@ -1,17 +1,32 @@
-var cordova = require('cordova');
-
-
- /* definition of named properties expected by the native side,
-    all arrays are stored in order of how they are received from common js code.
-    When other platforms evolve to using named args this will be removed.
- */
+/*
+ *
+ * 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 cordova = require('cordova');
+var commandProxy = require('cordova/commandProxy');
 
 /**
  * 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
- *      Asynchrounous: Empty string ""
+ *      Asynchronous: Empty string ""
  * If async, the native side will cordova.callbackSuccess or cordova.callbackError,
  * depending upon the result of the action.
  *
@@ -21,70 +36,23 @@ var cordova = require('cordova');
  * @param {String} action       Action to be run in cordova
  * @param {String[]} [args]     Zero or more arguments to pass to the method
  */
-
-
-
-var CommandProxy;
-
-function getCP() {
-    if (!CommandProxy) {
-        CommandProxy = {
-          "Accelerometer": require('cordova/plugin/windows8/AccelerometerProxy'),
-          "Camera":require('cordova/plugin/windows8/CameraProxy'),
-          "Capture":require('cordova/plugin/windows8/CaptureProxy'),
-          "Compass":require('cordova/plugin/windows8/CompassProxy'),
-          "Device":require('cordova/plugin/windows8/DeviceProxy'),
-          "File":require('cordova/plugin/windows8/FileProxy'),
-          "FileTransfer":require('cordova/plugin/windows8/FileTransferProxy'),
-          "Media":require('cordova/plugin/windows8/MediaProxy'),
-          "NetworkStatus":require('cordova/plugin/windows8/NetworkStatusProxy'),
-          "Notification":require('cordova/plugin/windows8/NotificationProxy')
-        };
-    }
-    return CommandProxy;
-}
-
 module.exports = function(success, fail, service, action, args) {
-    var CommandProxy = getCP();
-    if(CommandProxy[service] && CommandProxy[service][action]) {
 
+    var proxy = commandProxy.get(service,action);
+    if(proxy) {
         var callbackId = service + cordova.callbackId++;
-        console.log("EXEC:" + service + " : " + action);
-
+        // console.log("EXEC:" + service + " : " + action);
         if (typeof success == "function" || typeof fail == "function") {
             cordova.callbacks[callbackId] = {success:success, fail:fail};
         }
-        // pass it on to Notify
         try {
-            CommandProxy [service][action](success, fail, args);
+            proxy(success, fail, args);
         }
         catch(e) {
             console.log("Exception calling native with command :: " + service + " :: " +
action  + " ::exception=" + e);
         }
     }
-    else
-    {
-        if(fail) { fail("Missing Command Error"); }
+    else {
+        fail && fail("Missing Command Error");
     }
-
-};
-
-// cordova.exec.addCommandProxy("Accelerometer",{getCurrentAcceleration: function(successCallback,
errorCallback, options) {...},...);
-module.exports.addCommandProxy = function(id,proxyObj) {
-    var CommandProxy = getCP();
-    CommandProxy[id] = proxyObj;
-};
-
-// cordova.exec.removeCommandProxy("Accelerometer");
-module.exports.removeCommandProxy = function(id) {
-    var CommandProxy = getCP();
-    var proxy = CommandProxy[id];
-    delete CommandProxy[id];
-    CommandProxy[id] = null;
-    return proxy;
-};
-
-
-
-
-
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/40ef5295/lib/windows8/platform.js
----------------------------------------------------------------------
diff --git a/lib/windows8/platform.js b/lib/windows8/platform.js
index cd59c3b..47adbdc 100644
--- a/lib/windows8/platform.js
+++ b/lib/windows8/platform.js
@@ -1,7 +1,44 @@
+/*
+ *
+ * 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 cordova = require('cordova'),
     exec = require('cordova/exec'),
     channel = cordova.require("cordova/channel");
 
+
+/*
+ * Define native implementations ( there is no native layer, so need to make sure the proxies
are there )
+*/
+
+require('cordova/plugin/windows8/DeviceProxy');
+require('cordova/plugin/windows8/NetworkStatusProxy');
+require('cordova/plugin/windows8/AccelerometerProxy');
+require('cordova/plugin/windows8/CameraProxy');
+require('cordova/plugin/windows8/CaptureProxy');
+require('cordova/plugin/windows8/CompassProxy');
+require('cordova/plugin/windows8/FileProxy');
+require('cordova/plugin/windows8/FileTransferProxy');
+require('cordova/plugin/windows8/MediaProxy');
+require('cordova/plugin/windows8/NotificationProxy');
+
+
 module.exports = {
     id: "windows8",
     initialize:function() {
@@ -20,6 +57,14 @@ module.exports = {
         app.start();
     },
     objects: {
+        cordova: {
+            path: 'cordova',
+            children: {
+                commandProxy: {
+                    path: 'cordova/commandProxy'
+                }
+            }
+        },
         navigator: {
             children: {
                 device: {

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/40ef5295/lib/windows8/plugin/windows8/AccelerometerProxy.js
----------------------------------------------------------------------
diff --git a/lib/windows8/plugin/windows8/AccelerometerProxy.js b/lib/windows8/plugin/windows8/AccelerometerProxy.js
index 46749b5..953b147 100644
--- a/lib/windows8/plugin/windows8/AccelerometerProxy.js
+++ b/lib/windows8/plugin/windows8/AccelerometerProxy.js
@@ -1,5 +1,29 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+
 /*global Windows:true */
-var Acceleration = require('cordova/plugin/Acceleration');
+
+var cordova = require('cordova'),
+    Acceleration = require('cordova/plugin/Acceleration');
 
 /* This is the actual implementation part that returns the result on Windows 8
 */
@@ -10,7 +34,7 @@ module.exports = {
 
         var accel = Windows.Devices.Sensors.Accelerometer.getDefault();
         if(!accel) {
-            lose("No accelerometer found");
+            lose && lose("No accelerometer found");
         }
         else {
             var self = this;
@@ -22,13 +46,18 @@ module.exports = {
                 win(new Acceleration(a.accelerationX,a.accelerationY,a.accelerationZ));
             };
             accel.addEventListener("readingchanged",this.onDataChanged);
+
+            setTimeout(function(){
+                var a = accel.getCurrentReading();
+                win(new Acceleration(a.accelerationX,a.accelerationY,a.accelerationZ));
+            },0); // async do later
         }
     },
     stop:function(win,lose){
         console.log("Accelerometer.stop");
         var accel = Windows.Devices.Sensors.Accelerometer.getDefault();
         if(!accel) {
-            lose("No accelerometer found");
+            lose && lose("No accelerometer found");
         }
         else {
             accel.removeEventListener("readingchanged",this.onDataChanged);
@@ -37,4 +66,5 @@ module.exports = {
             win();
         }
     }
-};
\ No newline at end of file
+};
+require("cordova/commandProxy").add("Accelerometer",module.exports);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/40ef5295/lib/windows8/plugin/windows8/CameraProxy.js
----------------------------------------------------------------------
diff --git a/lib/windows8/plugin/windows8/CameraProxy.js b/lib/windows8/plugin/windows8/CameraProxy.js
index 9fbb830..8c0abe0 100644
--- a/lib/windows8/plugin/windows8/CameraProxy.js
+++ b/lib/windows8/plugin/windows8/CameraProxy.js
@@ -1,3 +1,25 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+
 /*global Windows:true, URL:true */
 
 
@@ -318,4 +340,6 @@ module.exports = {
             });
         }
     }
-};
\ No newline at end of file
+};
+
+require("cordova/commandProxy").add("Camera",module.exports);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/40ef5295/lib/windows8/plugin/windows8/CaptureProxy.js
----------------------------------------------------------------------
diff --git a/lib/windows8/plugin/windows8/CaptureProxy.js b/lib/windows8/plugin/windows8/CaptureProxy.js
index c39398a..8f1970a 100644
--- a/lib/windows8/plugin/windows8/CaptureProxy.js
+++ b/lib/windows8/plugin/windows8/CaptureProxy.js
@@ -1,3 +1,28 @@
+/*global Windows:true */
+
+/*
+ *
+ * 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 MediaFile = require('cordova/plugin/MediaFile');
 var CaptureError = require('cordova/plugin/CaptureError');
 var CaptureAudioOptions = require('cordova/plugin/CaptureAudioOptions');
@@ -137,3 +162,5 @@ module.exports = {
         );
     }
 };
+
+require("cordova/commandProxy").add("Capture",module.exports);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/40ef5295/lib/windows8/plugin/windows8/CompassProxy.js
----------------------------------------------------------------------
diff --git a/lib/windows8/plugin/windows8/CompassProxy.js b/lib/windows8/plugin/windows8/CompassProxy.js
index 9be8ecd..282979f 100644
--- a/lib/windows8/plugin/windows8/CompassProxy.js
+++ b/lib/windows8/plugin/windows8/CompassProxy.js
@@ -1,3 +1,25 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+
 /*global Windows:true */
 var cordova = require('cordova'),
     CompassHeading = require('cordova/plugin/CompassHeading');
@@ -38,4 +60,6 @@ module.exports = {
         }
 
     }
-};
\ No newline at end of file
+};
+
+require("cordova/commandProxy").add("Compass",module.exports);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/40ef5295/lib/windows8/plugin/windows8/DeviceProxy.js
----------------------------------------------------------------------
diff --git a/lib/windows8/plugin/windows8/DeviceProxy.js b/lib/windows8/plugin/windows8/DeviceProxy.js
index ffd9351..faf9869 100644
--- a/lib/windows8/plugin/windows8/DeviceProxy.js
+++ b/lib/windows8/plugin/windows8/DeviceProxy.js
@@ -1,3 +1,24 @@
+/*
+ *
+ * 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 cordova = require('cordova');
 
 
@@ -5,8 +26,21 @@ module.exports = {
 
         getDeviceInfo:function(win,fail,args){
             console.log("NativeProxy::getDeviceInfo");
+
+            var hostNames = Windows.Networking.Connectivity.NetworkInformation.getHostNames();
+                
+            var name = "unknown";
+            hostNames.some(function (nm) {
+                if (nm.displayName.indexOf(".local") > -1) {
+                    name = nm.displayName.split(".local")[0];
+                    return true;
+                }
+            });
+
             setTimeout(function(){
-                win({platform:"windows8", version:"8", name:"TODO", uuid:"TODO", cordova:"2.0.1"});
+                win({platform:"windows8", version:"8", name:name, uuid:"TODO", cordova:"2.2.0"});
             },0);
         }
-};
\ No newline at end of file
+};
+
+require("cordova/commandProxy").add("Device",module.exports);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/40ef5295/lib/windows8/plugin/windows8/FileProxy.js
----------------------------------------------------------------------
diff --git a/lib/windows8/plugin/windows8/FileProxy.js b/lib/windows8/plugin/windows8/FileProxy.js
index 06be506..7d4c105 100644
--- a/lib/windows8/plugin/windows8/FileProxy.js
+++ b/lib/windows8/plugin/windows8/FileProxy.js
@@ -1,11 +1,33 @@
+/*
+ *
+ * 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 cordova = require('cordova');
 var Entry = require('cordova/plugin/Entry'),
     File = require('cordova/plugin/File'),
     FileEntry = require('cordova/plugin/FileEntry'),
     FileError = require('cordova/plugin/FileError'),
     DirectoryEntry = require('cordova/plugin/DirectoryEntry'),
-    Flags = require('cordova/plugin/Flags');
-//var cordova = require('cordova');
-
+    Flags = require('cordova/plugin/Flags'),
+    FileSystem = require('cordova/plugin/FileSystem'),
+    LocalFileSystem = require('cordova/plugin/LocalFileSystem');
 
 module.exports = {
 
@@ -823,4 +845,6 @@ module.exports = {
         }
     }
 
-};
\ No newline at end of file
+};
+
+require("cordova/commandProxy").add("File",module.exports);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/40ef5295/lib/windows8/plugin/windows8/FileTransferProxy.js
----------------------------------------------------------------------
diff --git a/lib/windows8/plugin/windows8/FileTransferProxy.js b/lib/windows8/plugin/windows8/FileTransferProxy.js
index b1f44d1..1ce79d0 100644
--- a/lib/windows8/plugin/windows8/FileTransferProxy.js
+++ b/lib/windows8/plugin/windows8/FileTransferProxy.js
@@ -1,3 +1,25 @@
+/*
+ *
+ * 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 FileTransferError = require('cordova/plugin/FileTransferError'),
     FileUploadResult = require('cordova/plugin/FileUploadResult'),
     FileEntry = require('cordova/plugin/FileEntry');
@@ -84,3 +106,5 @@ module.exports = {
         });
     }
 };
+
+require("cordova/commandProxy").add("FileTransfer",module.exports);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/40ef5295/lib/windows8/plugin/windows8/MediaProxy.js
----------------------------------------------------------------------
diff --git a/lib/windows8/plugin/windows8/MediaProxy.js b/lib/windows8/plugin/windows8/MediaProxy.js
index 7d716c0..a9d0070 100644
--- a/lib/windows8/plugin/windows8/MediaProxy.js
+++ b/lib/windows8/plugin/windows8/MediaProxy.js
@@ -1,3 +1,26 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/*global Windows:true */
+
 var cordova = require('cordova');
 
 module.exports = {
@@ -152,3 +175,5 @@ module.exports = {
         thisM.volume = volume;
     }
 };
+
+require("cordova/commandProxy").add("Media",module.exports);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/40ef5295/lib/windows8/plugin/windows8/NetworkStatusProxy.js
----------------------------------------------------------------------
diff --git a/lib/windows8/plugin/windows8/NetworkStatusProxy.js b/lib/windows8/plugin/windows8/NetworkStatusProxy.js
index de76784..cad2357 100644
--- a/lib/windows8/plugin/windows8/NetworkStatusProxy.js
+++ b/lib/windows8/plugin/windows8/NetworkStatusProxy.js
@@ -1,3 +1,24 @@
+/*
+ *
+ * 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.
+ *
+*/
+
 /*global Windows:true */
 
 var cordova = require('cordova');
@@ -56,4 +77,6 @@ module.exports = {
         },0);
     }
 
-};
\ No newline at end of file
+};
+
+require("cordova/commandProxy").add("NetworkStatus",module.exports);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/40ef5295/lib/windows8/plugin/windows8/NotificationProxy.js
----------------------------------------------------------------------
diff --git a/lib/windows8/plugin/windows8/NotificationProxy.js b/lib/windows8/plugin/windows8/NotificationProxy.js
index d39c63c..898274c 100644
--- a/lib/windows8/plugin/windows8/NotificationProxy.js
+++ b/lib/windows8/plugin/windows8/NotificationProxy.js
@@ -1,3 +1,26 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/*global Windows:true */
+
 var cordova = require('cordova');
 
 module.exports = {
@@ -56,4 +79,6 @@ module.exports = {
             }
         }, playTime + quietTime); */
     }
-};
\ No newline at end of file
+};
+
+require("cordova/commandProxy").add("Notification",module.exports);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/40ef5295/lib/windows8/plugin/windows8/console.js
----------------------------------------------------------------------
diff --git a/lib/windows8/plugin/windows8/console.js b/lib/windows8/plugin/windows8/console.js
index a0ada8e..a0d5c3f 100644
--- a/lib/windows8/plugin/windows8/console.js
+++ b/lib/windows8/plugin/windows8/console.js
@@ -1,3 +1,24 @@
+/*
+ *
+ * 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.
+ *
+*/
+
 
 if(!console || !console.log)
 {
@@ -18,8 +39,8 @@ if(!console || !console.log)
     module.exports = debugConsole;
 }
 else if(console && console.log) {
-    
+
   console.log("console.log exists already!");
   console.warn = console.warn || function(msg){console.log("warn:"+msg);};
   console.error = console.error || function(msg){console.log("error:"+msg);};
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/40ef5295/lib/windows8/plugin/windows8/device.js
----------------------------------------------------------------------
diff --git a/lib/windows8/plugin/windows8/device.js b/lib/windows8/plugin/windows8/device.js
deleted file mode 100644
index 26381fe..0000000
--- a/lib/windows8/plugin/windows8/device.js
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-if(!console || !console.log)
-{
-    var exec = require('cordova/exec'),
-        channel = require('cordova/channel');
-
-
-
-    var debugConsole = {
-        log:function(msg){
-        exec(null,null,"DebugConsole","log",msg);
-        },
-        warn:function(msg){
-            exec(null,null,"DebugConsole","warn",msg);
-        },
-        error:function(msg){
-            exec(null,null,"DebugConsole","error",msg);
-        }
-    };
-
-
-    module.exports = debugConsole;
-}
-else
-{
-
-    if(console && console.log)
-    {
-        console.log("console.log exists already!");
-        console.warn = console.warn || function(msg){console.log("warn:"+msg);};
-        console.error = console.error || function(msg){console.log("error:"+msg);};
-
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/40ef5295/lib/windows8/plugin/windows8/geolocation.js
----------------------------------------------------------------------
diff --git a/lib/windows8/plugin/windows8/geolocation.js b/lib/windows8/plugin/windows8/geolocation.js
index 311d371..d7c4d94 100644
--- a/lib/windows8/plugin/windows8/geolocation.js
+++ b/lib/windows8/plugin/windows8/geolocation.js
@@ -1,3 +1,26 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+/*global Windows:true */
+
 var Position = require('cordova/plugin/Position'),
     PositionError = require('cordova/plugin/PositionError');
 


Mime
View raw message