Test

Psiklops

<font color=blue>Master of Useless Knowledge Coun
Joined
Mar 26, 2002
Messages
496
A test...

<Script language='Javascript'>var rndNum = Math.floor(Math.random() * 10000);eval("var CDTDate" + rndNum + " = 'May 17, 2003 1:00:00 AM EST';");document.writeln("<form name='CDTform" + rndNum + "' action='Javascript:void(0);'>");document.writeln('<font size=2 color=darkblue>:Pinkbounc:smooth::tongue:I Was Here!:earsgirl::earsboy::jester:</font><br>');document.writeln("<input type=text value='' size=40 name='WrittenByJamesMVenglarikII'>");document.writeln("</form>");if (theFunction) theFunction += "var d = new Date();";else var theFunction = "var d = new Date();";theFunction += "var c = new Date('" + eval("CDTDate" + rndNum) + "');";theFunction += "var tzo = (c.getTimezoneOffset() - d.getTimezoneOffset()) * 60;";theFunction += "var diff = ((c - d)/1000) + tzo;";theFunction += "var days = Math.floor(diff / 86400);";theFunction += "var rem = diff - (days * 86400);";theFunction += "var hours = Math.floor(rem / 3600);";theFunction += "rem = rem - (hours * 3600);";theFunction += "var minutes = Math.floor(rem / 60);";theFunction += "rem = rem - (minutes * 60);";theFunction += "var seconds = Math.floor(rem);";theFunction += "if ((days < 0) | (hours < 0) | (minutes < 0) | (seconds < 0)) ";theFunction += "var out = '';";theFunction += "else ";theFunction += "var out = ' ' + days + ' days ' + hours + ' hrs. ' + minutes + ' mins. ' + seconds + ' secs.';";theFunction += "document.forms.CDTform" + rndNum + ".elements.WrittenByJamesMVenglarikII.value = out;";setInterval(theFunction, 1000);</Script>
 
Are you showing the break problem?

JC
 
Ok - the problem seems to have something to do with the number of smilies in a row and the length of the <img> tags they generate. If you remove the text from the Countdown Timer text above it gives that extra line break in the jester.

Will test some more...

- Jim
 
Here's one without the jester at the end...

<Script language='Javascript'>var rndNum = Math.floor(Math.random() * 10000);eval("var CDTDate" + rndNum + " = 'May 17, 2003 1:00:00 AM EST';");document.writeln("<form name='CDTform" + rndNum + "' action='Javascript:void(0);'>");document.writeln('<font size=2 color=darkblue>:Pinkbounc:smooth::tongue::earsgirl::earsboy:</font><br>');document.writeln("<input type=text value='' size=40 name='WrittenByJamesMVenglarikII'>");document.writeln("</form>");if (theFunction) theFunction += "var d = new Date();";else var theFunction = "var d = new Date();";theFunction += "var c = new Date('" + eval("CDTDate" + rndNum) + "');";theFunction += "var tzo = (c.getTimezoneOffset() - d.getTimezoneOffset()) * 60;";theFunction += "var diff = ((c - d)/1000) + tzo;";theFunction += "var days = Math.floor(diff / 86400);";theFunction += "var rem = diff - (days * 86400);";theFunction += "var hours = Math.floor(rem / 3600);";theFunction += "rem = rem - (hours * 3600);";theFunction += "var minutes = Math.floor(rem / 60);";theFunction += "rem = rem - (minutes * 60);";theFunction += "var seconds = Math.floor(rem);";theFunction += "if ((days < 0) | (hours < 0) | (minutes < 0) | (seconds < 0)) ";theFunction += "var out = '';";theFunction += "else ";theFunction += "var out = ' ' + days + ' days ' + hours + ' hrs. ' + minutes + ' mins. ' + seconds + ' secs.';";theFunction += "document.forms.CDTform" + rndNum + ".elements.WrittenByJamesMVenglarikII.value = out;";setInterval(theFunction, 1000);</Script>
 

Here's on e with the jester, but the earsgirl changed to ;)

