aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorache <ache@ache.one>2018-02-04 04:49:32 +0100
committerache <ache@ache.one>2018-02-04 04:49:32 +0100
commit5ef5b666c2caa7961523f5566d0f480d564dd7fb (patch)
treee0ed1baf734f86ccc67613244147debbc09eda30 /public
parentXO fix (diff)
Work on the style guideline
Diffstat (limited to 'public')
-rw-r--r--public/js/qcm.js12
-rw-r--r--public/js/script.js8
2 files changed, 10 insertions, 10 deletions
diff --git a/public/js/qcm.js b/public/js/qcm.js
index 3ce5724..6a09aa6 100644
--- a/public/js/qcm.js
+++ b/public/js/qcm.js
@@ -8,7 +8,7 @@
*
*/
-const check = (id => {
+const check = id => {
const fieldQCM = document.getElementById(id);
Array.from(fieldQCM.getElementsByTagName('INPUT')).forEach(input => {
@@ -16,11 +16,11 @@ const check = (id => {
return;
}
- const label = document.querySelector('label[for=\'' + input.id + '\']');
+ const label = document.querySelector(`label[for='${input.id}']`);
if (input.checked) {
- Array.from(label.getElementsByClassName('hiden_block_quote')).forEach((child => {
+ Array.from(label.getElementsByClassName('hiden_block_quote')).forEach(child => {
child.classList.remove('hiden_block_quote');
- }));
+ });
}
switch (input.className) {
case '!':
@@ -36,7 +36,7 @@ const check = (id => {
// Empty
}
});
-});
+};
function shuffle(array) {
let currentIndex = array.length;
@@ -63,7 +63,7 @@ document.addEventListener('DOMContentLoaded', () => {
listQCM.forEach(field => {
let listInput = [];
Array.from(field.getElementsByTagName('INPUT')).forEach(input => {
- const label = document.querySelector('label[for=\'' + input.id + '\']');
+ const label = document.querySelector(`label[for='${input.id}']`);
listInput.push({input, label});
field.removeChild(input);
field.removeChild(label);
diff --git a/public/js/script.js b/public/js/script.js
index e90198c..1bcb250 100644
--- a/public/js/script.js
+++ b/public/js/script.js
@@ -12,7 +12,7 @@ document.addEventListener('DOMContentLoaded', () => {
document.getElementById('tree').appendChild(addDirectory(data));
Array.from(document.getElementsByTagName('a')).forEach(a => {
- a.onclick = (function (e) {
+ a.onclick = function (e) {
e.preventDefault();
e.stopPropagation();
const setMd = new XMLHttpRequest();
@@ -23,19 +23,19 @@ document.addEventListener('DOMContentLoaded', () => {
};
setMd.open('GET', a.href);
setMd.send();
- });
+ };
});
Array.from(document.getElementsByClassName('directory')).forEach(dir => {
dir.querySelectorAll('ul').forEach(ul => {
ul.style.display = 'none';
});
- dir.onclick = (e => {
+ dir.onclick = e => {
e.stopPropagation();
dir.querySelectorAll('ul').forEach(ul => {
ul.style.display = ul.style.display === 'none' ? 'block' : 'none';
});
- });
+ };
});
}
};