Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- /*
- Nieuwe layout voor one2xs
- Design en extensie door Thom Peetoom
- Met dank aan Yorrick
- LET OP:
- * #forum_title pas deleten NA de breadcrumb !!!!
- * Titel formaat MOET leeg zijn zodat je zoiets krijgt: one2xs | {forum/pagina} | {topic}
- */
- function createMessage(message){
- $('#top_info').remove();
- $('#logo').after("<div id='top_info'><div id='top_info_tekst'>" + message + " <strong>~ Thom</strong></div><br style='clear: both' /></div>");
- }
- //createMessage('Wegens eventuele 1 aprilgrappen van one2xs is de layout vandaag uitgeschakeld. De kans is namelijk groot dat deze grappen niet zichtbaar zijn met layout aan. Als deze nog wel zichtbaar zijn zal de layout later op de dag automatisch ingeschakeld worden.');
- var systemOn = true;
- if(systemOn === true){
- var ingelogd,
- topinfoBericht,
- sidebarPage,
- punten,
- priveberichten,
- saldo,
- watchlist;
- // Geef body #thom zodat de styles werken
- $('body').attr("id", "thom");
- // Verwijder elementen
- $('#zoek, #logo').remove();
- $('#sthommediv, #right').hide();
- $('#forum_punten').parent().hide();
- /* ============================
- GEGEVENS
- ============================ */
- // Ben je ingelogd?
- if($('body').html().indexOf('id="ingelogdals"') >= 0){
- ingelogd = true;
- // Wat is je gebruikersnaam dan?
- username = $("#ingelogdals").text();
- } else {
- ingelogd = false;
- }
- // Is er een top_info bericht?
- if($('body').html().indexOf('id="top_info"') >= 0){
- topinfoBericht = true;
- } else {
- topinfoBericht = false;
- }
- // Heeft de pagina een sidebar?
- if($('#container').html().indexOf('id="left"') >= 0){
- sidebarPage = true;
- } else {
- sidebarPage = false;
- }
- // Page arrays
- // Voor: menu en breadcrumb
- var pageArrayVerdienen = [
- 'http://www.one2xs.com/overzicht',
- 'http://www.one2xs.com/bellenvoorpunten',
- 'http://www.one2xs.com/blackjack',
- 'http://www.one2xs.com/bubble',
- 'http://www.one2xs.com/loterij',
- 'http://www.one2xs.com/belapi',
- 'http://www.one2xs.com/smsapi',
- 'http://www.one2xs.com/referral',
- 'http://www.one2xs.com/invite',
- 'http://www.one2xs.com/paysafecardvoorpunten',
- 'http://www.one2xs.com/paypalvoorpunten',
- 'http://www.one2xs.com/idealvoorpunten',
- 'http://www.one2xs.com/doe_overzicht',
- 'http://www.one2xs.com/dynamische_advertenties',
- 'http://www.one2xs.com/invite'
- ];
- var pageArrayInbox = [
- 'http://www.one2xs.com/inbox',
- 'http://www.one2xs.com/new_pb',
- 'http://www.one2xs.com/verzonden',
- 'http://www.one2xs.com/read_pb?'
- ];
- var pageArrayInfo = [
- 'http://www.one2xs.com/info/index',
- 'http://www.one2xs.com/hof'
- ];
- var pageArrayForum = [
- 'http://www.one2xs.com/forum/index',
- 'http://www.one2xs.com/forum/zoek',
- 'http://www.one2xs.com/watchlist',
- 'http://www.one2xs.com/forum/recent'
- ];
- var pageArrayUitgeven = [
- 'http://www.one2xs.com/domein/index',
- 'http://www.one2xs.com/mogelijke_extensies',
- 'http://www.one2xs.com/mdrcheck',
- 'http://www.one2xs.com/handelen',
- 'http://www.one2xs.com/ruilbank',
- 'http://www.one2xs.com/host/minecraft',
- 'http://www.one2xs.com/host/resellerhosting',
- 'http://www.one2xs.com/host/sharedwebhosting',
- 'http://www.one2xs.com/host/vpswebhosting',
- 'http://www.one2xs.com/host/info?s=11',
- 'http://www.one2xs.com/host/info?s=12',
- 'http://www.one2xs.com/host/info?s=13',
- 'http://www.one2xs.com/host/info?s=14',
- 'http://www.one2xs.com/host/info?s=15',
- 'http://www.one2xs.com/host/info?s=19',
- 'http://www.one2xs.com/host/resinfo?s=1',
- 'http://www.one2xs.com/host/resinfo?s=2',
- 'http://www.one2xs.com/host/resinfo?s=3',
- 'http://www.one2xs.com/host/resinfo?s=4',
- 'http://www.one2xs.com/host/resinfo?s=5',
- 'http://www.one2xs.com/host/resinfo?s=6',
- 'http://www.one2xs.com/tekkit'
- ];
- /* ============================
- MENU
- ============================ */
- // Advertentiebalk toevoegen
- $('#top-bar').before('<div id="newad"></div>');
- // "Zoeken" knop toevoegen aan menu
- $('#top-bar ul').append('<li><a href="http://www.one2xs.com/forum/zoek" title="Zoeken op het forum">Zoeken</a></li>');
- // "Ticket" knop toevoegen aan menu
- if(ingelogd){
- $('#top-bar ul').append('<li><a href="http://www.one2xs.com/ticket" title="Ticketsysteem">Tickets</a></li>');
- }
- // Menu active class
- if(window.location == 'http://www.one2xs.com'
- || window.location == 'http://www.one2xs.com/'
- || window.location == 'http://www.one2xs.com/index' ) {
- $('#top-bar ul li:first a').attr('class', 'active');
- } else if(window.location == 'http://www.one2xs.com/aanmelden'
- && ingelogd == false){
- $('#top-bar ul li:eq(1) a').attr('class', 'active');
- } else if($.inArray(window.location.href.toString(), pageArrayVerdienen) != -1){
- $('#top-bar ul li:eq(1) a').attr('class', 'active');
- } else if(document.URL.indexOf("forum") !=-1
- && window.location != 'http://www.one2xs.com/forum/zoek') {
- $('#top-bar ul li:eq(2) a').attr('class', 'active');
- } else if($.inArray(window.location.href.toString(), pageArrayInfo) != -1) {
- $('#top-bar ul li:eq(3) a').attr('class', 'active');
- } else if(window.location == 'http://www.one2xs.com/linkpartners'){
- $('#top-bar ul li:eq(4) a').attr('class', 'active');
- } else if(window.location == 'http://www.one2xs.com/help'){
- $('#top-bar ul li:eq(5) a').attr('class', 'active');
- } else if(window.location == 'http://www.one2xs.com/adverteren'
- && ingelogd == false){
- $('#top-bar ul li:eq(6) a').attr('class', 'active');
- } else if(window.location == 'http://www.one2xs.com/forum/zoek'){
- $('#top-bar ul li:eq(6) a').attr('class', 'active');
- } else if((window.location == 'http://www.one2xs.com/ticket'
- || window.location == 'http://www.one2xs.com/ticket/')
- && ingelogd){
- $('#top-bar ul li:eq(7) a').attr('class', 'active');
- }
- // Menu padding fix
- var beforeActiveElement = $('#top-bar .active').parent().prev().children();
- if(beforeActiveElement != null){
- $(beforeActiveElement).css("padding-right", "25px");
- }
- /* ============================
- HEADER
- ============================ */
- // Header element aanmaken
- $('#top-bar').after('<div id="header"></div>');
- // Logo toevoegen
- $('#header').append('<div id="logo"><a href="http://www.one2xs.com"><img src="' + chrome.extension.getURL('images/logo.png') + '" title="One2xs" /></a></div>');
- // Notificatiebalk
- if(topinfoBericht){
- // Notificatiebalk element aanmaken
- $('#header').append('<div id="notificatiebalk"><div id="notif_pijl"></div></div>');
- // Notificatiebericht ophalen
- var notifBerichtContent = $('#top_info_tekst').html(),
- notifBerichtTitel = '',
- notifBerichtSluit = '',
- extraclass = '';
- // Titel en extra class voor juiste buttons (a[klik-ads] en a[doe-ads] mogen geen button worden)
- if(notifBerichtContent.indexOf('one2xs gebruikt cookies') >= 0){
- notifBerichtTitel = 'one2xs gebruikt cookies';
- extraclass = 'mooiebuttons';
- } else if(notifBerichtContent.indexOf('klik advertentie') >= 0){
- notifBerichtTitel = 'nieuwe klik advertentie(s)';
- } else if(notifBerichtContent.indexOf('doe advertentie') >= 0){
- notifBerichtTitel = 'nieuwe doe advertentie(s)';
- } else {
- notifBerichtTitel = 'let op!';
- extraclass = 'mooiebuttons';
- }
- // Sluitknop
- if($("#top_info_img a").length != 0){
- var notifBerichtSluitUrl = $("#top_info_img a").attr("href"),
- notifBerichtSluitTitle = $("#top_info_img a img").attr("alt");
- }
- notifBerichtSluit = '<div class="notif_kruisje" onclick="location.href=\'' + notifBerichtSluitUrl + '\'" title="' + notifBerichtSluitTitle + '">X</div>';
- // Die » dingen wegfilteren omdat het in een button komt
- notifBerichtContent = notifBerichtContent.replace(/\»/g, ' ');
- // Notificatiebericht laten zien
- $('#notificatiebalk').append('<div class="notificatie ' + extraclass + '"><div class="notif_titel">' + notifBerichtTitel + notifBerichtSluit + '</div><div class="notif_bericht">' + notifBerichtContent + '</div></div>');
- }
- else {
- // Logo centreren
- $("#logo").css("left", "255px");
- }
- /* ============================
- USERBAR
- ============================ */
- // Userbar element aanmaken
- $('#header').after('<div id="userbar"></div>');
- // Vars
- var userbarLeft = '',
- userbarMiddle = '',
- userbarRight = '';
- // Left
- if(ingelogd){
- userbarLeft = 'Je bent ingelogd als <a href="/profiel/bekijk?gebruiker=' + username + '">' + username + '</a>.';
- // Midden ophalen: saldo,punten,priveberichten.
- // Locatie verschilt of er een sidebar is of niet
- var priveberichtenstyle = '',
- puntenUrl = '#" onclick="indexPunten(800)',
- userbarAutoMiddle = '<img src="http://famfamfam.nl/famicons/email.png" /><span class="item"><a href="http://www.one2xs.com/inbox">Inbox</a></span>';
- if(sidebarPage){
- // Bestaat het ingelogd blokje?
- if($('#left').html().indexOf('<h1>Ingelogd</h1>') >= 0){
- // Punten ophalen
- punten = $('a[onclick^="indexPunten("]').html().replace(' punten', '');
- // Saldo ophalen
- // Ben je wel een adverteerder?
- if($('#left').html().indexOf('Adverteersaldo') >= 0){
- saldo = $('a[href="http://www.one2xs.com/adv_admin/saldooverzicht"]').html().replace('€ ', '');
- } else {
- saldo = '';
- }
- // Priveberichten ophalen
- priveberichten = $('a[title="Inbox"]').html().replace('Privéberichten ', '').replace('(', '').replace(')', '');
- } else {
- userbarMiddle = userbarAutoMiddle;
- }
- } else {
- // Bestaat de sthomme div?
- //if($('body').html().indexOf('id="sthommediv"') >= 0){
- //}
- // Priveberichten
- if($('body').html().indexOf('id="newPms"') >= 0){
- priveberichten = $('#newPms').html().replace(' nieuwe berichten', '').replace(' nieuw bericht', '');
- } else {
- if($('body').html().indexOf('id="forum_pbs"') >= 0){
- priveberichten = $('#forum_pbs a').html().replace(' nieuwe berichten', '').replace(' nieuw bericht', '');
- }
- }
- // Punten
- if($('body').html().indexOf('id="forum_punten"') >= 0){
- punten = $('#forum_punten a').html().replace(' punten', '');
- puntenUrl = '#" onclick="postData(\'http://www.one2xs.com/includes/ajaxfuncties.php\', saldooverzicht, \'s=9&own=1\', true);';
- }
- // Saldo
- if($('body').html().indexOf('id="forum_advsaldo"') >= 0){
- saldo = $('#forum_advsaldo a').html().replace('Saldo: €', '');
- }
- // Watchlist
- if($('body').html().indexOf('<div style="background: url(http://www.one2xs.com/img/forum_read_small.gif) no-repeat; height: 16px; width: 16px; float: left; ">') >= 0){
- watchlist = 'read';
- } else if($('body').html().indexOf('<div style="background: url(http://www.one2xs.com/img/forum_unread_small.gif) no-repeat; height: 16px; width: 16px; float: left; ">') >= 0){
- watchlist = 'unread';
- }
- }
- // userbarMiddle HTML genereren
- if(userbarMiddle != userbarAutoMiddle){
- // Punten toevoegen aan userbarMiddleuserbarMiddle
- if(punten != '' && punten != undefined){
- userbarMiddle = '<img src="http://famfamfam.nl/famicons/coins.png" /><span class="item"><a href="' + puntenUrl + '">' + punten + ' punten</a></span>';
- }
- // Saldo toevoegen aan userbarMiddle
- if(saldo != '' && saldo != undefined){
- userbarMiddle = userbarMiddle + '<img src="http://famfamfam.nl/famicons/coins.png" /><span class="item"><a href="http://www.one2xs.com/adv_admin/saldooverzicht">€ ' + saldo + '</a></span>';
- }
- // Priveberichten toevoegen aan userbarMiddle
- if(priveberichten != '' && priveberichten != undefined){
- if(priveberichten != '0'){
- priveberichtenstyle = 'font-weight: bolder';
- }
- userbarMiddle = userbarMiddle + '<img src="http://famfamfam.nl/famicons/email.png" /><span class="item" style="' + priveberichtenstyle + '"><a href="http://www.one2xs.com/inbox">' + priveberichten + ' privébericht(en)</a></span>';
- }
- // Watchlist toevoegen aan userbarMiddle
- if(watchlist != '' && watchlist != undefined){
- userbarMiddle = userbarMiddle + '<img src="' + chrome.extension.getURL('images/watchlist-' + watchlist + '.png') + '" /><span class="item"><a href="http://www.one2xs.com/watchlist">Watchlist</a></span>';
- }
- }
- // userbarMiddle fix
- if(userbarMiddle == ''){
- userbarMiddle = userbarAutoMiddle;
- }
- // Watchlist link toevoegen aan userbarRight
- if(watchlist == undefined){
- userbarRight = userbarRight + '<a href="/watchlist">Watchlist</a> - ';
- }
- userbarRight = userbarRight + '<a href="/profiel/index">Mijn profiel</a>';
- // Uitlog link toevoegen aan userbarRight
- if($('body').html().indexOf('title="Uitloggen"') >= 0){
- userbarRight = userbarRight + ' - <a href="' + $('#left a[title="Uitloggen"]').attr("href") + '" title="' + $('#left a[title="Uitloggen"]').attr("href") + '">Uitloggen</a>';
- }
- } else {
- userbarMiddle = 'Je bent niet ingelogd. <a href="/login">Log in</a> of <a href="/aanmelden">maak een gratis account aan</a>.';
- }
- // HTML invoegen
- $("#userbar").html("<div id='items'>" + userbarMiddle + "</div><div class='ubar_left'>" + userbarLeft + "</div><div class='ubar_right'>" + userbarRight + "</div>");
- /* ============================
- BREADCRUMB
- ============================ */
- // Breadcrumb element toevoegen
- $("#userbar").after("<div id='breadcrumb1' class='breadcrumb'></div>");
- // Tweede Breadcrumb element toevoegen
- $("#container").append("<div id='breadcrumb2' class='breadcrumb'></div>");
- // one2xs link toevoegen aan breadcrumb
- $(".breadcrumb").append("<div class='item'><a href='/'>one2xs</a></div>");
- /*
- *
- * Let op: Dit script hieronder is een beetje slecht.
- *
- */
- var firstpage = '',
- firstpageLink = '',
- secondpage = '',
- secondpageLink = '',
- thirdpage = '',
- thirdpageLink = '';
- // Breadcrumn page recognizing
- // Ken ik de pagina al?
- if(window.location == 'http://www.one2xs.com'
- || window.location == 'http://www.one2xs.com/'
- || window.location == 'http://www.one2xs.com/index' ) {
- firstpage = 'Home';
- firstpageLink = window.location;
- }
- //
- // Speciale pagina's:
- //
- var locatie = window.location.href.toString();
- // Profielen:
- if(locatie.substr(0,29) == 'http://www.one2xs.com/profiel'){
- firstpage = 'Profielen';
- firstpageLink = '/profiel/index';
- secondpage = $('title').text().replace('one2xs | ', '');
- secondpageLink = window.location;
- }
- // Adv paneel:
- if(locatie.substr(0,31) == 'http://www.one2xs.com/adv_admin'){
- firstpage = 'Adverteerders administratiepaneel';
- firstpageLink = '/adv_admin/index';
- secondpage = $('title').text().replace('one2xs | ', '');
- secondpageLink = window.location;
- if(secondpage == 'Adverteerders administratiepaneel'){
- secondpage = 'Home';
- }
- }
- // Priveberichten:
- if($.inArray(locatie, pageArrayInbox) != -1){
- firstpage = 'Privéberichten';
- firstpageLink = '/inbox';
- secondpage = $('title').text().replace('one2xs | ', '').replace('Privéberichten - ', '');
- secondpageLink = window.location;
- }
- // Verdienen:
- if($.inArray(locatie, pageArrayVerdienen) != -1){
- firstpage = 'Verdienen';
- firstpageLink = '/overzicht';
- secondpage = $('title').text().replace('one2xs | ', '').replace('Privéberichten - ', '');
- secondpageLink = window.location;
- }
- // Info:
- if($.inArray(locatie, pageArrayInfo) != -1){
- firstpage = 'Informatie over one2xs';
- firstpageLink = '/info/index';
- secondpage = $('title').text().replace('one2xs | ', '');
- secondpageLink = window.location;
- if(secondpage == 'Informatie over one2xs'){
- secondpage = 'Home';
- }
- }
- // Uitgeven:
- if($.inArray(locatie, pageArrayUitgeven) != -1){
- firstpage = 'Uitgeven';
- firstpageLink = '/index';
- secondpage = $('title').text().replace('one2xs | ', '');
- secondpageLink = window.location;
- }
- // Forum:
- if($.inArray(locatie, pageArrayForum) != -1){
- firstpage = 'Forum';
- firstpageLink = '/forum/index';
- secondpage = $('title').text().replace('one2xs | ', '');
- secondpageLink = window.location;
- }
- if(locatie.substr(0,27) == 'http://www.one2xs.com/forum'){
- firstpage = 'Forum';
- firstpageLink = '/forum/index';
- secondpage = $('title').text().replace('one2xs | ', '');
- secondpageLink = window.location;
- }
- // Forum: forum
- if(locatie.substr(0,37) == 'http://www.one2xs.com/forum/forum?id='){
- // Bestaat het forum?
- if($('body').html().indexOf('Dit forum bestaat niet (meer).') >= 0){
- // Bestaat niet:
- secondpage = 'Forum bestaat niet';
- secondpageLink = window.location;
- } else {
- // Forum ophalen uit titel
- secondpage = $('title').text().replace('one2xs | Forum - ', '');
- }
- }
- // Forum: topic
- if(locatie.substr(0,37) == 'http://www.one2xs.com/forum/topic?id='){
- // Bestaat het topic?
- if($('body').html().indexOf('Dit topic bestaat niet.') >= 0){
- // Bestaat niet:
- secondpage = 'Topic bestaat niet';
- secondpageLink = window.location;
- var topicnaam = 'Topic bestaat niet';
- } else {
- // Forum ophalen uit #forum_title
- secondpage = $('#forum_title a:eq(1)').text();
- secondpageLink = $('#forum_title a:eq(1)').attr("href");
- // Topic ophalen uit #forum_title
- thirdpage = $('#forum_title a:eq(2)').text();
- thirdpageLink = $('#forum_title a:eq(2)').attr("href");
- var topicnaam = $('#forum_title a:eq(2)').text();
- }
- }
- // Uit titel halen omdat er anders niks is
- if(firstpage == ''){
- firstpage = $('title').text().replace('one2xs | ', '');
- firstpageLink = window.location;
- }
- // Pagina's verwerken, html genereren en laten zien
- if(firstpage != ''){
- $('.breadcrumb').append('<div class="sep"></div><div class="item"><a href="' + firstpageLink + '">' + firstpage + '</a></div>');
- }
- if(secondpage != ''){
- $('.breadcrumb').append('<div class="sep"></div><div class="item"><a href="' + secondpageLink + '">' + secondpage + '</a></div>');
- }
- if(thirdpage != ''){
- $('.breadcrumb').append('<div class="sep"></div><div class="item"><a href="' + thirdpageLink + '">' + thirdpage + '</a></div>');
- }
- /* ============================
- CONTENT
- ============================ */
- // Advertentie weergeven
- if($('body').html().indexOf('id="horizontaleadvertentie"') >= 0){
- $("#horizontaleadvertentie").show();
- }
- // Heeft de pagina een sidebar?
- if(sidebarPage){
- // Left eerste blok en header van navigatie weghalen
- var allesbehalveinloggenenheader = $("#left").html().split('<h1>Navigatie</h1>');
- $("#left").html(allesbehalveinloggenenheader[1]);
- // Navigatie blok span en strong weghalen
- $("#navigatie strong").each(function(){
- $(this).parent().html('<div class="nav-header">' + $('span', this).text() + '</div>');
- });
- // Lijn corrigeren
- $("#navigatie li[style='border-top: 1px solid #CCC; height: 1px; width: 90%; overflow: hidden; margin: 5px 0 0 0;']")
- .attr("style", "border-top: 1px solid #CCC; height: 1px; width: 100%; overflow: hidden; margin-top: 5px; margin-bottom: 5px;");
- // » voor elke link zetten
- $("#navigatie a").before("» ");
- // Advertentie toevoegen
- // $("#content").prepend('<script type="text/javascript"><!--
- //google_ad_client = "ca-pub-8826198676569410";
- ///* one2xs_rechts_lang_horiz */
- //google_ad_slot = "7619448970";
- //google_ad_width = 468;
- //google_ad_height = 60;
- ////-->
- //</script>
- //<script type="text/javascript"
- //src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
- //</script>'); */
- }
- // Buttons aanpassen
- $('img[src="http://www.one2xs.com/img/meer-button.gif"]').each(function(){
- $(this).parent().addClass('gobutton').html($(this).attr("alt"));
- });
- $('img[src="../img/nieuw_topic.png"]').each(function(){
- $(this).parent().addClass('gobutton').html($(this).attr("alt"));
- });
- $('input.login-button').attr("value", "Inloggen");
- // top h1 op bepaalde pagina's aanpassen
- if(locatie.substr(0,32) == 'http://www.one2xs.com/forum/zoek'
- || locatie.substr(0,34) == 'http://www.one2xs.com/forum/bewerk'
- || locatie.substr(0,35) == 'http://www.one2xs.com/forum/reageer'
- || locatie.substr(0,32) == 'http://www.one2xs.com/forum/nieuw'
- || locatie == 'http://www.one2xs.com/doe_overzicht'){
- $('#content-forum h1:first, #content-forum-orange h1:first').css("margin-top", "0px");
- }
- /* ============================
- FORUM
- ============================ */
- // Blokje-style
- $('[style="border: 1px solid #ce8a32; margin: 5px 0 0 0; padding: 5px 5px 5px 7px;"]')
- .attr("style", "").addClass("blokje");
- // Blokjes titel kleur weghalen
- $(".blokje").each(function(){
- $(this).html($(this).html().replace('color: #d18120;', 'color: #484b4d;'));
- });
- setInterval(function(){
- $(".blokje").each(function(){
- $(this).html($(this).html().replace('color: #d18120;', 'color: #484b4d;'));
- });
- }, 100);
- // Forumindex
- if(locatie == 'http://www.one2xs.com/forum'
- || locatie == 'http://www.one2xs.com/forum/'
- || locatie == 'http://www.one2xs.com/forum/index'){
- // h1 margin top weghalen
- $("#content-forum-orange h1:first").css("margin-top", "0px");
- // onderste lijn van laatste categorie kleur geven
- $(".forum-cat-container").attr("style", "");
- // Markeer alles als gelezen blokje aanpassen
- $('div[style="border: 1px solid #ce8a32; margin: 5px 0 0 0; padding: 5px 5px 5px 7px; text-align: center;"] a').each(function(){
- var reallythis = $(this);
- if($(this).html() == 'Markeer alle berichten als gelezen'){
- $(this).parent().attr("style", "text-align: center; padding: 10px; border: 0;");
- // Informatie blokje toevoegen
- $(this).parent().after("<h1 style='margin-bottom: 0px'>Informatie</h1>");
- // Rand aanpassen van online blokje
- $("#usersOnline").parent().css("border-top", "0");
- }
- });
- }
- // Forum pagina
- if(locatie.substr(0,37) == 'http://www.one2xs.com/forum/forum?id='){
- $('body').addClass('forumpage');
- // h1 margin top weghalen
- $("#content-forum-orange h1:first").css("margin-top", "0px");
- // #forum_title left
- $("#forum_title").html($("#forum_title a:eq(1)").text()).parent().attr("class", "grijs");
- // Fix op aanbiedingen forum
- if(locatie.substr(0,38) == 'http://www.one2xs.com/forum/forum?id=3'){
- $('.recent').css({
- "position": "relative",
- "bottom": "4px"
- });
- }
- // Pagina's
- $("div[style='float: left; width: 50%;']").addClass('paginalinkjes');
- // Markeer alles als gelezen knop beter maken
- // » weghalen
- $('#content-forum-orange').html(
- $('#content-forum-orange').html()
- .replace('» <a href="http://www.one2xs.com/forum/gelezen?id=', '<a style="margin-top: 10px; text-align: center; display: block;" href="http://www.one2xs.com/forum/gelezen?id=')
- );
- }
- // Topic pagina
- if(locatie.substr(0,33) == 'http://www.one2xs.com/forum/topic'){
- $('body').addClass('topicpage');
- // #forum_title left
- $("#forum_title").parent().hide().after('<h1 id="topicnaamHolder" class="grijs" style="margin-top: 0px;">' + topicnaam + '</h1>');
- // #forum_title2 veranderen naar Snel reageren
- $("#forum_title2").parent().text("Snel reageren").addClass("grijs").attr("style", "");
- // Onder paginatie class geven
- $('.pagnav').parent().addClass('paginalinkjes');
- // Boven paginatie
- $("#topicnaamHolder").after("<div id='bovenpaginatie' class='paginalinkjes'>" + $('.pagnav').parent().html() + "</div>");
- // Reageren knop
- $('#reageer_eins').after("<a href='reageer?topic=" + $('.pagnav').attr("href").replace('?id=', '') + "' class='gobutton' style='float: right; margin-top: 20px;'>Reageren</a>").remove();
- }
- // Zoeken op het forum
- if(locatie.substr(0,32) == 'http://www.one2xs.com/forum/zoek'){
- $('body').addClass('zoekpage');
- }
- // Posts aanpassen
- setInterval(function(){
- // Ben je op het forum of zoek je posts?
- if($('body').hasClass('topicpage')
- || $('body').hasClass('zoekpage')){
- // Posts de post class geven
- $('.forum-sub-top-topic').parent().addClass('forumpost');
- $('.forumpost').each(function(){
- // Is deze reactie al veranderd? Nee?
- if(!$(this).hasClass('fstt-changed')){
- if($('.forum-sub-top-topic', this).html().indexOf('class="topic-icons-top"') >= 0){
- var icontjes = $('.topic-icons-top', this).html();
- } else {
- var icontjes = '';
- }
- // Structuur wijzigen
- $('.forum-sub-top-topic', this).html(
- '<div class="forum-sub-top-topic-left" id="' + $('.topic-titel-top', this).attr("id") + '">'
- + $('.topic-gebruiker-top', this).html().replace('width: 100%', '')
- + ' - '
- + $('.topic-titel-top', this).html()
- + '</div>'
- + '<div class="forum-sub-top-topic-right">'
- + icontjes
- + '</div>');
- // Over de poster structuur wijzigen
- if($('.topic-gebruikersinhoud', this).html().indexOf('class="topic-avatar"') >= 0){
- $('.topic-gebruikersinhoud', this).html(
- '<div class="topic-avatar">'
- + '<img src="' + $('.topic-avatar', this).attr("src") + '" style="margin: 0; padding: 0;" />'
- + '</div>'
- + '<div class="topic-wiebenik">'
- + $('.topic-usernaam', this).clone().html()
- + '<br /><em>' + $('.topic-userstatus', this).clone().html() + '</em>'
- + '<br /><br />' + $('.topic-userinformatie', this).clone().html()
- //+ $('.topic-gebruikersinhoud div[style="width: 119px; border: 1px solid #999; height: 6px; margin: 3px 0 0 0;"]', this).clone().html()
- + '</div>');
- } else {
- $('.topic-gebruikersinhoud', this).html(
- $('.topic-usernaam', this).clone().html()
- + '<br /><em>' + $('.topic-userstatus', this).clone().html() + '</em>'
- + '<br /><br />' + $('.topic-userinformatie', this).clone().html()
- //+ $('.topic-gebruikersinhoud div[style="width: 119px; border: 1px solid #999; height: 6px; margin: 3px 0 0 0;"]', this).clone().html()
- );
- }
- // hr lijn wijzigen
- $('hr[color="#deac68"]', this).attr("color", "#c4c4c4");
- // Add class
- $(this).addClass('fstt-changed');
- // Icoontjes aanpassen
- var icoontjesArray = {
- '/img/topic-quote.gif': 'topic-quote.png',
- '/img/topic-pb.gif': 'topic-pb.png',
- '/img/topic-edit.gif': 'topic-edit.png',
- '/img/slotje.gif': 'slotje.png',
- '/img/report.png': 'report.png',
- '/img/watchlist.gif': 'watchlist.png'
- }
- $.each(icoontjesArray, function(k, v) {
- $('img[src="http://www.one2xs.com' + k + '"]').each(function(){
- $(this).attr("src", chrome.extension.getURL('images/' + v));
- });
- });
- // MultiQuote verwijderen
- $('img[alt="MultiQuote"]',this).remove();
- }
- });
- }
- }, 100);
- // Reageren vak
- if($('body').hasClass('topicpage')
- //|| $('body').hasClass('zoekpage')
- || locatie.substr(0,35) == 'http://www.one2xs.com/forum/reageer'
- ){
- // Vars bepalen voor topic
- if($('body').hasClass('topicpage')){
- var reageervak = $('#smileydiv').parent().parent().parent().parent();
- var ubbButtons = $('tr:first td:first div', reageervak).html();
- var smileys = $('#smileydiv', reageervak).attr("style", "height: 118px").clone().html();
- var moreSmileys= '<a href="javascript:moresmilies" id="moresmilies">Meer smilies</a>';
- var right = $('tr:first td:first', reageervak).html();
- var right2 = '<br /><br /><strong>' + $('tr:eq(2) td:first', reageervak).html() + '</strong><br />' + $('tr:eq(2) td:last', reageervak).html();
- var textarea = '<textarea style="height: 220px; width: 595px;" name="bericht" id="bericht" tabindex="2"></textarea>';
- var buttons = '<div class="pb_buttons">' + $('tr:eq(1) td', reageervak).html() + '</div>';
- } else {
- // En ook voor /reageer...
- var reageervak = $('form[name="postform"] table tbody');
- var ubbButtons = $('tr:first td:first div', reageervak).html();
- var smileys = $('#smileydiv', reageervak).attr("style", "height: 118px").clone().html();
- var moreSmileys= '<a href="javascript:moresmilies" id="moresmilies">Meer smilies</a>';
- var right = $('tr:eq(1) td:first', reageervak).html();
- var right2 = '<br /><br /><br />' + $('tr:first td:last', reageervak).html();
- var textarea = '<textarea style="height: 220px; width: 595px;" name="bericht" id="bericht" tabindex="2"></textarea>';
- var buttons = '<div class="pb_buttons">' + $('tr:eq(2) td:last', reageervak).html() + '</div>';
- }
- var HTML = '<div class="postblock">'
- + '<div class="pb_left">'
- + textarea
- + buttons
- + '</div>'
- + '<div class="pb_right">'
- + right
- + '<br />'
- + right2
- + '</div>'
- + '<div style="clear: both;"></div>'
- + '</div>';
- $(reageervak).replaceWith(HTML);
- }
- /* ============================
- FOOTER
- ============================ */
- // | veranderen in -
- $('#footer_right li').each(function(){
- $(this).html($(this).html().replace('|', ' - '));
- });
- // Mijn copyright erbij zetten
- $('#breadcrumb2').append('<div class="item" style="float: right; color: rgb(173, 147, 103);">Design en extensie door <a href="http://www.one2xs.com/profiel/bekijk?gebruiker=Thom">Thom</a>. Met dank aan <a href="http://www.one2xs.com/profiel/bekijk?gebruiker=Yorrick">Yorrick</a>.</div>');
- } else {
- $('#top_info').show();
- }
- /* ============================
- FINAL
- ============================ */
- // Laat pagina weergeven
- $('body').css("display", "block");
- /* ============================
- BUG FIXES
- ============================ */
- // Anchor scroll fix
- if(window.location.hash.replace("#", "") != ''){
- var selector = '[name="' + window.location.hash.replace("#", "") + '"]';
- if($('body').html().indexOf('name="' + window.location.hash.replace("#", "") + '"') >= 0){
- $('html, body').animate({
- scrollTop: $( selector ).offset().top
- }, 1);
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment