Converted all markdown code blocks in dev to GFM fenced blocks
Project: http://git-wip-us.apache.org/repos/asf/cordova-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-docs/commit/a65e8109 Tree: http://git-wip-us.apache.org/repos/asf/cordova-docs/tree/a65e8109 Diff: http://git-wip-us.apache.org/repos/asf/cordova-docs/diff/a65e8109 Branch: refs/heads/master Commit: a65e8109a34b3ca68545fde45029d8430298b3a8 Parents: da85fd2 Author: Richard Knoll <richard.b.kn...@gmail.com> Authored: Thu Mar 17 17:49:17 2016 -0700 Committer: Richard Knoll <richard.b.kn...@gmail.com> Committed: Thu Mar 17 18:26:23 2016 -0700 ---------------------------------------------------------------------- www/docs/en/dev/config_ref/index.md | 349 ++++++++++--------- www/docs/en/dev/cordova/events/events.md | 188 +++++----- www/docs/en/dev/cordova/storage/storage.md | 160 +++++---- www/docs/en/dev/guide/appdev/hooks/index.md | 148 ++++---- www/docs/en/dev/guide/appdev/whitelist/index.md | 55 +-- www/docs/en/dev/guide/cli/index.md | 139 +++++--- www/docs/en/dev/guide/hybrid/plugins/index.md | 32 +- .../en/dev/guide/platforms/android/index.md | 91 +++-- .../en/dev/guide/platforms/android/plugin.md | 2 +- .../en/dev/guide/platforms/android/upgrade.md | 26 +- .../en/dev/guide/platforms/android/webview.md | 8 +- .../dev/guide/platforms/blackberry/upgrade.md | 57 +-- .../dev/guide/platforms/blackberry10/config.md | 16 +- .../dev/guide/platforms/blackberry10/index.md | 117 ++++--- .../dev/guide/platforms/blackberry10/plugin.md | 192 +++++----- .../dev/guide/platforms/blackberry10/tools.md | 48 ++- .../dev/guide/platforms/blackberry10/upgrade.md | 49 ++- www/docs/en/dev/guide/platforms/ios/index.md | 46 ++- www/docs/en/dev/guide/platforms/ios/plugin.md | 141 ++++---- www/docs/en/dev/guide/platforms/ios/upgrade.md | 174 +++++---- www/docs/en/dev/guide/platforms/ios/webview.md | 68 ++-- www/docs/en/dev/guide/platforms/osx/config.md | 29 +- www/docs/en/dev/guide/platforms/osx/index.md | 22 +- www/docs/en/dev/guide/platforms/ubuntu/index.md | 35 +- www/docs/en/dev/guide/platforms/win8/index.md | 112 +++--- www/docs/en/dev/guide/platforms/win8/plugin.md | 4 +- www/docs/en/dev/guide/platforms/win8/upgrade.md | 19 +- .../dev/platform_plugin_versioning_ref/index.md | 81 +++-- www/docs/en/dev/plugin_ref/plugman.md | 112 ++++-- www/docs/en/dev/plugin_ref/spec.md | 100 +++--- 30 files changed, 1539 insertions(+), 1081 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a65e8109/www/docs/en/dev/config_ref/index.md ---------------------------------------------------------------------- diff --git a/www/docs/en/dev/config_ref/index.md b/www/docs/en/dev/config_ref/index.md index 7312633..e5dee88 100644 --- a/www/docs/en/dev/config_ref/index.md +++ b/www/docs/en/dev/config_ref/index.md @@ -33,7 +33,9 @@ For projects created with the Cordova CLI (described in [The Command-Line Interface](../guide/cli/index.html)), this file can be found in the top-level directory: - app/config.xml +``` +app/config.xml +``` Note that before version 3.3.1-0.2.0, the file existed at `app/www/config.xml`, and that having it here is still supported. @@ -42,9 +44,11 @@ When using the CLI to build a project, versions of this file are passively copied into various `platforms/` subdirectories. For example: - app/platforms/ios/AppName/config.xml - app/platforms/blackberry10/www/config.xml - app/platforms/android/res/xml/config.xml +``` +app/platforms/ios/AppName/config.xml +app/platforms/blackberry10/www/config.xml +app/platforms/android/res/xml/config.xml +``` In addition to the various configuration options detailed below, you can also configure an application's core set of images for each target @@ -67,40 +71,45 @@ platform. See [Customize icons topic](images.html) for more information. Examples: - <!-- Android --> - <widget id="io.cordova.hellocordova" version="0.0.1" android-versionCode="0.1.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> - </widget> + ```xml + <!-- Android --> + <widget id="io.cordova.hellocordova" version="0.0.1" android-versionCode="0.1.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> + </widget> - <!-- iOS --> - <widget id="io.cordova.hellocordova" version="0.0.1" ios-CFBundleVersion="0.1.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> - </widget> + <!-- iOS --> + <widget id="io.cordova.hellocordova" version="0.0.1" ios-CFBundleVersion="0.1.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> + </widget> - <!-- Windows --> - <widget id="io.cordova.hellocordova" version="0.0.1" windows-packageVersion="0.1.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> - </widget> + <!-- Windows --> + <widget id="io.cordova.hellocordova" version="0.0.1" windows-packageVersion="0.1.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> + </widget> - <!-- OS X --> - <widget id="io.cordova.hellocordova" version="0.0.1" osx-CFBundleVersion="0.1.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> - </widget> + <!-- OS X --> + <widget id="io.cordova.hellocordova" version="0.0.1" osx-CFBundleVersion="0.1.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> + </widget> + ``` ## name Specifies the app's formal name, as it appears on the device's home screen and within app-store interfaces. Examples: - <widget ...> - <name>HelloCordova</name> - </widget> + ```xml + <widget ...> + <name>HelloCordova</name> + </widget> + ``` ## description Specifies metadata that may appear within app-store listings. Examples: - <widget ...> - <description>A sample Apache Cordova application</description> - </widget> - + ```xml + <widget ...> + <description>A sample Apache Cordova application</description> + </widget> + ``` ## author Specifies contact information that may appear within app-store lisitngs. @@ -112,9 +121,11 @@ platform. See [Customize icons topic](images.html) for more information. Examples: - <widget ...> - <author email="d...@cordova.apache.org" href="http://cordova.io"></author> - </widget> + ```xml + <widget ...> + <author email="d...@cordova.apache.org" href="http://cordova.io"></author> + </widget> + ``` ## content @@ -128,10 +139,11 @@ platform. See [Customize icons topic](images.html) for more information. Examples: - <widget ...> - <content src="startPage.html"></content> - </widget> - + ```xml + <widget ...> + <content src="startPage.html"></content> + </widget> + ``` ## access Defines the set of external domains the app is allowed to communicate with. The default value shown above allows it to access any server. @@ -145,13 +157,15 @@ platform. See [Customize icons topic](images.html) for more information. Examples: - <widget ...> - <access origin="*"></content> - </widget> + ```xml + <widget ...> + <access origin="*"></content> + </widget> - <widget ...> - <access origin="http://google.com"></content> - </widget> + <widget ...> + <access origin="http://google.com"></content> + </widget> + ``` ## allow-navigation @@ -164,11 +178,13 @@ platform. See [Customize icons topic](images.html) for more information. Examples: - <!-- Allow links to example.com --> - <allow-navigation href="http://example.com/*" /> + ```xml + <!-- Allow links to example.com --> + <allow-navigation href="http://example.com/*" /> - <!-- Wildcards are allowed for the protocol, as a prefix to the host, or as a suffix to the path --> - <allow-navigation href="*://*.example.com/*" /> + <!-- Wildcards are allowed for the protocol, as a prefix to the host, or as a suffix to the path --> + <allow-navigation href="*://*.example.com/*" /> + ``` ## allow-intent Controls which URLs the app is allowed to ask the system to open. By default, no external URLs are allowed. @@ -180,13 +196,15 @@ platform. See [Customize icons topic](images.html) for more information. Examples: - <allow-intent href="http://*/*" /> - <allow-intent href="https://*/*" /> - <allow-intent href="tel:*" /> - <allow-intent href="sms:*" /> + ```xml + <allow-intent href="http://*/*" /> + <allow-intent href="https://*/*" /> + <allow-intent href="tel:*" /> + <allow-intent href="sms:*" /> + ``` ## engine - Specifies details about what platform to restore during a prepare. + Specifies details about what platform to restore during a prepare. Attributes(type) | Description ----------------- | ------------ @@ -195,11 +213,13 @@ platform. See [Customize icons topic](images.html) for more information. Examples: - <engine name="android" spec="https://github.com/apache/cordova-android.git#5.1.1" /> - <engine name="ios" spec="^4.0.0" /> - + ```xml + <engine name="android" spec="https://github.com/apache/cordova-android.git#5.1.1" /> + <engine name="ios" spec="^4.0.0" /> + ``` + ## plugin - Specifies details about what plugin to restore during a prepare. + Specifies details about what plugin to restore during a prepare. Attributes(type) | Description ----------------- | ------------ @@ -208,8 +228,10 @@ platform. See [Customize icons topic](images.html) for more information. Examples: - <plugin name="cordova-plugin-device" spec="^1.1.0" /> - <plugin name="cordova-plugin-device" spec="https://github.com/apache/cordova-plugin-device.git#1.0.0" /> + ```xml + <plugin name="cordova-plugin-device" spec="^1.1.0" /> + <plugin name="cordova-plugin-device" spec="https://github.com/apache/cordova-plugin-device.git#1.0.0" /> + ``` ## preference Sets various options as pairs of name/value attributes. Each preference's name is case-insensitive. Many preferences are unique to specific platforms, @@ -263,7 +285,7 @@ platform. See [Customize icons topic](images.html) for more information. WebSecurity(string) | *Default: enable* <br/> ==BlackBerry== <br/> Set to disable to override web security settings, allowing access to remote content from unknown sources. This preference is intended as a development convenience only, so remove it before packaging the app for distribution. For the released app, all URIs should be known and whitelisted using the <access> element, described in the Domain Whitelist Guide. WindowSize(string) | *Default: auto* <br/> ==OS X **4.0.0**== <br/> Sets the size of the application window. <br/> Accepts the format `WxH` for a specific width and height or the special values `auto` and `fullscreen`. The latter will open a borderless window spanning the entire desktop area. Please note, that this is different from the _normal_ OS X fullscreen mode, which would never span multiple displays. <br/> **Note**: The global cordova `fullscreen` preference has no effect in OS X. WindowsDefaultUriPrefix(string) | ==Windows== <br/> Allowed values: `ms-appx://`, `ms-appx-web://` <br/> Identifies whether you want your app to target the local context or remote context as its startup URI. When building for Windows 10, the default is the remote context (`ms-appx-web://`). <br/> In order to have a local-mode application that is not impacted by Remote Mode capability restrictions, you must set this preference to `ms-appx://` and not declare any `<access>` elements with remote URIs. The local mode is the default for Windows 8.1 - WindowsStoreDisplayName(string) | ==Windows== <br/> A friendly name for the publisher that can be displayed to users. + WindowsStoreDisplayName(string) | ==Windows== <br/> A friendly name for the publisher that can be displayed to users. WindowsStoreIdentityName(string) | ==Windows== <br/> Identity name used for Windows store. The identity defines a globally unique identifier for a package. A package identity is represented as a tuple of attributes of the package. See the [identity page on the package manifest schema reference](https://msdn.microsoft.com/en-us/library/windows/apps/br211441.aspx) for further details. WindowsStorePublisherName(string) | ==Windows== <br/> Publisher Display Name. WindowsToastCapable(boolean) | *Default: false* <br/> ==Windows== <br/> A value of ```true``` indicates that the app is allowed to provide 'toast notifications'. @@ -274,68 +296,70 @@ platform. See [Customize icons topic](images.html) for more information. Examples: - <preference name="DisallowOverscroll" value="true"/> - <preference name="Fullscreen" value="true" /> - <preference name="BackgroundColor" value="0xff0000ff"/> - <preference name="HideKeyboardFormAccessoryBar" value="true"/> - <preference name="Orientation" value="landscape" /> - - <!-- iOS only preferences --> - <preference name="EnableViewportScale" value="true"/> - <preference name="MediaPlaybackAllowsAirPlay" value="false"/> - <preference name="MediaPlaybackRequiresUserAction" value="true"/> - <preference name="AllowInlineMediaPlayback" value="true"/> - <preference name="BackupWebStorage" value="local"/> - <preference name="TopActivityIndicator" value="white"/> - <preference name="SuppressesIncrementalRendering" value="true"/> - <preference name="GapBetweenPages" value="0"/> - <preference name="PageLength" value="0"/> - <preference name="PaginationBreakingMode" value="page"/> - <preference name="PaginationMode" value="unpaginated"/> - <preference name="UIWebViewDecelerationSpeed" value="fast" /> - <preference name="ErrorUrl" value="myErrorPage.html"/> - <preference name="OverrideUserAgent" value="Mozilla/5.0 My Browser" /> - <preference name="AppendUserAgent" value="My Browser" /> - <preference name="target-device" value="universal" /> - <preference name="deployment-target" value="7.0" /> - <preference name="CordovaWebViewEngine" value="CDVUIWebViewEngine" /> - <preference name="SuppressesLongPressGesture" value="true" /> - <preference name="Suppresses3DTouchGesture" value="true" /> - - <!-- Android only preferences --> - <preference name="KeepRunning" value="false"/> - <preference name="LoadUrlTimeoutValue" value="10000"/> - <preference name="InAppBrowserStorageEnabled" value="true"/> - <preference name="LoadingDialog" value="My Title,My Message"/> - <preference name="ErrorUrl" value="myErrorPage.html"/> - <preference name="ShowTitle" value="true"/> - <preference name="LogLevel" value="VERBOSE"/> - <preference name="AndroidLaunchMode" value="singleTop"/> - <preference name="DefaultVolumeStream" value="call" /> - <preference name="OverrideUserAgent" value="Mozilla/5.0 My Browser" /> - <preference name="AppendUserAgent" value="My Browser" /> - - <!-- Windows only preferences --> - <preference name="windows-phone-target-version" value="8.1" /> - <preference name="windows-target-version" value="8.1" /> - <preference name="Windows.Universal" value="10.0.10240.0" /> - <preference name="WindowsDefaultUriPrefix" value="ms-appx://"" /> - <preference name="Windows.Mobile-MaxVersionTested" value="10.0.10031.0" /> - <preference name="Windows.Universal-MinVersion" value="10.0.0.0" /> - <preference name="WindowsStoreIdentityName" value="Cordova.Example.ApplicationDataSample" /> - <preference name="WindowsStorePublisherName" value="CN=Contoso Corp, O=Contoso Corp, L=Redmond, S=Washington, C=US" /> - <preference name="WindowsToastCapable" value="true" /> - - <!-- BlackBerry only preferences --> - <preference name="ChildBrowser" value="disable"/> - <preference name="PopupBlocker" value="enable"/> - <preference name="WebSecurity" value="disable"/> - - <!-- OS X only preferences --> - <preference name="HideMousePointer" value="5"/> - <preference name="OSXLocalStoragePath" value="~/.myapp/database"/> - <preference name="WindowSize" value="800x400"/> - <preference name="EnableWebGL" value="true"/> + ```xml + <preference name="DisallowOverscroll" value="true"/> + <preference name="Fullscreen" value="true" /> + <preference name="BackgroundColor" value="0xff0000ff"/> + <preference name="HideKeyboardFormAccessoryBar" value="true"/> + <preference name="Orientation" value="landscape" /> + + <!-- iOS only preferences --> + <preference name="EnableViewportScale" value="true"/> + <preference name="MediaPlaybackAllowsAirPlay" value="false"/> + <preference name="MediaPlaybackRequiresUserAction" value="true"/> + <preference name="AllowInlineMediaPlayback" value="true"/> + <preference name="BackupWebStorage" value="local"/> + <preference name="TopActivityIndicator" value="white"/> + <preference name="SuppressesIncrementalRendering" value="true"/> + <preference name="GapBetweenPages" value="0"/> + <preference name="PageLength" value="0"/> + <preference name="PaginationBreakingMode" value="page"/> + <preference name="PaginationMode" value="unpaginated"/> + <preference name="UIWebViewDecelerationSpeed" value="fast" /> + <preference name="ErrorUrl" value="myErrorPage.html"/> + <preference name="OverrideUserAgent" value="Mozilla/5.0 My Browser" /> + <preference name="AppendUserAgent" value="My Browser" /> + <preference name="target-device" value="universal" /> + <preference name="deployment-target" value="7.0" /> + <preference name="CordovaWebViewEngine" value="CDVUIWebViewEngine" /> + <preference name="SuppressesLongPressGesture" value="true" /> + <preference name="Suppresses3DTouchGesture" value="true" /> + + <!-- Android only preferences --> + <preference name="KeepRunning" value="false"/> + <preference name="LoadUrlTimeoutValue" value="10000"/> + <preference name="InAppBrowserStorageEnabled" value="true"/> + <preference name="LoadingDialog" value="My Title,My Message"/> + <preference name="ErrorUrl" value="myErrorPage.html"/> + <preference name="ShowTitle" value="true"/> + <preference name="LogLevel" value="VERBOSE"/> + <preference name="AndroidLaunchMode" value="singleTop"/> + <preference name="DefaultVolumeStream" value="call" /> + <preference name="OverrideUserAgent" value="Mozilla/5.0 My Browser" /> + <preference name="AppendUserAgent" value="My Browser" /> + + <!-- Windows only preferences --> + <preference name="windows-phone-target-version" value="8.1" /> + <preference name="windows-target-version" value="8.1" /> + <preference name="Windows.Universal" value="10.0.10240.0" /> + <preference name="WindowsDefaultUriPrefix" value="ms-appx://"" /> + <preference name="Windows.Mobile-MaxVersionTested" value="10.0.10031.0" /> + <preference name="Windows.Universal-MinVersion" value="10.0.0.0" /> + <preference name="WindowsStoreIdentityName" value="Cordova.Example.ApplicationDataSample" /> + <preference name="WindowsStorePublisherName" value="CN=Contoso Corp, O=Contoso Corp, L=Redmond, S=Washington, C=US" /> + <preference name="WindowsToastCapable" value="true" /> + + <!-- BlackBerry only preferences --> + <preference name="ChildBrowser" value="disable"/> + <preference name="PopupBlocker" value="enable"/> + <preference name="WebSecurity" value="disable"/> + + <!-- OS X only preferences --> + <preference name="HideMousePointer" value="5"/> + <preference name="OSXLocalStoragePath" value="~/.myapp/database"/> + <preference name="WindowSize" value="800x400"/> + <preference name="EnableWebGL" value="true"/> + ``` ## feature If you use the CLI to build applications, you use the plugin command to enable device APIs. This does not modify the top-level config.xml file, so the <feature> element does not apply to your workflow. If you work directly in an SDK and using the platform-specific config.xml file as source, you use the <feature> tag to enable device-level APIs and external plugins. They often appear with custom values in platform-specific config.xml files. See the API Reference for details on how to specify each feature. See @@ -358,22 +382,24 @@ platform. See [Customize icons topic](images.html) for more information. Examples: - <!-- Here is how to specify the Device API for Android projects --> - <feature name="Device"> - <param name="android-package" value="org.apache.cordova.device.Device" /> - </feature> + ```xml + <!-- Here is how to specify the Device API for Android projects --> + <feature name="Device"> + <param name="android-package" value="org.apache.cordova.device.Device" /> + </feature> - <!-- Here's how the element appears for iOS projects --> - <feature name="Device"> - <param name="ios-package" value="CDVDevice" /> - <param name="onload" value="true" /> - </feature> + <!-- Here's how the element appears for iOS projects --> + <feature name="Device"> + <param name="ios-package" value="CDVDevice" /> + <param name="onload" value="true" /> + </feature> - <!-- Here's how the element appears for OS X projects --> - <feature name="Device"> - <param name="osx-package" value="CDVDevice" /> - <param name="onload" value="true" /> - </feature> + <!-- Here's how the element appears for OS X projects --> + <feature name="Device"> + <param name="osx-package" value="CDVDevice" /> + <param name="onload" value="true" /> + </feature> + ``` ## platform @@ -385,9 +411,11 @@ platform. See [Customize icons topic](images.html) for more information. Examples: - <platform name="android"> - <preference name="Fullscreen" value="true" /> - </platform> + ```xml + <platform name="android"> + <preference name="Fullscreen" value="true" /> + </platform> + ``` ## hook Represents your custom script which will be called by Cordova when @@ -402,37 +430,40 @@ platform. See [Customize icons topic](images.html) for more information. Examples: - <hook type="after_plugin_install" src="scripts/afterPluginInstall.js" /> + ```xml + <hook type="after_plugin_install" src="scripts/afterPluginInstall.js" /> + ``` # Sample config.xml Below is a sample config.xml file: - <?xml version='1.0' encoding='utf-8'?> - <widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> - <name>HelloCordova</name> - <description> - A sample Apache Cordova application that responds to the deviceready event. - </description> - <author email="d...@cordova.apache.org" href="http://cordova.io"> - Apache Cordova Team - </author> - <content src="index.html" /> - <plugin name="cordova-plugin-whitelist" spec="1" /> - <access origin="*" /> - <allow-intent href="http://*/*" /> - <allow-intent href="https://*/*" /> - <allow-intent href="tel:*" /> - <allow-intent href="sms:*" /> - <allow-intent href="mailto:*" /> - <allow-intent href="geo:*" /> - <platform name="android"> - <allow-intent href="market:*" /> - </platform> - <platform name="ios"> - <allow-intent href="itms:*" /> - <allow-intent href="itms-apps:*" /> - </platform> - </widget> - + ```xml + <?xml version='1.0' encoding='utf-8'?> + <widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> + <name>HelloCordova</name> + <description> + A sample Apache Cordova application that responds to the deviceready event. + </description> + <author email="d...@cordova.apache.org" href="http://cordova.io"> + Apache Cordova Team + </author> + <content src="index.html" /> + <plugin name="cordova-plugin-whitelist" spec="1" /> + <access origin="*" /> + <allow-intent href="http://*/*" /> + <allow-intent href="https://*/*" /> + <allow-intent href="tel:*" /> + <allow-intent href="sms:*" /> + <allow-intent href="mailto:*" /> + <allow-intent href="geo:*" /> + <platform name="android"> + <allow-intent href="market:*" /> + </platform> + <platform name="ios"> + <allow-intent href="itms:*" /> + <allow-intent href="itms-apps:*" /> + </platform> + </widget> + ``` [uses-sdk]: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a65e8109/www/docs/en/dev/cordova/events/events.md ---------------------------------------------------------------------- diff --git a/www/docs/en/dev/cordova/events/events.md b/www/docs/en/dev/cordova/events/events.md index 69d6dea..5e6e4ba 100644 --- a/www/docs/en/dev/cordova/events/events.md +++ b/www/docs/en/dev/cordova/events/events.md @@ -27,49 +27,53 @@ The application code could add listeners for these events. For example: **HTML File** - <!DOCTYPE html> - <html> - <head> - <title>Device Ready Example</title> - - <script type="text/javascript" charset="utf-8" src="cordova.js"></script> - <script type="text/javascript" charset="utf-8" src="example.js"></script> - </head> - <body onload="onLoad()"> - </body> - </html> +```html +<!DOCTYPE html> +<html> + <head> + <title>Device Ready Example</title> + + <script type="text/javascript" charset="utf-8" src="cordova.js"></script> + <script type="text/javascript" charset="utf-8" src="example.js"></script> + </head> + <body onload="onLoad()"> + </body> +</html> +``` **JS File** - // example.js file - // Wait for device API libraries to load - // - function onLoad() { - document.addEventListener("deviceready", onDeviceReady, false); - } +```javascript +// example.js file +// Wait for device API libraries to load +// +function onLoad() { + document.addEventListener("deviceready", onDeviceReady, false); +} - // device APIs are available - // - function onDeviceReady() { - document.addEventListener("pause", onPause, false); - document.addEventListener("resume", onResume, false); - document.addEventListener("menubutton", onMenuKeyDown, false); - // Add similar listeners for other events - } +// device APIs are available +// +function onDeviceReady() { + document.addEventListener("pause", onPause, false); + document.addEventListener("resume", onResume, false); + document.addEventListener("menubutton", onMenuKeyDown, false); + // Add similar listeners for other events +} - function onPause() { - // Handle the pause event - } +function onPause() { + // Handle the pause event +} - function onResume() { - // Handle the resume event - } +function onResume() { + // Handle the resume event +} - function onMenuKeyDown() { - // Handle the menubutton event - } +function onMenuKeyDown() { + // Handle the menubutton event +} - // Add similar event handlers for other events +// Add similar event handlers for other events +``` **Note**: Applications typically should use `document.addEventListener` to attach an event listener once the [deviceready](#deviceready) @@ -209,11 +213,13 @@ callback function called immediately. ### Quick Example - document.addEventListener("deviceready", onDeviceReady, false); +```javascript +document.addEventListener("deviceready", onDeviceReady, false); - function onDeviceReady() { - // Now safe to use device APIs - } +function onDeviceReady() { + // Now safe to use device APIs +} +``` ## pause @@ -222,11 +228,13 @@ typically when the user switches to a different application. ### Quick Example - document.addEventListener("pause", onPause, false); +```javascript +document.addEventListener("pause", onPause, false); - function onPause() { - // Handle the pause event - } +function onPause() { + // Handle the pause event +} +``` ### iOS Quirks @@ -251,11 +259,13 @@ The `resume` event fires when the native platform pulls the application out from ### Quick Example - document.addEventListener("resume", onResume, false); +```javascript +document.addEventListener("resume", onResume, false); - function onResume() { - // Handle the resume event - } +function onResume() { + // Handle the resume event +} +``` ### iOS Quirks @@ -282,12 +292,14 @@ to `YES`. To run when locked on iOS 4, this setting does not matter. as `alert()` need to be wrapped in a `setTimeout()` call with a timeout value of zero, or else the app hangs. For example: - document.addEventListener("resume", onResume, false); - function onResume() { - setTimeout(function() { - // TODO: do your thing! - }, 0); - } + ```javascript + document.addEventListener("resume", onResume, false); + function onResume() { + setTimeout(function() { + // TODO: do your thing! + }, 0); + } + ``` ### Android Quirks @@ -303,11 +315,13 @@ back-button behavior. ### Quick Example - document.addEventListener("backbutton", onBackKeyDown, false); +```javascript +document.addEventListener("backbutton", onBackKeyDown, false); - function onBackKeyDown() { - // Handle the back button - } +function onBackKeyDown() { + // Handle the back button +} +``` ## menubutton @@ -316,11 +330,13 @@ overrides the default menu button behavior. ### Quick Example - document.addEventListener("menubutton", onMenuKeyDown, false); +```javascript +document.addEventListener("menubutton", onMenuKeyDown, false); - function onMenuKeyDown() { - // Handle the back button - } +function onMenuKeyDown() { + // Handle the back button +} +``` ## searchbutton @@ -330,11 +346,13 @@ listener for the 'searchbutton' event. ### Quick Example - document.addEventListener("searchbutton", onSearchKeyDown, false); +```javascript +document.addEventListener("searchbutton", onSearchKeyDown, false); - function onSearchKeyDown() { - // Handle the search button - } +function onSearchKeyDown() { + // Handle the search button +} +``` ## startcallbutton @@ -343,11 +361,13 @@ the default start call behavior you can register an event listener for the `star ### Quick Example - document.addEventListener("startcallbutton", onStartCallKeyDown, false); +```javascript +document.addEventListener("startcallbutton", onStartCallKeyDown, false); - function onStartCallKeyDown() { - // Handle the start call button - } +function onStartCallKeyDown() { + // Handle the start call button +} +``` ## endcallbutton @@ -356,11 +376,13 @@ default end call behavior. ### Quick Example - document.addEventListener("endcallbutton", onEndCallKeyDown, false); +```javascript +document.addEventListener("endcallbutton", onEndCallKeyDown, false); - function onEndCallKeyDown() { - // Handle the end call button - } +function onEndCallKeyDown() { + // Handle the end call button +} +``` ## volumedownbutton @@ -369,11 +391,13 @@ the default volume down behavior you can register an event listener for the `vol ### Quick Example - document.addEventListener("volumedownbutton", onVolumeDownKeyDown, false); +```javascript +document.addEventListener("volumedownbutton", onVolumeDownKeyDown, false); - function onVolumeDownKeyDown() { - // Handle the volume down button - } +function onVolumeDownKeyDown() { + // Handle the volume down button +} +``` ## volumeupbutton @@ -382,11 +406,13 @@ the default volume up behavior you can register an event listener for the `volum ### Quick Example - document.addEventListener("volumeupbutton", onVolumeUpKeyDown, false); +```javascript +document.addEventListener("volumeupbutton", onVolumeUpKeyDown, false); - function onVolumeUpKeyDown() { - // Handle the volume up button - } +function onVolumeUpKeyDown() { + // Handle the volume up button +} +``` [UIApplicationExitsOnSuspend]: http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html [AndroidLifeCycleGuide]: ../../guide/platforms/android/lifecycle.html http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a65e8109/www/docs/en/dev/cordova/storage/storage.md ---------------------------------------------------------------------- diff --git a/www/docs/en/dev/cordova/storage/storage.md b/www/docs/en/dev/cordova/storage/storage.md index ab6f751..8f89c8c 100644 --- a/www/docs/en/dev/cordova/storage/storage.md +++ b/www/docs/en/dev/cordova/storage/storage.md @@ -29,7 +29,7 @@ examples. Each API offers advantages and disadvantages, which are summarized here. You should choose whichever best suits your needs. You can also use several -different approaches within a single application for different purposes. +different approaches within a single application for different purposes. ## LocalStorage @@ -40,12 +40,14 @@ platforms. ### Usage Summary Local storage can be accessed via `window.localStorage`. The following code -snippet shows the most important methods exposed by the returned `Storage` object: +snippet shows the most important methods exposed by the returned `Storage` object: - var storage = window.localStorage; - var value = storage.getItem(key); // Pass a key name to get its value. - storage.setItem(key, value) // Pass a key name and its value to add or update that key. - storage.removeItem(key) // Pass a key name to remove that key from storage. +```javascript +var storage = window.localStorage; +var value = storage.getItem(key); // Pass a key name to get its value. +storage.setItem(key, value) // Pass a key name and its value to add or update that key. +storage.removeItem(key) // Pass a key name to remove that key from storage. +``` For more information, see: @@ -68,7 +70,7 @@ For more information, see: - Synchronous API means calls will lock up the user interface. - Limited total amount of storage (typically around 5MB). - iOS stores `localStorage` data in a location that may be cleaned out by - the OS when space is required. + the OS when space is required. ## WebSQL @@ -86,7 +88,9 @@ It is supported by the underlying WebView on the following Cordova platforms: The entry point into creating or opening a database is the `window.openDatabase()` method: - var db = window.openDatabase(name, version, displayName, estimatedSize); +```javascript +var db = window.openDatabase(name, version, displayName, estimatedSize); +``` - **name** (string): The unique name of the database, as it will be stored in disk. - **version** (string): The version of the database. @@ -100,17 +104,19 @@ The entry point into creating or opening a database is the `window.openDatabase( The returned `Database` object provides a `transaction()` method (or `readTransaction()` to optimize read-only transactions) that let's you create a failure-safe transaction: - var db = window.openDatabase(name, version, displayName, estimatedSize); - db.transaction(function (tx) { - tx.executeSql(sqlStatement, valueArray, function (tx, result) { - console.log(result); - }, function (error) { - console.log(error); - }); +```javascript +var db = window.openDatabase(name, version, displayName, estimatedSize); +db.transaction(function (tx) { + tx.executeSql(sqlStatement, valueArray, function (tx, result) { + console.log(result); + }, function (error) { + console.log(error); }); +}); +``` For more information, see: - + - [W3C: Spec][WebSQLDatabaseSpecification] - [TutorialsPoint: WebSQL Guide][TutorialsPointWebSQL] @@ -153,7 +159,7 @@ constraining the structure or needing to define it up front. IndexedDB provides a simple and easy to understand data model, much like LocalStorage. But unlike LocalStorage, you can create multiple databases, with multiple stores per -database, and its asynchronous API and search indexes provide performance benefits. +database, and its asynchronous API and search indexes provide performance benefits. IndexedDB is supported by the underlying WebView on the following Cordova platforms: @@ -161,7 +167,7 @@ IndexedDB is supported by the underlying WebView on the following Cordova platfo - Windows (with some limitations) - Android (4.4 and above) -### Windows Limitations +### Windows Limitations Windows platform support for IndexedDB is incomplete. For example, it lacks the following features: @@ -177,69 +183,71 @@ the following features: operation, then get notified of the result via a DOM event. - When you make a request, you get a request object, which provides `onerror` and `onsuccess` events, as well as properties such as `result`, `error` - and `readyState`. + and `readyState`. The following code snippet demonstrates some simple usage of IndexedDB: - var db; - var databaseName = 'myDB'; - var databaseVersion = 1; - var openRequest = window.indexedDB.open(databaseName, databaseVersion); - openRequest.onerror = function (event) { - console.log(openRequest.errorCode); - }; - openRequest.onsuccess = function (event) { - // Database is open and initialized - we're good to proceed. - db = openRequest.result; - displayData(); +```javascript +var db; +var databaseName = 'myDB'; +var databaseVersion = 1; +var openRequest = window.indexedDB.open(databaseName, databaseVersion); +openRequest.onerror = function (event) { + console.log(openRequest.errorCode); +}; +openRequest.onsuccess = function (event) { + // Database is open and initialized - we're good to proceed. + db = openRequest.result; + displayData(); +}; +openRequest.onupgradeneeded = function (event) { + // This is either a newly created database, or a new version number + // has been submitted to the open() call. + var db = event.target.result; + db.onerror = function () { + console.log(db.errorCode); }; - openRequest.onupgradeneeded = function (event) { - // This is either a newly created database, or a new version number - // has been submitted to the open() call. - var db = event.target.result; - db.onerror = function () { - console.log(db.errorCode); - }; - - // Create an object store and indexes. A key is a data value used to organize - // and retrieve values in the object store. The keyPath option identifies where - // the key is stored. If a key path is specified, the store can only contain - // JavaScript objects, and each object stored must have a property with the - // same name as the key path (unless the autoIncrement option is true). - var store = db.createObjectStore('customers', { keyPath: 'customerId' }); - - // Define the indexes we want to use. Objects we add to the store don't need - // to contain these properties, but they will only appear in the specified - // index of they do. - // - // syntax: store.createIndex(indexName, keyPath[, parameters]); - // - // All these values could have duplicates, so set unique to false - store.createIndex('firstName', 'firstName', { unique: false }); - store.createIndex('lastName', 'lastName', { unique: false }); - store.createIndex('street', 'street', { unique: false }); - store.createIndex('city', 'city', { unique: false }); - store.createIndex('zipCode', 'zipCode', { unique: false }); - store.createIndex('country', 'country', { unique: false }); - - // Once the store is created, populate it - store.transaction.oncomplete = function (event) { - // The transaction method takes an array of the names of object stores - // and indexes that will be in the scope of the transaction (or a single - // string to access a single object store). The transaction will be - // read-only unless the optional 'readwrite' parameter is specified. - // It returns a transaction object, which provides an objectStore method - // to access one of the object stores that are in the scope of this - //transaction. - var customerStore = db.transaction('customers', 'readwrite').objectStore('customers'); - customers.forEach(function (customer) { - customerStore.add(customer); - }); - }; + + // Create an object store and indexes. A key is a data value used to organize + // and retrieve values in the object store. The keyPath option identifies where + // the key is stored. If a key path is specified, the store can only contain + // JavaScript objects, and each object stored must have a property with the + // same name as the key path (unless the autoIncrement option is true). + var store = db.createObjectStore('customers', { keyPath: 'customerId' }); + + // Define the indexes we want to use. Objects we add to the store don't need + // to contain these properties, but they will only appear in the specified + // index of they do. + // + // syntax: store.createIndex(indexName, keyPath[, parameters]); + // + // All these values could have duplicates, so set unique to false + store.createIndex('firstName', 'firstName', { unique: false }); + store.createIndex('lastName', 'lastName', { unique: false }); + store.createIndex('street', 'street', { unique: false }); + store.createIndex('city', 'city', { unique: false }); + store.createIndex('zipCode', 'zipCode', { unique: false }); + store.createIndex('country', 'country', { unique: false }); + + // Once the store is created, populate it + store.transaction.oncomplete = function (event) { + // The transaction method takes an array of the names of object stores + // and indexes that will be in the scope of the transaction (or a single + // string to access a single object store). The transaction will be + // read-only unless the optional 'readwrite' parameter is specified. + // It returns a transaction object, which provides an objectStore method + // to access one of the object stores that are in the scope of this + //transaction. + var customerStore = db.transaction('customers', 'readwrite').objectStore('customers'); + customers.forEach(function (customer) { + customerStore.add(customer); + }); }; +}; - function displayData() { - } +function displayData() { +} +``` For more information, see: @@ -286,7 +294,7 @@ It is available in the following variations: * **[cordova-sqlite-storage][SQLiteStorage]** - core version that relies on native SQLite implementation. As such, it is only available for iOS - and Android platforms. + and Android platforms. * **[cordova-sqlite-ext][SQLiteExt]** - extended version with additional features including support for Windows and REGEXP support on Android and iOS. * **[cordova-sqlite-evfree][SQLiteEVFree]** - similar to *cordova-sqlite-ext* http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a65e8109/www/docs/en/dev/guide/appdev/hooks/index.md ---------------------------------------------------------------------- diff --git a/www/docs/en/dev/guide/appdev/hooks/index.md b/www/docs/en/dev/guide/appdev/hooks/index.md index 8eb48c8..8fb4818 100644 --- a/www/docs/en/dev/guide/appdev/hooks/index.md +++ b/www/docs/en/dev/guide/appdev/hooks/index.md @@ -196,36 +196,40 @@ Cordova supports the following hook types: Hooks could be defined in project's `config.xml` using `<hook>` elements, for example: - <hook type="before_build" src="scripts/appBeforeBuild.bat" /> - <hook type="before_build" src="scripts/appBeforeBuild.js" /> - <hook type="before_plugin_install" src="scripts/appBeforePluginInstall.js" /> - - <platform name="android"> - <hook type="before_build" src="scripts/wp8/appAndroidBeforeBuild.bat" /> - <hook type="before_build" src="scripts/wp8/appAndroidBeforeBuild.js" /> - <hook type="before_plugin_install" src="scripts/wp8/appWP8BeforePluginInstall.js" /> - ... - </platform> +```xml +<hook type="before_build" src="scripts/appBeforeBuild.bat" /> +<hook type="before_build" src="scripts/appBeforeBuild.js" /> +<hook type="before_plugin_install" src="scripts/appBeforePluginInstall.js" /> + +<platform name="android"> + <hook type="before_build" src="scripts/wp8/appAndroidBeforeBuild.bat" /> + <hook type="before_build" src="scripts/wp8/appAndroidBeforeBuild.js" /> + <hook type="before_plugin_install" src="scripts/wp8/appWP8BeforePluginInstall.js" /> + ... +</platform> - <platform name="windows"> - <hook type="before_build" src="scripts/windows/appWinBeforeBuild.bat" /> - <hook type="before_build" src="scripts/windows/appWinBeforeBuild.js" /> - <hook type="before_plugin_install" src="scripts/windows/appWinBeforePluginInstall.js" /> - ... - </platform> +<platform name="windows"> + <hook type="before_build" src="scripts/windows/appWinBeforeBuild.bat" /> + <hook type="before_build" src="scripts/windows/appWinBeforeBuild.js" /> + <hook type="before_plugin_install" src="scripts/windows/appWinBeforePluginInstall.js" /> + ... +</platform> +``` ### Plugin hooks (plugin.xml) As a plugin developer you can define hook scripts using `<hook>` elements in a `plugin.xml` like that: - <hook type="before_plugin_install" src="scripts/beforeInstall.js" /> - <hook type="after_build" src="scripts/afterBuild.js" /> +```xml +<hook type="before_plugin_install" src="scripts/beforeInstall.js" /> +<hook type="after_build" src="scripts/afterBuild.js" /> - <platform name="android"> - <hook type="before_plugin_install" src="scripts/androidBeforeInstall.js" /> - <hook type="before_build" src="scripts/androidBeforeBuild.js" /> - ... - </platform> +<platform name="android"> + <hook type="before_plugin_install" src="scripts/androidBeforeInstall.js" /> + <hook type="before_build" src="scripts/androidBeforeBuild.js" /> + ... +</platform> +``` `before_plugin_install`, `after_plugin_install`, `before_plugin_uninstall` plugin hooks will be fired exclusively for the plugin being installed/uninstalled. @@ -234,8 +238,10 @@ exclusively for the plugin being installed/uninstalled. To execute custom action when corresponding hook type is fired, use hook type as a name for a subfolder inside 'hooks' directory and place you script file here, for example: - # script file will be automatically executed after each build - hooks/after_build/after_build_custom_action.js +``` +# script file will be automatically executed after each build +hooks/after_build/after_build_custom_action.js +``` When using these hooks, they will always be run as executable files, not as loadable JavaScript modules. @@ -264,30 +270,36 @@ If there are hooks associated with `before_platform_add`, `after_platform_add`, `before_plugin_install` and `after_plugin_install` (and assuming you have one plugin installed on your project), adding a new platform will execute the hooks in the following order: - before_platform_add - before_prepare - after_prepare - before_plugin_install - after_plugin_install - after_platform_add +``` +before_platform_add + before_prepare + after_prepare + before_plugin_install + after_plugin_install +after_platform_add +``` ##### Example 2 (cordova build) If there are hooks associated with `before_prepare`, `after_prepare`, `before_compile`, `after_compile`, `before_build` and `after_build` - running a build command will execute the hooks in the following order: - before_build - before_prepare - after_prepare - before_compile - after_compile - after_build +``` +before_build + before_prepare + after_prepare + before_compile + after_compile +after_build +``` ## Script Interface ### Windows Quirks If you are working on Windows, and in case your hook (Javascript/Non-Javascript)scripts aren't bat files (which is recommended, if you want your scripts to work in non-Windows operating systems) Cordova CLI will expect a shebang line as the first line for it to know the interpreter it needs to use to launch the script. The shebang line should match the following example: - #!/usr/bin/env [name_of_interpreter_executable] +``` +#!/usr/bin/env [name_of_interpreter_executable] +``` ### Javascript @@ -376,35 +388,39 @@ size of generated .apk file for Android platform. Create blank Cordova app and add the following definition to `config.xml` to tell Cordova to run `afterBuild.js` script after each platform build. - <hook type="after_build" src="scripts/afterBuild.js" /> +```xml +<hook type="after_build" src="scripts/afterBuild.js" /> +``` Create `scripts/afterBuild.js` file and add the following implementation. We use async version of `fs.stat` method to demonstrate how async functionality could be done via hooks. - module.exports = function(ctx) { - // make sure android platform is part of build - if (ctx.opts.platforms.indexOf('android') < 0) { - return; +```javascript +module.exports = function(ctx) { + // make sure android platform is part of build + if (ctx.opts.platforms.indexOf('android') < 0) { + return; + } + var fs = ctx.requireCordovaModule('fs'), + path = ctx.requireCordovaModule('path'), + deferral = ctx.requireCordovaModule('q').defer(); + + var platformRoot = path.join(ctx.opts.projectRoot, 'platforms/android'); + var apkFileLocation = path.join(platformRoot, 'build/outputs/apk/android-debug.apk'); + + fs.stat(apkFileLocation, function(err,stats) { + if (err) { + deferral.reject('Operation failed'); + } else { + console.log('Size of ' + apkFileLocation + ' is ' + stats.size +' bytes'); + deferral.resolve(); } - var fs = ctx.requireCordovaModule('fs'), - path = ctx.requireCordovaModule('path'), - deferral = ctx.requireCordovaModule('q').defer(); + }); - var platformRoot = path.join(ctx.opts.projectRoot, 'platforms/android'); - var apkFileLocation = path.join(platformRoot, 'build/outputs/apk/android-debug.apk'); - - fs.stat(apkFileLocation, function(err,stats) { - if (err) { - deferral.reject('Operation failed'); - } else { - console.log('Size of ' + apkFileLocation + ' is ' + stats.size +' bytes'); - deferral.resolve(); - } - }); - - return deferral.promise; - }; + return deferral.promise; +}; +``` Parameter `ctx` in example above is passed by Cordova and represents execution context such as script full path, target platform, command-line arguments, etc and @@ -413,11 +429,13 @@ for more details. You can now add android platform and execute build. - cordova platform add android - .. - cordova build - .. - Size of path\to\app\platforms\android\build\outputs\apk\android-debug.apk is 1821193 bytes +``` +cordova platform add android +.. +cordova build +.. +Size of path\to\app\platforms\android\build\outputs\apk\android-debug.apk is 1821193 bytes +``` More good usage examples could be found in [Three Hooks Your Cordova Phone Gap Project needs][Devgirl_Hooks_Link] http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a65e8109/www/docs/en/dev/guide/appdev/whitelist/index.md ---------------------------------------------------------------------- diff --git a/www/docs/en/dev/guide/appdev/whitelist/index.md b/www/docs/en/dev/guide/appdev/whitelist/index.md index 1b4b4b4..601645e 100644 --- a/www/docs/en/dev/guide/appdev/whitelist/index.md +++ b/www/docs/en/dev/guide/appdev/whitelist/index.md @@ -42,31 +42,41 @@ enable network access to specific domains. For projects that rely on the CLI workflow described in [The Command-Line Interface](../../cli/index.html), this file is located in the project's top-level directory. Otherwise for platform-specific development paths, locations are listed in the -sections below. +sections below. The following examples demonstrate `<access>` whitelist syntax: * Access to [google.com][2]: - <access origin="http://google.com" /> + ```xml + <access origin="http://google.com" /> + ``` * Access to the secure [google.com][3] (`https://`): - <access origin="https://google.com" /> + ```xml + <access origin="https://google.com" /> + ``` * Access to the subdomain [maps.google.com][4]: - <access origin="http://maps.google.com" /> + ```xml + <access origin="http://maps.google.com" /> + ``` * Access to all the subdomains on [google.com][2], for example [mail.google.com][5] and [docs.google.com][6]: - <access origin="http://*.google.com" /> + ```xml + <access origin="http://*.google.com" /> + ``` * Access to _all_ domains, for example, [google.com][2] and [developer.mozilla.org][7]: - <access origin="*" /> + ```xml + <access origin="*" /> + ``` This is the default value for newly created CLI projects. @@ -88,7 +98,7 @@ prior to 4.0.0, see older versions of this documentation. ## iOS Whitelisting -`Cordova-ios` version 4.0 and greater does **not** require the [cordova-plugin-whitelist][wlp] plugin to be installed, however it's configuration details apply to iOS too. The `<allow-intent>` and `<allow-navigation>` tags are _new_ for cordova-ios 4.x and greater, see the [cordova-plugin-whitelist][wlp] documentation for details on the usage of these tags. +`Cordova-ios` version 4.0 and greater does **not** require the [cordova-plugin-whitelist][wlp] plugin to be installed, however it's configuration details apply to iOS too. The `<allow-intent>` and `<allow-navigation>` tags are _new_ for cordova-ios 4.x and greater, see the [cordova-plugin-whitelist][wlp] documentation for details on the usage of these tags. For cordova-ios versions prior to 4.0.0, see the older versions of this documentation. @@ -96,8 +106,8 @@ For cordova-ios versions prior to 4.0.0, see the older versions of this document The `<access>` and `<allow-navigation>` tags support these two new attributes below, which have their equivalents in ATS: - 1. minimum-tls-version (String, defaults to 'TLSv1.2') - 2. requires-forward-secrecy (Boolean, defaults to 'true') +1. minimum-tls-version (String, defaults to 'TLSv1.2') +2. requires-forward-secrecy (Boolean, defaults to 'true') See the [ATS Technote](https://developer.apple.com/library/prerelease/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW33) for details. @@ -113,26 +123,27 @@ ways: Alternatively, all web security may be disabled using the `WebSecurity` preference described in BlackBerry Configuration: - <preference name="websecurity" value="disable" /> + ```xml + <preference name="websecurity" value="disable" /> + ``` * As an alternative to setting `*.domain`, set an additional `subdomains` attribute to `true`. It should be set to `false` by - default. For example, the following allows access to `google.com`, - `maps.google.com`, and `docs.google.com`: + default. - <access origin="http://google.com" subdomains="true" /> + ```xml + <!-- Narrows access to google.com --> + <access origin="http://google.com" subdomains="false" /> - The following narrows access to `google.com`: + <!-- Allows access to maps.google.com and docs.google.com --> + <access origin="http://google.com" subdomains="true" /> - <access origin="http://google.com" subdomains="false" /> + <!-- Allows access to all domains, including the local `file://` protocol --> + <access origin="*" subdomains="true" /> + ``` - Specify access to all domains, including the local `file://` - protocol: - - <access origin="*" subdomains="true" /> - -(For more information on support, see BlackBerry's documentation on the -[access element][8].) +For more information on support, see BlackBerry's documentation on the +[access element][8]. ## Windows Phone Whitelisting http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a65e8109/www/docs/en/dev/guide/cli/index.md ---------------------------------------------------------------------- diff --git a/www/docs/en/dev/guide/cli/index.md b/www/docs/en/dev/guide/cli/index.md index 1b9e432..f75bb7f 100644 --- a/www/docs/en/dev/guide/cli/index.md +++ b/www/docs/en/dev/guide/cli/index.md @@ -29,24 +29,25 @@ interface (CLI). For detailed reference on Cordova command-line, review the [CLI ## Installing the Cordova CLI -The Cordova command-line tool is distributed as an npm package. +The Cordova command-line tool is distributed as an npm package. To install the `cordova` command-line tool, follow these steps: 1. Download and install [Node.js](https://nodejs.org/en/download/). On installation you should be able to invoke `node` and `npm` on your - command line. + command line. 1. (Optional) Download and install a [git client](http://git-scm.com/downloads), if you don't already have one. Following installation, you should be able to invoke `git` - on your command line. The CLI uses it to download assets when they are referenced using a url to a git repo. + on your command line. The CLI uses it to download assets when they are referenced using a url to a git repo. 1. Install the `cordova` module using `npm` utility of Node.js. The `cordova` module will automatically be downloaded by the `npm` utility. * on OS X and Linux: - - $ sudo npm install -g cordova + ```bash + $ sudo npm install -g cordova + ``` On OS X and Linux, prefixing the `npm` command with `sudo` may be necessary to install this development utility in @@ -58,8 +59,9 @@ To install the `cordova` command-line tool, follow these steps: available on using `npm` without `sudo`, if you desire to do that. * on Windows: - - C:\>npm install -g cordova + ``` + C:\>npm install -g cordova + ``` The `-g` flag above tells `npm` to install `cordova` globally. Otherwise it will be installed in the `node_modules` subdirectory of the current @@ -73,9 +75,11 @@ To install the `cordova` command-line tool, follow these steps: Go to the directory where you maintain your source code, and create a cordova project: - $ cordova create hello com.example.hello HelloWorld +```bash +$ cordova create hello com.example.hello HelloWorld +``` -This creates the required directory structure for your cordova app. By default, the `cordova create` script generates a skeletal web-based application whose home page is the project's `www/index.html` file. +This creates the required directory structure for your cordova app. By default, the `cordova create` script generates a skeletal web-based application whose home page is the project's `www/index.html` file. ###See Also - [Cordova create command reference documentation](../../cordova-cli/index.html#cordova-create-command) @@ -86,20 +90,26 @@ This creates the required directory structure for your cordova app. By default, All subsequent commands need to be run within the project's directory, or any subdirectories: - $ cd hello +```bash +$ cd hello +``` Add the platforms that you want to target your app. We will add the 'ios' and 'android' platform and ensure they get saved to `config.xml`: - $ cordova platform add ios --save - $ cordova platform add android --save +```bash +$ cordova platform add ios --save +$ cordova platform add android --save +``` To check your current set of platforms: - $ cordova platform ls +```bash +$ cordova platform ls +``` Running commands to add or remove platforms affects the contents of the project's _platforms_ directory, where each specified platform -appears as a subdirectory. +appears as a subdirectory. > Note: When using the CLI to build your application, you should _not_ edit any files in the `/platforms/` directory. The files @@ -115,17 +125,17 @@ To build and run apps, you need to install SDKs for each platform you wish to ta To check if you satisfy requirements for building the platform: ``` - $ cordova requirements - Requirements check results for android: - Java JDK: installed . - Android SDK: installed - Android target: installed android-19,android-21,android-22,android-23,Google Inc.:Google APIs:19,Google Inc.:Google APIs (x86 System Image):19,Google Inc.:Google APIs:23 - Gradle: installed - - Requirements check results for ios: - Apple OS X: not installed - Cordova tooling for iOS requires Apple OS X - Error: Some of requirements check failed +$ cordova requirements +Requirements check results for android: +Java JDK: installed . +Android SDK: installed +Android target: installed android-19,android-21,android-22,android-23,Google Inc.:Google APIs:19,Google Inc.:Google APIs (x86 System Image):19,Google Inc.:Google APIs:23 +Gradle: installed + +Requirements check results for ios: +Apple OS X: not installed +Cordova tooling for iOS requires Apple OS X +Error: Some of requirements check failed ``` ###See Also @@ -135,16 +145,20 @@ To check if you satisfy requirements for building the platform: ## Build the App -By default, `cordova create` script generates a skeletal web-based application whose start page is the project's `www/index.html` file. Any -initialization should be specified as part of the [deviceready][DeviceReadyEvent] event handler defined in `www/js/index.js`. +By default, `cordova create` script generates a skeletal web-based application whose start page is the project's `www/index.html` file. Any +initialization should be specified as part of the [deviceready][DeviceReadyEvent] event handler defined in `www/js/index.js`. Run the following command to build the project for _all_ platforms: - $ cordova build +```bash +$ cordova build +``` You can optionally limit the scope of each build to specific platforms - 'ios' in this case: - $ cordova build ios +```bash +$ cordova build ios +``` ###See Also - [Cordova build command reference documentation](../../dev/cordova-cli/index.html#cordova-build-command) @@ -157,8 +171,9 @@ screen and see how it interacts with many platform features. Run a command such as the following to rebuild the app and view it within a specific platform's emulator: - $ cordova emulate android - +```bash +$ cordova emulate android +``` ![]({{ site.baseurl }}/static/img/guide/cli/android_emulate_init.png) @@ -171,10 +186,12 @@ launch from the home screen: Alternately, you can plug the handset into your computer and test the app directly: - $ cordova run android +```bash +$ cordova run android +``` Before running this command, you need to set up the device for -testing, following procedures that vary for each platform. +testing, following procedures that vary for each platform. ###See Also - [Setting up Android emulator](../../guide/platforms/android/index.html#setting-up-an-emulator) @@ -183,20 +200,24 @@ testing, following procedures that vary for each platform. ## Add Plugins -You can modify the default generated app to take advantage of standard web technologies, +You can modify the default generated app to take advantage of standard web technologies, but for the app to access device-level features, you need to add plugins. -A _plugin_ exposes a Javascript API for native SDK functionality. Plugins are typically hosted on +A _plugin_ exposes a Javascript API for native SDK functionality. Plugins are typically hosted on npm and you can search for them on the [plugin search page](/plugins/). Some key APIs are provided by the Apache Cordova open source project and these are referred to as [Core Plugin APIs]. You can also use the CLI to launch the search page: - $ cordova plugin search camera - +```bash +$ cordova plugin search camera +``` + To add the camera plugin, we will specify the npm package name for the camera plugin: - $ cordova plugin add cordova-plugin-camera - Fetching plugin "cordova-plugin-camera@~2.1.0" via npm - Installing "cordova-plugin-camera" for android - Installing "cordova-plugin-camera" for ios +``` +$ cordova plugin add cordova-plugin-camera +Fetching plugin "cordova-plugin-camera@~2.1.0" via npm +Installing "cordova-plugin-camera" for android +Installing "cordova-plugin-camera" for ios +``` Plugins can also be added using a directory or a git repo. @@ -209,9 +230,11 @@ add plugins separately for each platform. (For more information, see Use `plugin ls` (or `plugin list`, or `plugin` by itself) to view currently installed plugins. Each displays by its identifier: - $ cordova plugin ls - cordova-plugin-camera 2.1.0 "Camera" - cordova-plugin-whitelist 1.2.1 "Whitelist" +``` +$ cordova plugin ls +cordova-plugin-camera 2.1.0 "Camera" +cordova-plugin-whitelist 1.2.1 "Whitelist" +``` ###See Also - [Cordova plugin command reference documentation](../../cordova-cli/index.html#cordova-plugin-command) @@ -236,9 +259,9 @@ font size for Android devices: * Edit the `www/index.html` file, adding a link to an additional CSS file, `overrides.css` in this case: -```html + ```html <link rel="stylesheet" type="text/css" href="css/overrides.css" /> -``` + ``` * Optionally create an empty `www/css/overrides.css` file, which would apply for all non-Android builds, preventing a missing-file error. @@ -248,9 +271,9 @@ font size for Android devices: 12-point default font size specified within `www/css/index.css`, for example: -```css + ```css body { font-size:14px; } -``` + ``` When you rebuild the project, the Android version features the custom font size, while others remain unchanged. @@ -268,21 +291,29 @@ button. After installing the `cordova` utility, you can always update it to the latest version by running the following command: - $ sudo npm update -g cordova +```bash +$ sudo npm update -g cordova +``` Use this syntax to install a specific version: - $ sudo npm install -g cordova@3.1.0-0.2.0 +```bash +$ sudo npm install -g cordova@3.1.0-0.2.0 +``` Run `cordova -v` to see which version is currently running. To find the latest released cordova version, you can run: - $ npm info cordova version +```bash +$ npm info cordova version +``` To update platform that you're targeting: - $ cordova platform update android --save - $ cordova platform update ios --save - ...etc. +```bash +$ cordova platform update android --save +$ cordova platform update ios --save +...etc. +``` [DeviceReadyEvent]: ../../cordova/events/events.html#deviceready [BackButtonEvent]: ../../cordova/events/events.html#backbutton http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a65e8109/www/docs/en/dev/guide/hybrid/plugins/index.md ---------------------------------------------------------------------- diff --git a/www/docs/en/dev/guide/hybrid/plugins/index.md b/www/docs/en/dev/guide/hybrid/plugins/index.md index ec05499..7459fbc 100644 --- a/www/docs/en/dev/guide/hybrid/plugins/index.md +++ b/www/docs/en/dev/guide/hybrid/plugins/index.md @@ -107,7 +107,7 @@ correctly for each platform. Install `plugman` with the following You need an valid app source directory, such as the top-level `www` directory included in a default CLI-generated project as described in -[Create your first app](../../cli/index.html) guide. +[Create your first app](../../cli/index.html) guide. Then run a command such as the following to test whether iOS dependencies load properly: @@ -126,7 +126,7 @@ plugin's JavaScript however you like, but you need to call `cordova.exec` to communicate with the native platform, using the following syntax: -```js +```javascript cordova.exec(function(winParam) {}, function(error) {}, "service", @@ -160,7 +160,7 @@ Here is how each parameter works: This example shows one way to implement the plugin's JavaScript interface: -```js +```javascript window.echo = function(str, callback) { cordova.exec(callback, function(err) { callback('Nothing to echo.'); @@ -171,7 +171,7 @@ interface: In this example, the plugin attaches itself to the `window` object as the `echo` function, which plugin users would call as follows: -```js +```javascript window.echo("echome", function(echoValue) { alert(echoValue == "echome"); // should alert true. }); @@ -202,29 +202,35 @@ listed below, and each builds on the simple Echo Plugin example above: ## Publishing Plugins -You can publish your plugin to any `npmjs`-based registry, but the recommended one is the [NPM registry](https://www.npmjs.com). Other developers can install your plugin automatically using either `plugman` or the Cordova CLI. +You can publish your plugin to any `npmjs`-based registry, but the recommended one is the [NPM registry](https://www.npmjs.com). Other developers can install your plugin automatically using either `plugman` or the Cordova CLI. To publish a plugin to NPM registry you need to follow steps below: * install the `plugman` CLI: - - $ npm install -g plugman - + + ```bash + $ npm install -g plugman + ``` + * create `package.json` file for your plugin: - $ plugman createpackagejson /path/to/your/plugin + ```bash + $ plugman createpackagejson /path/to/your/plugin + ``` * publish it: - $ npm adduser # that is if you don't have an account yet - $ npm publish /path/to/your/plugin + ```bash + $ npm adduser # that is if you don't have an account yet + $ npm publish /path/to/your/plugin + ``` For more details on npm usage refer to [publishing a npm package](https://docs.npmjs.com/getting-started/publishing-npm-packages) on the NPM documentation site. ## Integrating with Plugin Search -To surface the plugin in [Cordova Plugin Search](/plugins/), add the `ecosystem:cordova` keyword to the `package.json` file of your plugin before publishing. +To surface the plugin in [Cordova Plugin Search](/plugins/), add the `ecosystem:cordova` keyword to the `package.json` file of your plugin before publishing. -To indicate support for a particular platform add a keyword with the `<platformName>` as `**cordova-<platformName>**` to the list of keywords in package.json. +To indicate support for a particular platform add a keyword with the `<platformName>` as `**cordova-<platformName>**` to the list of keywords in package.json. Plugman's `createpackagejson` command does this for you, but if you did not use it to generate your `package.json`, you should manually edit it as shown below. For example, for a plugin that supports android, iOS & Windows, the keywords in package.json should include: http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a65e8109/www/docs/en/dev/guide/platforms/android/index.md ---------------------------------------------------------------------- diff --git a/www/docs/en/dev/guide/platforms/android/index.md b/www/docs/en/dev/guide/platforms/android/index.md index de9ac06..3580e04 100644 --- a/www/docs/en/dev/guide/platforms/android/index.md +++ b/www/docs/en/dev/guide/platforms/android/index.md @@ -112,16 +112,22 @@ On a Mac or Linux, you can use a text editor to create or modify the `~/.bash_profile` file. To set an environment variable, add a line that uses `export` like so (substitute the path with your local installation): - export ANDROID_HOME=/Development/android-sdk/ +```bash +export ANDROID_HOME=/Development/android-sdk/ +``` To update your `PATH`, add a line resembling the following (substitute the paths with your local Android SDK installation's location): - export PATH=${PATH}:/Development/android-sdk/platform-tools:/Development/android-sdk/tools +```bash +export PATH=${PATH}:/Development/android-sdk/platform-tools:/Development/android-sdk/tools +``` Reload your terminal to see this change reflected or run the following command: - $ source ~/.bash_profile +```bash +$ source ~/.bash_profile +``` #### Windows @@ -164,7 +170,9 @@ for configuring the emulator and setting up hardware acceleration. Once your AVD is configured correctly, you should be able to see it by running this command from within a Cordova project: - $ cordova run --list +```bash +$ cordova run --list +``` ### Configuring Gradle @@ -192,14 +200,14 @@ You can set these properties in one of four ways: 1. By setting environment variables like so: - ``` + ```bash $ export ORG_GRADLE_PROJECT_cdvMinSdkVersion=20 $ cordova build android - ``` + ``` 2. By using the `--gradleArg` flag in your Cordova `build` or `run` commands: - ``` + ```bash $ cordova run android -- --gradleArg=-PcdvMinSdkVersion=20 ``` @@ -215,8 +223,8 @@ You can set these properties in one of four ways: 4. By extending `build.gradle` via a [`build-extras.gradle` file](#extending-build-gradle) and setting the property like so: - ``` - # In <your-project>/platforms/android/build-extras.gradle + ```groovy + // In <your-project>/platforms/android/build-extras.gradle ext.cdvMinSdkVersion = 20 ``` @@ -238,19 +246,22 @@ recommended that you copy it over via a script attached to the `before_build` Here's an example: - # Example build-extras.gradle - # This file is included at the beginning of `build.gradle` - ext.cdvDebugSigningPropertiesFile = '../../android-debug-keys.properties' +```groovy +// Example build-extras.gradle +// This file is included at the beginning of `build.gradle` +ext.cdvDebugSigningPropertiesFile = '../../android-debug-keys.properties' - # When set, this function allows code to run at the end of `build.gradle` - ext.postBuildExtras = { - android.buildTypes.debug.applicationIdSuffix = '.debug' - } +// When set, this function allows code to run at the end of `build.gradle` +ext.postBuildExtras = { + android.buildTypes.debug.applicationIdSuffix = '.debug' +} +``` Note that plugins can also include `build-extras.gradle` files via: - <framework src="some.gradle" custom="true" type="gradleReference" /> - +```xml +<framework src="some.gradle" custom="true" type="gradleReference" /> +``` ### Setting the Version Code @@ -309,24 +320,26 @@ Alternatively, you could specify them in a build configuration file (`build.json using the `--buildConfig` argument to the same commands. Here's a sample of a build configuration file: - { - "android": { - "debug": { - "keystore": "../android.keystore", - "storePassword": "android", - "alias": "mykey1", - "password" : "password", - "keystoreType": "" - }, - "release": { - "keystore": "../android.keystore", - "storePassword": "", - "alias": "mykey2", - "password" : "password", - "keystoreType": "" - } - } - } +```json +{ + "android": { + "debug": { + "keystore": "../android.keystore", + "storePassword": "android", + "alias": "mykey1", + "password" : "password", + "keystoreType": "" + }, + "release": { + "keystore": "../android.keystore", + "storePassword": "", + "alias": "mykey2", + "password" : "password", + "keystoreType": "" + } + } +} +``` For release signing, passwords can be excluded and the build system will issue a prompt asking for the password. @@ -422,7 +435,9 @@ To get started, either download the cordova-android package from To create a project using this package, run the `create` script in the `bin` folder: - $ cordova-android/bin/create ... +```bash +$ cordova-android/bin/create ... +``` The created project will have a folder named `cordova` inside that contains scripts for the project-specific Cordova commands (e.g. `run`, `build`, etc.). @@ -564,7 +579,7 @@ external activity made prior to the activity being destroyed. The payload for the `resume` event adheres to the following format: -``` +```text { action: "resume", pendingResult: { http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a65e8109/www/docs/en/dev/guide/platforms/android/plugin.md ---------------------------------------------------------------------- diff --git a/www/docs/en/dev/guide/platforms/android/plugin.md b/www/docs/en/dev/guide/platforms/android/plugin.md index 200172a..719c102 100644 --- a/www/docs/en/dev/guide/platforms/android/plugin.md +++ b/www/docs/en/dev/guide/platforms/android/plugin.md @@ -446,7 +446,7 @@ Instead, this replacement `CallbackContext` will return the result as part of th [`resume`][event-resume] event that is fired when the application resumes. The payload of the [`resume`][event-resume] event follows this structure: -```json +```text { action: "resume", pendingResult: { http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a65e8109/www/docs/en/dev/guide/platforms/android/upgrade.md ---------------------------------------------------------------------- diff --git a/www/docs/en/dev/guide/platforms/android/upgrade.md b/www/docs/en/dev/guide/platforms/android/upgrade.md index d6dd685..c5c2865 100644 --- a/www/docs/en/dev/guide/platforms/android/upgrade.md +++ b/www/docs/en/dev/guide/platforms/android/upgrade.md @@ -32,7 +32,7 @@ version of the CLI. The best way to upgrade to 5.X.X is to simply remove the Android platform from your project and re-add it with the new version. For example, -``` +```bash cordova platform remove android cordova platform add android@5.X.X ``` @@ -44,7 +44,9 @@ discouraged). Alternatively, you may attempt to use the platform update script. For non-CLI projects, run: - bin/update path/to/project +`` +bin/update path/to/project +`` For CLI projects: @@ -78,7 +80,7 @@ For non-core plugins, you can verify if a plugin requests a `plugin.xml` file. If the plugin uses Android permissions, you will see entries in `plugin.xml` that declare them. For example: -``` +```xml <uses-permission android:name="android.permission.PERMISSION_NAME" /> ``` @@ -86,7 +88,7 @@ Where `PERMISSION_NAME` is replaced with the name of an Android permission. The `plugin.xml` file can be found in the plugin's folder in your Cordova project (e.g. `plugins/example-plugin/plugin.xml`). Consult the documentation of any plugins using dangerous permissions to determine what steps need to be taken -to ensure **cordova-android 5.0.0+** compatibility. +to ensure **cordova-android 5.0.0+** compatibility. ## Upgrading to 4.0.0 @@ -95,7 +97,9 @@ changes in 4.0.0. First, the common upgrade steps are needed as below. For non-CLI projects, run: - bin/update path/to/project +``` +bin/update path/to/project +``` For CLI projects: @@ -127,7 +131,9 @@ By default, your app will continue to use the system WebView provided by the device. If you wish to use the Crosswalk WebView instead, simply add the Crosswalk plugin: - cordova plugin add cordova-plugin-crosswalk-webview +```bash +cordova plugin add cordova-plugin-crosswalk-webview +``` Upon adding the plugin, your app will get the Crosswalk WebView installed and configured correctly. @@ -137,13 +143,17 @@ If your app makes use of a splash screen, that functionality has been moved to a plugin. The configuration options for splash screens are unchanged. The only upgrade step required is to add the plugin: - cordova plugin add cordova-plugin-splashscreen +```bash +cordova plugin add cordova-plugin-splashscreen +``` ## Upgrading to 3.7.1 from 3.6.0 For non-CLI projects, run: - bin/update path/to/project +``` +bin/update path/to/project +``` For CLI projects: http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a65e8109/www/docs/en/dev/guide/platforms/android/webview.md ---------------------------------------------------------------------- diff --git a/www/docs/en/dev/guide/platforms/android/webview.md b/www/docs/en/dev/guide/platforms/android/webview.md index 24bcf12..b07ac6a 100644 --- a/www/docs/en/dev/guide/platforms/android/webview.md +++ b/www/docs/en/dev/guide/platforms/android/webview.md @@ -91,16 +91,16 @@ legacy `CordovaActivity` component that pre-dates the 1.9 release. public void startActivityForResult(CordovaPlugin command, Intent intent, int requestCode) { this.activityResultCallback = command; this.activityResultKeepRunning = this.keepRunning; - + // If multitasking turned on, then disable it for activities that return results if (command != null) { this.keepRunning = false; } - + // Start activity super.startActivityForResult(intent, requestCode); - } - + } + @Override /** * Called when an activity you launched exits, giving you the requestCode you started it with, http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a65e8109/www/docs/en/dev/guide/platforms/blackberry/upgrade.md ---------------------------------------------------------------------- diff --git a/www/docs/en/dev/guide/platforms/blackberry/upgrade.md b/www/docs/en/dev/guide/platforms/blackberry/upgrade.md index c608bb8..9d0bab2 100644 --- a/www/docs/en/dev/guide/platforms/blackberry/upgrade.md +++ b/www/docs/en/dev/guide/platforms/blackberry/upgrade.md @@ -338,14 +338,16 @@ Updating just the `www` directory: 6. Update the `www/plugins.xml` file. Two plugins changed their namespace/service label. Change the old entries for the Capture and Contact plugins from: - - <plugin name="Capture" value="org.apache.cordova.media.MediaCapture"/> - <plugin name="Contact" value="org.apache.cordova.pim.Contact"/> + ```xml + <plugin name="Capture" value="org.apache.cordova.media.MediaCapture"/> + <plugin name="Contact" value="org.apache.cordova.pim.Contact"/> + ``` To: - - <plugin name="Capture" value="org.apache.cordova.capture.MediaCapture"/> - <plugin name="Contacts" value="org.apache.cordova.pim.Contact"/> + ```xml + <plugin name="Capture" value="org.apache.cordova.capture.MediaCapture"/> + <plugin name="Contacts" value="org.apache.cordova.pim.Contact"/> + ``` Updating the sample directory (ie, updating using the ant tools): @@ -366,14 +368,16 @@ Updating the sample directory (ie, updating using the ant tools): 8. Open the `www` directory and update the `plugins.xml` file. Two plugins changed their namespace/service label. Change the old entries for the Capture and Contact plugins from: - - <plugin name="Capture" value="org.apache.cordova.media.MediaCapture"/> - <plugin name="Contact" value="org.apache.cordova.pim.Contact"/> + ```xml + <plugin name="Capture" value="org.apache.cordova.media.MediaCapture"/> + <plugin name="Contact" value="org.apache.cordova.pim.Contact"/> + ``` To: - - <plugin name="Capture" value="org.apache.cordova.capture.MediaCapture"/> - <plugin name="Contacts" value="org.apache.cordova.pim.Contact"/> + ```xml + <plugin name="Capture" value="org.apache.cordova.capture.MediaCapture"/> + <plugin name="Contacts" value="org.apache.cordova.pim.Contact"/> + ``` - To upgrade to 1.8.0, please go from 1.7.0 @@ -395,14 +399,16 @@ Updating just the `www` directory: 6. Update the `www/plugins.xml` file. Two plugins changed their namespace/service label. Change the old entries for the Capture and Contact plugins from: - - <plugin name="Capture" value="org.apache.cordova.media.MediaCapture"/> - <plugin name="Contact" value="org.apache.cordova.pim.Contact"/> + ```xml + <plugin name="Capture" value="org.apache.cordova.media.MediaCapture"/> + <plugin name="Contact" value="org.apache.cordova.pim.Contact"/> + ``` To: - - <plugin name="Capture" value="org.apache.cordova.capture.MediaCapture"/> - <plugin name="Contacts" value="org.apache.cordova.pim.Contact"/> + ```xml + <plugin name="Capture" value="org.apache.cordova.capture.MediaCapture"/> + <plugin name="Contacts" value="org.apache.cordova.pim.Contact"/> + ``` Updating the sample directory (ie, updating using the ant tools): @@ -423,12 +429,13 @@ Updating the sample directory (ie, updating using the ant tools): 8. Open the `www` directory and update the `plugins.xml` file. Two plugins changed their namespace/service label. Change the old entries for the Capture and Contact plugins from: - - <plugin name="Capture" value="org.apache.cordova.media.MediaCapture"/> - <plugin name="Contact" value="org.apache.cordova.pim.Contact"/> + ```xml + <plugin name="Capture" value="org.apache.cordova.media.MediaCapture"/> + <plugin name="Contact" value="org.apache.cordova.pim.Contact"/> + ``` To: - - <plugin name="Capture" value="org.apache.cordova.capture.MediaCapture"/> - <plugin name="Contacts" value="org.apache.cordova.pim.Contact"/> - + ```xml + <plugin name="Capture" value="org.apache.cordova.capture.MediaCapture"/> + <plugin name="Contacts" value="org.apache.cordova.pim.Contact"/> + ``` http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/a65e8109/www/docs/en/dev/guide/platforms/blackberry10/config.md ---------------------------------------------------------------------- diff --git a/www/docs/en/dev/guide/platforms/blackberry10/config.md b/www/docs/en/dev/guide/platforms/blackberry10/config.md index 9ffa87f..ce2d5c3 100644 --- a/www/docs/en/dev/guide/platforms/blackberry10/config.md +++ b/www/docs/en/dev/guide/platforms/blackberry10/config.md @@ -32,15 +32,17 @@ File](config_ref_index.md.html#The%20config.xml%20File) for information on globa to display resources accessed via `window.open()` or by specifying a `_blank` anchor target. Specify `disable` to override this default behavior. - - <preference name="ChildBrowser" value="disable"/> + ```xml + <preference name="ChildBrowser" value="disable"/> + ``` - `PopupBlocker` (`enable` or the default `disable`): Enables the popup blocker, which prevents calls to `window.open()`. By default, popups display in a child browser window. Setting the preference to `enable` prevents it from displaying at all. - - <preference name="PopupBlocker" value="enable"/> + ```xml + <preference name="PopupBlocker" value="enable"/> + ``` - `WebSecurity` (`disable` or the default `enable`): Set to `disable` to override web security settings, allowing access to remote content @@ -49,6 +51,6 @@ File](config_ref_index.md.html#The%20config.xml%20File) for information on globa distribution. For the released app, all URIs should be known and whitelisted using the `<access>` element, described in the Domain [Whitelist Guide](../../appdev/whitelist/index.html). - - <preference name="WebSecurity" value="disable"/> - + ```xml + <preference name="WebSecurity" value="disable"/> + ``` --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org