Advertisement
Ansolley

Plugin - Additional Enhancements

Jun 28th, 2019
2,047
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 6.46 KB | None | 0 0
  1. /**
  2.  * Additional Enhancements:
  3.  *  - ideas by Armand Tresova
  4.  *
  5.  * @author xjsv
  6.  * @version 1.4.0
  7.  * @url https://raw.githubusercontent.com/XjSv/BBLog-Additional-Enhancements/master/additional-enhancements.js
  8.  * @last-edit 12.28.2015 17:10
  9.  */
  10.  
  11. BBLog.handle("add.plugin", {
  12.  
  13.     id   : "additional-enhancements",
  14.     name : "Additional Enhancements",
  15.  
  16.     configFlags : [
  17.         ["option.remove-buy-battlepacks", 0],
  18.         ["option.remove-tiles",           0],
  19.         ["option.remove-side-bar",        0],
  20.         ["option.remove-buy-hardline",    0],
  21.         ["option.remove-comcenter",       0],
  22.         ["option.remove-cookiebar",       0]
  23.     ],
  24.  
  25.     translations : {
  26.         "en" : {
  27.             "option.remove-buy-battlepacks"         : "Remove the 'BUY BATTLEPACKS' box in the Battlepacks page",
  28.             "option.remove-buy-battlepacks.tooltip" : "Removes the 'BUY BATTLEPACKS' box above the 'UPCOMING RANK BATTLEPACKS' box in the Battlepacks page.",
  29.             "option.remove-tiles"                   : "Remove the tiles below the 'TOP STORY' in the landing page",
  30.             "option.remove-tiles.tooltip"           : "Removes the tiles below the 'TOP STORY' in the landing page (battlelog.battlefield.com/bf4/).",
  31.             "option.remove-side-bar"                : "Remove the right sidebar in the landing page",
  32.             "option.remove-side-bar.tooltip"        : "Removes the right sidebar in the landing page (battlelog.battlefield.com/bf4/) and expands the battle feed.",
  33.             "option.remove-buy-hardline"            : "Remove Battlefield Hardline Ad (BUY NOW) in the landing page",
  34.             "option.remove-buy-hardline.tooltip"    : "Removes Battlefield Hardline advertisement (BUY NOW) in the landing page (battlelog.battlefield.com/bf4/).",
  35.             "option.remove-comcenter"               : "Remove the Com Center panel on the right",
  36.             "option.remove-comcenter.tooltip"       : "Removed the Com Center on the right of all BF4 Battlelog Pages and widens the Top bar.",
  37.             "option.remove-cookiebar"               : "Remove the EU Cookie Agreement Bottom bar entirely",
  38.             "option.remove-cookiebar.tooltip"       : "Removes the Cookie Agreement Bar at the bottom of the page entirely (including the close button thing)"
  39.         },
  40.         "de" : {
  41.             "option.remove-buy-battlepacks"         : "Entferne 'Battlepacks kaufen' von Battlepack Seite",
  42.             "option.remove-buy-battlepacks.tooltip" : "Entfernt die 'Battlepack kaufen' Box von der Battlepack Seite.",
  43.             "option.remove-tiles"                   : "Entferne die Boxen unter der Top Story",
  44.             "option.remove-tiles.tooltip"           : "Entfernt die Boxen (Empfohlener Server, Platoon, Missionen etc.) von der Startseite (battlelog.battlefield.com/bf4/).",
  45.             "option.remove-side-bar"                : "Entferne rechte Seitenleiste auf der Startseite",
  46.             "option.remove-side-bar.tooltip"        : "Entfernt die rechte Seitenleiste auf der Startseite und verbreitert den Battlefeed.",
  47.             "option.remove-buy-hardline"            : "Entferne Hardline Werbung",
  48.             "option.remove-buy-hardline.tooltip"    : "Entfernt den 'Hardline kaufen' Werbeblock von der Startseite (battlelog.battlefield.com/bf4/).",
  49.             "option.remove-comcenter"               : "Entferne Com Center",
  50.             "option.remove-comcenter.tooltip"       : "Entfernt das ComCenter am rechten Bildschirmrand auf allen (BF4) Seiten im Battlelog und passt die Breite an.",
  51.             "option.remove-cookiebar"               : "Entferne Cookie Zustimmung",
  52.             "option.remove-cookiebar.tooltip"       : "Entfernt die Cookie Zustimmungsleiste am unteren Bildschirmrand komplett."
  53.         },
  54.     },
  55.  
  56.     init : function(instance) {
  57.         if(BBLog.cache("mode") == "bf4") {
  58.             instance.removeBuyBattlePacks(instance);
  59.             instance.removeTiles(instance);
  60.             instance.removeSideBar(instance);
  61.             instance.removeBuyHardline(instance);
  62.             instance.removeComCenter(instance);
  63.             instance.removeCookieBar(instance);
  64.         }
  65.     },
  66.  
  67.     domchange : function(instance) {
  68.         if(BBLog.cache("mode") == "bf4") {
  69.             instance.removeBuyBattlePacks(instance);
  70.             instance.removeTiles(instance);
  71.             instance.removeSideBar(instance);
  72.             instance.removeBuyHardline(instance);
  73.             instance.removeComCenter(instance);
  74.             instance.removeCookieBar(instance);
  75.         }
  76.     },
  77.  
  78.     removeBuyBattlePacks : function(instance) {
  79.         var url = window.location.href;
  80.         if(instance.storage("option.remove-buy-battlepacks") && url.match(/\/battlepacks\//) && $(".battlepacks-buypacks").length > 0) {
  81.             $(".battlepacks-buypacks").remove();
  82.         }
  83.     },
  84.  
  85.     removeTiles : function(instance) {
  86.         var path = window.location.pathname;
  87.         if(instance.storage("option.remove-tiles") && path == '/bf4/' && $("#bottom-tiles").length > 0) {
  88.             $("#bottom-tiles").remove();
  89.         }
  90.     },
  91.  
  92.     removeSideBar : function(instance) {
  93.         var path = window.location.pathname;
  94.         if(instance.storage("option.remove-side-bar") && path == '/bf4/' && $(".base-middle-content").length > 0 && $(".main-side-column").length > 0) {
  95.             var battleFeed = $(".base-middle-content .span8");
  96.  
  97.             if($(battleFeed).hasClass('span8')) {
  98.                 $(battleFeed).removeClass('span8').addClass('span12');
  99.             }
  100.  
  101.             $(".main-side-column").remove();
  102.         }
  103.     },
  104.  
  105.     removeBuyHardline : function(instance) {
  106.         var path = window.location.pathname;
  107.         if(instance.storage("option.remove-buy-hardline") && path == '/bf4/' && $("#main-header .get-bfh-tile").length > 0) {
  108.             $('#main-header .get-bfh-tile').remove();
  109.         }
  110.     },
  111.  
  112.     removeComCenter: function (instance) {
  113.         if (instance.storage("option.remove-comcenter") && window.location.pathname.substr(0, 5) == '/bf4/' && $('#comcenter_container').length > 0) {
  114.             $('#comcenter_container').remove();
  115.             $('#base-header').css('right', 0);
  116.             $('#viewport').css('padding-right', 0);
  117.         }
  118.     },
  119.  
  120.     removeCookieBar: function (instance) {
  121.         if (instance.storage("option.remove-cookiebar") && window.location.pathname.substr(0, 5) == '/bf4/' && $('#cookie-preferences').length > 0) {
  122.             $('#cookie-preferences').remove();
  123.         }
  124.     }
  125. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement