mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-08 21:23:01 +08:00
moved click handler to script files
This commit is contained in:
parent
0f551b0eb9
commit
130eb17ae7
2 changed files with 17 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { activateAnalytics } from "../controllers/analytics-controller";
|
||||
import { focusWords } from "../test/test-ui";
|
||||
import * as Notifications from "../elements/notifications";
|
||||
|
||||
let visible = false;
|
||||
|
||||
|
|
@ -109,3 +110,18 @@ $(document).on("keypress", (e) => {
|
|||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
$("#cookiePopup .cookie.ads .text-button").on("click", () => {
|
||||
try {
|
||||
//@ts-ignore
|
||||
window.__tcfapi("displayConsentUi", 2, function () {
|
||||
//
|
||||
});
|
||||
} catch (e) {
|
||||
console.error("Failed to open ad consent UI");
|
||||
Notifications.add(
|
||||
"Failed to open Ad consent popup. Do you have an ad or cookie popup blocker enabled?",
|
||||
-1
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -71,10 +71,7 @@
|
|||
Our advertising partner may use cookies to deliver ads that are more
|
||||
relevant to you.
|
||||
</div>
|
||||
<a
|
||||
class="text-button"
|
||||
onclick="window.__tcfapi('displayConsentUi', 2, function() {} );"
|
||||
>
|
||||
<a class="text-button">
|
||||
Click to change your preferences on ad related cookies
|
||||
</a>
|
||||
</label>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue