PageSourceSearch

https://www.thegamecrafter.com/tgc6/js/eugdprprefs.js?v=6

js thegamecrafter.com collected 2026-09-24 08:36:50 UTC 13,430 bytes, 347 lines download raw bytes

1var eugdprprefs = {
2  stored: false,
3  user: null,
4  properties: [
5    "can_use_facebook_beacon",
6    "can_use_pinterest_beacon",
7    "can_use_google_analytics",
8    "can_use_helpscout_beacon",
9  ],
10
11  facebook: function () {
12    !(function (f, b, e, v, n, t, s) {
13      if (f.fbq) return;
14      n = f.fbq = function () {
15        n.callMethod
16          ? n.callMethod.apply(n, arguments)
17          : n.queue.push(arguments);
18      };
19      if (!f._fbq) f._fbq = n;
20      n.push = n;
21      n.loaded = !0;
22      n.version = "2.0";
23      n.queue = [];
24      t = b.createElement(e);
25      t.async = !0;
26      t.src = v;
27      s = b.getElementsByTagName(e)[0];
28      s.parentNode.insertBefore(t, s);
29    })(
30      window,
31      document,
32      "script",
33      "https://connect.facebook.net/en_US/fbevents.js"
34    );
35    fbq("init", "338104966677329");
36    fbq("track", "PageView");
37  },
38
39  pinterest: function () {
40    !(function (e) {
41      if (!window.pintrk) {
42        window.pintrk = function () {
43          window.pintrk.queue.push(Array.prototype.slice.call(arguments));
44        };
45        var n = window.pintrk;
46        (n.queue = []), (n.version = "3.0");
47        var t = document.createElement("script");
48        (t.async = !0), (t.src = e);
49        var r = document.getElementsByTagName("script")[0];
50        r.parentNode.insertBefore(t, r);
51      }
52    })("https://s.pinimg.com/ct/core.js");
53    pintrk("load", "2620722707733", {});
54    pintrk("page");
55  },
56
57  google: function () {
58    (function (i, s, o, g, r, a, m) {
59      (a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]);
60      a.async = 1;
61      a.src = g;
62      m.parentNode.insertBefore(a, m);
63    })(
64      window, // i
65      document, // s
66      "script", // o
67      "https://www.googletagmanager.com/gtag/js?id=UA-15146236-4", //g
68    );
69
70    
vendor: 139 bytes, lines 70-73
70window.dataLayer = window.dataLayer || [];
71    function gtag(){dataLayer.push(arguments);}
72    gtag('js', new Date());
73    gtag('config', '
73UA-15146236-4
vendor: 6 bytes, lines 73-74
73');
74  
74},
75
76  helpscout: function () {
77    !(function (e, t, n) {
78      function a() {
79        var e = t.getElementsByTagName("script")[0],
80          n = t.createElement("script");
81        (n.type = "text/javascript"),
82          (n.async = !0),
83          (n.src = "https://beacon-v2.helpscout.net"),
84          e.parentNode.insertBefore(n, e);
85      }
86      if (
87        ((e.Beacon = n = function (t, n, a) {
88          e.Beacon.readyQueue.push({ method: t, options: n, data: a });
89        }),
90        (n.readyQueue = []),
91        "complete" === t.readyState)
92      )
93        return a();
94      e.attachEvent
95        ? e.attachEvent("onload", a)
96        : e.addEventListener("load", a, !1);
97    })(window, document, window.Beacon || function () {});
98
99    window.Beacon("init", "b1b85616-0ab1-4406-b20e-44a46aafed18");
100
101    Beacon("config", {
102      messaging: {
103        contactForm: {
104          allowAttachments: true,
105        },
106      },
107      display: {
108        style: "manual",
109      },
110      labels: {
111        responseTime:
112          "We respond in 2 business days or less. If you need faster support check out the help link at the top of the page or ask in chat at the bottom of the page.",
113        howCanWeHelp:
114          "How can we help you? If you need help with a previous order, please tell us your Order #.",
115      },
116    });
117    if (eugdprprefs.user.id != "") {
118      Beacon("identify", {
119        name: eugdprprefs.user.display_name,
120        email: eugdprprefs.user.email,
121        Username: eugdprprefs.user.username,
122        "Real Name": eugdprprefs.user.real_name,
123        ID: eugdprprefs.user.id,
124        Manage:
125          "https://www.thegamecrafter.com/admin/user/" + eugdprprefs.user.id,
126      });
127    }
128
129    Beacon("on", "ready", () => {
130      var d = document,
131        s = d.createElement("button");
132        s.classList.add("btn");
133        s.classList.add("btn-success");
134        s.classList.add("btn-sm");
135        s.innerHTML = '<i class="fas fa-life-ring"></i> Get Support';
136      s.addEventListener("click", function (e) {
137        Beacon("toggle");
138      });
139      var e = d.getElementById("sitewidebuttons");
140      if (e) {
141          e.append(s);
142      }
143    });
144  },
145
146  configure: function () {
147    if (eugdprprefs.user.can_use_google_analytics) {
148      eugdprprefs.google();
149    }
150    if (eugdprprefs.user.can_use_facebook_beacon) {
151      eugdprprefs.facebook();
152    }
153    if (eugdprprefs.user.can_use_pinterest_beacon) {
154      eugdprprefs.pinterest();
155    }
156    if (eugdprprefs.user.can_use_helpscout_beacon) {
157      eugdprprefs.helpscout();
158    }
159  },
160
161  save_preference: function () {
162    var pass = true;
163    for (var i in eugdprprefs.properties) {
164      var key = eugdprprefs.properties[i];
165      var selector = 'input[name="eugdprprefs_' + key + '"]:checked';
166      var field = document.querySelector(selector);
167      if (field == null) {
168        alert("You must make your selections for all the preferences.");
169        pass = false;
170        break;
171      } else {
172        eugdprprefs.user[key] = field.value;
173      }
174    }
175    if (pass) {
176      window.sessionStorage.setItem(
177        "eugdprprefs",
178        JSON.stringify(eugdprprefs.user)
179      );
180      var modal = document.getElementById("eugdprprefs");
181      modal.parentNode.removeChild(modal);
182      eugdprprefs.configure();
183    }
184  },
185  display_popup: function () {
186    var d = document,
187      f = d.getElementsByTagName("div")[0],
188      s = d.createElement("div");
189    s.id = "eugdprprefs";
190    s.style =
191      "width: 100%; height:" +
192      window.innerHeight +
193      "px; overflow: scroll; background-color: #444; position: fixed; z-index: 999999; top: 0px; left: 0px;";
194    s.innerHTML = `
195            <div style="margin: 10px; padding: 15px; background-color: white; color: black; ">
196                <h2>Your Preferences</h2>
197                <p>We use a number of third-party services to improve user experience and see how many people are using our site. We need your permission to make use of these services.</p>
198                <div class="row">
199
200                    <div class="col-sm-4">
201                        <div class="form-group">
202                            <h4>Help Scout</h4>
203                            <p>We use <a href="http://www.helpscout.com" target="_new">Help Scout</a> to answer your support questions. We send the page you viewed and your contact information to Help Scout to aid in assisting you when you have a question. Your information is never shared outside of The Game Crafter and Help Scout.</p>
204                            <div class="radio">
205                              <label>
206                                <input type="radio" name="eugdprprefs_can_use_helpscout_beacon" value="
2060">
207                                Do not track me.
208                              </label>
209                            </div>
210                            <div class="radio">
211                              <label>
212                                <input type="radio" name="eugdprprefs_can_use_helpscout_beacon" value="1">
213                                You can track me.
214                              </label>
215                            </div>
216                        </div>
217                    </div>
218
219                    <div class="col-sm-4">
220                        <div class="form-group">
221                            <h4>Google Analytics</h4>
222                            <p>We use <a href="http://www.google.com/analytics" target="_new">Google Analytics</a> to track how many people are visiting our site and which pages are most popular. We send no data to them that is specific to you.</p>
223                            <div class="radio">
224                              <label>
225                                <input type="radio" name="eugdprprefs_can_use_google_analytics" value="0">
226                                Do not track me.
227                              </label>
228                            </div>
229                            <div class="radio">
230                              <label>
231                                <input type="radio" name="eugdprprefs_can_use_google_analytics" value="1">
232                                You can track me.
233                              </label>
234                            </div>
235                        </div>
236                    </div>
237                </div>
238                <div class="row">
239                    <div class="col-sm-4">
240                        <div class="form-group">
241                            <h4>Facebook</h4>
242                            <p>We use <a href="http://www.facebook.com" target="_new">Facebook</a> to track how our advertising on their platform is working. We send no data to them that is specific to you.</p>
243                            <div class="radio">
244                              <label>
245                                <input type="radio" name="eugdprprefs_can_use_facebook_beacon" value="0">
246                                Do not track me.
247                              </label>
248                            </div>
249                            <div class="radio">
250                              <label>
251                                <input type="radio" name="eugdprprefs_can_use_facebook_beacon" value="1">
252                                You can track me.
253                              </label>
254                            </div>
255                        </div>
256                    </div>
257
258                    <div class="col-sm-4">
259                        <div class="form-group">
260                            <h4>Pinterest</h4>
261                            <p>We use <a href="http://www.pinterest.com" target="_new">Pinterest</a> to track how our advertising on their platform is working. We send no data to them that is specific to you.</p>
262                            <div class="radio">
263                              <label>
264                                <input type="radio" name="eugdprprefs_can_use_pinterest_beacon" value="0">
265                                Do not track me.
266                              </label>
267                            </div>
268                            <div class="radio">
269                              <label>
270                                <input type="radio" name="eugdprprefs_can_use_pinterest_beacon" value="1">
271                                You can track me.
272                              </label>
273                            </div>
274                        </div>
275                    </div>
276
277                    <div class="col-sm-4">
278                        <div class="form-group">
279                            <h4>Firebase</h4>
280                            <p>We use <a href="http://www.firebase.com" target="_new">Firebase</a> for status notifications, chat, and other social functions on the site. Your IP address, username, and unique user ID are all stored in Firebase. Since The Game Crafter is a community driven site there is no option to disable these functions. If you do not wish to have your information stored in Firebase then do not log in to our site.</p>
281                        </div>
282                    </div>
283
284                </div>
285                <div class="row">
286
287                    <div class="col-sm-4">
288                        <div class="form-group">
289                            <h4>Cookies</h4>
290                            <p>We use cookies to keep track of your login and items you add to your cart. As cookies are essential to those functions, you cannot opt out of them.</p>
291                        </div>
292                    </div>
293
294                    <div class="col-sm-4">
295                        <div class="form-group">
296                            <h4>IP Address</h4>
297                            <p>We store your IP address as it aids in tracking fraudsters and hackers. As security is important to us, you cannot opt out of us storing your IP address.</p>
298                        </div>
299                    </div>
300
301                </div>
302
303                <button id="eugdprprefs_save" class="btn btn-success">Save my preferences</button>
304            </div>
305        `;
306    f.parentNode.insertBefore(s, f);
307    d.getElementById("eugdprprefs_save").onclick = eugdprprefs.save_preference;
308  },
309  init: function (user) {
310    eugdprprefs.user = user;
311    if (eugdprprefs.user.id == "") {
312      try {
313        var prefs = JSON.parse(window.sessionStorage.getItem("eugdprprefs"));
314        if (typeof prefs !== "undefined" && prefs != null) {
315          eugdprprefs.user = prefs;
316          eugdprprefs.stored = true;
317        }
318      } catch (e) {}
319    }
320    if (eugdprprefs.stored || eugdprprefs.user.id != "") {
321      eugdprprefs.configure();
322    } else {
323      geoip2.country(
324        function (location) {
325          console.log("Location: "+location.registered_country.iso_code);
326          if (location.is_in_european_union || ! location.registered_country.iso_code == "BR" || location.registered_country.iso_code == "GB") {
327            eugdprprefs.display_popup();
328          } else {
329            eugdprprefs.configure();
330          }
331        },
332        function () {}
333      );
334    }
335  },
336  populate_create_form: function (form) {
337    for (var i in eugdprprefs.properties) {
338      var key = eugdprprefs.properties[i];
339      var element = document.createElement("input");
340      element.setAttribute("type", "hidden");
341      element.setAttribute("name", key);
342      element.setAttribute("value", eugdprprefs.user[key]);
343      form.appendChild(element);
344    }
345    return true;
346  },
347};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.