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 C65A3D477 for ; Fri, 13 Jul 2012 23:03:34 +0000 (UTC) Received: (qmail 62200 invoked by uid 500); 13 Jul 2012 23:03:34 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 62181 invoked by uid 500); 13 Jul 2012 23:03:34 -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 62174 invoked by uid 99); 13 Jul 2012 23:03:34 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jul 2012 23:03:34 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 5DCE413E81; Fri, 13 Jul 2012 23:03:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: filmaj@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: js commit: [CB-388] REMOVED "PhoneGap" and "Cordova" JavaScript globals - have been deprecated and slated for removal in 2.0 since 1.4. Message-Id: <20120713230334.5DCE413E81@tyr.zones.apache.org> Date: Fri, 13 Jul 2012 23:03:34 +0000 (UTC) Updated Branches: refs/heads/master fd00bff18 -> 3d0790c87 [CB-388] REMOVED "PhoneGap" and "Cordova" JavaScript globals - have been deprecated and slated for removal in 2.0 since 1.4. 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/3d0790c8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/3d0790c8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/3d0790c8 Branch: refs/heads/master Commit: 3d0790c8707ec09711c4a8f06f4cf5b796afef9a Parents: fd00bff Author: Fil Maj Authored: Fri Jul 13 16:05:56 2012 -0700 Committer: Fil Maj Committed: Fri Jul 13 16:05:56 2012 -0700 ---------------------------------------------------------------------- lib/cordova.js | 56 --------------------------------------------------- 1 files changed, 0 insertions(+), 56 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/3d0790c8/lib/cordova.js ---------------------------------------------------------------------- diff --git a/lib/cordova.js b/lib/cordova.js index 596e83b..dbaf478 100644 --- a/lib/cordova.js +++ b/lib/cordova.js @@ -218,17 +218,6 @@ var cordova = { } } }, - // TODO: remove in 2.0. - addPlugin: function(name, obj) { - console.log("[DEPRECATION NOTICE] window.addPlugin and window.plugins will be removed in version 2.0."); - if (!window.plugins[name]) { - window.plugins[name] = obj; - } - else { - console.log("Error: Plugin "+name+" already exists."); - } - }, - addConstructor: function(func) { channel.onCordovaReady.subscribeOnce(function() { try { @@ -245,49 +234,4 @@ channel.onPause = cordova.addDocumentEventHandler('pause'); channel.onResume = cordova.addDocumentEventHandler('resume'); channel.onDeviceReady = cordova.addDocumentEventHandler('deviceready'); -// Adds deprecation warnings to functions of an object (but only logs a message once) -function deprecateFunctions(obj, objLabel) { - var newObj = {}; - var logHash = {}; - for (var i in obj) { - if (obj.hasOwnProperty(i)) { - if (typeof obj[i] == 'function') { - newObj[i] = (function(prop){ - var oldFunk = obj[prop]; - var funkId = objLabel + '_' + prop; - return function() { - if (!logHash[funkId]) { - console.log('[DEPRECATION NOTICE] The "' + objLabel + '" global will be removed in version 2.0, please use lowercase "cordova".'); - logHash[funkId] = true; - } - oldFunk.apply(obj, arguments); - }; - })(i); - } else { - newObj[i] = (function(prop) { return obj[prop]; })(i); - } - } - } - return newObj; -} - -/** - * Legacy variable for plugin support - * TODO: remove in 2.0. - */ -if (!window.PhoneGap) { - window.PhoneGap = deprecateFunctions(cordova, 'PhoneGap'); -} -if (!window.Cordova) { - window.Cordova = deprecateFunctions(cordova, 'Cordova'); -} - -/** - * Plugins object - * TODO: remove in 2.0. - */ -if (!window.plugins) { - window.plugins = {}; -} - module.exports = cordova;