2016-01-23, 05:53 PM
I'm trying to implement a 4chan ">greentext" kind of coding in my myBB forum and I was wondering what files I need to edit with this:
http://codepen.io/anon/pen/cHgmb
Javascript:
CSS:
I'm suggesting implementing the code as a means of modifying text that appears in posts "outside" of myBB so that all it does is alter text after myBB performs a post.
> Example
I tried adding in the javascript to "general.js" and the CSS to "global.css" to see if that would work, but it didn't so I figured I would try asking here.
http://codepen.io/anon/pen/cHgmb
Javascript:
$.fn.tweetify = function() {
this.each(function() {
$(this).html(
$(this).html()
.replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi,'<a href="$1">$1</a>')
.replace(/(^|\s)#(\w+)/g,'$1<a href="http://search.twitter.com/search?q=%23$2">#$2</a>')
.replace(/(^|\s)@(\w+)/g,'$1<a href="http://twitter.com/$2">@$2</a>')
.replace(/(^|\s)>>(\w+)/g,'$1<a href="$2">>>$2</a>')
.replace(/(^|\s)>(.*?)(<br( )*(\/)?( )*>|\n|$)/g,'$1<span>>$2</span>$3')
);
});
return $(this);
};
$("p").tweetify();
CSS:
span{color:green;}
div{padding:20px;}
I'm suggesting implementing the code as a means of modifying text that appears in posts "outside" of myBB so that all it does is alter text after myBB performs a post.
> Example
I tried adding in the javascript to "general.js" and the CSS to "global.css" to see if that would work, but it didn't so I figured I would try asking here.