a zip code crypto-currency system good for red ONLY

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import { Component, ElementRef, HostListener, Renderer, ViewEncapsulation } from '@angular/core';
  2. import { Config } from '../../config/config';
  3. import { BLOCK_ALL, GestureController } from '../../gestures/gesture-controller';
  4. import { isDefined, isUndefined } from '../../util/util';
  5. import { KEY_ESCAPE } from '../../platform/key';
  6. import { NavParams } from '../../navigation/nav-params';
  7. import { ViewController } from '../../navigation/view-controller';
  8. /**
  9. * @hidden
  10. */
  11. export class LoadingCmp {
  12. constructor(_viewCtrl, _config, _elementRef, gestureCtrl, params, renderer) {
  13. this._viewCtrl = _viewCtrl;
  14. this._config = _config;
  15. (void 0) /* assert */;
  16. this.gestureBlocker = gestureCtrl.createBlocker(BLOCK_ALL);
  17. this.d = params.data;
  18. renderer.setElementClass(_elementRef.nativeElement, `loading-${_config.get('mode')}`, true);
  19. if (this.d.cssClass) {
  20. this.d.cssClass.split(' ').forEach(cssClass => {
  21. // Make sure the class isn't whitespace, otherwise it throws exceptions
  22. if (cssClass.trim() !== '')
  23. renderer.setElementClass(_elementRef.nativeElement, cssClass, true);
  24. });
  25. }
  26. this.id = (++loadingIds);
  27. }
  28. ngOnInit() {
  29. // If no spinner was passed in loading options we need to fall back
  30. // to the loadingSpinner in the app's config, then the mode spinner
  31. if (isUndefined(this.d.spinner)) {
  32. this.d.spinner = this._config.get('loadingSpinner', this._config.get('spinner', 'ios'));
  33. }
  34. // If the user passed hide to the spinner we don't want to show it
  35. this.showSpinner = isDefined(this.d.spinner) && this.d.spinner !== 'hide';
  36. }
  37. ionViewWillEnter() {
  38. this.gestureBlocker.block();
  39. }
  40. ionViewDidLeave() {
  41. this.gestureBlocker.unblock();
  42. }
  43. ionViewDidEnter() {
  44. // If there is a duration, dismiss after that amount of time
  45. if (this.d && this.d.duration) {
  46. this.durationTimeout = setTimeout(() => this.dismiss('backdrop'), this.d.duration);
  47. }
  48. }
  49. keyUp(ev) {
  50. if (this._viewCtrl.isLast() && ev.keyCode === KEY_ESCAPE) {
  51. this.bdClick();
  52. }
  53. }
  54. bdClick() {
  55. if (this.d.enableBackdropDismiss) {
  56. this.dismiss('backdrop');
  57. }
  58. }
  59. dismiss(role) {
  60. if (this.durationTimeout) {
  61. clearTimeout(this.durationTimeout);
  62. }
  63. return this._viewCtrl.dismiss(null, role);
  64. }
  65. ngOnDestroy() {
  66. (void 0) /* assert */;
  67. this.gestureBlocker.destroy();
  68. }
  69. }
  70. LoadingCmp.decorators = [
  71. { type: Component, args: [{
  72. selector: 'ion-loading',
  73. template: '<ion-backdrop [hidden]="!d.showBackdrop" (click)="bdClick()" [class.backdrop-no-tappable]="!d.enableBackdropDismiss"></ion-backdrop>' +
  74. '<div class="loading-wrapper">' +
  75. '<div *ngIf="showSpinner" class="loading-spinner">' +
  76. '<ion-spinner [name]="d.spinner"></ion-spinner>' +
  77. '</div>' +
  78. '<div *ngIf="d.content" [innerHTML]="d.content" class="loading-content"></div>' +
  79. '</div>',
  80. host: {
  81. 'role': 'dialog'
  82. },
  83. encapsulation: ViewEncapsulation.None,
  84. },] },
  85. ];
  86. /** @nocollapse */
  87. LoadingCmp.ctorParameters = () => [
  88. { type: ViewController, },
  89. { type: Config, },
  90. { type: ElementRef, },
  91. { type: GestureController, },
  92. { type: NavParams, },
  93. { type: Renderer, },
  94. ];
  95. LoadingCmp.propDecorators = {
  96. 'keyUp': [{ type: HostListener, args: ['body:keyup', ['$event'],] },],
  97. };
  98. let loadingIds = -1;
  99. //# sourceMappingURL=loading-component.js.map