MSV FM

dot.antimicrobial@66.96.161.157: ~ $
Path : /hermes/sb_web/b1536/advancedfunctions.co/lahblms/
File Upload :
Current < : //hermes/sb_web/b1536/advancedfunctions.co/lahblms/therapistProfile.js

var therapistSlideScript="<div style= 'background-color:white;width:25vw;min-width:320px;' ><div style='height:100px;background-color:white;width:100%'><img src='saceSpaceHighContrastTransparency.png' width=250 style='position:absolute;left:50%;transform:translate(-50%,0%);padding:5px 5px;'></div><div id='therapistSlide' style='display:block'></div><div style='height:50px;background-color:white;'><div style='position:absolute;left:50%;transform:translate(-50%,0%);background-color:white;'></div><div></div>";

var therapistPopup="<div style='box-shadow: 0px 4px 8px 4px rgba(10,31,87,0.2);background-color:white;z-index:2;position:fixed;top:50px;left:50vw;transform:translate(-50%,0%);-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;padding:10px 20px;min-width:320px;' >"+therapistSlideScript+"</div>";

function renderTherapistPopup(elementId){
document.getElementById(elementId).innerHTML=therapistPopup;
document.getElementById('therapistSlide').innerHTML="<h5 style='background-color:black;color:white;text-align:center;padding:10px 20px;'>Create a profile</h5><div ><div style='width:100%;padding:10px 10px;-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;border:1px solid lightgray;font: 18px Calibri;margin-top:20px;'>Upload a profile picture<input type='file' id='profilePictureToUpload' style='margin-bottom:20px;margin:20px;' onclick='javascript:removeProfileToUploadWarning()'></input></div><div><textarea onclick='javascript:removeProfileToUploadWarning()' id='myProfileDescriptionToUpload' placeholder='Write something about yourself.' style='margin-top:20px;max-width:100%;min-width:100%;box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.2);background-color:white;z-index:2;padding:10px 10px;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;border:none;margin-bottom:20px;' ></textarea><div onclick='javascript:uploadMyProfile()' style='cursor:pointer;' ><div style='margin-bottom:20px; width:100%;font: 18px Calibri;padding:5px 5px;text-align:center;background-color:lightgray' id='myProfileUploadButton' ><i class='fas fa-save' ></i> Save </div><div id='uploadStatus' style='font:18px Calibri;text-align:center;'>&nbsp;</div></div></div></div>";
}

function uploadMyProfile(){
var fieldsCompletedToUpload=true;
var profilePictureToUpload=document.getElementById('profilePictureToUpload').files[0];
var myProfileDescriptionToUpload=document.getElementById('myProfileDescriptionToUpload').value;
if(myProfileDescriptionToUpload==''){
fieldsCompletedToUpload=false;
document.getElementById('myProfileUploadButton').innerHTML="<i class='fas fa-exclamation-triangle' style='color:orange'></i> Profile description missing";
}
if(typeof profilePictureToUpload=='undefined'){
fieldsCompletedToUpload=false;
document.getElementById('myProfileUploadButton').innerHTML="<i class='fas fa-exclamation-triangle' style='color:orange'></i> Profile picture missing";
}

if(fieldsCompletedToUpload){
var fileReader=new FileReader();
var rawFile='';

fileReader.onload=function(){
rawFile=fileReader.result;
var resourceData=rawFile.substring(rawFile.indexOf('base64,')+7,rawFile.length);
waitForTherapistInfo(resourceData,profilePictureToUpload.type,myProfileDescriptionToUpload);
}
fileReader.readAsDataURL(profilePictureToUpload);
document.getElementById('uploadStatus').innerHTML="<span style='animation-name:popupStatus;animation-duration:8s;animation-iteration-count:infinite'><i class='fas fa-cloud-upload-alt' style='color:orange'></i> Uploading...</span> ";
document.getElementById('myProfileUploadButton').innerHTML='&#39;';
document.getElementById('myProfileUploadButton').style.backgroundColor='white';
}


}

function removeProfileToUploadWarning(){
document.getElementById('myProfileUploadButton').innerHTML="<i class='fas fa-save' ></i> Save ";
}