voyager.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. (function() {
  2. window.Softgames = function() {
  3. function e() {}
  4. return e.prototype._getUrlParameters = function() {
  5. var e = this;
  6. return this._urlParameters === void 0 && (this._urlParameters = {},
  7. this._location().replace(/[?&]+([^=&]+)=([^&]*)/gi,
  8. function(t, n, r) {
  9. return e._urlParameters[n] = r
  10. })),
  11. this._urlParameters
  12. },
  13. e.prototype._getUrlParameter = function(e) {
  14. var t;
  15. return t = this._getUrlParameters(),
  16. t[e]
  17. },
  18. e.prototype._location = function() {
  19. return window.location.href
  20. },
  21. e.prototype.getReady = function() {
  22. return this._ready_to_start = !0,
  23. this.loadVoyager()
  24. },
  25. e.prototype.loadVoyager = function() {
  26. var e, t = this;
  27. return e = document.createElement("script"),
  28. e.type = "text/javascript",
  29. e.src = "./api/voyager_base-83d560e0d0350eb5ccd49f0320347575.js",
  30. e.onload = function() {
  31. return window.softgamesDocumentReady = !0,
  32. t.ready()
  33. },
  34. document.getElementsByTagName("head")[0].appendChild(e)
  35. },
  36. e
  37. } (),
  38. window.softgames = new Softgames,
  39. window.softgamesDocumentReady = !1,
  40. window.SG_DefaultLang = "en",
  41. window.SG_getLang = function() {
  42. var e;
  43. return e = window.softgames._getUrlParameter("locale"),
  44. typeof e == "undefined" && (e = window.softgames._getUrlParameter("lang")),
  45. typeof e == "undefined" && (e = SG_DefaultLang),
  46. e
  47. },
  48. document.addEventListener("DOMContentLoaded",
  49. function() {
  50. var e;
  51. return e = document.createElement("script"),
  52. e.type = "text/javascript",
  53. e.src = "./api/voyager_base-83d560e0d0350eb5ccd49f0320347575.js",
  54. e.onload = function() {
  55. return window.softgamesDocumentReady = !0,
  56. window.softgames.ready()
  57. },
  58. document.getElementsByTagName("head")[0].appendChild(e)
  59. },
  60. !1)
  61. }).call(this);