-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
68 lines (56 loc) · 1.31 KB
/
main.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
toggle();
var template = "<div style='text-align: center'> <h1 padding-top='50px'> Yeah, you probably shouldn't be here right now </h1> </div>";
function toggle() {
chrome.storage.sync.get("key", function(results){
var options = results.key;
for (var op in options) {
if (window.location.href.indexOf(op) > -1) {
if (options[op] == true) {
disableScrollAndPrepare(op);
}
}
}
});
};
function disableScrollAndPrepare(option) {
document.body.style.display = 'block';
document.body.style.overflow = 'hidden';
var contentItem = "";
switch (option) {
case "facebook":
contentItem = "#contentArea";
break;
case "twitter":
contentItem = "#timeline";
$(".dashboard-right").remove();
break;
case "vine":
contentItem = ".posts-container ";
break;
case "reddit":
contentItem = ".content";
break;
case "instagram":
contentItem = "._qj7yb";
break;
case "tumblr":
contentItem = ".posts";
break;
case "youtube":
contentItem = "#content";
break;
default:
console.log("Not Supported");
}
deleteElements(contentItem);
disableLinks();
}
function disableLinks() {
$(document).ready(function (){
$("a").css("cursos", "arrow").click(false);
$(":input").prop("disabled", true);
});
}
function deleteElements(item) {
$(item).replaceWith(template);
}