Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9426DDA3E for ; Sun, 29 Jul 2012 18:40:24 +0000 (UTC) Received: (qmail 31751 invoked by uid 500); 29 Jul 2012 18:40:24 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 31696 invoked by uid 500); 29 Jul 2012 18:40:24 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 31666 invoked by uid 99); 29 Jul 2012 18:40:23 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Jul 2012 18:40:23 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 1D6DD1ADAD; Sun, 29 Jul 2012 18:40:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: agrieve@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [1/2] ios commit: Update JS bundle to pull in recent changes to incubator-cordova-js. Message-Id: <20120729184023.1D6DD1ADAD@tyr.zones.apache.org> Date: Sun, 29 Jul 2012 18:40:23 +0000 (UTC) Updated Branches: refs/heads/master fa8cbdaba -> 5711d1869 Update JS bundle to pull in recent changes to incubator-cordova-js. Also tweaks the create script to use the cordova.ios.js from the CordovaLib/javascript directory instead of having a separate copy of it in the template directory. Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/5711d186 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/5711d186 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/5711d186 Branch: refs/heads/master Commit: 5711d186929ca3f651879851c43e56adefdfa3d8 Parents: fa8cbda Author: Andrew Grieve Authored: Sun Jul 29 14:38:05 2012 -0400 Committer: Andrew Grieve Committed: Sun Jul 29 14:38:05 2012 -0400 ---------------------------------------------------------------------- CordovaLib/javascript/cordova.ios.js | 41 +- bin/create | 1 + bin/templates/project/www/cordova-2.0.0.js | 5241 +---------------------- 3 files changed, 17 insertions(+), 5266 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/5711d186/CordovaLib/javascript/cordova.ios.js ---------------------------------------------------------------------- diff --git a/CordovaLib/javascript/cordova.ios.js b/CordovaLib/javascript/cordova.ios.js index c2caa2f..26600b1 100644 --- a/CordovaLib/javascript/cordova.ios.js +++ b/CordovaLib/javascript/cordova.ios.js @@ -1,6 +1,6 @@ -// commit 114cf5304a74ff8f7c9ff1d21cf5652298af04b0 +// commit 8c46a970a0719d0f16a225b75421ecf6f12dcc02 -// File generated at :: Wed Jul 18 2012 16:47:25 GMT-0700 (PDT) +// File generated at :: Sun Jul 29 2012 14:26:58 GMT-0400 (EDT) /* Licensed to the Apache Software Foundation (ASF) under one @@ -926,13 +926,6 @@ module.exports = function() { actionArgs = Array.prototype.splice.call(arguments, 1); } - // Start building the command object. - var command = { - className: service, - methodName: action, - "arguments": [] - }; - // Register the callbacks and add the callbackId to the positional // arguments if given. if (successCallback || failCallback) { @@ -940,20 +933,8 @@ module.exports = function() { cordova.callbacks[callbackId] = {success:successCallback, fail:failCallback}; } - if (callbackId !== null) { - command["arguments"].push(callbackId); - } - for (var i = 0; i < actionArgs.length; ++i) { - var arg = actionArgs[i]; - if (arg === undefined || arg === null) { // nulls are pushed to the args now (becomes NSNull) - command["arguments"].push(arg); - } else if (typeof(arg) == 'object' && !(utils.isArray(arg))) { - command.options = arg; - } else { - command["arguments"].push(arg); - } - } + var command = [callbackId, service, action, actionArgs]; // Stringify and queue the command. We stringify to command now to // effectively clone the command arguments in case they are mutated before @@ -2502,10 +2483,12 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro var mimeType = null; var params = null; var chunkedMode = true; + var headers = null; if (options) { fileKey = options.fileKey; fileName = options.fileName; mimeType = options.mimeType; + headers = options.headers; if (options.chunkedMode !== null || typeof options.chunkedMode != "undefined") { chunkedMode = options.chunkedMode; } @@ -2522,7 +2505,7 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro errorCallback(error); }; - exec(successCallback, fail, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode]); + exec(successCallback, fail, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode, headers]); }; /** @@ -2592,15 +2575,19 @@ define("cordova/plugin/FileUploadOptions", function(require, exports, module) { * @param fileName {String} Filename to be used by the server. Defaults to image.jpg. * @param mimeType {String} Mimetype of the uploaded file. Defaults to image/jpeg. * @param params {Object} Object with key: value params to send to the server. + * @param headers {Object} Keys are header names, values are header values. Multiple + * headers of the same name are not supported. */ -var FileUploadOptions = function(fileKey, fileName, mimeType, params) { +var FileUploadOptions = function(fileKey, fileName, mimeType, params, headers) { this.fileKey = fileKey || null; this.fileName = fileName || null; this.mimeType = mimeType || null; this.params = params || null; + this.headers = headers || null; }; module.exports = FileUploadOptions; + }); // file: lib/common/plugin/FileUploadResult.js @@ -4507,10 +4494,12 @@ var cordova = require('cordova'); * Called by native code to retrieve all queued commands and clear the queue. */ module.exports = function() { - var json = JSON.stringify(cordova.commandQueue); - cordova.commandQueue = []; + // Each entry in commandQueue is a JSON string already. + var json = '[' + cordova.commandQueue.join(',') + ']'; + cordova.commandQueue.length = 0; return json; }; + }); // file: lib/ios/plugin/ios/notification.js http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/5711d186/bin/create ---------------------------------------------------------------------- diff --git a/bin/create b/bin/create index 349b2b8..366c2a2 100755 --- a/bin/create +++ b/bin/create @@ -66,6 +66,7 @@ fi # copy the files in; then modify them cp -r $BINDIR/templates/project/ $PROJECT_PATH +cp $BINDIR/../CordovaLib/javascript/cordova.ios.js $PROJECT_PATH/www/cordova-*.js # I've tried to be thorough in my documentation of the manual actions below... # on first brush it would seem that the right solution would be to brute force