-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.min.js
1 lines (1 loc) · 3.07 KB
/
Player.min.js
1
function __5szm2kaj(e){if(1===e.error)return void alert("Guided Learning System : "+e.errormsg);if("undefined"==typeof $)return void setTimeout(()=>{__5szm2kaj(e)},1e3);initStyling(e.data.css);let t=getUrlParameter("GLSCurrStepId"),r=t?getStep(e.data.structure.steps,t):e.data.structure.steps[0];$(".sttip")&&$(".sttip").remove(),renderToolTip(null,e.data,r)}function initStyling(e){var t=$(`<style>${e}</style>`,{type:"text/css"});$("head").append(t)}var prevStepId;function renderToolTip(e,t,r){if(e&&e.remove(),!r||"eol0"===r.id)return;e&&e.remove(),r.next&&"click"===r.next.event&&$(r.action.selector).attr("href",$(r.action.selector).attr("href")+"&GLSCurrStepId="+r.followers[0].next);let i=getToolTip(t.tiplates);0===$(r.action.selector).length&&'input[value="Google Search"]'===r.action.selector&&(r.action.selector='button[aria-label="Google Search"] div'),$(r.action.selector).after(i),$("div.tooltip").addClass(r.action.classes),r.action.placement&&($("div.tooltip").addClass("in"),$("div.tooltip").addClass(r.action.placement)),$("div[aria-label='Steps']").css({"background-color":"#fff",border:"1px solid #dfe1e5","border-radius":"5px",padding:"5px","box-shadow":"0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)","min-width":"330px"});const a=$.parseHTML(r.action.contents["#content"]);$("div.popover-title").prepend("Guided Learning System"),$("div[data-iridize-id='content']").append(a),$("span[data-iridize-role='stepsCount']").text(t.structure.steps.length),$("span[data-iridize-role='stepCount']").text(r.action.stepOrdinal),r.action.roleTexts&&r.action.roleTexts.nextBt&&$(".next-btn").text(r.action.roleTexts.nextBt),$(".next-btn").click((function(){prevStepId=r.id,renderToolTip(i,t,getStep(t.structure.steps,r.followers[0].next))})),$("button[data-iridize-role='prevBt']").click((function(){renderToolTip(i,t,getStep(t.structure.steps,prevStepId))})),$("button[data-iridize-role='closeBt']").click((function(){i.remove()})),$("button[data-iridize-role='laterBt']").click((function(){i.remove()}))}function getToolTip(e){let t=$("<div>",{class:"sttip"});t.css({position:"absolute",display:"inline"});let r=$("<div>",{class:"tooltip"});r.css({position:"absolute",display:"flex","align-items":"center"});let i=$.parseHTML(e.tip);return r.append(i),t.append(r),t}function getStep(e,t){return e.find(e=>e.id===t)}function getUrlParameter(e){var t,r,i=window.location.search.substring(1).split("&");for(r=0;r<i.length;r++)if((t=i[r].split("="))[0]===e)return void 0===t[1]||decodeURIComponent(t[1])}jQueryScript=document.createElement("script"),jQueryScript.type="text/javascript",jQueryScript.src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js",document.getElementsByTagName("head")[0].append(jQueryScript),GLSScript=document.createElement("script"),GLSScript.type="text/javascript",GLSScript.src="https://guidedlearning.oracle.com/player/latest/api/scenario/get/v_IlPvRLRWObwLnV5sTOaw/5szm2kaj/?callback=__5szm2kaj&refresh=true&env=dev&type=startPanel&vars%5Btype%5D=startPanel&sid=none&_=1582203987867",document.getElementsByTagName("head")[0].append(GLSScript);