Skip to content

Commit 3436f36

Browse files
committed
First Push
0 parents  commit 3436f36

13 files changed

+240
-0
lines changed

0.png

3.5 KB
Loading

1.png

3.42 KB
Loading

2.png

3.5 KB
Loading

icon.png

21 KB
Loading

icon.psd

313 KB
Binary file not shown.

jquery.min.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

manifest.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"manifest_version": 2,
3+
4+
"name": "WikiNoNotes",
5+
"version": "0.1.0",
6+
"description": "A chrome extension that will simplify cheating (yay)",
7+
8+
"content_scripts": [{
9+
"css": ["style.css"],
10+
"js": ["wikinonotes.js", "jquery.min.js"],
11+
"matches": [
12+
"*://*/*"
13+
]
14+
}],
15+
"browser_action": {
16+
"default_icon": "0.png",
17+
"default_popup": "popup.html"
18+
},
19+
"permissions": [
20+
"storage",
21+
"activeTab"
22+
]
23+
}

popup.css

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
*
2+
{
3+
}
4+
5+
*::selection {
6+
background-color: rgba(200, 200, 200, 0.3);
7+
}
8+
9+
html {
10+
11+
}
12+
13+
body{margin:0;}
14+
15+
header
16+
{
17+
position: absolute;
18+
top: 0px;
19+
background-color: #222;
20+
margin: 0;
21+
padding: 0;
22+
width: 100%;
23+
}
24+
25+
header h1
26+
{
27+
color: white;
28+
text-align: center;
29+
padding-top: 1px;
30+
padding-bottom: 3px;
31+
}
32+
33+
.content {
34+
margin: 25px 5px 5px 5px;
35+
text-align: center;
36+
padding-top: 40px;
37+
padding-bottom: 5px;
38+
padding-left: 20px;
39+
padding-right: 20px;
40+
border-style: none dashed dashed dashed;
41+
border-width: 2px;
42+
border-color: #d3d3d3;
43+
}
44+
45+
p {
46+
margin-bottom: 12px;
47+
font-size: 15px;
48+
}
49+
50+
h2 {
51+
margin-bottom: 5px;
52+
}
53+
54+
.slider_container {
55+
position: relative;
56+
padding-bottom: 8px;
57+
}
58+
59+
.labels {
60+
position: absolute;
61+
width: 100%;
62+
top: 6px;
63+
pointer-events: none;
64+
}
65+
66+
.label {
67+
position: relative;
68+
font-size: 12px;
69+
color: white;
70+
width: 32%;
71+
display: inline-block;
72+
pointer-events: none;
73+
margin: 0;
74+
font-weight: bold;
75+
}
76+
77+
.label.w2 {
78+
width: 49%;
79+
}
80+
81+
.slider {
82+
-webkit-appearance: none;
83+
appearance: none;
84+
background-color: #d3d3d3;
85+
outline: none;
86+
min-width: 300px;
87+
border-radius: 5px;
88+
transition-duration: .2s;
89+
}
90+
91+
.slider:hover {
92+
background-color: #c9c9c9;
93+
cursor: pointer;
94+
/* Cursor on hover */
95+
}
96+
97+
.slider::-webkit-slider-thumb {
98+
-webkit-appearance: none;
99+
/* Override default look */
100+
appearance: none;
101+
width: 33.3333%;
102+
/* Set a specific slider handle width */
103+
height: 25px;
104+
/* Slider handle height */
105+
background-color: #0390fc;
106+
/* Green background */
107+
cursor: pointer;
108+
/* Cursor on hover */
109+
border-radius: 5px;
110+
transition-duration: .2s;
111+
}
112+
113+
.slider.w2::-webkit-slider-thumb {
114+
width: 50%;
115+
}
116+
117+
.slider::-webkit-slider-thumb:hover {
118+
background-color: #007cdb;
119+
}
120+
121+
a {
122+
color: #0390fc;
123+
transition-duration: 0.1s;
124+
}
125+
126+
a:hover {
127+
color: #007cdb;
128+
font-weight: bold;
129+
}

popup.html

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>WikiNoNotes</title>
5+
<script src="popup.js"></script>
6+
<link rel="stylesheet" href="popup.css">
7+
<link rel="stylesheet" href="https://file.wylarel.com/scrollbar.css">
8+
</head>
9+
10+
<body>
11+
<header>
12+
<h1>WikiNoNotes</h1>
13+
</header>
14+
<div class="content">
15+
<h2>Inline notes and references:</h4>
16+
<div class="slider_container">
17+
<input type="range" min="0" max="2" value="1" class="slider w3" id="wikis_notes">
18+
<div class="labels">
19+
<div class="label w3">Default</div>
20+
<div class="label w3">Unselectable</div>
21+
<div class="label w3">Hidden</div>
22+
</div>
23+
</div>
24+
</div>
25+
</body>
26+
</html>

popup.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
document.addEventListener('DOMContentLoaded', function() {
2+
var sliders = document.getElementsByClassName("slider");
3+
var names = [];
4+
5+
for (var i = sliders.length - 1; i >= 0; i--) {
6+
names[i] = sliders[i].id;
7+
}
8+
9+
chrome.storage.sync.get(names, function(data) {
10+
for (var i = sliders.length - 1; i >= 0; i--) {
11+
sliders[i].value = data[names[i]];
12+
console.log(sliders[i].value + ".png")
13+
chrome.browserAction.setIcon({path: sliders[i].value + ".png"});
14+
}
15+
});
16+
sliders[0].oninput = function() {
17+
chrome.storage.sync.set({"wikis_notes": this.value});
18+
chrome.tabs.executeScript({code: 'update_settings();'});
19+
chrome.browserAction.setIcon({path: this.value + ".png"});
20+
}
21+
});

style.css

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
:root
2+
{
3+
--wikis_selectable: initial;
4+
--wikis_hidden: initial;
5+
}
6+
7+
sup.reference, sup.prononciation
8+
{
9+
-webkit-touch-callout: var(--wikis_selectable); /* iOS Safari */
10+
-webkit-user-select: var(--wikis_selectable); /* Safari */
11+
-khtml-user-select: var(--wikis_selectable); /* Konqueror HTML */
12+
-moz-user-select: var(--wikis_selectable); /* Old versions of Firefox */
13+
-ms-user-select: var(--wikis_selectable); /* Internet Explorer/Edge */
14+
user-select: var(--wikis_selectable);
15+
16+
display: var(--wikis_hidden);
17+
}

wikinonotes.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
let root = document.documentElement;
2+
var bodyContent = document.getElementById("bodyContent");
3+
update_settings();
4+
5+
function update_settings() {
6+
chrome.storage.sync.get("wikis_notes", function(data) {
7+
switch (data.wikis_notes) {
8+
case '0':
9+
root.style.setProperty('--wikis_selectable', "initial");
10+
root.style.setProperty('--wikis_hidden', "initial");
11+
break;
12+
case '1':
13+
root.style.setProperty('--wikis_selectable', "none");
14+
root.style.setProperty('--wikis_hidden', "initial");
15+
break;
16+
case '2':
17+
root.style.setProperty('--wikis_selectable', "none");
18+
root.style.setProperty('--wikis_hidden', "none");
19+
break;
20+
}
21+
});
22+
}

zero.psd

301 KB
Binary file not shown.

0 commit comments

Comments
 (0)