Skip to content

Commit

Permalink
hide net neutrality button
Browse files Browse the repository at this point in the history
  • Loading branch information
night committed Jul 12, 2017
1 parent 18721de commit b1bbdf1
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "BetterTTV",
"author": "Night",
"version": "7.0.19",
"version": "7.0.20",
"description": "BetterTTV enhances Twitch with new features, bug fixes, and reduced clutter.",
"main": "betterttv.js",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions src/css/betterttv-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -3826,3 +3826,7 @@ textarea.form__input.activity-create__textarea, textarea.form__input.activity-cr
color: #7d7d7d;
border-color: #3a3a3a;
}

.header-announcement--net-neutrality {
color: black;
}
40 changes: 40 additions & 0 deletions src/modules/net_neutrality/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const $ = require('jquery');
const watcher = require('../../watcher');
const storage = require('../../storage');

const STORAGE_KEY = 'hideNetNeutralityBar2017';

class HideNetNeutralityModule {
constructor() {
watcher.on('load', () => this.hideBar());
this.addCloseButton();
}

hideBar() {
if (!storage.get(STORAGE_KEY)) return;

$('div.app-main').toggleClass('has-net-neutrality', false);
$('.header-announcement--net-neutrality').hide();
}

addCloseButton() {
$('.header-announcement--net-neutrality .header-announcement__bar').append(`
<div class="flex__item">
<a href="#"
target="_blank"
rel="noopener noreferrer"
class="bttv-close-net-neutrality"
style="font-size: 20px;font-weight: bold;color: black;">
&times;
</a>
</div>
`);
$('.bttv-close-net-neutrality').click(e => {
e.preventDefault();
storage.set(STORAGE_KEY, true);
this.hideBar();
});
}
}

module.exports = new HideNetNeutralityModule();

0 comments on commit b1bbdf1

Please sign in to comment.