// ==UserScript== // @name 长江大学图书馆查询优化 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 将长江大学图书馆索引出来的列表里的武汉校区藏书筛选出来 // @author clannadxr // @include http://calis.yangtzeu.edu.cn:8000/* // @grant none // @downloadURL none // ==/UserScript== $(".expressServiceTab").tabs('select', 0); var allDivs,thisDiv; allDivs = document.evaluate( '//div[contains(@id,"holdingPreviewDiv")]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); /*var navList = document.getElementsByClassName('facetList')[1]; var newDiv = document.createElement('div'); newDiv.setAttribute('class','facetContainer'); var newOl = document.createElement('ol'); newOl.setAttribute('id','curlibcodeFacetSetting'); var newH4 = document.createElement('h4'); newH4.innerHTML='查询优化设置'; var list1 = document.createElement('li'); newOl.appendChild(newH4); newDiv.appendChild(newOl); navList.insertBefore(newDiv,navList.firstChild); alert(navList.innerHTML); */ var timer = setInterval(filterWuHan,10); function filterWuHan(){ if(allDivs.snapshotLength>0) { if (isTabsDone()===true){ for (var i = 0; i < allDivs.snapshotLength; i++) { thisDiv = allDivs.snapshotItem(i); var trs = thisDiv.getElementsByTagName('tr'); for (var j = 1;j0) { for (var i = 0; i < allDivs.snapshotLength; i++) { thisDiv = allDivs.snapshotItem(i); flag= flag && (thisDiv.innerHTML.indexOf("记录")>0 || thisDiv.innerHTML.indexOf("table")>0) ; } return flag; } return false; }