MSV FM

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

//common gui interfaces and their respective functions

/**  Insert the following in the head tags
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css'>
<script src='gui.js'></script>
**/

/**
Insert the following in script tags to run code whenever a checkbox is clicked
function onClickCheckbox(){}
**/

/**
Insert the following in script tags to create a choice
function createChoice(choiceName,choiceText)
**/

/**
Insert the following in script tags to create a button
createButton(buttonName,buttonText,functionToExecute)
**/

/**
Insert the following in script tags to add code or text to a 'div' element
function displayUi(elementId,codeOrText)
**/

function placeElementsInContainer(elementsAsString){
return "<div class='container' style='width: 300px;'>"+elementsAsString+"</div>";
}

function createChoice(choiceName,choiceText){
return "<input type='checkbox' id='"+choiceName+"' onclick='javascript:onClickCheckbox()'><label for='"+choiceName+"'>&nbsp;"+choiceText+"</label>";
}

function createButton(buttonName,buttonText,functionToExecute){
return "<button class='btn btn-default' id='"+buttonName+"' onclick='javascript:"+functionToExecute+"'>"+buttonText+"</button>";
}

function getValue(elementId){
return document.getElementById(elementId).checked;}

function getElementValue(elementId){
var elementText='';
try{elementText=document.getElementById(elementId).value;}catch(err){}
return elementText;
}

function setElementValue(elementId,value){
document.getElementById(elementId).value=value;}

function setValue(elementId,trueOrFalse){
document.getElementById(elementId).checked=trueOrFalse;}


function setEnabled(elementId,trueOrFalse){
document.getElementById(elementId).disabled=!trueOrFalse;}

function displayUi(elementId,codeOrText){
document.getElementById(elementId).innerHTML=codeOrText;
}

function getWarning(nameOfField){
document.getElementById(nameOfField).style='background-color:lightyellow';}

function createSpan(spanID){
return "<span id='"+spanID+"'></span>";
}

function getDropDownMenu(title,arrayOfOptions){
var dropDownMenuUiAsString="<select id='"+title+"' onchange='javascript:dropDownItemSelected()'>";
for(var i=0;i<arrayOfOptions.length;i++){
dropDownMenuUiAsString=dropDownMenuUiAsString+"<option value='"+arrayOfOptions[i]+"' >"+arrayOfOptions[i]+"</option>"
}
 dropDownMenuUiAsString= "<label>"+title+"</label><br>"+dropDownMenuUiAsString+'</select>';
return  dropDownMenuUiAsString;
}