Widget:FestivalsCharts: Difference between revisions
From International Robin Hood Bibliography
mNo edit summary |
mNo edit summary |
||
Line 7: | Line 7: | ||
window.IRHB.timeline = {}; | window.IRHB.timeline = {}; | ||
var t = window.IRHB.timeline; | var t = window.IRHB.timeline; | ||
window.IRHB.get = window.IRHB.get || function (elem) { | |||
if (typeof elem === "string") { | |||
elem = document.getElementById(elem); | |||
} | |||
return elem; | |||
}; | |||
var get = window.IRHB.get; | |||
Line 78: | Line 88: | ||
function divClickHandler () { | |||
var delay = 25; | var delay = 25; | ||
var p = this.nextElementSibling.firstElementChild; | var p = this.nextElementSibling.firstElementChild; | ||
Line 106: | Line 116: | ||
function toggleRow (s, state) { | |||
s.style.display = state; | s.style.display = state; | ||
}; | }; | ||
Line 118: | Line 128: | ||
var t = window.IRHB.timeline; | var t = window.IRHB.timeline; | ||
var get = window.IRHB.get; | |||
var chartOptions = { | var chartOptions = { | ||
Line 168: | Line 179: | ||
}; | }; | ||
function replaceAll (str, find, replacement) { | |||
return str.replace(new RegExp(escapeRegEx(find), 'g'), replacement); | return str.replace(new RegExp(escapeRegEx(find), 'g'), replacement); | ||
}; | }; | ||
escapeRegEx | function escapeRegEx (str) { | ||
return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); | return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); | ||
}; | }; | ||
Line 313: | Line 317: | ||
item + "]][[flDate::" + yr + | item + "]][[flDate::" + yr + | ||
"]]|?flDate|?flCenturyOrdinal|?flLocality|?flLat|?flLon|?flCountry|?flAdmDiv|?flVicinity|?flRiding|?flGlondon|?flEvents|?flImage&format=json"; | "]]|?flDate|?flCenturyOrdinal|?flLocality|?flLat|?flLon|?flCountry|?flAdmDiv|?flVicinity|?flRiding|?flGlondon|?flEvents|?flImage&format=json"; | ||
query(qry, "POST", makeItemCard); | query(qry, "POST", makeItemCard); |
Revision as of 19:31, 21 May 2019
This widget generates the charts on landing pages in the Festivals section of IRHB. It takes no parameters.