course: bo-signal, bo-test
This commit is contained in:
@ -89,10 +89,6 @@ function addCaptions() {
|
||||
'TABLE': obj.dataset.alt,
|
||||
}[obj.tagName]
|
||||
|
||||
if (obj.dataset.tag) {
|
||||
counter_by_tag[obj.dataset.tag] = obj_counter[obj.tagName]
|
||||
}
|
||||
|
||||
let div = document.createElement('div')
|
||||
div.classList.add(...({
|
||||
'IMG': ['col', 'y-center'],
|
||||
@ -105,6 +101,11 @@ function addCaptions() {
|
||||
obj.style.cssText = 'width: 100%'
|
||||
}
|
||||
|
||||
if (obj.dataset.tag) {
|
||||
counter_by_tag[obj.dataset.tag] = obj_counter[obj.tagName]
|
||||
div.id = 'tag-' + obj.dataset.tag
|
||||
}
|
||||
|
||||
let prev = obj.previousSibling
|
||||
obj.remove()
|
||||
div.append(obj, cap)
|
||||
@ -112,10 +113,16 @@ function addCaptions() {
|
||||
obj_counter[obj.tagName]++
|
||||
}
|
||||
|
||||
const refs = document.querySelectorAll('span[data-ref]')
|
||||
const refs = document.querySelectorAll('span[data-ref],a[data-ref]')
|
||||
|
||||
for (const ref of refs) {
|
||||
ref.innerHTML = counter_by_tag[ref.dataset.ref] ?? 'без номера'
|
||||
switch (ref.tagName) {
|
||||
case 'A':
|
||||
ref.href = '#tag-' + ref.dataset.ref
|
||||
case 'SPAN':
|
||||
ref.innerHTML = counter_by_tag[ref.dataset.ref] ?? 'без номера'
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -160,6 +167,10 @@ function genTables() {
|
||||
dot.colSpan = +args[1]
|
||||
break
|
||||
|
||||
case 'R':
|
||||
dot.rowSpan = +args[1]
|
||||
break
|
||||
|
||||
case 'c':
|
||||
dot.style.backgroundColor = {
|
||||
'r': 'lightcoral',
|
||||
|
||||
Reference in New Issue
Block a user