{"repo":"apache/cordova-js","free":true,"listed":false,"github":"https://github.com/apache/cordova-js","clone":"git clone https://github.com/apache/cordova-js.git","description":"Apache Cordova JavaScript Bridge","language":"JavaScript","stars":642,"topics":["cordova","nodejs","javascript","mobile","hacktoberfest"],"license":"Apache-2.0","category":"mobile-apps","readme_excerpt":"cordova-js A unified JavaScript layer for Apache Cordova projects. Project Structure How It Works The build-tools/build.js process is a Node.js script that concatenates all of the core Cordova plugins in this repository into a cordova. .js file under the pkg/ folder. It also wraps the plugins with a RequireJS-compatible module syntax that works in both browser and node environments. We end up with a cordova.js file that wraps each Cordova plugin into its own module. Cordova defines a channel module under src/common/channel.js , which is a publish/subscribe implementation that the project uses for event management. The Cordova native-to-webview bridge is initialized in src/scripts/bootstrap.js . This file attaches the boot function to the channel.onNativeReady event - fired by native with a call to: The boot method does all the work. First, it grabs the common platform definition (under src/common/common.js ) and injects all of the objects defined there onto window and other global namespaces. Next, it grabs all of the platform-specific object definitions (as defined under src/ /platform.js ) and overrides those onto window . Finally, it calls the platform-specific initialize function (located in the platform definition). At this point, Cordova is fully initialized and ready to roll. Last thing we do is wait for the DOMContentLoaded event to fire to make sure the page has loaded properly. Once that is done, Cordova fires the deviceready event where you can safely attach functi","default_branch":null,"files":null,"tree":[],"storefront":"/r/apache","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/apache/cordova-js/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}