<Script language='Javascript'>var rndNum = Math.floor(Math.random() * 10000);eval("var CDTDate" + rndNum + " = 'May 17, 2003 1:00:00 AM EST';");document.writeln("<form name='CDTform" + rndNum + "' action='Javascript:void(0);'>");document.writeln('<font size=2 color=darkblue>:Pinkbounc:smooth::tongue:;):earsboy::jester:</font><br>');document.writeln("<input type=text value='' size=40 name='WrittenByJamesMVenglarikII'>");document.writeln("</form>");if (theFunction) theFunction += "var d = new Date();";else var theFunction = "var d = new Date();";theFunction += "var c = new Date('" + eval("CDTDate" + rndNum) + "');";theFunction += "var tzo = (c.getTimezoneOffset() - d.getTimezoneOffset()) * 60;";theFunction += "var diff = ((c - d)/1000) + tzo;";theFunction += "var days = Math.floor(diff / 86400);";theFunction += "var rem = diff - (days * 86400);";theFunction += "var hours = Math.floor(rem / 3600);";theFunction += "rem = rem - (hours * 3600);";theFunction += "var minutes = Math.floor(rem / 60);";theFunction += "rem = rem - (minutes * 60);";theFunction += "var seconds = Math.floor(rem);";theFunction += "if ((days < 0) | (hours < 0) | (minutes < 0) | (seconds < 0)) ";theFunction += "var out = '';";theFunction += "else ";theFunction += "var out = ' ' + days + ' days ' + hours + ' hrs. ' + minutes + ' mins. ' + seconds + ' secs.';";theFunction += "document.forms.CDTform" + rndNum + ".elements.WrittenByJamesMVenglarikII.value = out;";setInterval(theFunction, 1000);</Script>
 
changing a bunch of stuff

<Script language='Javascript'>var rndNum = Math.floor(Math.random() * 10000);eval("var CDTDate" + rndNum + " = 'May 17, 2003 1:00:00 AM EST';");document.writeln("<form name='CDTform" + rndNum + "' action='Javascript:void(0);'>");document.writeln('<font size=2 color=darkblue> :Pinkbounc:eek::):earsboy::earsboy::earsboy::eek:</font><br>');document.writeln("<input type=text value='' size=40 name='WrittenByJamesMVenglarikII'>"); document.writeln("</form>");if (theFunction) theFunction += "var d = new Date();";else var theFunction = "var d = new Date();";theFunction += "var c = new Date('" + eval("CDTDate" + rndNum) + "');";theFunction += "var tzo = (c.getTimezoneOffset() - d.getTimezoneOffset()) * 60;";theFunction += "var diff = ((c - d)/1000) + tzo;";theFunction += "var days = Math.floor(diff / 86400);";theFunction += "var rem = diff - (days * 86400);";theFunction += "var hours = Math.floor(rem / 3600);";theFunction += "rem = rem - (hours * 3600);";theFunction += "var minutes = Math.floor(rem / 60);";theFunction += "rem = rem - (minutes * 60);";theFunction += "var seconds = Math.floor(rem);";theFunction += "if ((days < 0) | (hours < 0) | (minutes < 0) | (seconds < 0)) ";theFunction += "var out = '';";theFunction += "else ";theFunction += "var out = ' ' + days + ' days ' + hours + ' hrs. ' + minutes + ' mins. ' + seconds + ' secs.';";theFunction += "document.forms.CDTform" + rndNum + ".elements.WrittenByJamesMVenglarikII.value = out;";setInterval(theFunction, 1000);</Script>
 
And now for something completely different...

51 characters in a row with no spaces:
123456789012345678901234567890123456789012345678901

51 characters in a row with the 50th character replaced with a space:
1234567890123456789012345678901234567890123456789 1

Let's see what that did...
 
That just proved that the board automatically inserts a line break after 50, non space-broken characters.

Now, the question is how do we get around that for a string of smilies?

I'll see what might be done to the generator - maybe automatically placing a space before each smilie...

- Jim
 
If the spaces thing doesn't work, could you substittute the HTML image code for the vB code instead? That would remove the problem right?

JC
 
How about a wrap text area rather than the run on box it has now for the input field? Limit it to 50 characters max. width? This would allow for more a descriptive text too.

I'm not really thinking these through, I'm just mentioning ideas.

JC
 
