Widget:AllusionsCharts: Difference between revisions
From International Robin Hood Bibliography
mNo edit summary |
mNo edit summary |
||
Line 29: | Line 29: | ||
} | } | ||
var pText = "<div class='chrtHead'>Timeline</div>"; | var pText = "<div class='chrtHead'>Timeline</div>"; | ||
var curCentury = 0, cText = "", cTotal; | var curCentury = 0, cText = "", cTotal; | ||
for (var prop in pages) { | for (var prop in pages) { | ||
Line 76: | Line 63: | ||
initDiv(centuries[i]); | initDiv(centuries[i]); | ||
} | } | ||
var decades = get("tline").getElementsByClassName("tLnDec"); | var decades = get("tline").getElementsByClassName("tLnDec"); | ||
Line 273: | Line 259: | ||
bars[String(i)] = 0; | bars[String(i)] = 0; | ||
} | } | ||
for (var i = 0; i < nVals; i++) { | for (var i = 0; i < nVals; i++) { | ||
var cnt = valuesAr[i].aldecade; | var cnt = valuesAr[i].aldecade; | ||
Line 345: | Line 330: | ||
function prepareItemCard(event) { | function prepareItemCard(event) { | ||
var t = event.target; | var t = event.target; | ||
if (t.tagName != "A") { | if (t.tagName != "A") { | ||
var tc = event.currentTarget; | var tc = event.currentTarget; | ||
var item = tc.firstChild.innerHTML; | var item = tc.firstChild.innerHTML; | ||
var card = tc.firstChild.nextSibling; | var card = tc.firstChild.nextSibling; | ||
if (card.innerHTML == "") { | if (card.innerHTML == "") { | ||
Line 370: | Line 352: | ||
res = res.query.results; | res = res.query.results; | ||
res = res[Object.keys(res)[0]]; | res = res[Object.keys(res)[0]]; | ||
var page = res.fulltext; | var page = res.fulltext; | ||
var author = res.printouts.Alauthor[0]; | var author = res.printouts.Alauthor[0]; |
Revision as of 17:27, 29 May 2019
This widget renders the charts on the section and century landing pages in the Allusions section and Records sub-section of IRHB. It takes no parameters.