NEVERSLEEP
Programmer
when i run my page my script
misconduct it self and i can't seem to spot the bug
run the page wait for the end (u will know when)
and then hit the debug word to view what i wanted
it not the same....
could someone help me ! thanks alot
here the code
<!-- author : aDjOu (c) adjtml 1.0 tester page -->
<html>
<head>
<style type="text/css">
<!--
BODY{
scrollbar-face-color:000000;
scrollbar-arrow-color:000000;
scrollbar-track-color:000000;
scrollbar-highlight-color:000000;
}
div.one{
color:0066cc;
font:28px bold;
font-family:helvetica;
position:absolute;
left:160;
top:30;
width:600;
text-align:left;
}
div.two{
color:FFFFFF;
font:24px bold;
font-family:helvetica;
position:absolute;
left:160;
top:130;
width:600;
text-align:left;
}
-->
</style>
<!-- in the js code here we are asuming your browser suport my methods mine are ie6 & ns6.2 -->
<script language="javascript1.2" type="text/javascript">
<!--
var delay = 80;
var operator = 0;
var lastoprt = 0;
var deepoprt = 0;
var counter_one = 0;
var counter_two = 0;
var operator_history = 0;
var lock;
var tag;
var thatag;
var letter_one;
var letter_two;
var link_value = "";
var mail_value = "";
var image_value = "";
var content_one = "100% preserved code <br> [br] for title";
var content_two = "adjtml example ~:~ (linebreak test each line)[br]pre ? : <br> ~again ? ~ <br> see[br][image ][br]now text fun :[br]test test test[br]some test again [br]more[br]end";
function startup() {
runner = setInterval("dothajob()", delay);
}
function dothajob() {
if (content_two.charAt(counter_two) == "[" {
if (content_two.charAt(counter_two + 1) == "/" {
if ((content_two.charAt(counter_two + 2) == "b" && (content_two.charAt(counter_two + 3) == "]") {
setoperator();
counter_two += 3;
}
if ((content_two.charAt(counter_two + 2) == "i" && (content_two.charAt(counter_two + 3) == "]") {
setoperator();
counter_two += 3;
}
if ((content_two.charAt(counter_two + 2) == "u" && (content_two.charAt(counter_two + 3) == "]") {
setoperator();
counter_two += 3;
}
if ((content_two.charAt(counter_two + 2) == "l" && (content_two.charAt(counter_two + 3) == "i" && (content_two.charAt(counter_two + 4) == "n" && (content_two.charAt(counter_two + 5) == "k" && (content_two.charAt(counter_two + 6) == "]") {
setoperator();
counter_two += 6;
}
if ((content_two.charAt(counter_two + 2) == "m" && (content_two.charAt(counter_two + 3) == "a" && (content_two.charAt(counter_two + 4) == "i" && (content_two.charAt(counter_two + 5) == "l" && (content_two.charAt(counter_two + 6) == "]") {
setoperator();
counter_two += 6;
}
} else {
if (content_two.charAt(counter_two + 1) == "b" {
if ((content_two.charAt(counter_two + 2) == "r" && (content_two.charAt(counter_two + 3) == "]") {
writetag('<br>');
counter_two += 3;
} else {
if (content_two.charAt(counter_two + 2) == "]" {
writetag('<b></b>');
lastoprt = operator;
operator = 1;
counter_two += 2;
}
}
} else {
if ((content_two.charAt(counter_two + 1) == "u" && (content_two.charAt(counter_two + 2) == "]") {
writetag('<u></u>');
deepoprt = lastoprt;
lastoprt = operator;
operator_history++;
operator = 2;
counter_two += 2;
} else {
if ((content_two.charAt(counter_two + 1) == "i" && (content_two.charAt(counter_two + 2) == "]") {
writetag('<i></i>');
deepoprt = lastoprt;
lastoprt = operator;
operator_history++;
operator = 3;
counter_two += 2;
} else {
if ((content_two.charAt(counter_two + 1) == "i" && (content_two.charAt(counter_two + 2) == "m" && (content_two.charAt(counter_two + 3) == "a" && (content_two.charAt(counter_two + 4) == "g" && (content_two.charAt(counter_two + 5) == "e" && (content_two.charAt(counter_two + 6) == " ") {
lock = 7;
while (lock > 0) {
if (content_two.charAt(counter_two + lock) == "]" {
counter_two += lock;
lock = 0;
} else {
image_value += content_two.charAt(counter_two + lock);
lock++;
}
}
writetag('<img src="' + image_value + '" border="0">');
} else {
// underc
if ((content_two.charAt(counter_two + 1) == "l" && (content_two.charAt(counter_two + 2) == "i" && (content_two.charAt(counter_two + 3) == "n" && (content_two.charAt(counter_two + 4) == "k" && (content_two.charAt(counter_two + 5) == " ") {
deepoprt = lastoprt;
lastoprt = operator;
operator_history++;
operator = 4;
} else {
if ((content_two.charAt(counter_two + 1) == "m" && (content_two.charAt(counter_two + 2) == "a" && (content_two.charAt(counter_two + 3) == "i" && (content_two.charAt(counter_two + 4) == "l" && (content_two.charAt(counter_two + 5) == " ") {
deepoprt = lastoprt;
lastoprt = operator;
operator_history++;
operator = 4;
}
}
// end underc
}
}
}
}
}
} else {
document.getElementById('one').appendChild(document.createTextNode(content_one.charAt(counter_one)));
if (operator == 0) {
document.getElementById('two').appendChild(document.createTextNode(content_two.charAt(counter_two)));
} else {
if (operator == 1) {
tag = document.getElementById('two').getElementsByTagName('b');
tag[tag.length - 1].appendChild(document.createTextNode(content_two.charAt(counter_two)));
} else {
if (operator == 2) {
tag = document.getElementById('two').getElementsByTagName('u');
tag[tag.length - 1].appendChild(document.createTextNode(content_two.charAt(counter_two)));
} else {
if (operator == 3) {
tag = document.getElementById('two').getElementsByTagName('i');
tag[tag.length - 1].appendChild(document.createTextNode(content_two.charAt(counter_two)));
} else {
tag = document.getElementById('two').getElementsByTagName('a');
tag[tag.length - 1].appendChild(document.createTextNode(content_two.charAt(counter_two)));
}
}
}
}
}
if ((content_one.charAt(counter_one) == "" && (content_two.charAt(counter_two) == "") {
window.clearInterval(runner);
} else {
counter_one++;
counter_two++;
}
}
function setoperator() {
if (operator_history == 0) {
operator = 0;
} else {
if (operator_history == 1) {
operator = lastoprt;
} else {
if (operator_history == 2) {
operator = deepoprt;
}
}
operator_history--;
}
}
function writetag(whatag) {
if (operator == 0) {
document.getElementById('two').appendChild(document.createElement(whatag));
} else {
if (operator == 1) {
tag = document.getElementById('two').getElementsByTagName('b');
} else {
if (operator == 2) {
tag = document.getElementById('two').getElementsByTagName('u');
} else {
if (operator == 3) {
tag = document.getElementById('two').getElementsByTagName('i');
} else {
if (operator == 4) {
tag = document.getElementById('two').getElementsByTagName('a');
}
}
}
}
tag[tag.length - 1].appendChild(document.createElement(whatag));
}
}
function debug() {
alert(content_two + "\n\n\n" + "counter_two = " + counter_two + " : operator value = " + operator + " : operator_history value = " + operator_history + "\n\n\n" + "suppose to be :\nadjtml example ~:~ (linebreak test each line)\npre ? : <br> ~again ? ~ <br> see\n[image ...]\nnow text fun :\ntest test test\nsome test again \nmore\nend"
}
-->
</script>
</head>
<body onload="startup()" bgcolor="000000">
<br><a href="javascript:debug()">debug</a>
<div id="one" class="one"></div>
<div id="two" class="two"></div>
</body>
</html> someone knowledge ends where
someone else knowledge starts
misconduct it self and i can't seem to spot the bug
run the page wait for the end (u will know when)
and then hit the debug word to view what i wanted
it not the same....
could someone help me ! thanks alot
here the code
<!-- author : aDjOu (c) adjtml 1.0 tester page -->
<html>
<head>
<style type="text/css">
<!--
BODY{
scrollbar-face-color:000000;
scrollbar-arrow-color:000000;
scrollbar-track-color:000000;
scrollbar-highlight-color:000000;
}
div.one{
color:0066cc;
font:28px bold;
font-family:helvetica;
position:absolute;
left:160;
top:30;
width:600;
text-align:left;
}
div.two{
color:FFFFFF;
font:24px bold;
font-family:helvetica;
position:absolute;
left:160;
top:130;
width:600;
text-align:left;
}
-->
</style>
<!-- in the js code here we are asuming your browser suport my methods mine are ie6 & ns6.2 -->
<script language="javascript1.2" type="text/javascript">
<!--
var delay = 80;
var operator = 0;
var lastoprt = 0;
var deepoprt = 0;
var counter_one = 0;
var counter_two = 0;
var operator_history = 0;
var lock;
var tag;
var thatag;
var letter_one;
var letter_two;
var link_value = "";
var mail_value = "";
var image_value = "";
var content_one = "100% preserved code <br> [br] for title";
var content_two = "adjtml example ~:~ (linebreak test each line)[br]pre ? : <br> ~again ? ~ <br> see[br][image ][br]now text fun :[br]test test test[br]some test again [br]more[br]end";
function startup() {
runner = setInterval("dothajob()", delay);
}
function dothajob() {
if (content_two.charAt(counter_two) == "[" {
if (content_two.charAt(counter_two + 1) == "/" {
if ((content_two.charAt(counter_two + 2) == "b" && (content_two.charAt(counter_two + 3) == "]") {
setoperator();
counter_two += 3;
}
if ((content_two.charAt(counter_two + 2) == "i" && (content_two.charAt(counter_two + 3) == "]") {
setoperator();
counter_two += 3;
}
if ((content_two.charAt(counter_two + 2) == "u" && (content_two.charAt(counter_two + 3) == "]") {
setoperator();
counter_two += 3;
}
if ((content_two.charAt(counter_two + 2) == "l" && (content_two.charAt(counter_two + 3) == "i" && (content_two.charAt(counter_two + 4) == "n" && (content_two.charAt(counter_two + 5) == "k" && (content_two.charAt(counter_two + 6) == "]") {
setoperator();
counter_two += 6;
}
if ((content_two.charAt(counter_two + 2) == "m" && (content_two.charAt(counter_two + 3) == "a" && (content_two.charAt(counter_two + 4) == "i" && (content_two.charAt(counter_two + 5) == "l" && (content_two.charAt(counter_two + 6) == "]") {
setoperator();
counter_two += 6;
}
} else {
if (content_two.charAt(counter_two + 1) == "b" {
if ((content_two.charAt(counter_two + 2) == "r" && (content_two.charAt(counter_two + 3) == "]") {
writetag('<br>');
counter_two += 3;
} else {
if (content_two.charAt(counter_two + 2) == "]" {
writetag('<b></b>');
lastoprt = operator;
operator = 1;
counter_two += 2;
}
}
} else {
if ((content_two.charAt(counter_two + 1) == "u" && (content_two.charAt(counter_two + 2) == "]") {
writetag('<u></u>');
deepoprt = lastoprt;
lastoprt = operator;
operator_history++;
operator = 2;
counter_two += 2;
} else {
if ((content_two.charAt(counter_two + 1) == "i" && (content_two.charAt(counter_two + 2) == "]") {
writetag('<i></i>');
deepoprt = lastoprt;
lastoprt = operator;
operator_history++;
operator = 3;
counter_two += 2;
} else {
if ((content_two.charAt(counter_two + 1) == "i" && (content_two.charAt(counter_two + 2) == "m" && (content_two.charAt(counter_two + 3) == "a" && (content_two.charAt(counter_two + 4) == "g" && (content_two.charAt(counter_two + 5) == "e" && (content_two.charAt(counter_two + 6) == " ") {
lock = 7;
while (lock > 0) {
if (content_two.charAt(counter_two + lock) == "]" {
counter_two += lock;
lock = 0;
} else {
image_value += content_two.charAt(counter_two + lock);
lock++;
}
}
writetag('<img src="' + image_value + '" border="0">');
} else {
// underc
if ((content_two.charAt(counter_two + 1) == "l" && (content_two.charAt(counter_two + 2) == "i" && (content_two.charAt(counter_two + 3) == "n" && (content_two.charAt(counter_two + 4) == "k" && (content_two.charAt(counter_two + 5) == " ") {
deepoprt = lastoprt;
lastoprt = operator;
operator_history++;
operator = 4;
} else {
if ((content_two.charAt(counter_two + 1) == "m" && (content_two.charAt(counter_two + 2) == "a" && (content_two.charAt(counter_two + 3) == "i" && (content_two.charAt(counter_two + 4) == "l" && (content_two.charAt(counter_two + 5) == " ") {
deepoprt = lastoprt;
lastoprt = operator;
operator_history++;
operator = 4;
}
}
// end underc
}
}
}
}
}
} else {
document.getElementById('one').appendChild(document.createTextNode(content_one.charAt(counter_one)));
if (operator == 0) {
document.getElementById('two').appendChild(document.createTextNode(content_two.charAt(counter_two)));
} else {
if (operator == 1) {
tag = document.getElementById('two').getElementsByTagName('b');
tag[tag.length - 1].appendChild(document.createTextNode(content_two.charAt(counter_two)));
} else {
if (operator == 2) {
tag = document.getElementById('two').getElementsByTagName('u');
tag[tag.length - 1].appendChild(document.createTextNode(content_two.charAt(counter_two)));
} else {
if (operator == 3) {
tag = document.getElementById('two').getElementsByTagName('i');
tag[tag.length - 1].appendChild(document.createTextNode(content_two.charAt(counter_two)));
} else {
tag = document.getElementById('two').getElementsByTagName('a');
tag[tag.length - 1].appendChild(document.createTextNode(content_two.charAt(counter_two)));
}
}
}
}
}
if ((content_one.charAt(counter_one) == "" && (content_two.charAt(counter_two) == "") {
window.clearInterval(runner);
} else {
counter_one++;
counter_two++;
}
}
function setoperator() {
if (operator_history == 0) {
operator = 0;
} else {
if (operator_history == 1) {
operator = lastoprt;
} else {
if (operator_history == 2) {
operator = deepoprt;
}
}
operator_history--;
}
}
function writetag(whatag) {
if (operator == 0) {
document.getElementById('two').appendChild(document.createElement(whatag));
} else {
if (operator == 1) {
tag = document.getElementById('two').getElementsByTagName('b');
} else {
if (operator == 2) {
tag = document.getElementById('two').getElementsByTagName('u');
} else {
if (operator == 3) {
tag = document.getElementById('two').getElementsByTagName('i');
} else {
if (operator == 4) {
tag = document.getElementById('two').getElementsByTagName('a');
}
}
}
}
tag[tag.length - 1].appendChild(document.createElement(whatag));
}
}
function debug() {
alert(content_two + "\n\n\n" + "counter_two = " + counter_two + " : operator value = " + operator + " : operator_history value = " + operator_history + "\n\n\n" + "suppose to be :\nadjtml example ~:~ (linebreak test each line)\npre ? : <br> ~again ? ~ <br> see\n[image ...]\nnow text fun :\ntest test test\nsome test again \nmore\nend"
}
-->
</script>
</head>
<body onload="startup()" bgcolor="000000">
<br><a href="javascript:debug()">debug</a>
<div id="one" class="one"></div>
<div id="two" class="two"></div>
</body>
</html> someone knowledge ends where
someone else knowledge starts