Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setTimeout(function(){
- (function(HintedWidget) {
- if (!HintedWidget) {
- throw new Error('Hinted undefined');
- }
- // Load triggers here
- try {
- //console.log(HintedWidget, "Hinted widget loaded")
- /* create the link element */
- var linkElement = document.createElement('link');
- /* add attributes */
- linkElement.setAttribute('rel', 'stylesheet');
- linkElement.setAttribute('href', 'https://hinted.me/logic/studyfree/studyfree.css');
- /* attach to the document head */
- document.getElementsByTagName('head')[0].appendChild(linkElement);
- HintedWidget([], {position: 'bottom-left', usePathname: false, showWhenEmpty: false});
- var options = {"force": false, "playTimes": "2"};
- var SCENARIOS = [
- { id: "adb1ccb8-e129-4ba8-b757-3246bc3ad3e6", url: "/dashboard/search" },
- { id: "56a786d3-a9a0-4169-8538-2a032c6059be", url: "/dashboard/search" },
- { id: "5dee40e8-a539-4128-ba63-28e39949087f", url: "/dashboard/profile" },
- { id: "272d8e98-5d3b-4499-b6bc-49a29a18b8ab", url: "/dashboard/profile" },
- { id: "728a3fde-3828-4aac-9a90-5f1d5c8604e6", url: "/dashboard/chances" },
- { id: "5be953a7-8633-4b8f-bf15-f52183a4cb90", url: "/dashboard/" }
- ];
- var currentScenario = 0;
- function runHints() {
- if (currentScenario >= SCENARIOS.length) {
- return;
- }
- const scenario = SCENARIOS[currentScenario];
- HintedWidget.play(scenario.id, {
- force: false,
- playTimes: 2,
- url: scenario.url
- });
- }
- HintedWidget.player.on(function(event) {
- if (
- event.event === "end" ||
- (event.event === "error" && event.status === "end")
- ) {
- console.log("Run hints");
- currentScenario++;
- setTimeout(runHints, 15, currentScenario);
- }
- });
- } catch (error) {
- console.error(error);
- }
- })(window.HintedWidget, undefined);
- }, 500);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement