diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..1594d125 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,16 @@ +# Contributing to Apache Cordova + +Anyone can contribute to Cordova. And we need your contributions. + +There are multiple ways to contribute: report bugs, improve the docs, and +contribute code. + +For instructions on this, start with the +[contribution overview](http://cordova.apache.org/#contribute). + +The details are explained there, but the important items are: + - Sign and submit an Apache ICLA (Contributor License Agreement). + - Have a Jira issue open that corresponds to your contribution. + - Run the tests so your patch doesn't break existing functionality. + +We look forward to your contributions! diff --git a/NOTICE b/NOTICE index 8ec56a52..40c5e74c 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,17 @@ Apache Cordova -Copyright 2012 The Apache Software Foundation +Copyright 2014 The Apache Software Foundation This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). +The Apache Software Foundation (http://www.apache.org) + +========================================================================= +== NOTICE file corresponding to the section 4 d of == +== the Apache License, Version 2.0, == +== in this case for the Android-specific code. == +========================================================================= + +This product includes software developed as part of +The Android Open Source Project (http://source.android.com). + +This software includes software developed at Square, Inc. +Copyright (C) 2013 Square, Inc. diff --git a/README.md b/README.md index 26ab1e52..8dc2f953 100755 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ Running Tests Please see details under test/README.md. Further Reading ---- +---- - [http://developer.android.com](http://developer.android.com) - [http://cordova.apache.org/](http://cordova.apache.org) diff --git a/VERSION b/VERSION index 414a102c..86bab9cf 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.5.0-dev +3.6.0-dev diff --git a/bin/templates/cordova/version b/bin/templates/cordova/version index 4250850f..ac3bb54d 100755 --- a/bin/templates/cordova/version +++ b/bin/templates/cordova/version @@ -20,6 +20,6 @@ */ // Coho updates this line: -var VERSION = "3.5.0-dev"; +var VERSION = "3.6.0-dev"; console.log(VERSION); diff --git a/framework/assets/www/cordova.js b/framework/assets/www/cordova.js index 45c1943a..ed621c7b 100644 --- a/framework/assets/www/cordova.js +++ b/framework/assets/www/cordova.js @@ -1,5 +1,5 @@ // Platform: android -// 3.5.0-dev-81f9a00 +// 3.6.0-dev-7e845f3 /* 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 = '3.5.0-dev-81f9a00'; +var CORDOVA_JS_BUILD_LABEL = '3.6.0-dev-7e845f3'; // file: src/scripts/require.js /*jshint -W079 */ @@ -825,6 +825,7 @@ channel.createSticky('onNativeReady'); channel.createSticky('onCordovaReady'); // Event to indicate that all automatically loaded JS plugins are loaded and ready. +// FIXME remove this channel.createSticky('onPluginsReady'); // Event to indicate that Cordova is ready @@ -1245,6 +1246,111 @@ channel.join(function() { }, platformInitChannelsArray); +}); + +// file: src/common/init_b.js +define("cordova/init_b", function(require, exports, module) { + +var channel = require('cordova/channel'); +var cordova = require('cordova'); +var platform = require('cordova/platform'); + +var platformInitChannelsArray = [channel.onDOMContentLoaded, channel.onNativeReady]; + +// setting exec +cordova.exec = require('cordova/exec'); + +function logUnfiredChannels(arr) { + for (var i = 0; i < arr.length; ++i) { + if (arr[i].state != 2) { + console.log('Channel not fired: ' + arr[i].type); + } + } +} + +window.setTimeout(function() { + if (channel.onDeviceReady.state != 2) { + console.log('deviceready has not fired after 5 seconds.'); + logUnfiredChannels(platformInitChannelsArray); + logUnfiredChannels(channel.deviceReadyChannelsArray); + } +}, 5000); + +// Replace navigator before any modules are required(), to ensure it happens as soon as possible. +// We replace it so that properties that can't be clobbered can instead be overridden. +function replaceNavigator(origNavigator) { + var CordovaNavigator = function() {}; + CordovaNavigator.prototype = origNavigator; + var newNavigator = new CordovaNavigator(); + // This work-around really only applies to new APIs that are newer than Function.bind. + // Without it, APIs such as getGamepads() break. + if (CordovaNavigator.bind) { + for (var key in origNavigator) { + if (typeof origNavigator[key] == 'function') { + newNavigator[key] = origNavigator[key].bind(origNavigator); + } + } + } + return newNavigator; +} +if (window.navigator) { + window.navigator = replaceNavigator(window.navigator); +} + +if (!window.console) { + window.console = { + log: function(){} + }; +} +if (!window.console.warn) { + window.console.warn = function(msg) { + this.log("warn: " + msg); + }; +} + +// Register pause, resume and deviceready channels as events on document. +channel.onPause = cordova.addDocumentEventHandler('pause'); +channel.onResume = cordova.addDocumentEventHandler('resume'); +channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready'); + +// Listen for DOMContentLoaded and notify our channel subscribers. +if (document.readyState == 'complete' || document.readyState == 'interactive') { + channel.onDOMContentLoaded.fire(); +} else { + document.addEventListener('DOMContentLoaded', function() { + channel.onDOMContentLoaded.fire(); + }, false); +} + +// _nativeReady is global variable that the native side can set +// to signify that the native code is ready. It is a global since +// it may be called before any cordova JS is ready. +if (window._nativeReady) { + channel.onNativeReady.fire(); +} + +// Call the platform-specific initialization. +platform.bootstrap && platform.bootstrap(); + +/** + * Create all cordova objects once native side is ready. + */ +channel.join(function() { + + platform.initialize && platform.initialize(); + + // Fire event to notify that all objects are created + channel.onCordovaReady.fire(); + + // Fire onDeviceReady event once page has fully loaded, all + // constructors have run and cordova info has been received from native + // side. + channel.join(function() { + require('cordova').fireDocumentEvent('deviceready'); + }, channel.deviceReadyChannelsArray); + +}, platformInitChannelsArray); + }); // file: src/common/modulemapper.js diff --git a/framework/src/org/apache/cordova/AndroidWebView.java b/framework/src/org/apache/cordova/AndroidWebView.java index 6f73dbff..be2f9686 100755 --- a/framework/src/org/apache/cordova/AndroidWebView.java +++ b/framework/src/org/apache/cordova/AndroidWebView.java @@ -70,7 +70,7 @@ import android.widget.FrameLayout; public class AndroidWebView extends WebView implements CordovaWebView { public static final String TAG = "CordovaWebView"; - public static final String CORDOVA_VERSION = "3.5.0-dev"; + public static final String CORDOVA_VERSION = "3.6.0-dev"; private ArrayList keyDownCodes = new ArrayList(); private ArrayList keyUpCodes = new ArrayList(); diff --git a/package.json b/package.json new file mode 100644 index 00000000..0d203c92 --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "cordova-android", + "version": "3.4.0", + "description": "cordova-android release", + "main": "bin/create", + "repository": { + "type": "git", + "url": "https://git-wip-us.apache.org/repos/asf/cordova-android.git" + }, + "keywords": [ + "android", + "cordova", + "apache" + ], + "author": "Apache Software Foundation", + "license": "Apache version 2.0", + "dependencies": { + "q": "^0.9.0", + "shelljs": "^0.2.6" + } +}