Skip to content

Commit

Permalink
space added to regenerate action
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleysmithTTD committed Jan 27, 2025
1 parent e14568a commit 46ab1b8
Showing 1 changed file with 51 additions and 23 deletions.
74 changes: 51 additions & 23 deletions examples/js-sdk/views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
let callbackCounter = 0;

function updateGuiElements(state) {
$("#targeted_advertising_ready").html(__uid2.getAdvertisingToken() ? "yes" : "no");
$("#advertising_token").html(String(__uid2.getAdvertisingToken()));
$("#login_required").html(__uid2.isLoginRequired() ? "yes" : "no");
$("#update_counter").html(callbackCounter);
$("#identity_state").html(String(JSON.stringify(state, null, 2)));
$('#targeted_advertising_ready').html(__uid2.getAdvertisingToken() ? 'yes' : 'no');
$('#advertising_token').html(String(__uid2.getAdvertisingToken()));
$('#login_required').html(__uid2.isLoginRequired() ? 'yes' : 'no');
$('#update_counter').html(callbackCounter);
$('#identity_state').html(String(JSON.stringify(state, null, 2)));

if (__uid2.isLoginRequired()) {
$("#login_form").show();
$("#logout_form").hide();
$('#login_form').show();
$('#logout_form').hide();
} else {
$("#login_form").hide();
$("#logout_form").show();
$('#login_form').hide();
$('#logout_form').show();
}
}

Expand All @@ -32,35 +32,63 @@
updateGuiElements(state);
}

$("#logout").click(() => {
$('#logout').click(() => {
__uid2.disconnect();
updateGuiElements(undefined);
});

updateGuiElements(undefined);

__uid2.init({
baseUrl: "<%- uid2BaseUrl %>"
baseUrl: '<%- uid2BaseUrl %>',
});

__uid2.callbacks.push(onUid2IdentityUpdated);
});
</script>
</head>
<body>
<%- include('intro.html'); -%>
<table id="uid2_state">
<tr><td class="label">Ready for Targeted Advertising:</td><td class="value"><pre id="targeted_advertising_ready"></pre></td></tr>
<tr><td class="label">UID2 Advertising Token:</td><td class="value"><pre id="advertising_token"></pre></td></tr>
<tr><td class="label">Is UID2 Login Required?</td><td class="value"><pre id="login_required"></pre></td></tr>
<tr><td class="label">UID2 Identity Updated Counter:</td><td class="value"><pre id="update_counter"></pre></td></tr>
<tr><td class="label">UID2 Identity Callback State:</td><td class="value"><pre id="identity_state"></pre></td></tr>
<tr>
<td class="label">Ready for Targeted Advertising:</td>
<td class="value"><pre id="targeted_advertising_ready"></pre></td>
</tr>
<tr>
<td class="label">UID2 Advertising Token:</td>
<td class="value"><pre id="advertising_token"></pre></td>
</tr>
<tr>
<td class="label">Is UID2 Login Required?</td>
<td class="value"><pre id="login_required"></pre></td>
</tr>
<tr>
<td class="label">UID2 Identity Updated Counter:</td>
<td class="value"><pre id="update_counter"></pre></td>
</tr>
<tr>
<td class="label">UID2 Identity Callback State:</td>
<td class="value"><pre id="identity_state"></pre></td>
</tr>
</table>
<div id="login_form" style="display:none" class="form"><form action="/login" method="POST">
<div class="email_prompt"><input type="text" id="email" name="email" placeholder="Enter an email address" style="border-style: none;"></div>
<div><input type="submit" value="Log In" class="button"></div>
</form></div>
<div id="logout_form" style="display:none" class="form"><form>
<button type="button" class="button" id="logout">Log Out</button>
</form></div>
<div id="login_form" style="display: none" class="form">
<form action="/login" method="POST">
<div class="email_prompt">
<input
type="text"
id="email"
name="email"
placeholder="Enter an email address"
style="border-style: none"
/>
</div>
<div><input type="submit" value="Log In" class="button" /></div>
</form>
</div>
<div id="logout_form" style="display: none" class="form">
<form>
<button type="button" class="button" id="logout">Log Out</button>
</form>
</div>
</body>
</html>

0 comments on commit 46ab1b8

Please sign in to comment.