[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
4Archive logo
for(i=0;i<(posts=document.getElementsByTagName('blockquote')).length;i++){posts[i].innerHTML=posts[i].innerHTML.replace(/(.*?\&lt\;)(\<br\/?\>|$)/g,'<span...
If images are not shown try to refresh the page. If you like this website, please disable any AdBlock software!
The stories and information posted here are artistic works of fiction and falsehood.
Only a fool would take anything posted here as fact.

You are currently reading a thread in /b/ - Random

Thread replies: 43
Thread images: 3
File: 1422825100742.png (25 KB, 396x160) Image search: [iqdb] [SauceNao] [Google]
1422825100742.png
25 KB, 396x160
for(i=0;i<(posts=document.getElementsByTagName('blockquote')).length;i++){posts[i].innerHTML=posts[i].innerHTML.replace(/(.*?\&lt\;)(\<br\/?\>|$)/g,'<span style="color:orange;">$1</span>$2');}

You first have to enable orange text<
>>
File: Orange.png (57 KB, 452x507) Image search: [iqdb] [SauceNao] [Google]
Orange.png
57 KB, 452x507
>>
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?
>>
&lt;Emmmm
>>
for(i=0;i<(posts=document.getElementsByTagName('blockquote')).length;i++){posts[i].innerHTML=posts[i].innerHTML.replace(/(\<br\/?\>)/g,'$1\n').replace(/(.*?\&lt\;)(\<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<<
>>
File: Test.png (8 KB, 394x126) Image search: [iqdb] [SauceNao] [Google]
Test.png
8 KB, 394x126
>>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.
>>
>>595922385
>>>/s4s/
>>
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
>>
>>595923400
>>>/b/luetext
>>
>>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&amp;A has been posted <a href="//youtu.be/XYUKJBZuUig?t=41s" target="_blank" title="moot's final 4chan Q&amp;A on YouTube">here</a>.<span>
>>
>>595925279
<span class="redtxt">moot's final 4chan Q&amp;A has been posted <a href="//youtu.be/XYUKJBZuUig?t=41s" target="_blank" title="moot's final 4chan Q&amp;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(/(.*?\&lt\;)(\<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(/(.*?\&lt\;)(\<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<
Thread replies: 43
Thread images: 3
Thread DB ID: 35888



[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the shown content originated from that site. This means that 4Archive shows their content, archived. If you need information for a Poster - contact them.
If a post contains personal/copyrighted/illegal content, then use the post's [Report] link! If a post is not removed within 24h contact me at [email protected] with the post's information.