Skip to content

Commit

Permalink
Update respec hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Cooper committed Nov 19, 2021
1 parent 9c2f396 commit fe3a19b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 31 deletions.
2 changes: 1 addition & 1 deletion guidelines/respec-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,6 @@ var respecConfig = {

maxTocLevel: 4,

postProcess: [addTextSemantics, swapInDefinitions, linkUnderstanding]
postProcess: [postRespec]

};
36 changes: 6 additions & 30 deletions script/wcag.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,33 +68,9 @@ function swapInDefinitions() {
}
}

require(["core/pubsubhub"], function(respecEvents) {
"use strict";
respecEvents.sub('end', function(message) {
if (message === 'core/link-to-dfn') {
linkUnderstanding();
}
})
})

// Change the authors credit to WCAG 2.0 editors credit
require(["core/pubsubhub"], function(respecEvents) {
"use strict";
respecEvents.sub('end', function(message) {
if (message === 'core/link-to-dfn') {
document.querySelectorAll("div.head dt").forEach(function(node){
if (node.textContent == "Former editors:") node.textContent = "WCAG 2.0 Editors (until December 2008):";
});
}
})
})

// Fix the scroll-to-fragID problem:
require(["core/pubsubhub"], function (respecEvents) {
"use strict";
respecEvents.sub("end-all", function () {
if(window.location.hash) {
window.location = window.location.hash;
}
});
});
// scripts after Respec has run
function postRespec() {
addTextSemantics();
swapInDefinitions();
linkUnderstanding();
}

0 comments on commit fe3a19b

Please sign in to comment.