MSV FM

dot.antimicrobial@66.96.161.157: ~ $
Path : /hermes/sb_web/b1536/advancedfunctions.co/
File Upload :
Current < : //hermes/sb_web/b1536/advancedfunctions.co/ZoomQRPortalLinkGenerator.html

<!DOCTYPE html>
<html>
    <head>
        <title>Zoom QR Portal Link Generator</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<style>
            .grid-container{
                display: grid;
                grid-template-columns: 120px auto;
grid-gap:20px;
            }
.form-group{padding-top:10px;
}

.container{
max-width: 700px;
}


</style>
    </head>
    <body>

        <h1 id="title" style="font-size: 3vw;color: steelblue;" align="center"><img src="windsorLogo.png"/> <br></h1>
        <h2 id="status" style="font-size: 20px;color: steelblue; padding-bottom:30px" align="center">Zoom QR Portal Link Generator</h2>
       
        <div class="container" >
            <form action="javascript:send()">
            

                <div class="form-group">   <div class="grid-container"> <span class="label"  style="font-size: 20px; background-color: lightsteelblue; width: 120px;" >step <span class="badge" style="color: lightsteelblue;background-color: white;" >1</span></span>
                    <input class="form-control" style="width: 100%;" id="className"  placeholder="Enter Class Name (e.g. Physics CIE 900, SAT 1)">
                </div>
</div>


            

                <div class="form-group">   <div class="grid-container" >  <span class="label "  style="font-size: 20px; background-color: lightsteelblue; width: 120px;" >step <span class="badge" style="color: lightsteelblue;background-color: white;" >2</span></span>
                    <input class="form-control" id="gClass" placeholder="Paste Zoom Link Or Invitation Here">
                </div>
</div>

                <button type="submit" class="btn btn-default ">Generate Zoom Classroom Link</button>
<div class="form-group">
<h3>Copy Zoom Classroom Link Below</h3>
                    <input class="form-control" id="generatedLink" style="max-width:710px" placeholder="URL">
              </div>
            </form> 

<div>


        
        <script>
var classNameToSend;
var zoomLink;
var processedLink;
var parameters = new URLSearchParams(window.location.search);
var classInfo = parameters.get('class');
 while(classInfo .indexOf("_")!=-1){
      classInfo =classInfo .replace("_"," ");
      }
document.getElementById("className").value=classInfo; 
if(classInfo.length>0){
document.getElementById("className").disabled=true;}

function send(){
classNameToSend=document.getElementById("className").value;
zoomLink=document.getElementById("gClass").value;
zoomLink=zoomLink.replace("#success","");
var errorFound=false;

 while(classNameToSend.indexOf(" ")!=-1){
      classNameToSend=classNameToSend.replace(" ","_");
      }

//treat invitation
if(zoomLink.indexOf("Join Zoom Meeting")!=-1){
document.getElementById("generatedLink").value="processing...";
zoomLink=zoomLink.substring(zoomLink.indexOf("Join Zoom Meeting")+18,zoomLink.length);
zoomLink=zoomLink.substring(zoomLink.indexOf("https:"),zoomLink.indexOf(" "));
}
 while(zoomLink.indexOf(" ")!=-1){
      zoomLink=zoomLink.replace(" ","");
      }

if(zoomLink.indexOf("zoom")==-1){errorFound=true;
document.getElementById("generatedLink").value="Invalid Zoom Link";
}

if(classNameToSend.length<4){errorFound=true;
document.getElementById("generatedLink").value="Invalid Class Name";}

processedLink="https://advancedfunctions.co/qrScanner3Temp.html?class="+classNameToSend+"&gClass="+zoomLink;



if(!errorFound){sendDataToLog();}

}

function sendDataToLog() {

jQuery.post('https://script.google.com/macros/s/AKfycbyL-nKci90nn2JACAiXA-iIcI6Ro-i6__4pgSiOFXY46vEQOh4/exec', {
                    linkGenerated: processedLink
                }

                ).done(function (data) {
document.getElementById("generatedLink").value=data;
document.getElementById("generatedLink").select();
document.getElementById("generatedLink").setSelectionRange(0,99999);
document.execCommand("copy");

                    if (data === "Approved") {
                     
                    } else {
                   
                    }
                })

}

        </script>
    </body>
</html>