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 88BF5990B for ; Wed, 22 Feb 2012 08:16:37 +0000 (UTC) Received: (qmail 29827 invoked by uid 500); 22 Feb 2012 08:16:37 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 29808 invoked by uid 500); 22 Feb 2012 08:16:37 -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 29796 invoked by uid 99); 22 Feb 2012 08:16:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Feb 2012 08:16:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.114] (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Feb 2012 08:16:34 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id D286E81202D; Wed, 22 Feb 2012 08:15:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: purplecabbage@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [28/29] stage 1 - bulk rename Message-Id: <20120222081523.D286E81202D@tyr.zones.apache.org> Date: Wed, 22 Feb 2012 08:15:23 +0000 (UTC) http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/552bc14a/framework/js/phonegap-1.4.1.js ---------------------------------------------------------------------- diff --git a/framework/js/phonegap-1.4.1.js b/framework/js/phonegap-1.4.1.js index b1e3f62..2a35000 100644 --- a/framework/js/phonegap-1.4.1.js +++ b/framework/js/phonegap-1.4.1.js @@ -5,7 +5,7 @@ /* - * PhoneGap is available under *either* the terms of the modified BSD license *or* the + * Cordova is available under *either* the terms of the modified BSD license *or* the * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text. * * Copyright (c) 2005-2010, Nitobi Software Inc. @@ -18,20 +18,20 @@ /** - * The order of events during page load and PhoneGap startup is as follows: + * The order of events during page load and Cordova startup is as follows: * * onDOMContentLoaded Internal event that is received when the web page is loaded and parsed. * window.onload Body onload event. - * onNativeReady Internal event that indicates the PhoneGap native side is ready. - * onPhoneGapInit Internal event that kicks off creation of all PhoneGap JavaScript objects (runs constructors). - * onPhoneGapReady Internal event fired when all PhoneGap JavaScript objects have been created - * onPhoneGapInfoReady Internal event fired when device properties are available - * onDeviceReady User event fired to indicate that PhoneGap is ready + * onNativeReady Internal event that indicates the Cordova native side is ready. + * onCordovaInit Internal event that kicks off creation of all Cordova JavaScript objects (runs constructors). + * onCordovaReady Internal event fired when all Cordova JavaScript objects have been created + * onCordovaInfoReady Internal event fired when device properties are available + * onDeviceReady User event fired to indicate that Cordova is ready * onResume User event fired to indicate a start/resume lifecycle event * onPause User event fired to indicate a pause lifecycle event * onDestroy Internal event fired when app is being destroyed (User should use window.onunload event, not this one). * - * The only PhoneGap events that user code should register for are: + * The only Cordova events that user code should register for are: * onDeviceReady * onResume * @@ -45,7 +45,7 @@ var DeviceInfo = {}; } -var PhoneGap = { +var Cordova = { queue: { ready: true, commands: [], @@ -57,7 +57,7 @@ var PhoneGap = { resources:{} }; -PhoneGap.callbackStatus = { +Cordova.callbackStatus = { NO_RESULT: 0, OK: 1, CLASS_NOT_FOUND_EXCEPTION: 2, @@ -71,31 +71,31 @@ PhoneGap.callbackStatus = { }; /** - * Determine if resource has been loaded by PhoneGap + * Determine if resource has been loaded by Cordova * * @param name * @return */ -PhoneGap.hasResource = function(name) { - return PhoneGap.resources[name]; +Cordova.hasResource = function(name) { + return Cordova.resources[name]; }; /** - * Add a resource to list of loaded resources by PhoneGap + * Add a resource to list of loaded resources by Cordova * * @param name */ -PhoneGap.addResource = function(name) { - PhoneGap.resources[name] = true; +Cordova.addResource = function(name) { + Cordova.resources[name] = true; }; -PhoneGap.exec = function(success, fail, service, action, args) +Cordova.exec = function(success, fail, service, action, args) { - var callbackId = service + PhoneGap.callbackId++; + var callbackId = service + Cordova.callbackId++; if (typeof success == "function" || typeof fail == "function") { - PhoneGap.callbacks[callbackId] = {success:success, fail:fail}; + Cordova.callbacks[callbackId] = {success:success, fail:fail}; } // generate a new command string, ex. DebugConsole/log/DebugConsole23/{"message":"wtf dude?"} @@ -104,32 +104,32 @@ PhoneGap.exec = function(success, fail, service, action, args) window.external.Notify(command); }; -PhoneGapCommandResult = function(status,callbackId,args,cast) +CordovaCommandResult = function(status,callbackId,args,cast) { if(status === "backbutton") { - PhoneGap.fireEvent(document,"backbutton"); + Cordova.fireEvent(document,"backbutton"); return "true"; } else if(status === "resume") { - PhoneGap.onResume.fire(); + Cordova.onResume.fire(); return "true"; } else if(status === "pause") { - PhoneGap.onPause.fire(); + Cordova.onPause.fire(); return "true"; } var safeStatus = parseInt(status); - if(safeStatus === PhoneGap.callbackStatus.NO_RESULT || - safeStatus === PhoneGap.callbackStatus.OK) { - PhoneGap.CallbackSuccess(callbackId,args,cast); + if(safeStatus === Cordova.callbackStatus.NO_RESULT || + safeStatus === Cordova.callbackStatus.OK) { + Cordova.CallbackSuccess(callbackId,args,cast); } else { - PhoneGap.CallbackError(callbackId,args,cast); + Cordova.CallbackError(callbackId,args,cast); } }; @@ -140,7 +140,7 @@ PhoneGapCommandResult = function(status,callbackId,args,cast) * @param args * @param cast */ -PhoneGap.CallbackSuccess = function(callbackId, args, cast) +Cordova.CallbackSuccess = function(callbackId, args, cast) { var commandResult; @@ -159,13 +159,13 @@ PhoneGap.CallbackSuccess = function(callbackId, args, cast) return exception.message; } - if (PhoneGap.callbacks[callbackId] ) { + if (Cordova.callbacks[callbackId] ) { // If result is to be sent to callback - if (commandResult.status === PhoneGap.callbackStatus.OK) { + if (commandResult.status === Cordova.callbackStatus.OK) { try { - if (PhoneGap.callbacks[callbackId].success) { - result = PhoneGap.callbacks[callbackId].success(commandResult.message); + if (Cordova.callbacks[callbackId].success) { + result = Cordova.callbacks[callbackId].success(commandResult.message); } } catch (e) { @@ -175,7 +175,7 @@ PhoneGap.CallbackSuccess = function(callbackId, args, cast) // Clear callback if not expecting any more results if (!commandResult.keepCallback) { - delete PhoneGap.callbacks[callbackId]; + delete Cordova.callbacks[callbackId]; } } // Note that in WP7, this method can return a value to the native calling code @@ -189,7 +189,7 @@ PhoneGap.CallbackSuccess = function(callbackId, args, cast) * @param args * @param cast - not supported */ -PhoneGap.CallbackError = function (callbackId, args, cast) { +Cordova.CallbackError = function (callbackId, args, cast) { var commandResult; try @@ -201,10 +201,10 @@ PhoneGap.CallbackError = function (callbackId, args, cast) { return exception.message; } - if (PhoneGap.callbacks[callbackId]) { + if (Cordova.callbacks[callbackId]) { try { - if (PhoneGap.callbacks[callbackId].fail) { - PhoneGap.callbacks[callbackId].fail(commandResult.message); + if (Cordova.callbacks[callbackId].fail) { + Cordova.callbacks[callbackId].fail(commandResult.message); } } catch (e) { @@ -213,7 +213,7 @@ PhoneGap.CallbackError = function (callbackId, args, cast) { // Clear callback if not expecting any more results if (!args.keepCallback) { - delete PhoneGap.callbacks[callbackId]; + delete Cordova.callbacks[callbackId]; } } }; @@ -223,15 +223,15 @@ PhoneGap.CallbackError = function (callbackId, args, cast) { * * @return {String} */ -PhoneGap.createUUID = function() { - return PhoneGap.UUIDcreatePart(4) + '-' + - PhoneGap.UUIDcreatePart(2) + '-' + - PhoneGap.UUIDcreatePart(2) + '-' + - PhoneGap.UUIDcreatePart(2) + '-' + - PhoneGap.UUIDcreatePart(6); +Cordova.createUUID = function() { + return Cordova.UUIDcreatePart(4) + '-' + + Cordova.UUIDcreatePart(2) + '-' + + Cordova.UUIDcreatePart(2) + '-' + + Cordova.UUIDcreatePart(2) + '-' + + Cordova.UUIDcreatePart(6); }; -PhoneGap.UUIDcreatePart = function(length) { +Cordova.UUIDcreatePart = function(length) { var uuidpart = ""; var i, uuidchar; for (i=0; i