|
12 | 12 | let callbackCounter = 0; |
13 | 13 |
|
14 | 14 | function updateGuiElements(state) { |
15 | | - $("#targeted_advertising_ready").html(__uid2.getAdvertisingToken() ? "yes" : "no"); |
16 | | - $("#advertising_token").html(String(__uid2.getAdvertisingToken())); |
17 | | - $("#login_required").html(__uid2.isLoginRequired() ? "yes" : "no"); |
18 | | - $("#update_counter").html(callbackCounter); |
19 | | - $("#identity_state").html(String(JSON.stringify(state, null, 2))); |
| 15 | + $('#targeted_advertising_ready').html(__uid2.getAdvertisingToken() ? 'yes' : 'no'); |
| 16 | + $('#advertising_token').html(String(__uid2.getAdvertisingToken())); |
| 17 | + $('#login_required').html(__uid2.isLoginRequired() ? 'yes' : 'no'); |
| 18 | + $('#update_counter').html(callbackCounter); |
| 19 | + $('#identity_state').html(String(JSON.stringify(state, null, 2))); |
20 | 20 |
|
21 | 21 | if (__uid2.isLoginRequired()) { |
22 | | - $("#login_form").show(); |
23 | | - $("#logout_form").hide(); |
| 22 | + $('#login_form').show(); |
| 23 | + $('#logout_form').hide(); |
24 | 24 | } else { |
25 | | - $("#login_form").hide(); |
26 | | - $("#logout_form").show(); |
| 25 | + $('#login_form').hide(); |
| 26 | + $('#logout_form').show(); |
27 | 27 | } |
28 | 28 | } |
29 | 29 |
|
|
32 | 32 | updateGuiElements(state); |
33 | 33 | } |
34 | 34 |
|
35 | | - $("#logout").click(() => { |
| 35 | + $('#logout').click(() => { |
36 | 36 | __uid2.disconnect(); |
37 | 37 | updateGuiElements(undefined); |
38 | 38 | }); |
39 | 39 |
|
40 | 40 | updateGuiElements(undefined); |
41 | 41 |
|
42 | 42 | __uid2.init({ |
43 | | - baseUrl: "<%- uid2BaseUrl %>" |
| 43 | + baseUrl: '<%- uid2BaseUrl %>', |
44 | 44 | }); |
| 45 | + |
45 | 46 | __uid2.callbacks.push(onUid2IdentityUpdated); |
46 | 47 | }); |
47 | 48 | </script> |
48 | 49 | </head> |
49 | 50 | <body> |
50 | 51 | <%- include('intro.html'); -%> |
51 | 52 | <table id="uid2_state"> |
52 | | - <tr><td class="label">Ready for Targeted Advertising:</td><td class="value"><pre id="targeted_advertising_ready"></pre></td></tr> |
53 | | - <tr><td class="label">UID2 Advertising Token:</td><td class="value"><pre id="advertising_token"></pre></td></tr> |
54 | | - <tr><td class="label">Is UID2 Login Required?</td><td class="value"><pre id="login_required"></pre></td></tr> |
55 | | - <tr><td class="label">UID2 Identity Updated Counter:</td><td class="value"><pre id="update_counter"></pre></td></tr> |
56 | | - <tr><td class="label">UID2 Identity Callback State:</td><td class="value"><pre id="identity_state"></pre></td></tr> |
| 53 | + <tr> |
| 54 | + <td class="label">Ready for Targeted Advertising:</td> |
| 55 | + <td class="value"><pre id="targeted_advertising_ready"></pre></td> |
| 56 | + </tr> |
| 57 | + <tr> |
| 58 | + <td class="label">UID2 Advertising Token:</td> |
| 59 | + <td class="value"><pre id="advertising_token"></pre></td> |
| 60 | + </tr> |
| 61 | + <tr> |
| 62 | + <td class="label">Is UID2 Login Required?</td> |
| 63 | + <td class="value"><pre id="login_required"></pre></td> |
| 64 | + </tr> |
| 65 | + <tr> |
| 66 | + <td class="label">UID2 Identity Updated Counter:</td> |
| 67 | + <td class="value"><pre id="update_counter"></pre></td> |
| 68 | + </tr> |
| 69 | + <tr> |
| 70 | + <td class="label">UID2 Identity Callback State:</td> |
| 71 | + <td class="value"><pre id="identity_state"></pre></td> |
| 72 | + </tr> |
57 | 73 | </table> |
58 | | - <div id="login_form" style="display:none" class="form"><form action="/login" method="POST"> |
59 | | - <div class="email_prompt"><input type="text" id="email" name="email" placeholder="Enter an email address" style="border-style: none;"></div> |
60 | | - <div><input type="submit" value="Log In" class="button"></div> |
61 | | - </form></div> |
62 | | - <div id="logout_form" style="display:none" class="form"><form> |
63 | | - <button type="button" class="button" id="logout">Log Out</button> |
64 | | - </form></div> |
| 74 | + <div id="login_form" style="display: none" class="form"> |
| 75 | + <form action="/login" method="POST"> |
| 76 | + <div class="email_prompt"> |
| 77 | + <input |
| 78 | + type="text" |
| 79 | + id="email" |
| 80 | + name="email" |
| 81 | + placeholder="Enter an email address" |
| 82 | + style="border-style: none" |
| 83 | + /> |
| 84 | + </div> |
| 85 | + <div><input type="submit" value="Log In" class="button" /></div> |
| 86 | + </form> |
| 87 | + </div> |
| 88 | + <div id="logout_form" style="display: none" class="form"> |
| 89 | + <form> |
| 90 | + <button type="button" class="button" id="logout">Log Out</button> |
| 91 | + </form> |
| 92 | + </div> |
65 | 93 | </body> |
66 | 94 | </html> |
0 commit comments