Flashback PRO

Det här skriptet tar bort all reklam från flashback.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Flashback PRO
// @namespace   flashback.pro
// @include     *flashback.org*
// @description Det här skriptet tar bort all reklam från flashback. 
// @description 
// @description Det tar bort sidorutan till höger (där sökrutan är) och sträcker ut tråden över hela fönstret.
// @description Sökrutan läggs längst upp innan tråden istället.
// @description 
// @description Skriptet följer även länkar automatiskt så att du inte behöver klicka två gånger (DU LÄMNAR NU FLASHBACK FORUM)
// @description För uppdateringar, se hit: https://greasyfork.org/sv/scripts/38204-flashback-pro
// @version     1.7
// @grant       none
// @require 	http://code.jquery.com/jquery-1.11.1.min.js
// ==/UserScript==
console.log("Flashback PRO loaded.");
console.log("Flashback PRO loaded.");
$(document).ready(function () {
    $('#top-logo').children().attr("href","/usercp.php");  //Clicking logo will get you to the control panel
    var searchBar = $('#form-forum-search').parent().html(); //Save searchbar for later prepending
    $('#top-banner-container').remove();
    $('#right-banner-container').remove();
    $('.post-banner-container').remove();
    $('#bottom-banner-container').remove();
    $('.banner_text').remove();
    $('.ad').remove();
    $('#site-right').remove();
    $('#site-left').attr('class', ''); //Make main forum thread wider
    $('#site-left').attr('style', 'width:100%;margin-left:25px;margin-right:25px'); //fix margins for appearance
    $('#site-left').prepend("<center id=\"formcenter\">" + searchBar + "</center>");  //prepend search bar before thread
    $('#form-forum-search').attr('style', 'width: 40%');  //make search bar smaller for appearance

    var tmpstr = $('#gototxtval').val();
    var form = $("<form/>", { action: tmpstr });
    form.append("Hoppa till sida: ");
    form.append( $("<input>", { id: 'gototxtval',type:'text', name:'page', style:'width:50px;margin-right:5px' }    ));

  //  form.append( "<br>");
    form.append( $("<input>", { type:'submit', value:'Hoppa', style:'width:75px' }      ));
    $(".pagination-xs").prepend("<center id=\"gotocenter\"></center>");
    $("#gotocenter").prepend(form);
    //$(".selection").prepend(form);
   // $(".select2-selection").remove();

    if (/.leave./.test(window.location)) { //Automatically bypass the "Are you sure you want to follow this link" When clicking external links in threads
        var arr = document.getElementsByTagName('a');

        for(var i = 0; i < arr.length; i++){
            var href = arr[i].getAttribute('href');
            if (!(/.flashback./.test(href)))
                window.location = href;
        }
    }

});