From e27fbf47bd87047a3e565f164eca8391d49f9009 Mon Sep 17 00:00:00 2001 From: Mick Vleeshouwer Date: Sat, 17 Mar 2018 20:37:57 +0100 Subject: [PATCH 1/6] feat(plugin): add OpenALPR plugin --- src/@ionic-native/plugins/openalpr/index.ts | 69 +++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/@ionic-native/plugins/openalpr/index.ts diff --git a/src/@ionic-native/plugins/openalpr/index.ts b/src/@ionic-native/plugins/openalpr/index.ts new file mode 100644 index 000000000..7d0f5c306 --- /dev/null +++ b/src/@ionic-native/plugins/openalpr/index.ts @@ -0,0 +1,69 @@ +import { Injectable } from '@angular/core'; +import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; + +export interface OpenALPROptions { + /** Country used for scanning the license plate */ + country?: string; + + /** Amount of results returned */ + amount?: number; +} + +export interface OpenALPRResult { + /** LicensePlate */ + number: string; + /** Probability */ + confidence: number; +} + +/** + * @name OpenALPR + * @description + * This Cordova plugin adds support for the OpenALPR (Automatic License Plate Recognition) library, which provides support for retrieving the license plate from a picture. + * + * @usage + * ```typescript + * import { OpenALPR, OpenALPROptions, OpenALPRResult } from '@ionic-native/openalpr'; + * + * + * constructor(private openALPR: OpenALPR) { } + * + * const scanOptions: OpenALPROptions = { + * country: this.openALPR.Country.EU, + * amount: 3 + * } + * + * this.openALPR.scan(imageData, scanOptions) + * .then((res: [OpenALPRResult]) => console.log(res)) + * .catch((error: Error) => console.error(error)); + * + * ``` + */ +@Plugin({ + pluginName: 'OpenALPR', + plugin: 'cordova-plugin-openalpr', + pluginRef: 'cordova.plugins.OpenALPR', + repo: 'https://github.com/iMicknl/cordova-plugin-openalpr', + platforms: ['Android', 'iOS'] +}) + +@Injectable() +export class OpenALPR extends IonicNativePlugin { + + Country = { + EU: 'eu', + US: 'us', + AU: 'au', + BR: 'br', + KR2: 'kr2' + }; + + /** + * This function does something + * @param imageData {any} Base64 encoding of the image data or the image file URI + * @param options {OpenALPROptions} Options to pass to the OpenALPR scanner + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + scan(imageData: any, options?: OpenALPROptions): Promise { return; } +} From 11a402626cdda92f41e708ed264982b51645cfee Mon Sep 17 00:00:00 2001 From: Mick Vleeshouwer Date: Sat, 17 Mar 2018 20:44:56 +0100 Subject: [PATCH 2/6] Update documentation --- src/@ionic-native/plugins/openalpr/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/@ionic-native/plugins/openalpr/index.ts b/src/@ionic-native/plugins/openalpr/index.ts index 7d0f5c306..e05ca0fc8 100644 --- a/src/@ionic-native/plugins/openalpr/index.ts +++ b/src/@ionic-native/plugins/openalpr/index.ts @@ -33,6 +33,8 @@ export interface OpenALPRResult { * amount: 3 * } * + * // To get imageData, you can use the @ionic-native/camera module for example. It works with DestinationType.FILE_URI and DATA_URL + * * this.openALPR.scan(imageData, scanOptions) * .then((res: [OpenALPRResult]) => console.log(res)) * .catch((error: Error) => console.error(error)); From bf88f6ee51dd91917edb30c7042330a2ec1dae98 Mon Sep 17 00:00:00 2001 From: Mick Vleeshouwer Date: Sat, 17 Mar 2018 21:45:24 +0100 Subject: [PATCH 3/6] Update countries --- src/@ionic-native/plugins/openalpr/index.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/@ionic-native/plugins/openalpr/index.ts b/src/@ionic-native/plugins/openalpr/index.ts index e05ca0fc8..4872fa423 100644 --- a/src/@ionic-native/plugins/openalpr/index.ts +++ b/src/@ionic-native/plugins/openalpr/index.ts @@ -53,19 +53,22 @@ export interface OpenALPRResult { export class OpenALPR extends IonicNativePlugin { Country = { - EU: 'eu', - US: 'us', AU: 'au', BR: 'br', - KR2: 'kr2' + BR2: 'br2', + EU: 'eu', + IN: 'in', + KR2: 'kr2', + US: 'us', + VN2: 'vn2' }; - /** - * This function does something - * @param imageData {any} Base64 encoding of the image data or the image file URI - * @param options {OpenALPROptions} Options to pass to the OpenALPR scanner - * @return {Promise} Returns a promise that resolves when something happens - */ + /** + * This function does something + * @param imageData {any} Base64 encoding of the image data or the image file URI + * @param options {OpenALPROptions} Options to pass to the OpenALPR scanner + * @return {Promise} Returns a promise that resolves when something happens + */ @Cordova() scan(imageData: any, options?: OpenALPROptions): Promise { return; } } From 3bd61357306a8de1bedb34fc61fb7c61f91fdc65 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Fri, 23 Mar 2018 11:07:24 +0100 Subject: [PATCH 4/6] add CODE_OF_CONDUCT --- CODE_OF_CONDUCT.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..5cdfe9ed0 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,11 @@ +# Contributor Code of Conduct + +As contributors and maintainers of the Ionic project, we pledge to respect everyone who contributes by posting issues, updating documentation, submitting pull requests, providing feedback in comments, and any other activities. + +Communication through any of Ionic's channels (GitHub, Slack, Forum, IRC, mailing lists, Twitter, etc.) must be constructive and never resort to personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct. + +We promise to extend courtesy and respect to everyone involved in this project regardless of gender, gender identity, sexual orientation, disability, age, race, ethnicity, religion, or level of experience. We expect anyone contributing to the Ionic project to do the same. + +If any member of the community violates this code of conduct, the maintainers of the Ionic project may take action, removing issues, comments, and PRs or blocking accounts as deemed appropriate. + +If you are subject to or witness unacceptable behavior, or have any other concerns, please email us at [hi@ionicframework.com](mailto:hi@ionicframework.com). From 6d681675300be55c72b0b80a096f5c5553b7312d Mon Sep 17 00:00:00 2001 From: Perry Govier Date: Fri, 23 Mar 2018 12:40:03 -0500 Subject: [PATCH 5/6] fixing typo in install instructions --- src/@ionic-native/plugins/google-play-games-services/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/@ionic-native/plugins/google-play-games-services/index.ts b/src/@ionic-native/plugins/google-play-games-services/index.ts index 73314ffb9..5e6caecda 100644 --- a/src/@ionic-native/plugins/google-play-games-services/index.ts +++ b/src/@ionic-native/plugins/google-play-games-services/index.ts @@ -158,7 +158,7 @@ export interface Player { pluginRef: 'plugins.playGamesServices', repo: 'https://github.com/artberri/cordova-plugin-play-games-services', platforms: ['Android'], - install: 'ionic cordova plugin add cordova-plugin-play-games-service --variable APP_ID="YOUR_APP_ID', + install: 'ionic cordova plugin add cordova-plugin-play-games-services --variable APP_ID="YOUR_APP_ID', }) @Injectable() export class GooglePlayGamesServices extends IonicNativePlugin { From 2ae2a683d279f18af3a26a1561d5802f6dd398ec Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Fri, 23 Mar 2018 22:06:20 +0100 Subject: [PATCH 6/6] lint --- src/@ionic-native/plugins/openalpr/index.ts | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/@ionic-native/plugins/openalpr/index.ts b/src/@ionic-native/plugins/openalpr/index.ts index 4872fa423..7cdf35583 100644 --- a/src/@ionic-native/plugins/openalpr/index.ts +++ b/src/@ionic-native/plugins/openalpr/index.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; export interface OpenALPROptions { /** Country used for scanning the license plate */ @@ -19,7 +19,7 @@ export interface OpenALPRResult { /** * @name OpenALPR * @description - * This Cordova plugin adds support for the OpenALPR (Automatic License Plate Recognition) library, which provides support for retrieving the license plate from a picture. + * This Cordova plugin adds support for the OpenALPR (Automatic License Plate Recognition) library, which provides support for retrieving the license plate from a picture. * * @usage * ```typescript @@ -34,7 +34,7 @@ export interface OpenALPRResult { * } * * // To get imageData, you can use the @ionic-native/camera module for example. It works with DestinationType.FILE_URI and DATA_URL - * + * * this.openALPR.scan(imageData, scanOptions) * .then((res: [OpenALPRResult]) => console.log(res)) * .catch((error: Error) => console.error(error)); @@ -48,10 +48,8 @@ export interface OpenALPRResult { repo: 'https://github.com/iMicknl/cordova-plugin-openalpr', platforms: ['Android', 'iOS'] }) - @Injectable() export class OpenALPR extends IonicNativePlugin { - Country = { AU: 'au', BR: 'br', @@ -64,11 +62,13 @@ export class OpenALPR extends IonicNativePlugin { }; /** - * This function does something - * @param imageData {any} Base64 encoding of the image data or the image file URI - * @param options {OpenALPROptions} Options to pass to the OpenALPR scanner - * @return {Promise} Returns a promise that resolves when something happens - */ + * This function does something + * @param imageData {any} Base64 encoding of the image data or the image file URI + * @param options {OpenALPROptions} Options to pass to the OpenALPR scanner + * @return {Promise} Returns a promise that resolves when something happens + */ @Cordova() - scan(imageData: any, options?: OpenALPROptions): Promise { return; } + scan(imageData: any, options?: OpenALPROptions): Promise { + return; + } }