Skip to content

Commit 080cd87

Browse files
authored
fix: utility.js for AAMs (#77)
1 parent 9b7e93d commit 080cd87

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

script/utility.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
/* Utility functions */
22

33
// Change the authors credit to mapping contributors credit
4-
// Right now this will run on any author credit, not scoped to AAMs
4+
// add postProcess: [ addPlatformMaintainers ] in respecConfig
5+
// In AAMs to change Authors to Platform Mapping Maintainers in the header
6+
7+
function addPlatformMaintainers() {
8+
document.querySelectorAll("div.head dt").forEach(function(node){
9+
if (node.textContent.trim() == "Authors:") node.textContent = "Platform Mapping Maintainers:";
10+
})
11+
}
12+
513
require(["core/pubsubhub"], function(respecEvents) {
614
"use strict";
715
respecEvents.sub('end', function(message) {
816
if (message === 'core/link-to-dfn') {
9-
document.querySelectorAll("div.head dt").forEach(function(node){
10-
if (node.textContent.trim() == "Authors:") node.textContent = "Platform Mapping Maintainers:";
11-
});
17+
addPlatformMaintainers();
1218
}
1319
})
14-
})
15-
20+
})

0 commit comments

Comments
 (0)