a zip code crypto-currency system good for red ONLY

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. var __extends = (this && this.__extends) || (function () {
  2. var extendStatics = Object.setPrototypeOf ||
  3. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  4. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  5. return function (d, b) {
  6. extendStatics(d, b);
  7. function __() { this.constructor = d; }
  8. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9. };
  10. })();
  11. import { isPresent } from '../../util/util';
  12. import { PORTAL_TOAST } from '../app/app-constants';
  13. import { ToastCmp } from './toast-component';
  14. import { ToastMdSlideIn, ToastMdSlideOut, ToastSlideIn, ToastSlideOut, ToastWpPopIn, ToastWpPopOut } from './toast-transitions';
  15. import { ViewController } from '../../navigation/view-controller';
  16. /**
  17. * @hidden
  18. */
  19. var Toast = (function (_super) {
  20. __extends(Toast, _super);
  21. function Toast(app, opts, config) {
  22. if (opts === void 0) { opts = {}; }
  23. var _this = this;
  24. opts.dismissOnPageChange = isPresent(opts.dismissOnPageChange) ? !!opts.dismissOnPageChange : false;
  25. _this = _super.call(this, ToastCmp, opts, null) || this;
  26. _this._app = app;
  27. // set the position to the bottom if not provided
  28. if (!opts.position || !_this.isValidPosition(opts.position)) {
  29. opts.position = TOAST_POSITION_BOTTOM;
  30. }
  31. _this.isOverlay = true;
  32. config.setTransition('toast-slide-in', ToastSlideIn);
  33. config.setTransition('toast-slide-out', ToastSlideOut);
  34. config.setTransition('toast-md-slide-in', ToastMdSlideIn);
  35. config.setTransition('toast-md-slide-out', ToastMdSlideOut);
  36. config.setTransition('toast-wp-slide-out', ToastWpPopOut);
  37. config.setTransition('toast-wp-slide-in', ToastWpPopIn);
  38. return _this;
  39. }
  40. /**
  41. * @hidden
  42. */
  43. Toast.prototype.getTransitionName = function (direction) {
  44. var key = 'toast' + (direction === 'back' ? 'Leave' : 'Enter');
  45. return this._nav && this._nav.config.get(key);
  46. };
  47. /**
  48. * @hidden
  49. */
  50. Toast.prototype.isValidPosition = function (position) {
  51. return position === TOAST_POSITION_TOP || position === TOAST_POSITION_MIDDLE || position === TOAST_POSITION_BOTTOM;
  52. };
  53. /**
  54. * @param {string} message Toast message content
  55. */
  56. Toast.prototype.setMessage = function (message) {
  57. this.data.message = message;
  58. return this;
  59. };
  60. /**
  61. * @param {number} dur Toast message duration
  62. */
  63. Toast.prototype.setDuration = function (dur) {
  64. this.data.duration = dur;
  65. return this;
  66. };
  67. /**
  68. * @param {'top'|'middle'|'bottom'} pos Toast message position
  69. */
  70. Toast.prototype.setPosition = function (pos) {
  71. this.data.position = pos;
  72. return this;
  73. };
  74. /**
  75. * @param {string} cssClass Toast message CSS class
  76. */
  77. Toast.prototype.setCssClass = function (cssClass) {
  78. this.data.cssClass = cssClass;
  79. return this;
  80. };
  81. /**
  82. * @param {boolean} closeButton Toast message close button
  83. */
  84. Toast.prototype.setShowCloseButton = function (closeButton) {
  85. this.data.showCloseButton = closeButton;
  86. return this;
  87. };
  88. /**
  89. * Present the toast instance.
  90. *
  91. * @param {NavOptions} [navOptions={}] Nav options to go with this transition.
  92. * @returns {Promise} Returns a promise which is resolved when the transition has completed.
  93. */
  94. Toast.prototype.present = function (navOptions) {
  95. if (navOptions === void 0) { navOptions = {}; }
  96. navOptions.disableApp = false;
  97. navOptions.keyboardClose = false;
  98. return this._app.present(this, navOptions, PORTAL_TOAST);
  99. };
  100. /**
  101. * Dismiss all toast components which have been presented.
  102. */
  103. Toast.prototype.dismissAll = function () {
  104. this._nav && this._nav.popAll();
  105. };
  106. return Toast;
  107. }(ViewController));
  108. export { Toast };
  109. var TOAST_POSITION_TOP = 'top';
  110. var TOAST_POSITION_MIDDLE = 'middle';
  111. var TOAST_POSITION_BOTTOM = 'bottom';
  112. //# sourceMappingURL=toast.js.map