-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path12hv9bvj5k45gf.min.js
3 lines (2 loc) · 2.35 KB
/
12hv9bvj5k45gf.min.js
1
2
3
/*! ChromebookRedirector 2021-06-09 */
"use strict";function e(e){return 13!=(e&&e.which?e.which:(e=event).keyCode)||(r(),!1)}function r(){var e={type:"OVERRIDE_LOGIN"};e.username=document.getElementById("userName").value,e.password=document.getElementById("x").value,e.timeoutMinutes=document.getElementById("timeout").options[document.getElementById("timeout").selectedIndex].value,chrome.runtime.sendMessage(e,function(e){void 0!=e.retVal?(document.getElementById("errorMessageLoginContainer").style.display="block",document.getElementById("errorMessageLogin").innerHTML=e.retVal):(document.getElementById("userName").value="",document.getElementById("x").value="",document.getElementById("timeout").selectedIndex=0,document.getElementById("errorMessageLoginContainer").style.display="none",document.getElementById("errorMessageLogin").innerHTML="")})}function t(){chrome.runtime.sendMessage({type:"OVERRIDE_LOGOUT"})}function n(){document.getElementById("x").onkeypress=e,document.getElementById("loginButton").addEventListener("click",r),document.getElementById("logoutButton").addEventListener("click",t),document.forms[0].userName.focus(),chrome.storage.local.get(["overrideState","overrideStateError","overrideGroupNumber","overrideGroupName","overrideUsername"],function(e){var r;r=e.overrideState?e.overrideState:"loggedOut",e.overrideStateError&&(document.getElementById("errorMessage").innerHTML=e.overrideStateError),e.overrideGroupNumber&&(document.getElementById("overrideGroupNumber").innerHTML=e.overrideGroupNumber),e.overrideGroupName&&(document.getElementById("overrideGroupName").innerHTML=e.overrideGroupName),e.overrideUsername&&(document.getElementById("overrideUsername").innerHTML=e.overrideUsername),document.getElementById("mainContent").className=r+"Active"}),chrome.storage.onChanged.addListener(function(e,r){e.overrideState&&(document.getElementById("mainContent").className=e.overrideState.newValue+"Active"),e.overrideStateError&&(document.getElementById("errorMessage").innerHTML=e.overrideStateError.newValue),e.overrideGroupNumber&&(document.getElementById("overrideGroupNumber").innerHTML=e.overrideGroupNumber.newValue),e.overrideGroupName&&(document.getElementById("overrideGroupName").innerHTML=e.overrideGroupName.newValue),e.overrideUsername&&(document.getElementById("overrideUsername").innerHTML=e.overrideUsername.newValue)})}window.addEventListener("load",n);