You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2012/10/06 11:19:20 UTC
[8/45] js commit: merging
merging
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/ae2ad697
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/ae2ad697
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/ae2ad697
Branch: refs/heads/master
Commit: ae2ad69754c7c26f54c53e00f56ad4d0462e7ccb
Parents: 93a022c 27d9aed
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Oct 2 17:33:07 2012 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Oct 2 17:33:07 2012 -0700
----------------------------------------------------------------------
Jakefile | 18 +
VERSION | 2 +-
build/packager.js | 46 ++-
lib/android/exec.js | 253 ++++---
lib/android/platform.js | 51 +-
lib/android/plugin/android/app.js | 23 +-
lib/android/plugin/android/callback.js | 77 --
lib/android/plugin/android/device.js | 23 +-
lib/android/plugin/android/nativeapiprovider.js | 13 +
lib/android/plugin/android/notification.js | 23 +-
lib/android/plugin/android/polling.js | 41 --
lib/android/plugin/android/promptbasednativeapi.js | 16 +
lib/android/plugin/android/storage.js | 21 +
lib/bada/exec.js | 21 +
lib/bada/platform.js | 21 +
lib/bada/plugin/bada/Accelerometer.js | 25 +-
lib/bada/plugin/bada/Camera.js | 25 +-
lib/bada/plugin/bada/Capture.js | 25 +-
lib/bada/plugin/bada/Compass.js | 21 +
lib/bada/plugin/bada/Contacts.js | 21 +
lib/bada/plugin/bada/NetworkStatus.js | 21 +
lib/bada/plugin/bada/Notification.js | 21 +
lib/bada/plugin/bada/device.js | 25 +-
lib/common/builder.js | 40 +-
lib/common/channel.js | 214 +++---
lib/common/common.js | 40 +-
lib/common/exec.js | 21 +
lib/common/platform.js | 21 +
lib/common/plugin/Acceleration.js | 21 +
lib/common/plugin/Camera.js | 28 +-
lib/common/plugin/CameraConstants.js | 23 +-
lib/common/plugin/CameraPopoverOptions.js | 23 +-
lib/common/plugin/CaptureAudioOptions.js | 23 +-
lib/common/plugin/CaptureError.js | 23 +-
lib/common/plugin/CaptureImageOptions.js | 23 +-
lib/common/plugin/CaptureVideoOptions.js | 23 +-
lib/common/plugin/CompassError.js | 25 +-
lib/common/plugin/CompassHeading.js | 23 +-
lib/common/plugin/ConfigurationData.js | 23 +-
lib/common/plugin/Connection.js | 23 +-
lib/common/plugin/Contact.js | 21 +
lib/common/plugin/ContactAddress.js | 23 +-
lib/common/plugin/ContactError.js | 25 +-
lib/common/plugin/ContactField.js | 23 +-
lib/common/plugin/ContactFindOptions.js | 23 +-
lib/common/plugin/ContactName.js | 23 +-
lib/common/plugin/ContactOrganization.js | 23 +-
lib/common/plugin/Coordinates.js | 21 +
lib/common/plugin/DirectoryEntry.js | 25 +-
lib/common/plugin/DirectoryReader.js | 21 +
lib/common/plugin/Entry.js | 23 +-
lib/common/plugin/File.js | 23 +-
lib/common/plugin/FileEntry.js | 23 +-
lib/common/plugin/FileError.js | 23 +-
lib/common/plugin/FileReader.js | 25 +-
lib/common/plugin/FileSystem.js | 21 +
lib/common/plugin/FileTransfer.js | 94 ++-
lib/common/plugin/FileTransferError.js | 22 +
lib/common/plugin/FileUploadOptions.js | 21 +
lib/common/plugin/FileUploadResult.js | 23 +-
lib/common/plugin/FileWriter.js | 21 +
lib/common/plugin/Flags.js | 23 +-
lib/common/plugin/GlobalizationError.js | 41 ++
lib/common/plugin/LocalFileSystem.js | 23 +-
lib/common/plugin/Media.js | 23 +-
lib/common/plugin/MediaError.js | 27 +-
lib/common/plugin/MediaFile.js | 21 +
lib/common/plugin/MediaFileData.js | 23 +-
lib/common/plugin/Metadata.js | 23 +-
lib/common/plugin/Position.js | 21 +
lib/common/plugin/PositionError.js | 23 +-
lib/common/plugin/ProgressEvent.js | 23 +-
lib/common/plugin/accelerometer.js | 25 +-
lib/common/plugin/battery.js | 53 +-
lib/common/plugin/capture.js | 21 +
lib/common/plugin/compass.js | 23 +-
lib/common/plugin/console-via-logger.js | 25 +-
lib/common/plugin/contacts.js | 21 +
lib/common/plugin/device.js | 23 +-
lib/common/plugin/echo.js | 23 +-
lib/common/plugin/geolocation.js | 47 +-
lib/common/plugin/globalization.js | 554 +++++++++++++++
lib/common/plugin/logger.js | 21 +
lib/common/plugin/network.js | 37 +-
lib/common/plugin/notification.js | 23 +-
lib/common/plugin/requestFileSystem.js | 23 +-
lib/common/plugin/resolveLocalFileSystemURI.js | 21 +
lib/common/plugin/splashscreen.js | 23 +-
lib/common/utils.js | 34 +-
lib/cordova.js | 110 ++--
lib/errgen/exec.js | 2 +-
lib/ios/exec.js | 35 +-
lib/ios/platform.js | 21 +
lib/ios/plugin/ios/Contact.js | 23 +-
lib/ios/plugin/ios/Entry.js | 23 +-
lib/ios/plugin/ios/FileReader.js | 23 +-
lib/ios/plugin/ios/console.js | 54 ++-
lib/ios/plugin/ios/contacts.js | 23 +-
lib/ios/plugin/ios/nativecomm.js | 21 +
lib/ios/plugin/ios/notification.js | 23 +-
lib/scripts/bootstrap-bada.js | 21 +
lib/scripts/bootstrap-playbook.js | 23 +-
lib/scripts/bootstrap-qnx.js | 21 +
lib/scripts/bootstrap-tizen.js | 21 +
lib/scripts/bootstrap-windows8.js | 23 +-
lib/scripts/bootstrap.js | 33 +-
lib/scripts/require.js | 42 +-
lib/test/androidexec.js | 1 +
lib/test/exec.js | 23 +-
lib/test/plugin/android/nativeapiprovider.js | 1 +
lib/test/plugin/android/promptbasednativeapi.js | 1 +
lib/tizen/exec.js | 21 +
lib/tizen/platform.js | 21 +
lib/tizen/plugin/tizen/Accelerometer.js | 23 +-
lib/tizen/plugin/tizen/Battery.js | 21 +
lib/tizen/plugin/tizen/BufferLoader.js | 23 +-
lib/tizen/plugin/tizen/Camera.js | 21 +
lib/tizen/plugin/tizen/Compass.js | 21 +
lib/tizen/plugin/tizen/Contact.js | 21 +
lib/tizen/plugin/tizen/ContactUtils.js | 23 +-
lib/tizen/plugin/tizen/Device.js | 25 +-
lib/tizen/plugin/tizen/File.js | 21 +
lib/tizen/plugin/tizen/FileTransfer.js | 21 +
lib/tizen/plugin/tizen/Media.js | 21 +
lib/tizen/plugin/tizen/MediaError.js | 23 +-
lib/tizen/plugin/tizen/NetworkStatus.js | 21 +
lib/tizen/plugin/tizen/Notification.js | 21 +
lib/tizen/plugin/tizen/SoundBeat.js | 23 +-
lib/tizen/plugin/tizen/contacts.js | 21 +
lib/tizen/plugin/tizen/manager.js | 21 +
lib/webworks/air/platform.js | 21 +
lib/webworks/air/plugin/air/DirectoryEntry.js | 21 +
lib/webworks/air/plugin/air/DirectoryReader.js | 21 +
lib/webworks/air/plugin/air/Entry.js | 21 +
lib/webworks/air/plugin/air/File.js | 23 +-
lib/webworks/air/plugin/air/FileEntry.js | 21 +
lib/webworks/air/plugin/air/FileReader.js | 23 +-
lib/webworks/air/plugin/air/FileTransfer.js | 21 +
lib/webworks/air/plugin/air/FileWriter.js | 21 +
lib/webworks/air/plugin/air/battery.js | 21 +
lib/webworks/air/plugin/air/camera.js | 21 +
lib/webworks/air/plugin/air/capture.js | 23 +-
lib/webworks/air/plugin/air/device.js | 23 +-
lib/webworks/air/plugin/air/network.js | 21 +
lib/webworks/air/plugin/air/requestFileSystem.js | 21 +
.../air/plugin/air/resolveLocalFileSystemURI.js | 21 +
lib/webworks/air/plugin/manager.js | 21 +
.../common/plugin/webworks/accelerometer.js | 21 +
lib/webworks/common/plugin/webworks/logger.js | 21 +
lib/webworks/common/plugin/webworks/media.js | 21 +
.../common/plugin/webworks/notification.js | 21 +
lib/webworks/exec.js | 21 +
lib/webworks/java/platform.js | 69 +-
lib/webworks/java/plugin/java/Contact.js | 21 +
lib/webworks/java/plugin/java/ContactUtils.js | 23 +-
lib/webworks/java/plugin/java/DirectoryEntry.js | 23 +-
lib/webworks/java/plugin/java/Entry.js | 21 +
lib/webworks/java/plugin/java/MediaError.js | 23 +-
lib/webworks/java/plugin/java/app.js | 21 +
lib/webworks/java/plugin/java/contacts.js | 21 +
lib/webworks/java/plugin/java/notification.js | 23 +-
lib/webworks/java/plugin/manager.js | 27 +-
lib/webworks/qnx/platform.js | 21 +
lib/webworks/qnx/plugin/manager.js | 21 +
lib/webworks/qnx/plugin/qnx/device.js | 23 +-
lib/webworks/qnx/plugin/qnx/network.js | 21 +
lib/webworks/qnx/plugin/qnx/requestFileSystem.js | 21 +
.../qnx/plugin/qnx/resolveLocalFileSystemURI.js | 21 +
lib/windows8/exec.js | 21 +
lib/windows8/platform.js | 21 +
lib/windows8/plugin/windows8/AccelerometerProxy.js | 23 +-
lib/windows8/plugin/windows8/CameraProxy.js | 23 +-
lib/windows8/plugin/windows8/CaptureProxy.js | 34 +-
lib/windows8/plugin/windows8/CompassProxy.js | 23 +-
lib/windows8/plugin/windows8/DeviceProxy.js | 23 +-
lib/windows8/plugin/windows8/FileProxy.js | 23 +-
lib/windows8/plugin/windows8/MediaFile.js | 65 ++
lib/windows8/plugin/windows8/MediaProxy.js | 25 +-
lib/windows8/plugin/windows8/NetworkStatusProxy.js | 23 +-
lib/windows8/plugin/windows8/NotificationProxy.js | 23 +-
lib/windows8/plugin/windows8/console.js | 21 +
lib/windows8/plugin/windows8/device.js | 21 +
lib/windows8/plugin/windows8/geolocation.js | 23 +-
lib/wp7/exec.js | 21 +
lib/wp7/platform.js | 35 +-
lib/wp7/plugin/wp7/CordovaCommandResult.js | 21 +
lib/wp7/plugin/wp7/CordovaMediaonStatus.js | 23 +-
lib/wp7/plugin/wp7/DOMStorage.js | 21 +
lib/wp7/plugin/wp7/FileTransfer.js | 21 +
lib/wp7/plugin/wp7/FileUploadOptions.js | 23 +-
lib/wp7/plugin/wp7/XHRPatch.js | 23 +-
lib/wp7/plugin/wp7/console.js | 23 +-
test/android/test.exec.js | 126 ++++
test/reporter.js | 21 +
test/runner.js | 21 +
test/suite.html | 21 +
test/test.accelerometer.js | 21 +
test/test.battery.js | 21 +
test/test.builder.js | 25 +-
test/test.camera.js | 21 +
test/test.channel.js | 357 ++++++----
test/test.compass.js | 21 +
test/test.console-via-logger.js | 21 +
test/test.contact.js | 21 +
test/test.contacts.js | 23 +-
test/test.filetransfer.js | 21 +
test/test.geolocation.js | 50 ++-
test/test.logger.js | 21 +
test/test.media.js | 21 +
test/test.network.js | 21 +
test/test.notification.js | 21 +
test/test.require.js | 53 ++
test/test.utils.js | 21 +
213 files changed, 5882 insertions(+), 786 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/ae2ad697/lib/scripts/bootstrap-windows8.js
----------------------------------------------------------------------
diff --cc lib/scripts/bootstrap-windows8.js
index a994abf,0000000..91a6f71
mode 100644,000000..100644
--- a/lib/scripts/bootstrap-windows8.js
+++ b/lib/scripts/bootstrap-windows8.js
@@@ -1,1 -1,0 +1,22 @@@
- require('cordova/channel').onNativeReady.fire();
++/*
++ *
++ * 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.
++ *
++*/
++
++require('cordova/channel').onNativeReady.fire();
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/ae2ad697/lib/windows8/exec.js
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/ae2ad697/lib/windows8/platform.js
----------------------------------------------------------------------
diff --cc lib/windows8/platform.js
index 972f59b,37d1dae..28d0e07
mode 100755,100644..100755
--- a/lib/windows8/platform.js
+++ b/lib/windows8/platform.js
@@@ -1,3 -1,25 +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'),
exec = require('cordova/exec'),
channel = cordova.require("cordova/channel");
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/ae2ad697/lib/windows8/plugin/windows8/CameraProxy.js
----------------------------------------------------------------------
diff --cc lib/windows8/plugin/windows8/CameraProxy.js
index d00126d,96cbefe..6952093
--- a/lib/windows8/plugin/windows8/CameraProxy.js
+++ b/lib/windows8/plugin/windows8/CameraProxy.js
@@@ -316,7 -336,7 +337,7 @@@ module.exports =
}
}, function () {
errorCallback("Fail to capture a photo.");
- })
+ });
}
}
- };
+ };
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/ae2ad697/lib/windows8/plugin/windows8/CaptureProxy.js
----------------------------------------------------------------------
diff --cc lib/windows8/plugin/windows8/CaptureProxy.js
index d5f9c5b,dddae68..51d5ae5
--- a/lib/windows8/plugin/windows8/CaptureProxy.js
+++ b/lib/windows8/plugin/windows8/CaptureProxy.js
@@@ -1,6 -1,25 +1,27 @@@
++/*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.
+ *
+ */
- /*global Windows:true */
-/*global Windows:true */
+
var MediaFile = require('cordova/plugin/MediaFile');
var CaptureError = require('cordova/plugin/CaptureError');
@@@ -23,17 -44,15 +44,26 @@@ module.exports =
errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
return;
}
++<<<<<<< HEAD
+ var cameraCaptureAudioDuration = audioOptions.duration;
+
+ var mediaCaputreSettings;
+ var initCaptureSettings = function () {
+ mediaCaputreSettings = null;
+ mediaCaputreSettings = new Windows.Media.Capture.MediaCaptureInitializationSettings();
+ mediaCaputreSettings.streamingCaptureMode = Windows.Media.Capture.StreamingCaptureMode.audio;
+ };
++=======
+ var mediaCaptureSettings;
+ var initCaptureSettings = function () {
+ mediaCaptureSettings = null;
+ mediaCaptureSettings = new Windows.Media.Capture.MediaCaptureInitializationSettings();
+ mediaCaptureSettings.streamingCaptureMode = Windows.Media.Capture.StreamingCaptureMode.audio;
+ }
++>>>>>>> 27d9aedd5bf520f305e20fcf350da2eef244d53d
initCaptureSettings();
var mediaCapture = new Windows.Media.Capture.MediaCapture();
- mediaCapture.initializeAsync(mediaCaputreSettings).done(function () {
+ mediaCapture.initializeAsync(mediaCaptureSettings).done(function () {
Windows.Storage.KnownFolders.musicLibrary.createFileAsync("captureAudio.mp3", Windows.Storage.NameCollisionOption.generateUniqueName).then(function (storageFile) {
var mediaEncodingProfile = new Windows.Media.MediaProperties.MediaEncodingProfile.createMp3(Windows.Media.MediaProperties.AudioEncodingQuality.auto);
var stopRecord = function () {
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/ae2ad697/lib/windows8/plugin/windows8/FileProxy.js
----------------------------------------------------------------------
diff --cc lib/windows8/plugin/windows8/FileProxy.js
index 71213a8,4676b4a..3611f11
--- a/lib/windows8/plugin/windows8/FileProxy.js
+++ b/lib/windows8/plugin/windows8/FileProxy.js
@@@ -707,79 -87,9 +728,79 @@@ module.exports =
var type = args[0];
var size = args[1];
+ var filePath = "";
+ var result = null;
+ var fsTypeName = "";
+
+ switch (type) {
+ case LocalFileSystem.TEMPORARY:
+ filePath = Windows.Storage.ApplicationData.current.temporaryFolder.path;
+ fsTypeName = "temporary";
+ break;
+ case LocalFileSystem.PERSISTENT:
+ filePath = Windows.Storage.ApplicationData.current.localFolder.path;
+ fsTypeName = "persistent";
+ break;
+ }
+
+ var MAX_SIZE = 10000000000;
+ if (size > MAX_SIZE) {
+ fail(FileError.QUOTA_EXCEEDED_ERR);
+ return;
+ }
+
+ var fileSystem = new FileSystem(fsTypeName, new DirectoryEntry(fsTypeName, filePath));
+ result = fileSystem;
+ win(result);
},
- resolveLocalFileSystemURI:function(win,fail,args) { // ["uri"]
+
+ resolveLocalFileSystemURI:function(success,fail,args) {
var uri = args[0];
+
+ var path = uri;
+ path = path.split(" ").join("\ ");
+
+ // support for file name with parameters
+ if (/\?/g.test(path)) {
+ path = String(path).split("\?")[0];
+ }
+
+ // support for encodeURI
+ if (/\%5/g.test(path)) {
+ path = decodeURI(path);
+ }
+
+ // support for special path start with file:///
+ if (path.substr(0, 8) == "file:///") {
+ path = Windows.Storage.ApplicationData.current.localFolder.path + "\\" + String(path).substr(8).split("/").join("\\");
+ Windows.Storage.StorageFile.getFileFromPathAsync(path).then(
+ function (storageFile) {
+ success(new FileEntry(storageFile.name, storageFile.path));
+ }, function () {
+ Windows.Storage.StorageFolder.getFolderFromPathAsync(path).then(
+ function (storageFolder) {
+ success(new DirectoryEntry(storageFolder.name, storageFolder.path));
+ }, function () {
+ fail(FileError.NOT_FOUND_ERR);
+ }
+ );
+ }
+ );
+ } else {
+ Windows.Storage.StorageFile.getFileFromPathAsync(path).then(
+ function (storageFile) {
+ success(new FileEntry(storageFile.name, storageFile.path));
+ }, function () {
+ Windows.Storage.StorageFolder.getFolderFromPathAsync(path).then(
+ function (storageFolder) {
+ success(new DirectoryEntry(storageFolder.name, storageFolder.path));
+ }, function () {
+ fail(FileError.ENCODING_ERR);
+ }
+ );
+ }
+ );
+ }
}
- };
+ };
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/ae2ad697/lib/windows8/plugin/windows8/MediaProxy.js
----------------------------------------------------------------------
diff --cc lib/windows8/plugin/windows8/MediaProxy.js
index fa49348,de2c6d9..c2d9ccb
--- a/lib/windows8/plugin/windows8/MediaProxy.js
+++ b/lib/windows8/plugin/windows8/MediaProxy.js
@@@ -53,10 -74,10 +74,10 @@@ module.exports =
win();
} catch (err) {
lose("Failed to stop: "+err);
- };
+ }
},
- // Seeks to the postion in the audio
+ // Seeks to the position in the audio
seekToAudio:function(win, lose, args) {
var id = args[0];
var milliseconds = args[1];
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/ae2ad697/lib/windows8/plugin/windows8/NotificationProxy.js
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/ae2ad697/lib/windows8/plugin/windows8/geolocation.js
----------------------------------------------------------------------
diff --cc lib/windows8/plugin/windows8/geolocation.js
index 5d9c56e,014a38f..ab16087
--- a/lib/windows8/plugin/windows8/geolocation.js
+++ b/lib/windows8/plugin/windows8/geolocation.js
@@@ -85,7 -106,7 +106,7 @@@ module.exports = { // Merges with commo
// timers[]
timers[id] = new Windows.Devices.Geolocation.Geolocator().getGeopositionAsync(options.maximumAge, options.timeout).done(
new Geolocation().getCurrentPosition(win, lose, options)
- )
+ );
}
// clearWatch is not needed as in common code the timer is deleted
- };
+ };