This commit is contained in:
Ibrahim Hadeed 2016-04-25 05:32:58 -04:00
commit 9c78837113
9 changed files with 160 additions and 14 deletions

View File

@ -118,7 +118,7 @@ docType: "<$ doc.docType $>"
<@- if doc.decorators @> <@- if doc.decorators @>
<@ for prop in doc.decorators[0].argumentInfo @> <@ for prop in doc.decorators[0].argumentInfo @>
<pre><code>$ <@ if prop.install @><$ prop.install $><@ else @>cordova plugin add <$ prop.plugin $><@ endif -@></code></pre> <pre><code>$ <@ if prop.install @><$ prop.install $><@ else @>ionic plugin add <$ prop.plugin $><@ endif -@></code></pre>
<p>Repo: <p>Repo:
<a href="<$ prop.repo $>"> <a href="<$ prop.repo $>">
<$ prop.repo $> <$ prop.repo $>

View File

@ -25,11 +25,13 @@ import {DeviceMotion} from './plugins/devicemotion';
import {DeviceOrientation} from './plugins/deviceorientation'; import {DeviceOrientation} from './plugins/deviceorientation';
import {Diagnostic} from './plugins/diagnostic'; import {Diagnostic} from './plugins/diagnostic';
import {Dialogs} from './plugins/dialogs'; import {Dialogs} from './plugins/dialogs';
import {EmailComposer} from './plugins/emailcomposer';
import {Facebook} from './plugins/facebook'; import {Facebook} from './plugins/facebook';
import {File} from './plugins/file'; import {File} from './plugins/file';
import {Flashlight} from './plugins/flashlight'; import {Flashlight} from './plugins/flashlight';
import {Geolocation} from './plugins/geolocation'; import {Geolocation} from './plugins/geolocation';
import {Globalization} from './plugins/globalization'; import {Globalization} from './plugins/globalization';
import {GoogleAnalytics} from './plugins/googleanalytics';
import {Hotspot} from './plugins/hotspot'; import {Hotspot} from './plugins/hotspot';
import {ImagePicker} from './plugins/imagepicker'; import {ImagePicker} from './plugins/imagepicker';
import {InAppBrowser} from './plugins/inappbrowser'; import {InAppBrowser} from './plugins/inappbrowser';
@ -46,6 +48,7 @@ import {StatusBar} from './plugins/statusbar';
import {Toast} from './plugins/toast'; import {Toast} from './plugins/toast';
import {TouchID} from './plugins/touchid'; import {TouchID} from './plugins/touchid';
import {Vibration} from './plugins/vibration'; import {Vibration} from './plugins/vibration';
import {WebIntent} from './plugins/webintent';
export { export {
ActionSheet, ActionSheet,
@ -69,11 +72,13 @@ export {
DeviceOrientation, DeviceOrientation,
Dialogs, Dialogs,
Diagnostic, Diagnostic,
EmailComposer,
Facebook, Facebook,
File, File,
Flashlight, Flashlight,
Geolocation, Geolocation,
Globalization, Globalization,
GoogleAnalytics,
Hotspot, Hotspot,
ImagePicker, ImagePicker,
InAppBrowser, InAppBrowser,
@ -89,7 +94,8 @@ export {
StatusBar, StatusBar,
Toast, Toast,
TouchID, TouchID,
Vibration Vibration,
WebIntent
} }
export * from './plugins/plugin'; export * from './plugins/plugin';
@ -117,11 +123,13 @@ window['IonicNative'] = {
DeviceOrientation: DeviceOrientation, DeviceOrientation: DeviceOrientation,
Dialogs: Dialogs, Dialogs: Dialogs,
Diagnostic: Diagnostic, Diagnostic: Diagnostic,
EmailComposer: EmailComposer,
Facebook: Facebook, Facebook: Facebook,
File: File, File: File,
Flashlight: Flashlight, Flashlight: Flashlight,
Geolocation: Geolocation, Geolocation: Geolocation,
Globalization: Globalization, Globalization: Globalization,
GoogleAnalytics: GoogleAnalytics,
Hotspot: Hotspot, Hotspot: Hotspot,
ImagePicker: ImagePicker, ImagePicker: ImagePicker,
InAppBrowser: InAppBrowser, InAppBrowser: InAppBrowser,
@ -137,7 +145,8 @@ window['IonicNative'] = {
StatusBar: StatusBar, StatusBar: StatusBar,
Toast: Toast, Toast: Toast,
TouchID: TouchID, TouchID: TouchID,
Vibration: Vibration Vibration: Vibration,
WebIntent: WebIntent
}; };
// To help developers using cordova, we listen for the device ready event and // To help developers using cordova, we listen for the device ready event and

View File

@ -38,10 +38,10 @@ export class ActionSheet {
* |-------------------------------|-----------|----------------------------------------------| * |-------------------------------|-----------|----------------------------------------------|
* | title |`string` | The title for the actionsheet | * | title |`string` | The title for the actionsheet |
* | buttonLabels |`string[]` | the labels for the buttons. Uses the index x | * | buttonLabels |`string[]` | the labels for the buttons. Uses the index x |
* | androidTheme |`number` | Theme to bue used on Android | * | androidTheme |`number` | Theme to be used on Android |
* | androidEnableCancelButton |`boolean` | Enable a cancel on Android | * | androidEnableCancelButton |`boolean` | Enable a cancel on Android |
* | winphoneEnableCancelButton |`boolean` | Enable a cancel on Android | * | winphoneEnableCancelButton |`boolean` | Enable a cancel on Windows Phone |
* | addCancelButtonWithLabel |`string` | Add a cancle button with text | * | addCancelButtonWithLabel |`string` | Add a cancel button with text |
* | addDestructiveButtonWithLabel |`string` | Add a destructive button with text | * | addDestructiveButtonWithLabel |`string` | Add a destructive button with text |
* | position |`number[]` | On an iPad, set the X,Y position | * | position |`number[]` | On an iPad, set the X,Y position |
* *

View File

@ -37,7 +37,7 @@ export class BatteryStatus {
*/ */
@Cordova({ @Cordova({
eventObservable: true, eventObservable: true,
event: 'batterylevel' event: 'batterystatus'
}) })
static onChange () : Observable<StatusObject> {return} static onChange () : Observable<StatusObject> {return}

View File

@ -52,7 +52,7 @@ export interface accelerometerOptions {
* ); * );
* *
* // Watch device acceleration * // Watch device acceleration
* var subscription = DeviceMotion.watchPosition().subscribe(acceleration => { * var subscription = DeviceMotion.watchAcceleration().subscribe(acceleration => {
* console.log(acceleration); * console.log(acceleration);
* }); * });
* *

View File

@ -0,0 +1,99 @@
import {Plugin, Cordova} from './plugin';
declare var cordova;
/**
* Email object for Opening Email Composer
*/
export interface email {
app?: string,
to: string | Array<string>,
cc: string | Array<string>,
bcc: string | Array<string>,
attachments: Array<any>,
subject: string,
body: string,
isHtml: boolean
}
/**
* @name Email Composer
* @description
*
* Requires Cordova plugin: cordova-plugin-email-composer. For more info, please see the [Email Composer plugin docs](https://github.com/katzer/cordova-plugin-email-composer).
*
* @usage
* ```ts
* import {EmailComposer} from 'ionic-native';
*
*
* EmailComposer.isAvailable().then((available) =>{
* if(available) {
* //Now we know we can send
* }
* });
*
* let email = {
* to: 'max@mustermann.de',
* cc: 'erika@mustermann.de',
* bcc: ['john@doe.com', 'jane@doe.com'],
* attachments: [
* 'file://img/logo.png',
* 'res://icon.png',
* 'base64:icon.png//iVBORw0KGgoAAAANSUhEUg...',
* 'file://README.pdf'
* ],
* subject: 'Cordova Icons',
* body: 'How are you? Nice greetings from Leipzig',
* isHtml: true
* };
*
* // Send a text message using default options
* EmailComposer.send(email);
*
* ```
*/
@Plugin({
plugin: 'cordova-plugin-email-composer',
pluginRef: 'cordova.plugins.email',
repo: 'https://github.com/katzer/cordova-plugin-email-composer.git',
platforms: ['Android', 'iOS', 'Windows Phone 8']
})
export class EmailComposer {
/**
* Verifies if sending emails is supported on the device.
*
* @param app {string?} An optional app id or uri scheme. Defaults to mailto.
* @param scope {any?} An optional scope for the promise
* @returns {Promise<boolean>} Resolves promise with boolean whether EmailComposer is available
*/
static isAvailable (app? : string, scope? : any) : Promise<boolean> {
return new Promise<boolean>((resolve, reject) => {
cordova.plugins.email.isAvailable(app, resolve, scope);
});
}
/**
* Adds a new mail app alias.
*
* @param alias {string} The alias name
* @param packageName {string} The package name
*/
@Cordova()
static addAlias(alias : string, packageName : string): void {}
/**
* Displays the email composer pre-filled with data.
*
* @param email {email} Email
* @param scope {any?} An optional scope for the promise
* @returns {Promise<any>} Resolves promise when the EmailComposer has been opened
*/
@Cordova({
successIndex: 1,
errorIndex: 3
})
static open(email : email, scope? : any) : Promise<any> {return}
}

View File

@ -35,8 +35,8 @@ import {Plugin, Cordova} from './plugin';
* *
* // Schedule delayed notification * // Schedule delayed notification
* LocalNotifications.schedule({ * LocalNotifications.schedule({
* t ext: "Delayed Notification", * text: "Delayed Notification",
* at: new Date(new Date() + 3600), * at: new Date(new Date().getTime() + 3600),
* led: "FF0000", * led: "FF0000",
* sound: null * sound: null
* }); * });

View File

@ -74,7 +74,7 @@ export class StatusBar {
* Set the status bar to a specific named color. Valid options: * Set the status bar to a specific named color. Valid options:
* black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown. * black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown.
* *
* iOS note: you must call StatusBar.setOverlay(false) to enable color changing. * iOS note: you must call StatusBar.overlaysWebView(false) to enable color changing.
* *
* @param {string} colorName The name of the color (from above) * @param {string} colorName The name of the color (from above)
*/ */
@ -86,7 +86,7 @@ export class StatusBar {
/** /**
* Set the status bar to a specific hex color (CSS shorthand supported!). * Set the status bar to a specific hex color (CSS shorthand supported!).
* *
* iOS note: you must call StatusBar.setOverlay(false) to enable color changing. * iOS note: you must call StatusBar.overlaysWebView(false) to enable color changing.
* *
* @param {string} hexString The hex value of the color. * @param {string} hexString The hex value of the color.
*/ */

38
src/plugins/webintent.ts Normal file
View File

@ -0,0 +1,38 @@
import {Cordova, CordovaProperty, Plugin} from './plugin';
declare var window;
@Plugin({
plugin: 'https://github.com/Initsogar/cordova-webintent.git',
pluginRef: 'window.plugins.webintent',
repo: 'https://github.com/Initsogar/cordova-webintent.git'
})
export class WebIntent {
@CordovaProperty
static get ACTION_VIEW () {
return window.plugins.webintent.ACTION_VIEW;
}
@CordovaProperty
static get EXTRA_TEXT () {
return window.plugins.webintent.EXTRA_TEXT;
}
@Cordova()
static startActivity (options : {action:any,url:string}) : Promise<any> {return}
@Cordova()
static hasExtra (extra : any) : Promise<any> {return}
@Cordova()
static getExtra (extra : any) : Promise<any> {return}
@Cordova()
static getUri () : Promise<string> {return};
@Cordova()
static onNewIntent() : Promise<string> {return};
@Cordova()
static sendBroadcast(options : {action:string, extras?:{option:boolean}}) : Promise<any> {return}
}