User:Btwashburn/common.js

window.pg || $(document).ready( function($) {   var list = [];

// Make sure we are in article if ( wgCanonicalNamespace === '' ) { var spans = document.getElementsByTagName("span"); var index; var node; var classAttr; var zi = 0; for (index = 0; index < spans.length; ++index) { node = spans.item(index); classAttr = node.getAttribute("class"); titleAttr = node.getAttribute("title"); if (classAttr) { if (classAttr === "Z3988") { if (titleAttr) { list.push(titleAttr); zi++; var z3988 = document.createElement('span') z3988.innerHTML = "CHECKING"; z3988.setAttribute("id","z3988-"+zi); node.appendChild(z3988); }               }            }        }        // lookup full text for each of the listed references lookupList(list); } // end if article // given a list of openURL request parameters, call the eSwitch and show the results for each reference function lookupList(l) { for (var i=0; i<l.length; i++) { //alert("lookup "+l[i]); if (l[i]) { var node = document.getElementById("z3988-"+i); if (node) { node.innerHTML = "CHECKING "+l[i]; }           }        }    } // end lookupList } );