You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by lo...@apache.org on 2013/05/29 23:52:07 UTC
[1/3] webworks commit: [CB-3473] updated helloworld and js
Updated Branches:
refs/heads/master 17056848f -> 8b3a57a63
[CB-3473] updated helloworld and js
Project: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/commit/b03bc27a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/tree/b03bc27a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/diff/b03bc27a
Branch: refs/heads/master
Commit: b03bc27a49a723ba2b6098cd63b5995168784050
Parents: 1705684
Author: lorinbeer <lo...@adobe.com>
Authored: Wed May 29 13:57:07 2013 -0700
Committer: lorinbeer <lo...@adobe.com>
Committed: Wed May 29 13:57:07 2013 -0700
----------------------------------------------------------------------
.../www/res/screen/blackberry/screen-225.png | Bin 0 -> 16776 bytes
blackberry10/javascript/cordova.blackberry10.js | 99 ++++++++-------
2 files changed, 54 insertions(+), 45 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b03bc27a/blackberry10/bin/templates/project/www/res/screen/blackberry/screen-225.png
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/www/res/screen/blackberry/screen-225.png b/blackberry10/bin/templates/project/www/res/screen/blackberry/screen-225.png
new file mode 100644
index 0000000..29873e9
Binary files /dev/null and b/blackberry10/bin/templates/project/www/res/screen/blackberry/screen-225.png differ
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b03bc27a/blackberry10/javascript/cordova.blackberry10.js
----------------------------------------------------------------------
diff --git a/blackberry10/javascript/cordova.blackberry10.js b/blackberry10/javascript/cordova.blackberry10.js
index ebe8a46..def11e0 100644
--- a/blackberry10/javascript/cordova.blackberry10.js
+++ b/blackberry10/javascript/cordova.blackberry10.js
@@ -1,5 +1,5 @@
// Platform: blackberry10
-// 2.7.0rc1-73-g0bca505
+// 2.8.0rc1-2-geedbf67
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -19,7 +19,7 @@
under the License.
*/
;(function() {
-var CORDOVA_JS_BUILD_LABEL = '2.7.0rc1-73-g0bca505';
+var CORDOVA_JS_BUILD_LABEL = '2.8.0rc1-2-geedbf67';
// file: lib/scripts/require.js
var require,
@@ -930,8 +930,7 @@ module.exports = {
id: "blackberry10",
initialize: function() {
var modulemapper = require('cordova/modulemapper'),
- cordova = require('cordova'),
- addDocumentEventListener = document.addEventListener;
+ cordova = require('cordova');
modulemapper.loadMatchingModules(/cordova.*\/symbols$/);
modulemapper.loadMatchingModules(new RegExp('cordova/blackberry10/.*bbsymbols$'));
@@ -941,15 +940,6 @@ module.exports = {
modulemapper.merges('cordova/plugin/blackberry10/compass', 'navigator.compass');
modulemapper.mapModules(window);
-
- //override to pass online/offline events to window
- document.addEventListener = function (type) {
- if (type === "online" || type === "offline") {
- window.addEventListener.apply(window, arguments);
- } else {
- addDocumentEventListener.apply(document, arguments);
- }
- }
}
};
@@ -2005,12 +1995,21 @@ module.exports = function(name, root) {
});
-// file: lib/blackberry10/plugin/FileTransfer.js
+// file: lib/common/plugin/FileTransfer.js
define("cordova/plugin/FileTransfer", function(require, exports, module) {
var argscheck = require('cordova/argscheck'),
exec = require('cordova/exec'),
- FileTransferError = require('cordova/plugin/FileTransferError');
+ FileTransferError = require('cordova/plugin/FileTransferError'),
+ ProgressEvent = require('cordova/plugin/ProgressEvent');
+
+function newProgressEvent(result) {
+ var pe = new ProgressEvent();
+ pe.lengthComputable = result.lengthComputable;
+ pe.loaded = result.loaded;
+ pe.total = result.total;
+ return pe;
+}
function getBasicAuthHeader(urlString) {
var header = null;
@@ -2113,7 +2112,7 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro
var win = function(result) {
if (typeof result.lengthComputable != "undefined") {
if (self.onprogress) {
- self.onprogress(result);
+ self.onprogress(newProgressEvent(result));
}
} else {
successCallback && successCallback(result);
@@ -2150,10 +2149,21 @@ FileTransfer.prototype.download = function(source, target, successCallback, erro
var win = function(result) {
if (typeof result.lengthComputable != "undefined") {
if (self.onprogress) {
- return self.onprogress(result);
+ return self.onprogress(newProgressEvent(result));
}
} else if (successCallback) {
- successCallback(result);
+ var entry = null;
+ if (result.isDirectory) {
+ entry = new (require('cordova/plugin/DirectoryEntry'))();
+ }
+ else if (result.isFile) {
+ entry = new (require('cordova/plugin/FileEntry'))();
+ }
+ entry.isDirectory = result.isDirectory;
+ entry.isFile = result.isFile;
+ entry.name = result.name;
+ entry.fullPath = result.fullPath;
+ successCallback(entry);
}
};
@@ -3574,11 +3584,12 @@ define("cordova/plugin/blackberry10/fileTransfer", function(require, exports, mo
/*global Blob:false */
var cordova = require('cordova'),
+ ProgressEvent = require('cordova/plugin/ProgressEvent'),
nativeResolveLocalFileSystemURI = function(uri, success, fail) {
if (uri.substring(0,11) !== "filesystem:") {
uri = "filesystem:" + uri;
}
- resolveLocalFileSystemURI(uri, success, fail);
+ window.webkitResolveLocalFileSystemURL(uri, success, fail);
},
xhr;
@@ -3592,6 +3603,11 @@ function getFileName(filePath) {
return filePath.substring(pos + 1);
}
+function cleanUpPath(filePath) {
+ var pos = filePath.lastIndexOf('/');
+ return filePath.substring(0, pos) + filePath.substring(pos + 1, filePath.length);
+}
+
function checkURL(url) {
return url.indexOf(' ') === -1 ? true : false;
}
@@ -3613,7 +3629,7 @@ module.exports = {
headers = args[8];
if (!checkURL(server)) {
- fail(new FileTransferError(FileTransferError.INVALID_URL_ERR, server, filePath));
+ fail(new window.FileTransferError(window.FileTransferError.INVALID_URL_ERR));
}
nativeResolveLocalFileSystemURI(filePath, function(entry) {
@@ -3631,23 +3647,23 @@ module.exports = {
xhr = new XMLHttpRequest();
xhr.open("POST", server);
xhr.onload = function(evt) {
- if (xhr.status === 200) {
- var result = new FileUploadResult();
+ if (xhr.status == 200) {
+ var result = new window.FileUploadResult();
result.bytesSent = file.size;
result.responseCode = xhr.status;
result.response = xhr.response;
win(result);
- } else if (xhr.status === 404) {
- fail(new FileTransferError(FileTransferError.INVALID_URL_ERR, server, filePath, xhr.status, xhr.response));
+ } else if (xhr.status == 404) {
+ fail(new window.FileTransferError(window.FileTransferError.INVALID_URL_ERR, server, filePath, xhr.status));
} else {
- fail(new FileTransferError(FileTransferError.CONNECTION_ERR, server, filePath, xhr.status, xhr.response));
+ fail(new window.FileTransferError(window.FileTransferError.CONNECTION_ERR, server, filePath, xhr.status));
}
};
xhr.ontimeout = function(evt) {
- fail(new FileTransferError(FileTransferError.CONNECTION_ERR, server, filePath, xhr.status, xhr.response));
+ fail(new window.FileTransferError(window.FileTransferError.CONNECTION_ERR, server, filePath, xhr.status));
};
xhr.onerror = function () {
- fail(new FileTransferError(FileTransferError.CONNECTION_ERR, server, filePath, this.status, xhr.response));
+ fail(new window.FileTransferError(window.FileTransferError.CONNECTION_ERR, server, filePath, this.status));
};
xhr.onprogress = function (evt) {
win(evt);
@@ -3677,10 +3693,10 @@ module.exports = {
end = start + bytesPerChunk;
}
}, function(error) {
- fail(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR, server, filePath));
+ fail(new window.FileTransferError(window.FileTransferError.FILE_NOT_FOUND_ERR));
});
}, function(error) {
- fail(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR, server, filePath));
+ fail(new window.FileTransferError(window.FileTransferError.FILE_NOT_FOUND_ERR));
});
return { "status" : cordova.callbackStatus.NO_RESULT, "message" : "async"};
@@ -3688,12 +3704,11 @@ module.exports = {
download: function (args, win, fail) {
var source = args[0],
- target = args[1],
- headers = args[4],
+ target = cleanUpPath(args[1]),
fileWriter;
if (!checkURL(source)) {
- fail(new FileTransferError(FileTransferError.INVALID_URL_ERR, source, target));
+ fail(new window.FileTransferError(window.FileTransferError.INVALID_URL_ERR));
}
xhr = new XMLHttpRequest();
@@ -3703,7 +3718,7 @@ module.exports = {
fileWriter = writer;
fileWriter.onwriteend = function (evt) {
if (!evt.target.error) {
- win(entry);
+ win(new window.FileEntry(entry.name, entry.toURL()));
} else {
fail(evt.target.error);
}
@@ -3718,7 +3733,7 @@ module.exports = {
}
xhr.onerror = function (e) {
- fail(new FileTransferError(FileTransferError.CONNECTION_ERR, source, target, xhr.status, xhr.response));
+ fail(new window.FileTransferError(window.FileTransferError.CONNECTION_ERR, source, target, xhr.status));
};
xhr.onload = function () {
@@ -3726,15 +3741,15 @@ module.exports = {
if (xhr.status === 200 && xhr.response) {
nativeResolveLocalFileSystemURI(getParentPath(target), function (dir) {
dir.getFile(getFileName(target), {create: true}, writeFile, function (error) {
- fail(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR, source, target, xhr.status, xhr.response));
+ fail(new window.FileTransferError(window.FileTransferError.FILE_NOT_FOUND_ERR));
});
}, function (error) {
- fail(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR, source, target, xhr.status, xhr.response));
+ fail(new window.FileTransferError(window.FileTransferError.FILE_NOT_FOUND_ERR));
});
} else if (xhr.status === 404) {
- fail(new FileTransferError(FileTransferError.INVALID_URL_ERR, source, target, xhr.status, xhr.response));
+ fail(new window.FileTransferError(window.FileTransferError.INVALID_URL_ERR, source, target, xhr.status));
} else {
- fail(new FileTransferError(FileTransferError.CONNECTION_ERR, source, target, xhr.status, xhr.response));
+ fail(new window.FileTransferError(window.FileTransferError.CONNECTION_ERR, source, target, xhr.status));
}
}
};
@@ -3742,12 +3757,8 @@ module.exports = {
win(evt);
};
+ xhr.responseType = "blob";
xhr.open("GET", source, true);
- for (var header in headers) {
- if (headers.hasOwnProperty(header)) {
- xhr.setRequestHeader(header, headers[header]);
- }
- }
xhr.send();
return { "status" : cordova.callbackStatus.NO_RESULT, "message" : "async"};
}
@@ -5023,7 +5034,6 @@ function Device() {
this.available = false;
this.platform = null;
this.version = null;
- this.name = null;
this.uuid = null;
this.cordova = null;
this.model = null;
@@ -5039,7 +5049,6 @@ function Device() {
me.available = true;
me.platform = info.platform;
me.version = info.version;
- me.name = info.name;
me.uuid = info.uuid;
me.cordova = buildLabel;
me.model = info.model;
[3/3] webworks commit: [CB-3442] lost commit, fix for bb10
Posted by lo...@apache.org.
[CB-3442] lost commit, fix for bb10
Project: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/commit/8b3a57a6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/tree/8b3a57a6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/diff/8b3a57a6
Branch: refs/heads/master
Commit: 8b3a57a63fe18c6859d34b7f0fbc474f099b0282
Parents: 458cbe1
Author: lorinbeer <lo...@adobe.com>
Authored: Wed May 29 14:51:58 2013 -0700
Committer: lorinbeer <lo...@adobe.com>
Committed: Wed May 29 14:51:58 2013 -0700
----------------------------------------------------------------------
blackberry10/bin/create.js | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/8b3a57a6/blackberry10/bin/create.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/create.js b/blackberry10/bin/create.js
index 253c093..5ef05ec 100644
--- a/blackberry10/bin/create.js
+++ b/blackberry10/bin/create.js
@@ -43,7 +43,7 @@ var build,
update_dir = path.join(project_path, "lib", "cordova." + version),
native_dir = path.join(project_path, "native"),
js_path = "javascript",
- js_basename = "cordova-" + version + ".js";
+ js_basename = "cordova.js";
function getVersion() {
var version = fs.readFileSync(path.join(__dirname, "..", "VERSION"));
[2/3] webworks commit: [CB-3473] updated version to 2.8.0rc1
Posted by lo...@apache.org.
[CB-3473] updated version to 2.8.0rc1
Project: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/commit/458cbe1c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/tree/458cbe1c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/diff/458cbe1c
Branch: refs/heads/master
Commit: 458cbe1cc0c33122340048eac473c7f54deecf1d
Parents: b03bc27
Author: lorinbeer <lo...@adobe.com>
Authored: Wed May 29 13:57:42 2013 -0700
Committer: lorinbeer <lo...@adobe.com>
Committed: Wed May 29 13:57:42 2013 -0700
----------------------------------------------------------------------
blackberry10/VERSION | 2 +-
blackberry10/bin/templates/project/www/VERSION | 2 +-
blackberry10/bin/templates/project/www/index.html | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/458cbe1c/blackberry10/VERSION
----------------------------------------------------------------------
diff --git a/blackberry10/VERSION b/blackberry10/VERSION
index 38f8e88..1277c83 100644
--- a/blackberry10/VERSION
+++ b/blackberry10/VERSION
@@ -1 +1 @@
-dev
+2.8.0rc1
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/458cbe1c/blackberry10/bin/templates/project/www/VERSION
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/www/VERSION b/blackberry10/bin/templates/project/www/VERSION
index 38f8e88..1277c83 100644
--- a/blackberry10/bin/templates/project/www/VERSION
+++ b/blackberry10/bin/templates/project/www/VERSION
@@ -1 +1 @@
-dev
+2.8.0rc1
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/458cbe1c/blackberry10/bin/templates/project/www/index.html
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/www/index.html b/blackberry10/bin/templates/project/www/index.html
index ce767eb..e84fbd7 100644
--- a/blackberry10/bin/templates/project/www/index.html
+++ b/blackberry10/bin/templates/project/www/index.html
@@ -33,7 +33,7 @@
<p class="event received">Device is Ready</p>
</div>
</div>
- <script type="text/javascript" src="cordova-dev.js"></script>
+ <script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
app.initialize();