.................or would it have to be 49 width? I guess it doesn't really matter.
 
Yes, that would do it, it just makes the script a bit longer to store and it would break the smilies if you ever changed their location, but no biggee...

I think the spaces will work, but I'm having a little trouble accessing the files on the site - I have an e-mail into the support folks, so I might not be able to get it changed until tomorrow.

- Jim
 
I know, I know, I'm rambling.....

The 50 max nbsp thing is there to stop the layout of the boards from getting disrupted like when I post PHP code.

Example:

PHP:
<Script language='Javascript'>var rndNum = Math.floor(Math.random() * 10000);eval("var CDTDate" + rndNum + " = 'October 19, 2002 1:00:00 AM EST';");document.writeln("<form name='CDTform" + rndNum + "' action='Javascript:void(0);'>");document.writeln('<font size=2 color=darkblue>More \"Magic\"al Memories Oct.19 :earsboy::earsgirl::earsgirl::earsgirl::earsboy:</font><br>');document.writeln("<input type=text value='' size=40 name='WrittenByJamesMVenglarikII'>");document.writeln("</form>");if (theFunction) theFunction += "var d = new Date();";else var theFunction = "var d = new Date();";theFunction += "var c = new Date('" + eval("CDTDate" + rndNum) + "');";theFunction += "var tzo = (c.getTimezoneOffset() - d.getTimezoneOffset()) * 60;";theFunction += "var diff = ((c - d)/1000) + tzo;";theFunction += "var days = Math.floor(diff / 86400);";theFunction += "var rem = diff - (days * 86400);";theFunction += "var hours = Math.floor(rem / 3600);";theFunction += "rem = rem - (hours * 3600);";theFunction += "var minutes = Math.floor(rem / 60);";theFunction += "rem = rem - (minutes * 60);";theFunction += "var seconds = Math.floor(rem);";theFunction += "if ((days < 0) | (hours < 0) | (minutes < 0) | (seconds < 0)) ";theFunction += "var out = 'We\\\'re there!';";theFunction += "else ";theFunction += "var out = ' ' + days + ' days ' + hours + ' hrs. ' + minutes + ' mins. ' + seconds + ' secs.';";theFunction += "document.forms.CDTform" + rndNum + ".elements.WrittenByJamesMVenglarikII.value = out;";setInterval(theFunction, 1000);</Script>

In case you were wondering.
JC
 
Figures, it didn't do it in the example! :rolleyes:

I think you get the idea though.

JC
 
The wrap text box would be neat, but there is currently no way to enforce maxlength on a textarea field. Also, there actually IS a maxlength set on the current text input box, but when you place text into it from Javascript (as the Generator does with the smilies), the maxlength property is circumvented (I don't know why).

I thought about having it keep up with the length to limit it with the smilies, but I never got around to it and I figured people would get upset if they were limited on the smilies...

I know what you're saying about the wrapping and I don't have any problem with it since it's helping to keep control on the board - I just want to find a way where we aren't getting all of those broken Countdown Timers! :)

- Jim
 
The HTML idea doesn't sound quite as nice when I think of all the problems it could cause if the URL's of the images were changed.

Take your time.

The check's in the mail. ;)

JC
 
I fixed the previous example post.

JC
 
Tell me how wrong I am, but can't you just use"textarea.wrap" as the input field and set the column width? Wouldn't that place a soft break everyplace it's needed?

I don't know what are valid input "types" and what are not.

I haven't used JS in quite a long time.

JC
 
Yes, that would allow for a larger input area, but there is no way (other than through javascript) to limit the number of characters in the textarea (there is no maxlength property like there is for an input textbox).

- Jim
 
Could you pass the input.text value (which has a maxlength) to a hidden input.textarea.wrap and just use the attributes of both to filter and accomplish the breaks?

JC
 




New Posts









Receive up to $1,000 in Onboard Credit and a Gift Basket!
That’s right — when you book your Disney Cruise with Dreams Unlimited Travel, you’ll receive incredible shipboard credits to spend during your vacation!
CLICK HERE













DIS Facebook DIS youtube DIS Instagram DIS Pinterest DIS Tiktok DIS Twitter DIS Bluesky

Back
Top