Skip to content

Commit a242976

Browse files
committed
remove use of jQuery from src/js/11-page-customize.js; move tweaks to admonition icons to this file
1 parent c4d10b0 commit a242976

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

src/js/11-page-customize.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
;(function ($) {
1+
;(function () {
22
'use strict'
3-
var tableBlock = document.querySelectorAll('table.tableblock')
3+
4+
// hide admonition icons from Font Awesome i2svg
5+
// FIXME: eventually we want to add the right prefix so that these icons get loaded from Font Awesome
6+
;[].slice.call(document.querySelectorAll('td.icon > i.fa')).forEach(function (el) {
7+
el.classList.remove('fa')
8+
})
49
// for label edition/statuses
5-
var $labels = $('.edition').find('a')
6-
for (var i = 0; i < $labels.length; i++) {
7-
if ($labels[i].text.toLocaleLowerCase().indexOf('community') !== -1) {
8-
$labels[i].parentNode.classList.add('page-edition')
9-
}
10-
}
10+
;[].slice.call(document.querySelectorAll('.edition a')).forEach(function (a) {
11+
if (~a.innerText.toLowerCase().indexOf('community')) a.parentNode.classList.add('page-edition')
12+
})
1113
// add a caption class for all tablelock
12-
tableBlock.forEach(function (elem, index) {
13-
if (elem.caption !== null) {
14-
elem.classList.add('caption-table')
15-
}
14+
;[].slice.call(document.querySelectorAll('table.tableblock')).forEach(function (table) {
15+
if (table.caption) table.classList.add('caption-table')
1616
})
17-
/*eslint-env jquery*/
18-
})(jQuery)
17+
})()

src/js/vendor/fontawesome.bundle.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
;(function () {
22
'use strict'
3-
;[].slice.call(document.querySelectorAll('td.icon>i.fa')).forEach(function (el) {
4-
el.classList.remove('fa')
5-
})
6-
73
require('@fortawesome/fontawesome-free/js/v4-shims')
84
var fa = require('@fortawesome/fontawesome-svg-core')
95

0 commit comments

Comments
 (0)