From: | shadowrn@*********.com (Gurth) |
---|---|
Subject: | For Wally: time/date stamp generator |
Date: | Sun Jun 10 13:10:01 2001 |
signatures, I decided to write something that does what I suppose he meant.
The result is the HTML file I've included in this post, below. (I didn't
attach it because <GridSec warning>attachments are a no-no on the
list</GridSec warning>; I'm also hoping HTML-equipped mailers will ignore
it, but I'm not sure...)
Anyway, hopefully this is useful to someone :)
Instructions for use: everything between the <pre> and </pre> tags below
is the program/HTML file. (These are there to try and make sure that those
using HTML mailers will also see the script. If you see text boxes, a
button, etc., and the button actually does something when you click on it,
I'd suggest switching OFF certain "features" of your mailer _right_now_ :)
In this case, when you can't see the actual code, save the message to disk,
open it in a _text_ editor (not a web browser) and remove everything up to
and including the <pre> tag, and also the </pre> tag at the end and
everything after it.
If you can see the code rather than the text boxes, copy all of the code
that's between those two tags into a new, empty text file and save it to
your hard drive, preferably with ".html" or ".htm" extension.
In either case, you next open the file in your favorite web browser. Enter
the text you want into the first text box (the one with "In-text" above it)
and the name of the poster into the text box below it; copying and pasting
will be the best method, I would imagine. Then hit the Make It So... button
and the text will be Shadowrun-ized in the lower text box. If you want to
use this in a web page, check the Output As HTML box and you'll get all the
HTML character codes necessary to avoid problems, in place of the normal
larger- and smaller-than signs.
The scripts were tested in Opera 5.0 and Netscape 4.7something and found to
work without problems; hopefully they'll also do just that in other web
browsers :)
<pre>
<html>
<head>
<title>Shadowquoter</title>
<script language="JavaScript">
<!-- // Hide script from old browsers
function QuoteIt (InText, Poster, AsHTML) {
var OutText
if (AsHTML)
{
OutText = ">>>>>[" + InText
+ "]<<<<<\n—" + Poster + "
" + TimeDateStamp()
}
else
{
OutText = ">>>>>[" + InText +
"]<<<<<\n-" + Poster + " " + TimeDateStamp()
}
return OutText
}
function TimeDateStamp () {
Today = new Date()
ThisYear = 1900 + Today.getYear() // Y2K correction, else we get year 101
instead of 2001...
Hours = Today.getHours().toString()
if (Hours.length == 1) Hours = "0" + Hours
Minutes = Today.getMinutes().toString()
if (Minutes.length == 1) Minutes = "0" + Minutes
Seconds = Today.getSeconds().toString()
if (Seconds.length == 1) Seconds = "0" + Seconds
return "(" + Hours + ":" + Minutes + ":" + Seconds +
"/" + Today.getMonth() + "-" + Today.getDate() + "-" +
ThisYear.toString() + ")"
}
// end of script -->
</script>
</head>
<body>
<noscript>
<p><strong>Better get a JavaScript-capable browser</strong> (or switch
JavaScript support on, in case you already have one).</p>
</noscript>
<form name="Quoter">
<h3>In-text</h3>
<textarea cols="80" rows="10"
name="TextIn"></textarea>
<p>Poster's name: <input type="text" width="20"
name="YourNameHere"></p>
<p><input type="checkbox" name="HTMLout"
onclick="Quoter.TextOut.value = QuoteIt(TextIn.value, YourNameHere.value,
HTMLout.checked)"> Output as HTML</p>
<p><input type="button" name="QuoteNow"
value="Make it so..." onclick="Quoter.TextOut.value =
QuoteIt(TextIn.value, YourNameHere.value, HTMLout.checked)"></p>
<h3>Out-text</h3>
<textarea cols="80" rows="10"
name="TextOut"></textarea><br>
</form>
</body>
</html>
</pre>
--
Gurth@******.nl - http://www.xs4all.nl/~gurth/index.html
Conformity is our tragedy
-> NAGEE Editor * ShadowRN GridSec * Triangle Virtuoso <-
-> The Plastic Warriors Page: http://plastic.dumpshock.com <-
GC3.12: GAT/! d-(dpu) s:- !a>? C+@ UL P L++ E W-(++) N o? K w+(--) O V?
PS+ PE(-)(+) Y PGP- t@ 5++ X(+) R+++(-)>$ tv+ b++@ DI- D+ G+ e h! !r y?
Incubated into the First Church of the Sqooshy Ball, 21-05-1998