Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D92F6184CE for ; Wed, 5 Aug 2015 23:31:48 +0000 (UTC) Received: (qmail 52238 invoked by uid 500); 5 Aug 2015 23:31:48 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 52211 invoked by uid 500); 5 Aug 2015 23:31:48 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 52202 invoked by uid 99); 5 Aug 2015 23:31:48 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Aug 2015 23:31:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A2244E0414; Wed, 5 Aug 2015 23:31:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: purplecabbage@apache.org To: commits@cordova.apache.org Message-Id: <78d1ba35f06340118c3ee668bdaef8f8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cordova-windows git commit: CB-9456 Fixed windows app crash on startup Date: Wed, 5 Aug 2015 23:31:48 +0000 (UTC) Repository: cordova-windows Updated Branches: refs/heads/master cc3cec5da -> 01af8be34 CB-9456 Fixed windows app crash on startup Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/01af8be3 Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/01af8be3 Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/01af8be3 Branch: refs/heads/master Commit: 01af8be342f15b44b5364769369531b7e0e14fd9 Parents: cc3cec5 Author: alsorokin Authored: Wed Aug 5 16:06:45 2015 +0300 Committer: Jesse MacFadyen Committed: Wed Aug 5 16:31:22 2015 -0700 ---------------------------------------------------------------------- cordova-js-src/platform.js | 1 + template/www/cordova.js | 62 +++++++++++++++++++++++------------------ 2 files changed, 36 insertions(+), 27 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/01af8be3/cordova-js-src/platform.js ---------------------------------------------------------------------- diff --git a/cordova-js-src/platform.js b/cordova-js-src/platform.js index 488443b..216b14b 100644 --- a/cordova-js-src/platform.js +++ b/cordova-js-src/platform.js @@ -27,6 +27,7 @@ module.exports = { var cordova = require('cordova'), exec = require('cordova/exec'), channel = cordova.require('cordova/channel'), + platform = require('cordova/platform'), modulemapper = require('cordova/modulemapper'); modulemapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy'); http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/01af8be3/template/www/cordova.js ---------------------------------------------------------------------- diff --git a/template/www/cordova.js b/template/www/cordova.js index c9279d8..9809a48 100644 --- a/template/www/cordova.js +++ b/template/www/cordova.js @@ -1,5 +1,5 @@ // Platform: windows -// 796a18d425a03101a1a931c54cd8ea002230067c +// 2c29e187e4206a6a77fba940ef6f77aef5c7eb8c /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -331,7 +331,6 @@ module.exports = cordova; // file: src/common/argscheck.js define("cordova/argscheck", function(require, exports, module) { -var exec = require('cordova/exec'); var utils = require('cordova/utils'); var moduleExports = module.exports; @@ -1013,6 +1012,7 @@ if (!window.console.warn) { // Register pause, resume and deviceready channels as events on document. channel.onPause = cordova.addDocumentEventHandler('pause'); channel.onResume = cordova.addDocumentEventHandler('resume'); +channel.onActivated = cordova.addDocumentEventHandler('activated'); channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready'); // Listen for DOMContentLoaded and notify our channel subscribers. @@ -1295,10 +1295,16 @@ module.exports = { var cordova = require('cordova'), exec = require('cordova/exec'), channel = cordova.require('cordova/channel'), + platform = require('cordova/platform'), modulemapper = require('cordova/modulemapper'); modulemapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy'); + // we will make sure we get this channel + // TODO: remove this once other platforms catch up. + if(!channel.onActivated) { + channel.onActivated = cordova.addDocumentEventHandler('activated'); + } channel.onNativeReady.fire(); var onWinJSReady = function () { @@ -1357,6 +1363,10 @@ module.exports = { // file: src/common/pluginloader.js define("cordova/pluginloader", function(require, exports, module) { +/* + NOTE: this file is NOT used when we use the browserify workflow +*/ + var modulemapper = require('cordova/modulemapper'); var urlutil = require('cordova/urlutil'); @@ -1545,15 +1555,14 @@ utils.typeName = function(val) { /** * Returns an indication of whether the argument is an array or not */ -utils.isArray = function(a) { - return utils.typeName(a) == 'Array'; -}; +utils.isArray = Array.isArray || + function(a) {return utils.typeName(a) == 'Array';}; /** * Returns an indication of whether the argument is a Date or not */ utils.isDate = function(d) { - return utils.typeName(d) == 'Date'; + return (d instanceof Date); }; /** @@ -1587,17 +1596,25 @@ utils.clone = function(obj) { * Returns a wrapped version of the function */ utils.close = function(context, func, params) { - if (typeof params == 'undefined') { - return function() { - return func.apply(context, arguments); - }; - } else { - return function() { - return func.apply(context, params); - }; - } + return function() { + var args = params || arguments; + return func.apply(context, args); + }; }; +//------------------------------------------------------------------------------ +function UUIDcreatePart(length) { + var uuidpart = ""; + for (var i=0; i