Built files from Bizgaze WebServer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tour.min.js 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. window.Tour = function (t) {
  2. t.prototype.init = function (t) {
  3. this.current = 0, w.call(this, m(), t);
  4. }, t.prototype.override = function (t, e) {
  5. var n = this[t];
  6. this[t] = e.bind(this, n.bind(this));
  7. }, t.prototype.start = function () {
  8. this.showOverlay(), this.showStep(this.steps[this.current = 0]);
  9. }, t.prototype.goToStep = function (t) {
  10. this.current = t, this.showStep(this.steps[this.current]);
  11. }, t.prototype.nextStep = function () {
  12. var t = this.steps[++this.current];
  13. t ? this.showStep(t) : this.end();
  14. if (t == undefined) {
  15. $("#bizgaze_body").css("pointer-events", "auto");
  16. }
  17. }, t.prototype.prevStep = function () {
  18. var t = this.steps[Math.max(--this.current, 0)];
  19. this.showStep(t);
  20. }, t.prototype.showStep = function (t) {
  21. var n = v(t.element, this.container, this.padding), i = e(this, ".ttour-wrapper"), o = e(this, ".ttour-tip");
  22. o && i.removeChild(o), o = s.call(this, t, t.position || "bottom"), i.appendChild(o),
  23. r(e(this, ".ttour-overlay"), n);
  24. }, t.prototype.showOverlay = function () {
  25. this.el = this.el || n.call(this), this.container.appendChild(this.el);
  26. }, t.prototype.end = function () {
  27. this.container.removeChild(this.el), this.el = null;
  28. };
  29. var e = function (t, e) {
  30. return t.el.querySelector(e);
  31. }, n = function () {
  32. return y("div", {
  33. className: "ttour-shadow",
  34. onclick: this.end.bind(this)
  35. }, [i()]);
  36. }, i = function () {
  37. var t = y("div", {
  38. className: "ttour-wrapper"
  39. });
  40. return y("div", {
  41. className: "ttour-overlay"
  42. }, [t]);
  43. }, r = function (t, e) {
  44. t.style.left = e.left + "px", t.style.top = e.top + "px", t.style.width = e.width + "px",
  45. t.style.height = e.height + "px";
  46. }, o = function () {
  47. return y("div", {
  48. className: "ttour-arrow"
  49. });
  50. }, s = function (t, e) {
  51. return y("div", {
  52. className: "ttour-tip tip-" + this.current + " " + e,
  53. style: {
  54. position: "absolute"
  55. },
  56. onclick: function (t) {
  57. t.stopPropagation();
  58. }
  59. }, [h(t.title), u(t.description), c.call(this), o()]);
  60. }, h = function (t) {
  61. return y("div", {
  62. className: "ttour-header"
  63. }, [f(t)]);
  64. }, u = function (t) {
  65. return y("div", {
  66. className: "ttour-body",
  67. innerHTML: t
  68. });
  69. }, c = function () {
  70. var t = [l(this.steps.length, this.current), a.call(this, this.steps.length - 1 == this.current)];
  71. return this.current > 0 && t.push(d.call(this)), y("div", {
  72. className: "ttour-footer"
  73. }, t);
  74. }, l = function (t, e) {
  75. for (var n = [], i = 0; i < t; i++) n.push(p(i == e));
  76. return y("div", {
  77. className: "ttour-bullets"
  78. }, n);
  79. }, p = function (t) {
  80. return y("div", {
  81. className: "ttour-bullet " + (t ? "active" : "")
  82. });
  83. }, a = function (t) {
  84. return y("button", {
  85. className: "next",
  86. innerText: t ? this.done : this.next,
  87. onclick: this.nextStep.bind(this)
  88. });
  89. }, d = function () {
  90. return y("button", {
  91. className: "prev",
  92. innerText: this.prev,
  93. onclick: this.prevStep.bind(this)
  94. });
  95. }, f = function (t) {
  96. return y("h1", {
  97. innerText: t
  98. });
  99. }, v = function (t, e, n) {
  100. var i = (e.querySelector(t) || e).getBoundingClientRect();
  101. return {
  102. left: e.scrollLeft + i.left - n,
  103. top: e.scrollTop + i.top - n,
  104. width: i.width + 2 * n,
  105. height: i.height + 2 * n
  106. };
  107. }, y = function (t, e, n) {
  108. var i = document.createElement(t);
  109. w.call(i, e);
  110. for (var r = 0; r < (n || []).length; r++) i.appendChild(n[r]);
  111. return i;
  112. }, m = function () {
  113. return {
  114. steps: [],
  115. padding: 3,
  116. container: document.body,
  117. next: "Next",
  118. done: "Done",
  119. prev: "Prev"
  120. };
  121. }, w = function () {
  122. for (var t = this, e = 0; e < arguments.length; e++) for (var n = Object.keys(arguments[e]), i = 0; i < n.length; i++) t[n[i]] = arguments[e][n[i]];
  123. };
  124. return t;
  125. }(window.Tour || function (t) {
  126. this.init(t || {});
  127. });