recaptcha
This commit is contained in:
parent
81ee8de008
commit
9c825ca87a
@ -82,9 +82,7 @@
|
|||||||
<a href="javascript:void(0)" (click)="policyDisplayOpen()">Privacy Policy</a>
|
<a href="javascript:void(0)" (click)="policyDisplayOpen()">Privacy Policy</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-section implementation">
|
<div class="content-section implementation">
|
||||||
<!--<p-growl [value]="msgs" sticky="sticky"></p-growl>-->
|
|
||||||
|
|
||||||
<!--<p-captcha siteKey="6Ldld1gUAAAAAKBn115dpJcFpsI4G0ZTCcmP29iA" (onResponse)="showResponse($event)" initCallback="initRecaptcha" ></p-captcha>-->
|
|
||||||
<recaptcha
|
<recaptcha
|
||||||
[formControl]="myRecaptcha"
|
[formControl]="myRecaptcha"
|
||||||
(scriptLoad)="onScriptLoad()"
|
(scriptLoad)="onScriptLoad()"
|
||||||
|
@ -1,27 +1,19 @@
|
|||||||
import {
|
import {
|
||||||
AfterContentInit,
|
|
||||||
AfterViewInit,
|
|
||||||
Component,
|
Component,
|
||||||
ElementRef,
|
|
||||||
EventEmitter,
|
|
||||||
Input,
|
|
||||||
NgZone,
|
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
OnInit,
|
OnInit,
|
||||||
Output
|
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { FormGroup, FormBuilder, Validators, AbstractControl, FormControl } from '@angular/forms';
|
import { FormGroup, FormBuilder, Validators, AbstractControl, FormControl } from '@angular/forms';
|
||||||
import { Member } from '@overflow/commons-typescript/model/member';
|
import { Member } from '@overflow/commons-typescript/model/member';
|
||||||
import * as AuthStore from '../../store/signup';
|
import * as AuthStore from '../../store/signup';
|
||||||
import {Store} from '@ngrx/store';
|
import {Store} from '@ngrx/store';
|
||||||
import { Message } from 'primeng/api';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'of-member-signup',
|
selector: 'of-member-signup',
|
||||||
templateUrl: './signup.component.html',
|
templateUrl: './signup.component.html',
|
||||||
})
|
})
|
||||||
export class SignupComponent implements OnInit, AfterViewInit, AfterContentInit, OnDestroy {
|
export class SignupComponent implements OnInit, OnDestroy {
|
||||||
myRecaptcha = new FormControl(false);
|
myRecaptcha = new FormControl(false);
|
||||||
|
|
||||||
signupForm: FormGroup;
|
signupForm: FormGroup;
|
||||||
@ -33,77 +25,19 @@ export class SignupComponent implements OnInit, AfterViewInit, AfterContentInit,
|
|||||||
company: AbstractControl;
|
company: AbstractControl;
|
||||||
termsDisplay = false;
|
termsDisplay = false;
|
||||||
policyDisplay = false;
|
policyDisplay = false;
|
||||||
msgs: Message[] = [];
|
|
||||||
|
|
||||||
// private _instance: any = null;
|
|
||||||
|
|
||||||
// @Input() initCallback = 'initRecaptcha';
|
|
||||||
// @Input() siteKey = '6Ldld1gUAAAAAKBn115dpJcFpsI4G0ZTCcmP29iA';
|
|
||||||
// @Input() theme = 'light';
|
|
||||||
// @Input() type = 'image';
|
|
||||||
// @Input() size = 'normal';
|
|
||||||
// @Input() tabindex = 0;
|
|
||||||
// @Input() language: string = null;
|
|
||||||
|
|
||||||
// @Output() onResponse: EventEmitter<any> = new EventEmitter();
|
|
||||||
// @Output() onExpire: EventEmitter<any> = new EventEmitter();
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
private store: Store<AuthStore.State>,
|
private store: Store<AuthStore.State>,
|
||||||
public el: ElementRef,
|
|
||||||
public _zone: NgZone,
|
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngAfterViewInit() {
|
|
||||||
// console.log('ddddd');
|
|
||||||
}
|
|
||||||
|
|
||||||
ngAfterContentInit() {
|
|
||||||
// if ((<any>window).grecaptcha) {
|
|
||||||
// console.log((<any>window).grecaptcha);
|
|
||||||
// this.init();
|
|
||||||
// } else {
|
|
||||||
// (<any>window)[this.initCallback] = () => {
|
|
||||||
// this.init();
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
init() {
|
|
||||||
// console.log(this.el.nativeElement.children[2]);
|
|
||||||
// console.log((<any>window).grecaptcha.render());
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// this._instance = (<any>window).grecaptcha.render(this.el.nativeElement.children[2], {
|
|
||||||
// 'sitekey': this.siteKey,
|
|
||||||
// 'theme': this.theme,
|
|
||||||
// 'type': this.type,
|
|
||||||
// 'size': this.size,
|
|
||||||
// 'tabindex': this.tabindex,
|
|
||||||
// 'hl': this.language,
|
|
||||||
// 'callback': (response: string) => {this._zone.run(() => this.recaptchaCallback(response)); },
|
|
||||||
// 'expired-callback': () => {this._zone.run(() => this.recaptchaExpiredCallback()); },
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.initForm();
|
this.initForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
// if (this._instance != null) {
|
|
||||||
// (<any>window).grecaptcha.reset(this._instance);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
reset() {
|
|
||||||
// if (this._instance === null)
|
|
||||||
// return;
|
|
||||||
//
|
|
||||||
// (<any>window).grecaptcha.reset(this._instance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initForm() {
|
initForm() {
|
||||||
@ -197,20 +131,6 @@ export class SignupComponent implements OnInit, AfterViewInit, AfterContentInit,
|
|||||||
this.policyDisplay = false;
|
this.policyDisplay = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// showResponse(event) {
|
|
||||||
// this.msgs = [];
|
|
||||||
// this.msgs.push({severity: 'info', summary: 'Succees', detail: 'User Responded'});
|
|
||||||
// }
|
|
||||||
|
|
||||||
recaptchaCallback(response: string) {
|
|
||||||
// this.onResponse.emit({
|
|
||||||
// response: response
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
|
|
||||||
recaptchaExpiredCallback() {
|
|
||||||
// this.onExpire.emit();
|
|
||||||
}
|
|
||||||
onScriptLoad() {
|
onScriptLoad() {
|
||||||
console.log('Google reCAPTCHA loaded and is ready for use!');
|
console.log('Google reCAPTCHA loaded and is ready for use!');
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ import { COMPONENTS } from './component';
|
|||||||
import { SERVICES } from './service';
|
import { SERVICES } from './service';
|
||||||
import { PrimeNGModules } from '../commons/prime-ng/prime-ng.module';
|
import { PrimeNGModules } from '../commons/prime-ng/prime-ng.module';
|
||||||
import { QRCodeModule } from 'angularx-qrcode';
|
import { QRCodeModule } from 'angularx-qrcode';
|
||||||
import { CaptchaModule } from 'primeng/captcha';
|
|
||||||
import { RecaptchaModule } from 'angular-google-recaptcha';
|
import { RecaptchaModule } from 'angular-google-recaptcha';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user