Widget:PlaceNamesCharts: Difference between revisions

From International Robin Hood Bibliography
mNo edit summary
mNo edit summary
(3 intermediate revisions by the same user not shown)
Line 57: Line 57:
var nPages = pages[prop].length;
var nPages = pages[prop].length;
cTotal += nPages;
cTotal += nPages;
var decStr = prop + "–" + String((parseInt(prop) + 9)).substring(2) + ": " + nPages;
var decStr = prop + "–" + String((parseInt(prop) + 9)).substring(2) + " (" + nPages + ")";
cText += "<div class='tLnDec' id='i" + prop + "'><div>" + decStr + "</div><ul>";
cText += "<div class='tLnDec' id='i" + prop + "'><div>" + decStr + "</div><ul>";
for (var i = 0; i < nPages; i++) {
for (var i = 0; i < nPages; i++) {
Line 108: Line 108:
var divClickHandler = function () {
var divClickHandler = function () {
var delay = 25;
var delay = 25;
console.log(this);
console.log(this.nextElementSibling);
var p = this.nextElementSibling.firstElementChild;
var p = this.nextElementSibling.firstElementChild;
console.log(p);
if (p) {
if (p) {
var disp = window.getComputedStyle(p, null).getPropertyValue("display");
var disp = window.getComputedStyle(p, null).getPropertyValue("display");
console.log("disp: " + disp);
disp = disp == "block" ? "none" : "block";
disp = disp == "block" ? "none" : "block";
console.log("disp: " + disp);
if (disp == "none") {
if (disp == "none") {
console.log("disp is none");
p = this.nextElementSibling.lastElementChild;
p = this.nextElementSibling.lastElementChild;
console.log("p: " + p);
}
}
while (true) {
while (true) {

Revision as of 10:40, 6 June 2019

This widget generates charts on landing pages. It takes no parameters.