angular-captcha
Advanced tools
Comparing version 1.3.0 to 1.4.0
{ | ||
"name": "angular-captcha", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "BotDetect Captcha Angular Module (TypeScript / Angular 2+)", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -12,5 +12,5 @@ import { OnInit, ElementRef } from '@angular/core'; | ||
ngOnInit(): void; | ||
showHtml(): void; | ||
displayHtml(): void; | ||
reloadImage(): void; | ||
loadScriptIncludes(): void; | ||
} |
@@ -34,7 +34,7 @@ "use strict"; | ||
// display captcha html markup on view | ||
this.showHtml(); | ||
this.displayHtml(); | ||
}; | ||
// Display captcha html markup in the <botdetect-captcha> tag. | ||
// Display captcha html markup in the <botdetect-captcha> tag. | ||
CaptchaComponent.prototype.showHtml = | ||
CaptchaComponent.prototype.displayHtml = | ||
// Display captcha html markup in the <botdetect-captcha> tag. | ||
@@ -41,0 +41,0 @@ function () { |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"CaptchaComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"botdetect-captcha","template":""}]}],"members":{"styleName":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"./captcha.service","name":"CaptchaService"},{"__symbolic":"reference","module":"./captcha-helper.service","name":"CaptchaHelperService"}]}],"ngOnInit":[{"__symbolic":"method"}],"showHtml":[{"__symbolic":"method"}],"reloadImage":[{"__symbolic":"method"}],"loadScriptIncludes":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"CaptchaComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"botdetect-captcha","template":""}]}],"members":{"styleName":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"./captcha.service","name":"CaptchaService"},{"__symbolic":"reference","module":"./captcha-helper.service","name":"CaptchaHelperService"}]}],"ngOnInit":[{"__symbolic":"method"}],"displayHtml":[{"__symbolic":"method"}],"reloadImage":[{"__symbolic":"method"}],"loadScriptIncludes":[{"__symbolic":"method"}]}}}}] |
import { AbstractControl, Validator } from '@angular/forms'; | ||
import { CaptchaService } from './captcha.service'; | ||
export declare class CorrectCaptchaDirective implements Validator { | ||
private document; | ||
private captchaService; | ||
control: AbstractControl; | ||
constructor(captchaService: CaptchaService); | ||
constructor(document: any, captchaService: CaptchaService); | ||
validate(c: AbstractControl, onBlur?: boolean): Promise<{}>; | ||
onBlur(): void; | ||
} |
@@ -5,5 +5,7 @@ "use strict"; | ||
var forms_1 = require("@angular/forms"); | ||
var platform_browser_1 = require("@angular/platform-browser"); | ||
var captcha_service_1 = require("./captcha.service"); | ||
var CorrectCaptchaDirective = /** @class */ (function () { | ||
function CorrectCaptchaDirective(captchaService) { | ||
function CorrectCaptchaDirective(document, captchaService) { | ||
this.document = document; | ||
this.captchaService = captchaService; | ||
@@ -22,3 +24,4 @@ } | ||
if (onBlur) { | ||
var captchaCode = _this.control.value; | ||
var userInputID = _this.captchaService.botdetectInstance.options.userInputID; | ||
var captchaCode = _this.document.getElementById(userInputID).value; | ||
if (captchaCode) { | ||
@@ -25,0 +28,0 @@ _this.captchaService.validate(captchaCode) |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"CorrectCaptchaDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[correctCaptcha][formControlName],[correctCaptcha][formControl],[correctCaptcha][ngModel]","providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_ASYNC_VALIDATORS"},"useExisting":{"__symbolic":"reference","name":"CorrectCaptchaDirective"},"multi":true}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./captcha.service","name":"CaptchaService"}]}],"validate":[{"__symbolic":"method"}],"onBlur":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["blur"]}]}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"CorrectCaptchaDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[correctCaptcha][formControlName],[correctCaptcha][formControl],[correctCaptcha][ngModel]","providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_ASYNC_VALIDATORS"},"useExisting":{"__symbolic":"reference","name":"CorrectCaptchaDirective"},"multi":true}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"@angular/platform-browser","name":"DOCUMENT"}]}],null],"parameters":[{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","module":"./captcha.service","name":"CaptchaService"}]}],"validate":[{"__symbolic":"method"}],"onBlur":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["blur"]}]}]}}}}] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
35158
499