This is a test and sample page for css, javascript, web functions, linux functions and other references.
Submits will go to an error page with all pass data.
In <HEAD> before <BODY>:
<style>
#myBtn {
display: none; /* Hidden by default */
position: fixed; /* Fixed/sticky position */
bottom: 20px; /* Place the button at the bottom of the page */
left: 30px; /* Place the button 30px from the left */
z-index: 99; /* Make sure it does not overlap */
border: none; /* Remove borders */
outline: none; /* Remove outline */
background-color: red; /* Set a background color */
color: white; /* Text color */
cursor: pointer; /* Add a mouse pointer on hover */
padding: 15px; /* Some padding */
border-radius: 10px; /* Rounded corners */
font-size: 18px; /* Increase font size */
}
#myBtn:hover {
background-color: #555; /* Add a dark-grey background on hover */
}
</style>
After <BODY>, preferably either after menu bar or just after:
<button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
<div style="background-color:black;color:white;padding:30px">Scroll Down</div>
<script>
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("myBtn").style.display = "block";
} else {
document.getElementById("myBtn").style.display = "none";
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script>
In the .js file:
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("myBtn").style.display = "block";
} else {
document.getElementById("myBtn").style.display = "none";
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0; // For Safari
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
}
In the javascript file it uses the following functions:
<BODY onLoad="setVariables();checkLocation();">
setVariables - used with 'body onload'
function setVariables(){
if (navigator.appName == "Netscape") { v=".top=";dS="document.";sD="";y="window.pageYOffset" }
else {
v=".pixelTop=";dS="";sD=".style";y="document.body.scrollTop"}
}
checkLocation() - used with 'body onload'
function checkLocation(){
object="object1";yy=eval(y);eval(dS+object+sD+v+yy);setTimeout("checkLocation()",10)}
onme()
function onme() {
el = event.srcElement ;
if (el.getAttribute("litUp1") != null) {
el.className = "on" ;
}
}
offme()
function offme() {
el = event.srcElement ;
if (el.getAttribute("litUp1") != null) {
el.className = "off";
}
}
document.onMouseOver = onme ;
document.onMouseOut = offme ;
mopen(id)
function mopen(id)
{
// cancel close timer
mcancelclosetime();
// close old layer
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
// get new layer and show it
ddmenuitem = document.getElementById(id);
ddmenuitem.style.visibility = 'visible';
}
// close showed layer
mclose()
function mclose()
{
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}
// go close timer
mclosetime()
function mclosetime()
{
closetimer = window.setTimeout(mclose, timeout);
}
// cancel close timer
mcancelclosetime()
function mcancelclosetime()
{
if(closetimer)
window.clearTimeout(closetimer);
closetimer = null;
}
}
// close layer when click-out
document.onclick = mclose;
It appears to use the css file with the following values:
#sddm
#sddm li
#sddm li a
#sddm li a:hover
#sddm div
#sddm div a
#sddm div a:hover
This is a clickable drop down and the data is hidden until clicked. Stays open until clicked again.
In the javascript file it uses the following functions:
displayLayer(which)
function displayLayer(which) {
obj = document.getElementById(which);
obj.style.display == "block" ? obj.style.display = "none" : obj.style.display = "block";
}
Click for Trip Sheet information
while true
do
clear
echo " CUSTOMWARE DEMONSTRATION OPTIONS
"
echo " 1. Silk Screen CustomWare Demo
2. Equipment CustomWare Demo
3. Tour/Travel Guide CustomWare Demo
4. Basic (nearly clean) CustomWare Demo
"
# (1) prompt user, and read command line argument
read -p "Select Choice by number or . " answer
# (2) handle the input we were given
case in
[1]* ) cd databases/huge
pragma .
break;;
[2]* ) cd databases/taylor
pragma .
break ;;
[3]* ) cd ../
pragma .
break;;
[4]* ) pragma .
break;;
[.]* ) exit;;
* ) echo "Dude, select an option you actually see!";;
esac
done
Entr in the CSS file to highlight text input.:
.inputHighlighted
{
background-color:bisque;
color:navy;
font-size:11px;
line-height:13px;
font-weight:bold;
text-align:left;
}
A script in the js file to highlight text input. Must also have script just above "</body>":
<script type="text/javascript">
// Initialize the input highlight script
initInputHighlightScript();
</script>
</BODY>
This is placed after the <BODY> tag
<script>
(function() {
const idleDurationSecs = 6; // X number of seconds
const redirectUrl = 'https://www.customware.com/cgi-bin/test/test-works.cgi?p=e'; // Redirect idle users to this URL
let idleTimeout; // variable to hold the timeout, do not modify
const resetIdleTimeout = function() {
// Clears the existing timeout
if(idleTimeout) clearTimeout(idleTimeout);
// Set a new idle timeout to load the redirectUrl after idleDurationSecs
idleTimeout = setTimeout(() => location.href = redirectUrl, idleDurationSecs * 1000);
};
// Init on page load
resetIdleTimeout();
// Reset the idle timeout on any of the events listed below
['click','mousemove','mousedown','mouseup','mouseover','mouseout'].forEach(evt =>
document.addEventListener(evt, resetIdleTimeout, false)
);
})();
</script>
Click here to turn on a redirect to login page after a set time out of mouse inactivity.
You will be directed to the error page. Hit any link on the error page.
Form submit with SIMPLE verification - says, "please fill out this field" - auto html function?
<FORM ACTION="https://www.customware.com/cgi-bin/test/test-works.cgi" METHOD="POST">
<input name=t1 required>
<input type=hidden name=p value=fnv>
<P>
<input type=submit>
</form>
Form submit with verified input. This has a javascript function for each field. Allows custom instruction.
<FORM name=testForm ACTION="https://www.customware.com/cgi-bin/test/test-works.cgi" onsubmit="return validateForm()"; METHOD="POST">
name
<input name=t2>
password
<input name=t3>
<input type=hidden name=p value=fv>
<P>
<input type=submit>
</form>
Uses js file for:
validateForm()
Note that each field must have different name (t2,t3) as well as a different var name (x and y in this case)*/
function validateForm() {
var x=document.forms["testForm"]["t2"].value;
if (x==null || x=="")
{
alert("Name must be filled out");
return false;
}
var y=document.forms["testForm"]["t3"].value;
if (y==null || y=="") {
alert("Password name must be filled out");
return false;
}}
The different options with zip will store the files with or without directories
zip -rv9db /home/cw/backup/$yy/$mm/$xx-cwbul /home/cw/*.PFM /home/cw/printers -x@except
File result: home/cw/PRVOCAB.PFM
zip -9rv /home/cw/backup/$yy/$mm/$xx-cw-install install
File result: install/VOCAB.zip
zip -9v -x@except /home/cw/backup/$yy/$mm/$xx-cw-pfmfiles * ../backup/bu* ../backup/choice
File result: PRVOCAB.PFM
Usage:
<form>
Date of birth: (<script>DateInput('birth', true, 'MM-DD-YY','01-01-00')</script>
</form>
This program is too large to put here - look at the .js file.
Note that on only <form> has no path, etc - while in a form page, it only works the way shown.
Uses js file
Must be within a form function
Need to change only the 3 image url's in the js file. Will need only path from the cgi file.
Will need the variable set to a default (birthday can't be blank) and must be in same format as specified in the input line
This page has popups that allow navigation from one product to the next.
On the lower left you'll see a round target (shaded). This opens the main menu for product in the same page.
Clicking on a product name brings up the pop up.
<AREA ALT="Mountain Bike Designs" SHAPE="RECT" HREF="http://customware.com/cgi-bin/huge/huge.cgi?custid=&p=P1"
onClick="window.open('http://customware.com/cgi-bin/huge/huge.cgi?custid=&p=P2&cat=mountainbike&matrix=1','',config='height=520,width=430,toolbar=no,menubar=yes,scrollbars=no,resizable=no,location=no,directories=no,status=no')" COORDS="278,80,462,99"&t;
OPEN AND READ, SORT A FILE (password)
sub Getpwf {
@pwf1=@_;
@pwfs=@_;
@pwf=@_;
$valid=0;
open(PW, "$pwfile") or $valid=1;
if ($valid eq 1){
$title1="Failed to open password file";
&Error;
}
while() {
chomp $_;
push(@pwf,$_);
}
close(PW);
push(@pwfs,(sort(@pwf)));
}
OPEN SPECIFIC FILE (1 line?)
$contract1="data/sti/$contract";
$valid=0;
$fh="FH";
open($fh,'<',"$contract1") or $valid=1;
while ($row = <$fh>){
chomp $row;
$row1=$row;
($contract2,$date,$name,$slsmn,$operator)=split(/ /,$row1,5);
}
Over Write existing file
for APPEND TO END, us ">>"
open (STI, "> $datafile") or $valid=1;
if ($valid eq 1){
$title="Couldn't update contract file";
&Error;
}
$next++;
$left=$last-$next;
print STI "$prefix $next $last";
close("$datafile");
Read all files in a directory one at a time:
while ($filename= readdir DIR) {
}
Read all files in a directory to an array:
@files2= grep(/.ar$/,readdir(DIR));
Find all dirs
opendir($DIR, $datadir );
while ($entry = readdir $DIR ) {
next unless -d $datadir . '/' . $entry;
next if $entry eq '.' or $entry eq '..';
push(@dirs,$entry);
}
Get specific file type in dir:
opendir(DIR, "data/payroll");
@files1 = grep(/.pdf$/,readdir(DIR));
closedir(DIR);
The actual value of coords is totally dependent on the shape in question. Here is a summary, to be followed by detailed examples. You can use any available tool like Adobe Photoshop or MS Paint to detect various coordinates available on the image to be used for ISMAP.
A lines beginning with # are comments. Every other non-blank line consists of the following −
rect = x1 , y1 , x2 , y2
x1 and y1 are the coordinates of the upper left corner of the rectangle; x2 and y2 are the coordinates of the lower right corner.
circle = xc , yc , radius
xc and yc are the coordinates of the center of the circle, and radius is the circle's radius. A circle centered at 200,50 with a radius of 25 would have the attribute coords="200,50,25"
poly = x1 , y1 , x2 , y2 , x3 , y3 , ... xn , yn
The various x-y pairs define vertices (points) of the polygon, with a "line" being drawn from one point to the next point. A diamond-shaped polygon with its top point at 20,20 and 40 pixels across at its widest points would have the attribute coords="20,20,40,40,20,60,0,40".
All coordinates are relative to the upper-left corner of the image (0,0). Each shape has a related URL.You can use any image software to know the coordinates of different positions.
This script goes after <BODY>
<script>
(function() {
const idleDurationSecs = 60; // X number of seconds
const redirectUrl = 'https://user.xmission.com/~redman/cgibin/py.cgi'; // Redirect idle users to this URL
let idleTimeout; // variable to hold the timeout, do not modify
const resetIdleTimeout = function() {
// Clears the existing timeout
if(idleTimeout) clearTimeout(idleTimeout);
// Set a new idle timeout to load the redirectUrl after idleDurationSecs
idleTimeout = setTimeout(() => location.href = redirectUrl, idleDurationSecs * 1000);
};
// Init on page load
resetIdleTimeout();
// Reset the idle timeout on any of the events listed below
['click','mousemove','mousedown','mouseup','mouseover','mouseout'].forEach(evt => document.addEventListener(evt, resetIdleTimeout, false)
);
})();
</script>
These are found in "standards.cgi"
AddComma
ConvertFromMilitary
GetTime
CalcMonth (from short month name to long & #
CalcMonthAbbr (from # to short & long names)
Month2CapName (from # to full name in caps)
CalcDayNum (from short day name to #)
CalcDayName (from day # to short day name)
Select YN
FormatNum (format a number to 2 decimal places)
PadZeros
ZeroTotals (zeros t1 & st1 thru t20 & st20)
CalcAge
RemoveMJ
AddMJ
MultSelectInput5
Set Gender
Set Prefix
PadSpace
ConvertDatesCounter
FixDate (from 210409 to 04/09/21)