Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Commit b72e788

Browse files
authored
Merge pull request #249 from makkoncept/collections_section
Add "Sources" section to the extension
2 parents 87ed926 + 9606d3b commit b72e788

31 files changed

+730
-884
lines changed

src/options/base.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const elements = {
99
accordionItems: document.querySelectorAll('.accordion .accordion-link'),
1010
enableSearchStorageCheckbox: document.getElementById('enable-search-storage-checkbox'),
1111
enableSearchClearConfirmCheckbox: document.getElementById('enable-search-clear-confirm-checkbox'),
12+
tabsHeader: document.getElementsByClassName('tabs')[0].getElementsByTagName('ul')[0],
1213
};
1314

1415
export default elements;

src/options/helper.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ function addSourcesToDom(sources) {
2323
const input = document.createElement('input');
2424
input.type = 'checkbox';
2525
input.id = sources[key];
26-
input.classList = 'vocab choice-field magenta-colored small-sized';
2726

2827
const label = document.createElement('label');
2928
label.setAttribute('for', input.id);

src/options/options.html

Lines changed: 284 additions & 341 deletions
Large diffs are not rendered by default.

src/options/options.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,30 +91,34 @@ elements.importBookmarksButton.addEventListener('click', () => {
9191
});
9292

9393
// tab switching logic
94-
document.getElementById('vocab-tabbed-header').addEventListener('click', e => {
94+
elements.tabsHeader.addEventListener('click', e => {
95+
console.log(e.target);
96+
console.log(e.target.parentElement);
9597
// removing active class
96-
if (e.target.classList.contains('tab')) {
97-
Array.prototype.forEach.call(e.currentTarget.getElementsByClassName('tab active'), element => {
98-
element.classList.remove('active');
98+
if (e.target.parentElement.classList.contains('tab')) {
99+
Array.prototype.forEach.call(e.currentTarget.getElementsByClassName('is-active'), element => {
100+
element.classList.remove('is-active');
101+
console.log('this is inner element');
102+
console.log(element);
99103
});
100104

101105
// add active class to the clicked tab header
102-
e.target.classList.add('active');
106+
e.target.parentElement.classList.add('is-active');
103107

104-
const tabNo = e.target.getAttribute('data-tab-no');
108+
const tabNo = e.target.parentElement.getAttribute('data-tab-no');
105109
let targetContentDiv;
106110

107111
// removing active class from any tab content div
108-
Array.prototype.forEach.call(document.getElementById('vocab-tabbed-contents').children, element => {
109-
element.classList.remove('active');
112+
Array.prototype.forEach.call(document.getElementById('tabs-content').children, element => {
113+
element.classList.remove('is-active');
110114
if (element.getAttribute('data-content-no') === tabNo) {
111115
// saving the target content div
112116
targetContentDiv = element;
113117
}
114118
});
115119

116120
// adding active class to target content div
117-
targetContentDiv.classList.add('active');
121+
targetContentDiv.classList.add('is-active');
118122
}
119123
});
120124

src/options/sass/base/_base.scss

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/options/sass/base/_typography.scss

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/options/sass/base/_utilities.scss

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/options/sass/components/_faq_tab.scss

Lines changed: 0 additions & 86 deletions
This file was deleted.
Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
ul {
2-
padding-left: 1.1rem;
3-
}
4-
5-
.note {
6-
padding-left: 1rem;
7-
color: tomato;
8-
}
9-
10-
.filter-checkboxes {
11-
margin-left: 1rem;
12-
input[type='checkbox'] {
13-
margin-bottom: 0.2rem;
14-
}
1+
.tabs-panel {
2+
padding: 0rem 1rem 1rem;
153
}
Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
.highlight-orange {
1+
.highlight {
2+
font-family: monospace;
23
font-weight: 900;
34
font-style: normal;
4-
color: #ed592f;
5-
}
6-
7-
.highlight-green {
8-
font-weight: 900;
9-
font-style: normal;
10-
color: #04a635;
11-
}
12-
13-
.listitem {
14-
list-style: none;
15-
margin-bottom: 1rem;
165
}

0 commit comments

Comments
 (0)