-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadditional-enhancements.js
175 lines (158 loc) · 7.89 KB
/
additional-enhancements.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/**
* Additional Enhancements:
* - ideas by Armand Tresova
*
* @author xjsv
* @version 1.5.0
* @url https://raw.githubusercontent.com/XjSv/BBLog-Additional-Enhancements/master/additional-enhancements.js
* @last-edit 02.08.2015 01:30
*/
BBLog.handle("add.plugin", {
id: "additional-enhancements",
name: "Additional Enhancements",
configFlags: [
["option.remove-buy-battlepacks", 0],
["option.remove-tiles", 0],
["option.remove-side-bar", 0],
["option.remove-buy-hardline", 0],
["option.remove-comcenter", 0],
["option.remove-app-promotion", 0],
["option.remove-cookiebar", 0],
["option.remove-radar-servers", 0],
["option.remove-recom-servers", 0]
],
translations: {
"en": {
"option.remove-buy-battlepacks": "Remove the 'BUY BATTLEPACKS' box in the Battlepacks page",
"option.remove-buy-battlepacks.tooltip": "Removes the 'BUY BATTLEPACKS' and 'What's Battlepacks' boxes above/below the 'UPCOMING RANK BATTLEPACKS' box in the Battlepacks page.",
"option.remove-tiles": "Remove the tiles below the 'TOP STORY' in the landing page",
"option.remove-tiles.tooltip": "Removes the tiles below the 'TOP STORY' in the landing page (battlelog.battlefield.com/bf4/).",
"option.remove-side-bar": "Remove the right sidebar in the landing page",
"option.remove-side-bar.tooltip": "Removes the right sidebar in the landing page (battlelog.battlefield.com/bf4/) and expands the battle feed.",
"option.remove-buy-hardline": "Remove Battlefield Hardline Ads",
"option.remove-buy-hardline.tooltip": "Removes Battlefield Hardline advertisements from the landing page (battlelog.battlefield.com/bf4/).",
"option.remove-comcenter": "Remove the Com Center panel on the right",
"option.remove-comcenter.tooltip": "Removed the Com Center on the right of all BF4 Battlelog Pages and widens the Top bar.",
"option.remove-app-promotion": "Remove app promotion advertisement",
"option.remove-app-promotion.tooltip": "Removes the app promotion from the bottom of the com center.",
"option.remove-cookiebar": "Remove the EU Cookie Agreement Bottom bar entirely",
"option.remove-cookiebar.tooltip": "Removes the Cookie Agreement Bar at the bottom of the page entirely (including the close button thing)",
"option.remove-radar-servers": "Hide Servers on Radar",
"option.remove-radar-servers.tooltip": "Removes servers you have on radar from the server browser result list.",
"option.remove-recom-servers": "Remove recommended servers",
"option.remove-recom-servers.tooltip": "Removes the recommended servers block from the top of the server browser."
},
"de": {
"option.remove-buy-battlepacks": "Entferne 'Battlepacks kaufen' von Battlepack Seite",
"option.remove-buy-battlepacks.tooltip": "Entfernt die 'Battlepack kaufen' und 'Was sind Battlepacks' Boxen von der Battlepack Seite.",
"option.remove-tiles": "Entferne die Boxen unter der Top Story",
"option.remove-tiles.tooltip": "Entfernt die Boxen (Empfohlener Server, Platoon, Missionen etc.) von der Startseite (battlelog.battlefield.com/bf4/).",
"option.remove-side-bar": "Entferne rechte Seitenleiste auf der Startseite",
"option.remove-side-bar.tooltip": "Entfernt die rechte Seitenleiste auf der Startseite und verbreitert den Battlefeed.",
"option.remove-buy-hardline": "Entferne Hardline Werbung",
"option.remove-buy-hardline.tooltip": "Entfernt diverse Hardline Werbung von der Startseite (battlelog.battlefield.com/bf4/).",
"option.remove-comcenter": "Entferne Com Center",
"option.remove-comcenter.tooltip": "Entfernt das ComCenter am rechten Bildschirmrand auf allen (BF4) Seiten im Battlelog und passt die Breite an.",
"option.remove-app-promotion": "Entferne Battlelog App Werbung",
"option.remove-app-promotion.tooltip": "Entfernt die Battlelog App Werbung aus dem unteren Bereich des ComCenters auf der rechten Seite.",
"option.remove-cookiebar": "Entferne Cookie Zustimmung",
"option.remove-cookiebar.tooltip": "Entfernt die Cookie Zustimmungsleiste am unteren Bildschirmrand komplett.",
"option.remove-radar-servers": "Entferne blockierte Server (Server Radar)",
"option.remove-radar-servers.tooltip": "Entfernt Server die zum Radar hinzugefügt wurden aus den Ergebnissen im Serverbrowser.",
"option.remove-recom-servers": "Entferne empfohlene Server",
"option.remove-recom-servers.tooltip": "Entfernt den 'Empfohlene Server' Block oben im Serverbrowser"
},
},
init: function (instance) {
if (BBLog.cache("mode") == "bf4") {
instance.removeBuyBattlePacks(instance);
instance.removeTiles(instance);
instance.removeSideBar(instance);
instance.removeHardlineAds(instance);
instance.removeComCenter(instance);
instance.removeCookieBar(instance);
instance.removeBlockedServers(instance);
instance.removeRecommendedServers(instance);
instance.removeAppAd(instance);
}
},
domchange: function (instance) {
if (BBLog.cache("mode") == "bf4") {
instance.removeBuyBattlePacks(instance);
instance.removeTiles(instance);
instance.removeSideBar(instance);
instance.removeHardlineAds(instance);
instance.removeComCenter(instance);
instance.removeCookieBar(instance);
instance.removeBlockedServers(instance);
instance.removeRecommendedServers(instance);
instance.removeAppAd(instance);
}
},
removeBuyBattlePacks: function (instance) {
var url = window.location.href;
if (instance.storage("option.remove-buy-battlepacks") && url.match(/\/battlepacks\//)) {
if ($(".battlepacks-buypacks").length > 0)
$(".battlepacks-buypacks").remove();
if ($("#what-is-battlebacks-box").length > 0)
$("#what-is-battlebacks-box").remove();
}
},
removeTiles: function (instance) {
var path = window.location.pathname;
if (instance.storage("option.remove-tiles") && path == '/bf4/' && $("#bottom-tiles").length > 0) {
$("#bottom-tiles").remove();
}
},
removeSideBar: function (instance) {
var path = window.location.pathname;
if (instance.storage("option.remove-side-bar") && path == '/bf4/' && $(".base-middle-content").length > 0 && $(".main-side-column").length > 0) {
var battleFeed = $(".base-middle-content .span8");
if ($(battleFeed).hasClass('span8')) {
$(battleFeed).removeClass('span8').addClass('span12');
}
$(".main-side-column").remove();
}
},
removeHardlineAds: function (instance) {
var path = window.location.pathname;
if (instance.storage("option.remove-buy-hardline") && path == '/bf4/') {
if ($("#main-header .get-bfh-tile").length > 0)
$('#main-header .get-bfh-tile').remove();
if ($('div[data-advertisement]').length > 0) {
$('div[data-advertisement]').each(function () {
$(this).remove();
});
}
}
},
removeComCenter: function (instance) {
if (instance.storage("option.remove-comcenter") && window.location.pathname.substr(0, 5) == '/bf4/' && $('#comcenter_container').length > 0) {
$('#comcenter_container').remove();
$('#base-header').css('right', 0);
$('#viewport').css('padding-right', 0);
}
},
removeCookieBar: function (instance) {
if (instance.storage("option.remove-cookiebar") && window.location.pathname.substr(0, 5) == '/bf4/' && $('#cookie-preferences').length > 0) {
$('#cookie-preferences').remove();
}
},
removeBlockedServers: function (instance) {
if (instance.storage("option.remove-radar-servers") && window.location.pathname.substr(0, 13) == '/bf4/servers/' && $('tr.bblog-bf4-redbg').length > 0) {
$('tr.bblog-bf4-redbg').each(function (idx) {
$(this).remove();
});
}
},
removeRecommendedServers: function (instance) {
if (instance.storage("option.remove-recom-servers") && window.location.pathname.substr(0, 13) == '/bf4/servers/' && $('#serverbrowser-recommended-servers').length > 0) {
$('#serverbrowser-recommended-servers').remove();
}
},
removeAppAd: function (instance) {
if (instance.storage("option.remove-app-promotion") && window.location.pathname.substr(0, 5) == '/bf4/' && $('#app-promotion').length > 0) {
$('#app-promotion').remove();
}
}
});