for(i=0;i<(posts=document.getElementsByTagName('blockquote')).length;i++){posts[i].innerHTML=posts[i].innerHTML.replace(/(.*?\<\;)(\<br\/?\>|$)/g,'<span style="color:orange;">$1</span>$2');}
You first have to enable orange text<
What is moot? Haha sorry I'm new here, just came from reddit (:
>>595917958
:^) (^:
:v) (v:
I dont believe it<
>is this how greentext
>>595918295
Up vote for you kind sir :-)
>>595918686
captain?
<Emmmm
for(i=0;i<(posts=document.getElementsByTagName('blockquote')).length;i++){posts[i].innerHTML=posts[i].innerHTML.replace(/(\<br\/?\>)/g,'$1\n').replace(/(.*?\<\;)(\<br\/?\>|$)/g,'<span style="color:orange;">$1</span>$2');}
This would be a better code…
I think I’ll work on a User Script for GreaseMonkey to make orange text work everywhere.
>what if i do this<
or< this
what about this<<
>>595919724
class quote (used for greentexting) overrides orange text.
Second line gets ignored as expected.
And third line becomes orange.
>>595920054
really?<
>>595920957
no<
>>595919204
Do you mind if I publish the script?
>>595919204
I have also found another issue. If you click the update button at the bottom and someone tries to orange text it shows it without the orange.
I don't know what's going on here, but I really want to.
>>595921978
we are orange texting<
>>595921550
>>595921780
I know that it doesn’t update yet. See >>595919204: I’m working on a UserScript and I’ll be experimenting with MutationObserver in order for the updating thing to work properly. You can work on it, too, and publish it if you wish. I won’t be a copyright nazi or anything with that.
>>595922064
I see.
>>595922147
I don't really know much about coding so I'm not gonna publish it. Make a thread about this on >>/s4s/ and keep it updated.
How do I blue text?
>>595922477
Fuck, I could as well implement BB Code on 4chan via Grease Monkey…
>>595922595
Use ^ to bluetext
How I do orangine now?<
Purple text.
Red text.
White text.
Black text.
Beige text.
>>595922477blutext
>>595923534
this nigga gets it
>>595917159
tfw<
The fuckers that think they can orangetext lol..
if we can orange and greentext, how does one purpletext?
>>595924234
Delete System32.
why make everything piss yellow or some terrible color for a week
>>595924500
gr8 b8 m8, i r8 it an 8/8, pls no h8 do appreci8, i dont meant to berr8 when i say i hope you will make more b8 for me to r8
<span class="redtext">moot's final 4chan Q&A has been posted <a href="//youtu.be/XYUKJBZuUig?t=41s" target="_blank" title="moot's final 4chan Q&A on YouTube">here</a>.<span>
>>595925279
<span class="redtxt">moot's final 4chan Q&A has been posted <a href="//youtu.be/XYUKJBZuUig?t=41s" target="_blank" title="moot's final 4chan Q&A on YouTube">here</a>.</span>
>>595925210
>"bait"
>when its actually just an anon trying to be funny
>>595922147
Any luck on the update thing?
>>595926118
Working user script (just finished):
/*
Orange text on 4chan:
This line becomes orange.<
This line doesn’t.
*/
function doOrange(){
for(i=0;i<(pst=document.getElementsByTagName('blockquote')).length;i++){ // For every post
pst[i].innerHTML=pst[i].innerHTML
.replace(/(\<br\/?\>)/g,'$1\n')
.replace(/(.*?\<\;)(\<br\/?\>|$)/g,'<span style="color:orange;">$1</span>$2'); // Apply orange color to every line ending with "<"
}
}
window.addEventListener('DOMContentLoaded',function(){ // Initialize script upon page load
new MutationObserver(doOrange) // Set up mutation observer to observe updates in the thread
.observe(document.getElementsByClassName('thread')[0], // Observing the thread, obviuously
{childList:true}); // And the posts and all that within it
doOrange(); // Make text orange not only upon updates but also upon page load.
});
>>595926271
You should make a thread about it on a smaller board like [s4s]<
>>595926271
It’s actually fucking working!
You can also type
function doOrange(){for(i=0;i<(pst=document.getElementsByTagName('blockquote')).length;i++){pst[i].innerHTML=pst[i].innerHTML.replace(/(\<br\/?\>)/g,'$1\n').replace(/(.*?\<\;)(\<br\/?\>|$)/g,'<span style="color:orange;">$1</span>$2');}}new MutationObserver(doOrange).observe(document.getElementsByClassName('thread')[0],{childList:true});doOrange();});
in your browser’s Developer Tools Console.
Orange<