广州十校图书馆豆瓣助手

为豆瓣图书增加广州大学城十校图书馆藏

  1. // ==UserScript==
  2. // @name 广州十校图书馆豆瓣助手
  3. // @description 为豆瓣图书增加广州大学城十校图书馆藏
  4. // @name:en Douban library helper for Guangzhou Daxuecheng
  5. // @description:en add library collections in Guangzhou Daxuecheng on douban website
  6. // @author Hanchy Hill
  7. // @namespace https://minhill.com
  8. // @include http://book.douban.com/subject/*
  9. // @include https://book.douban.com/subject/*
  10. // @include http://202.116.64.108:8080/apsm/recommend/recommend_nobor.jsp*
  11. // @include http://202.116.64.108:8080/apsm/recommend/recommend.jsp*
  12. // @include http://202.38.232.10/opac/servlet/opac.go?cmdACT=recommend.form*
  13. // @include http://read.douban.com/ebook/*
  14. // @include https://read.douban.com/ebook/*
  15. // @include http://www.gdtgw.cn:8080/*
  16. // @include http://opac.gdufs.edu.cn:8991/F/*func=item-global*
  17. // @include http://202.116.64.108:8991/F/*func=item-global*
  18. // @include http://202.38.232.10/opac/servlet/opac.go*
  19. // @include http://lib.gzhu.edu.cn:8080/bookle/search2/detail/*
  20. // @include http://202.116.41.246:8080/opac/item.php?marc_no=*
  21. // @include http://210.38.102.131:86/opac/item.php?marc_no=*
  22. // @include http://222.200.98.171:81/bookinfo.aspx?ctrlno=*
  23. // @include http://121.33.246.167/opac/bookinfo.aspx?ctrlno=*
  24. // @include http://218.192.148.33:81/bookinfo.aspx?ctrlno=*
  25. // @include http://opac.gdufs.edu.cn:8118/apsm/recommend/recommend_nobor.jsp*
  26. // @version 1.9.8
  27. // @license MIT
  28. // @grant GM_getValue
  29. // @grant GM_setValue
  30. // @grant GM_xmlhttpRequest
  31. // @grant GM_openInTab
  32. // @grant GM_deleteValue
  33. // @grant GM_addStyle
  34. // @grant GM_registerMenuCommand
  35. // @grant GM_setClipboard
  36. // @icon http://minhill.com/blog/wp-content/uploads/2012/03/favicon.ico
  37. // ==/UserScript==
  38.  
  39.  
  40. GM_addStyle("#ISBNLoading,#titleLoading { list-style-type:none; }");
  41.  
  42. GM_addStyle("#libSetting {background: #F6F6F1;border: 1px solid #aaa;box-shadow: 0 0 8px 2px #777;height: auto;left: 320px;min-height: 100px;padding: 0 20px 65px;position: fixed;top: 25%;width: 600px;z-index: 1000002;}"+
  43. '.setbtn{display: inline-block; background: #33A057; border: 1px solid #2F7B4B; color: white!important; padding: 1px 10px; border-radius: 3px; margin-right: 8px;margin:5px;cursor:pointer;} '+
  44. '.gotobtn{display: inline-block; background: #33A057!important; border: 1px solid #2F7B4B; color: white!important; padding: 1px 10px; border-radius: 3px;margin-bottom:5px;font-size:0.8em!important;cursor:pointer;} '+
  45. '#otherTitle .getlink a{display: inline-block; border: 1px solid #2F7B4B; padding: 1px 5px; border-radius: 3px;margin-bottom:2px;font-size:0.8em!important;cursor:pointer;text-decoration:none!important;}');
  46.  
  47. var schoolList=["SYSU","SCUT","SCNU","GDUT","GDUFS","GZHTCM","GZHU","GZARTS","XHCOM"];
  48.  
  49. //个人选项设置
  50. var prefs={
  51. school:GM_getValue("school","SYSU"),
  52. studentID:GM_getValue("studentID","2333333"),
  53. //password:"Hello_Kitty",
  54. campus:GM_getValue("campus","东校区"),
  55. telephone:GM_getValue("telephone","13145201748"),
  56. name:GM_getValue("name","二三三"),
  57. eMail:GM_getValue("eMail","HelloKitty@sysu.edu.cn"),
  58. libraryId:GM_getValue("libraryId","ID1000244462")
  59. }
  60.  
  61.  
  62. function LibMeta(schoolName){
  63. this.state=null;
  64. this.error=false;
  65. this.errorMsg=null;
  66. this.type=null;
  67. this.link=null;
  68. this.items=null;
  69. this.originUrl=null;
  70. this.school=schoolName;
  71. }
  72.  
  73.  
  74. function LibItem(school){
  75. this.bookName=null;
  76. this.author=null;
  77. this.bookIndex=null;
  78. this.publisher=null;
  79. this.pubDate=null;
  80. this.school=school;
  81. this.link=null;
  82. this.extra=null;
  83. this.type="booklist";
  84. }
  85.  
  86. function StoreItem(school){
  87. this.school=school;
  88. this.storeState=null;
  89. this.borrowTime=null;
  90. this.returnTime="";
  91. this.location=null;
  92. this.bookIndex=null;
  93. this.branch=null;
  94. this.link=null;
  95. this.type="store";
  96. this.rentable=false;
  97. }
  98.  
  99.  
  100.  
  101. ///////////////////////////豆瓣图书元信息///////////////////////////////////
  102. bookMeta=(function(){
  103. if(location.href.indexOf('douban')==-1){return null;}//只在豆瓣页面执行
  104.  
  105. if(location.href.indexOf('douban.com/subject')!=-1){
  106. //执行豆瓣图书Func.
  107. var rawBookInfo=document.getElementById("info").innerHTML; //获取info块
  108. var author = document.querySelector("#info a"); //获取作者
  109. if (author){
  110. author = author.innerHTML.trim();
  111.  
  112. }
  113.  
  114. var title =document.querySelector('h1 span').textContent;
  115. var bracketIndex = title.indexOf("(");//去除括号,防止搜索进行子匹配操作
  116. if(bracketIndex!=-1){
  117. title=title.slice(0,bracketIndex);
  118. }
  119.  
  120. bracketIndex = title.indexOf("(");//去除括号,防止搜索进行子匹配操作
  121. if(bracketIndex!=-1){
  122. title=title.slice(0,bracketIndex);
  123. }
  124.  
  125. var publisher = /出版社:<\/span>(.*)<br>/.exec(rawBookInfo);
  126. if (publisher !== null){
  127. publisher = publisher[1].trim();
  128. }
  129.  
  130. var pubdate = /出版年:<\/span>(.*)<br>/.exec(rawBookInfo);
  131. if (pubdate !== null){
  132. pubdate = /[\d]+/.exec(pubdate[1].trim());
  133. pubdate = pubdate[0];
  134. }
  135.  
  136. var price = /定价:<\/span>(.*)<br>/.exec(rawBookInfo);
  137. if (price !== null){
  138. price = price[1].trim();
  139. }
  140.  
  141. var isbn = /ISBN:<\/span>(.*)<br>/.exec(rawBookInfo);
  142. if (isbn !== null){
  143. isbn = isbn[1].trim();
  144. }
  145. var bookIndex = /统一书号:<\/span>(.*)<br>/.exec(rawBookInfo);
  146. if (bookIndex !== null){
  147. bookIndex = bookIndex[1].trim();
  148. }
  149.  
  150. var rating = document.querySelector('#interest_sectl .rating_num').innerHTML.trim();
  151. if (!rating) {
  152. rating = '暂无评分';
  153. }
  154. }
  155.  
  156. else if(location.href.indexOf('ebook')!=-1){//豆瓣电子书页面
  157. var allNodes, isbn=null;
  158. allNodes = document.evaluate('//a[@itemprop="isbn"]',document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);//获取isbn
  159. if(allNodes.snapshotItem(0)){
  160. isbn=allNodes.snapshotItem(0).innerHTML;
  161. }
  162. //////////////
  163.  
  164. ////////////
  165. var title;
  166. allNodes = document.evaluate('//h1[@itemprop="name"]',document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
  167. if(allNodes.snapshotItem(0)){
  168. title=allNodes.snapshotItem(0).innerHTML;
  169. var bracketIndex = title.indexOf("(");//去除括号,防止搜索进行子匹配操作
  170. if(bracketIndex!=-1){
  171. title=title.slice(0,bracketIndex);
  172. }
  173. bracketIndex = title.indexOf("(");//去除括号,防止搜索进行子匹配操作
  174. if(bracketIndex!=-1){
  175. title=title.slice(0,bracketIndex);
  176. }
  177. }
  178.  
  179. var publisher;
  180. allNodes = document.evaluate('//span[@itemprop="publisher"]',document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
  181. if(allNodes.snapshotItem(0)){
  182. publisher=allNodes.snapshotItem(0).innerHTML;
  183. }
  184.  
  185. var author;
  186. allNodes = document.evaluate('//span[@itemprop="author"]',document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
  187. if(allNodes.snapshotItem(0)){
  188. author=allNodes.snapshotItem(0).innerHTML;
  189. }
  190.  
  191. var pubdate;
  192. allNodes = document.evaluate('//span[@itemprop="datePublished"]',document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
  193. if(allNodes.snapshotItem(0)){
  194. pubdate=allNodes.snapshotItem(0).innerHTML;
  195. pubdate=pubdate.slice(0,4);
  196. }
  197.  
  198. var rating='暂无评分';
  199. var price="";
  200. var bookIndex="";
  201. }
  202. //////////////////////ISBN转为旧格式///////////////////////////////////
  203. function ISBN10(isbn){
  204. if(isbn == null){
  205. return null;
  206. }
  207. else if(pubdate == null){
  208. return isbn;
  209. }
  210.  
  211. if(isbn.length==13){
  212.  
  213. var rawISBN=isbn.slice(3,12);
  214.  
  215. var checkCode=0;//校验码
  216. for(i=0;i<9;i++){
  217. checkCode+=parseInt(rawISBN[i])*(10-i);
  218. }
  219.  
  220. checkCode=11-checkCode%11;
  221. if(checkCode==10){checkCode="X";}
  222.  
  223.  
  224. var preCode="";
  225. publishDate=Number(pubdate.slice(0,4));
  226. if((publishDate)>=2007){//判断年份以检查是否需要加前缀和修正校验位
  227. preCode=isbn.slice(0,3)+"-";
  228. checkCode=isbn[12];
  229. }
  230. }
  231. else{//ISBN只有10位的时候,年份小于2007时校验位为原码
  232. rawISBN =isbn.slice(0,9);
  233. checkCode = isbn[9];
  234. preCode="";
  235. publishDate=Number(pubdate.slice(0,4));
  236. if((publishDate)>=2007){//判断年份以检查是否需要加前缀和修正校验位
  237. preCode='978'+"-";
  238. a = 7+parseInt(rawISBN[0])+parseInt(rawISBN[2])+parseInt(rawISBN[4])+parseInt(rawISBN[6])+parseInt(rawISBN[8]);
  239. a =a*3;
  240. b = 9+8+parseInt(rawISBN[1])+parseInt(rawISBN[3])+parseInt(rawISBN[5])+parseInt(rawISBN[7]);
  241. c = a+b;
  242. d = c%10;
  243. checkCode = (10-d)%10;
  244. }
  245. }
  246.  
  247. //alert(preCode+rawISBN+checkCode);
  248. switch(rawISBN[1]){
  249. case '0':
  250. ISBNold=preCode+rawISBN[0]+"-"+rawISBN.slice(1,3)+"-"+rawISBN.slice(3,9)+"-"+checkCode;
  251. break;
  252. case '1':
  253. case '2':
  254. case '3':
  255. ISBNold=preCode+rawISBN[0]+"-"+rawISBN.slice(1,4)+"-"+rawISBN.slice(4,9)+"-"+checkCode;
  256. break;
  257. case '5':
  258. case '7':
  259. ISBNold=preCode+rawISBN[0]+"-"+rawISBN.slice(1,5)+"-"+rawISBN.slice(5,9)+"-"+checkCode;
  260. break;
  261. case '4':
  262. case '8':
  263. ISBNold=preCode+rawISBN[0]+"-"+rawISBN.slice(1,6)+"-"+rawISBN.slice(6,9)+"-"+checkCode;
  264. break;
  265. case '6':
  266. ISBNold=preCode+rawISBN.slice(0,3)+"-"+rawISBN.slice(3,6)+"-"+rawISBN.slice(6,9)+"-"+checkCode;
  267. break;
  268. default:
  269. ISBNold=rawISBN;
  270. break;
  271. }
  272. return ISBNold;
  273. }
  274.  
  275. var isbn10=ISBN10(isbn,pubdate);
  276. /////////////////////////////////////////////////////////
  277. var lan="zh";
  278. GM_setValue("doubanLanguage","zh");
  279. if(title.charCodeAt(0)<=122&&((isbn&&isbn[3]!=="7")||!isbn)){
  280. lan="en";
  281. GM_setValue("doubanLanguage","en");
  282. }
  283. return{
  284. "title": title,
  285. "author": author,
  286. "publisher": publisher,
  287. "pubdate": pubdate,
  288. "price": price,
  289. "isbn": isbn,
  290. "bookIndex": bookIndex,
  291. "rating": rating,
  292. "isbn10": isbn10,
  293. "lan":lan//语言
  294. };
  295. })();
  296.  
  297.  
  298.  
  299. //各学校元信息
  300. var schoolInfo={
  301. //中山大学
  302. "SYSU":{
  303. name:"中山大学",
  304. anySearchUrl:"http://202.116.64.108:8991/F/?func=find-b&find_code=WRD&request=%s",
  305. anyForeianSearchUrl:"http://202.116.64.108:8991/F/?func=find-b&find_code=WRD&request=%s&local_base=ZSU09",
  306. isbnSearchUrl:"http://202.116.64.108:8991/F/?func=find-b&find_code=ISB&request=%s",
  307. isbnForeianSearchUrl:"http://202.116.64.108:8991/F/?func=find-b&find_code=ISB&request=%s&local_base=ZSU09",
  308. titleSearchUrl:"",
  309. abbrName:"中大",
  310. isGBK:false,
  311. recommendUrl:"http://202.116.64.108:8080/apsm/recommend/recommend.jsp?url_id=http://202.116.64.108:8991/F/"
  312. },
  313.  
  314. //华南理工大学
  315. "SCUT":{
  316. name:"华南理工大学",
  317. anySearchUrl:"http://202.38.232.10/opac/servlet/opac.go?CLANLINK=&CODE=&FIELD1=TITLE&MARCTYPE=&MODE=FRONT&ORGLIB=SCUT&PAGE=&RDID=ANONYMOUS&SCODE=&TABLE=&VAL1=%s&cmdACT=simple.list&libcode=",
  318. isbnSearchUrl:"http://202.38.232.10/opac/servlet/opac.go?CLANLINK=&CODE=&FIELD1=ISBN&MARCTYPE=&MODE=FRONT&ORGLIB=SCUT&PAGE=&RDID=ANONYMOUS&SCODE=&TABLE=&VAL1=%s&cmdACT=simple.list&libcode=",
  319. anyForeianSearchUrl:"http://202.38.232.10/opac/servlet/opac.go?CLANLINK=&CODE=&FIELD1=TITLE&MARCTYPE=&MODE=FRONT&ORGLIB=SCUT&PAGE=&RDID=ANONYMOUS&SCODE=&TABLE=&VAL1=%s&cmdACT=simple.list&libcode=",
  320. isbnForeianSearchUrl:"http://202.38.232.10/opac/servlet/opac.go?CLANLINK=&CODE=&FIELD1=ISBN&MARCTYPE=&MODE=FRONT&ORGLIB=SCUT&PAGE=&RDID=ANONYMOUS&SCODE=&TABLE=&VAL1=%s&cmdACT=simple.list&libcode=",
  321. abbrName:"华理工",
  322. isGBK:false,
  323. recommendUrl:"http://202.38.232.10/opac/servlet/opac.go?cmdACT=recommend.form"
  324.  
  325. },
  326.  
  327. //南中国一般大学
  328. "SCNU":{
  329. name:"华南师范大学",
  330. abbrName:"华师",
  331. anySearchUrl:"http://202.116.41.246:8080/opac/openlink.php?sort=M_TITLE&orderby=ASC&title=%s",
  332. isbnSearchUrl:"http://202.116.41.246:8080/opac/openlink.php?isbn=%s&_m=1",
  333. isGBK:false
  334. },
  335.  
  336. //广东工业大学
  337. "GDUT":{
  338. name:"广东工业大学",
  339. abbrName:"广工",
  340. anySearchUrl:"http://222.200.98.171:81/searchresult.aspx?anywords=%s&dt=ALL&cl=ALL&dp=20&sf=M_PUB_YEAR&ob=DESC&sm=table&dept=ALL",
  341. isbnSearchUrl:"http://222.200.98.171:81/searchresult.aspx?isbn_f=%s&dt=ALL&cl=ALL&dp=20&sf=M_PUB_YEAR&ob=DESC&sm=table&dept=ALL",
  342. isGBK:true
  343. },
  344.  
  345. //外语外贸大学
  346. "GDUFS":{
  347. name:"广东外语外贸大学",
  348. abbrName:"广外",
  349. anySearchUrl:"http://opac.gdufs.edu.cn:8991/F/?find_code=WRD&request=%s&func=find-b",
  350. anyForeianSearchUrl:"http://opac.gdufs.edu.cn:8991/F/?func=find-b&find_code=WRD&request=%s&local_base=GWD09",
  351. isbnSearchUrl:"http://opac.gdufs.edu.cn:8991/F/?func=find-b&find_code=ISB&request=%s&local_base=GWD01",
  352. isbnForeianSearchUrl:"http://opac.gdufs.edu.cn:8991/F/?func=find-b&find_code=ISB&request=%s&local_base=GWD09",
  353. recommendUrl:"http://opac.gdufs.edu.cn:8118/apsm/recommend/recommend_nobor.jsp",
  354. isGBK:false
  355.  
  356. },
  357.  
  358. //广州中医药大学
  359. "GZHTCM":{
  360. name:"广州中医药大学",
  361. abbrName:"广中医",
  362. anySearchUrl:"http://210.38.102.131:86/opac/openlink.php?sort=M_TITLE&orderby=ASC&title=%s",
  363. isbnSearchUrl:"http://210.38.102.131:86/opac/openlink.php?strText=%s&strSearchType=isbn",
  364. isGBK:false
  365. },
  366.  
  367. //广州大学
  368. "GZHU":{
  369. name:"广州大学",
  370. abbrName:"广大",
  371. anySearchUrl:"http://lib.gzhu.edu.cn:8080/bookle/?id=searchForm&displayPages=15&index=default&matchesPerPage=10&query=%s&searchPage=1&submit=Bookle%20%E6%90%9C%E7%B4%A2",
  372. isbnSearchUrl:"http://lib.gzhu.edu.cn:8080/bookle/?index=default&query=STANDARDNO%3A%28%s%29",
  373. isGBK:false
  374. },
  375.  
  376. //广州美术学院gzarts
  377. "GZARTS":{
  378. name:"广州美术学院",
  379. abbrName:"广美",
  380. anySearchUrl:"http://121.33.246.167/opac/searchresult.aspx?anywords=%s&dt=ALL&cl=ALL&dp=20&sf=M_PUB_YEAR&ob=DESC&sm=table&dept=ALL&ecx=0",
  381. isbnSearchUrl:"http://121.33.246.167/opac/searchresult.aspx?isbn_f=%s&dt=ALL&cl=ALL&dp=20&sf=M_PUB_YEAR&ob=DESC&sm=table&dept=ALL&ecx=0",
  382. //http://121.33.246.167/opac/searchresult.aspx?isbn_f=7-02-000220-X&dt=ALL&cl=ALL&dp=20&sf=M_PUB_YEAR&ob=DESC&sm=table&dept=ALL&ecx=0
  383. isGBK:true
  384. },
  385.  
  386.  
  387. //星海音乐学院
  388. "XHCOM":{
  389. name:"星海音乐学院",
  390. abbrName:"星海",
  391. anySearchUrl:"http://218.192.148.33:81/searchresult.aspx?anywords=%s&dt=ALL&cl=ALL&dp=20&sf=M_PUB_YEAR&ob=DESC&sm=table&dept=ALL",
  392. isbnSearchUrl:"http://218.192.148.33:81/searchresult.aspx?isbn_f=%s&dt=ALL&cl=ALL&dp=20&sf=M_PUB_YEAR&ob=DESC&sm=table&dept=ALL",
  393. isGBK:true
  394. },
  395.  
  396.  
  397. "zhizhen":{
  398. name:"超星发现",
  399. abbrName:"超星发现",
  400. anySearchUrl:"http://ss.zhizhen.com/s?strchannel=11&adv=Z%3D%s&aorp=a&size=15&isort=0&x=0_17#searchbody",
  401. isbnSearchUrl:"http://ss.zhizhen.com/s?adv=I%3D%s&aorp=a&size=15&isort=0&x=0_17#searchbody",
  402. //anyForeianSearchUrl:"http://ss.zhizhen.com/s?strchannel=11&adv=Z%3D%s&aorp=a&size=15&isort=0&x=0_17#searchbody",
  403. isGBK:false
  404. },
  405.  
  406. "chaoxing":{
  407. name:"超星读书",
  408. abbrName:"超星读书",
  409. anySearchUrl:"http://book.chaoxing.com/search/name/%s/bookList1_.html",
  410. //isbnSearchUrl:"http://ss.zhizhen.com/s?adv=I%3D%s&aorp=a&size=15&isort=0&x=0_17#searchbody",
  411. isGBK:false
  412. },
  413.  
  414. "CALIS":{
  415. name:"CALIS",
  416. abbrName:"CALIS",
  417. anySearchUrl:"http://opac.calis.edu.cn/doSimpleQuery.do?actionType=doSimpleQuery&dbselect=all&indexkey=dc.title%7Cinc&langBase=default&maximumRecords=50&operation=searchRetrieve&pageno=1&pagingType=0&query=(dc.title%3D%22*%s*%22)&sortkey=title&startRecord=1&version=1.1",
  418. isbnSearchUrl:"http://opac.calis.edu.cn/doSimpleQuery.do?actionType=doSimpleQuery&dbselect=all&indexkey=bath.isbn|frt&langBase=default&maximumRecords=50&operation=searchRetrieve&pageno=1&pagingType=0&query=%28bath.isbn%3D%22%s*%22%29&sortkey=title&startRecord=1&version=1.1",
  419. isGBK:false
  420. },
  421.  
  422. "NLC":{
  423. name:"中国国家图书馆",
  424. abbrName:"国家馆",
  425. anySearchUrl:"http://opac.nlc.gov.cn/F?func=find-b&find_code=WTP&request=%s&local_base=NLC01&filter_code_1=WLN&filter_request_1=&filter_code_2=WYR&filter_request_2=&filter_code_3=WYR&filter_request_3=&filter_code_4=WFM&filter_request_4=&filter_code_5=WSL&filter_request_5=",
  426. isbnSearchUrl:"http://opac.nlc.gov.cn/F?find_code=ISB&request=%s&local_base=NLC01&func=find-b",
  427. isGBK:false
  428. },
  429.  
  430. "EBSCO":{
  431. name:"EBSCOhost eBook",
  432. abbrName:"EBSCO",
  433. anySearchUrl:"http://search.ebscohost.com/login.aspx?direct=true&site=eds-live&scope=site&type=0&custid=s5802652&groupid=main&profid=eds&mode=and&lang=en&authtype=ip,guest&bquery=%s&defaultdb=NLEBK",
  434. isGBK:false
  435. //,EXP:"title-link-wrapper*?treelist-group"
  436. },
  437.  
  438. "GoogleDoc":{
  439. name:"谷歌聚合搜索",
  440. abbrName:"谷歌",
  441. anySearchUrl:"https://g.net.co/uds/GwebSearch?rsz=filtered_cse&hl=zh_CN&cx=006100883259189159113%3Atwgohm0sz8q&v=1.0&key=notsupplied&q=%s",
  442. mirrorUrl:['https://g.net.co/', 'https://www.90r.org/', 'https://soso.red/', 'https://cao.si/'],
  443. isGBK:false
  444. },
  445.  
  446.  
  447. //广东药学院,由于编码问题和没提供ISBN检索,暂不支持//
  448. "GDPU":{
  449. name:"广东药学院",
  450. abbrName:"广药"
  451. }
  452.  
  453. }
  454.  
  455. function popSetting(){
  456. var settingDiv = document.createElement("div");
  457. settingDiv.setAttribute("id","libSetting");
  458. settingDiv.innerHTML="<h2>图书馆检索设置</h2>"+
  459. '&nbsp&nbsp'+'学校<select id="setschool" class="barname">'+'<option value="SYSU">中山大学</option><option value="SCUT">华南理工大学</option>'+
  460. '<option value="SCNU">华南师范大学</option><option value="GDUFS">广东外语外贸大学</option>'+
  461. '<option value="GDUT">广东工业大学</option><option value="GZHU">广州大学</option>'+
  462. '<option value="GZHTCM">广州中医药大学</option><option value="GZARTS">广州美术学院</option><option value="XHCOM">星海音乐学院</option></select>'+'&nbsp&nbsp'+
  463. '学号<input id="setstudentID" class="barname">'+'&nbsp&nbsp&nbsp'+
  464. '校区<input id="setcampus" class="barname">'+'<br><br>'+
  465. '手机号<input id="settelephone" class="barname">'+'&nbsp&nbsp'+
  466. '姓名<input id="setname" class="barname">'+'&nbsp&nbsp'+
  467. '邮箱<input id="seteMail" class="barname">'+'<br>'+'<br>'+
  468. '读者ID<input id="setLibID" class="barname">*读者ID为荐购页面登陆时所填写的ID,请自行查阅本馆读者荐购页面'+'<br>'+'<br>'+
  469. '<a id="setsave" class="setbtn">保存设置并刷新</a><a id="setclose" class="setbtn">直接关闭</a>'
  470.  
  471. document.getElementsByTagName("body")[0].appendChild(settingDiv);// 插入完毕
  472.  
  473. document.getElementById("setschool").value=prefs.school;
  474. document.getElementById("setstudentID").value=prefs.studentID;
  475. document.getElementById("setcampus").value=prefs.campus;
  476. document.getElementById("settelephone").value=prefs.telephone;
  477. document.getElementById("setname").value=prefs.name;
  478. document.getElementById("seteMail").value=prefs.eMail;
  479. document.getElementById("setLibID").value=prefs.libraryId;
  480. function setSaving(){
  481.  
  482. GM_setValue("school",document.getElementById("setschool").value);
  483. GM_setValue("studentID",document.getElementById("setstudentID").value);
  484. GM_setValue("campus",document.getElementById("setcampus").value);
  485. GM_setValue("telephone",document.getElementById("settelephone").value);
  486. GM_setValue("name",document.getElementById("setname").value);
  487. GM_setValue("eMail",document.getElementById("seteMail").value);
  488. GM_setValue("libraryId",document.getElementById("setLibID").value);
  489. settingDiv.parentNode.removeChild(settingDiv);
  490. location.reload();
  491. }
  492. document.getElementById("setsave").addEventListener("click",setSaving,false);
  493. document.getElementById("setclose").addEventListener("click",function(){settingDiv.parentNode.removeChild(settingDiv)},false);
  494. }
  495.  
  496.  
  497.  
  498. //函数:提取isbn搜索元信息
  499. var isbnFilter={
  500. //中山大学
  501. SYSU: {
  502.  
  503. respond:function (reDetails,frameLocation,fullUrl) {
  504. if (reDetails.status !== 200&&reDetails.status !== 304){
  505. var msg = new LibMeta("SYSU");
  506. msg.state="error";
  507. msg.errorMsg="ISBN连接错误";
  508. messageCatcher(msg,frameLocation);
  509. return;
  510. }
  511. //document.getElementById("footer").textContent=reDetails.responseText;
  512. if(reDetails.responseText.indexOf('indexpage')!=-1){
  513. var msg = new LibMeta("SYSU");
  514. msg.state="recommend";
  515.  
  516. messageCatcher(msg,frameLocation);
  517. return;
  518. }
  519. if(reDetails.responseText.indexOf('Search Results')!=-1){
  520. titleFilter.SYSU.filter(reDetails.responseText,fullUrl,frameLocation);
  521. }
  522. else{
  523.  
  524. isbnFilter.SYSU.filter(reDetails.responseText,frameLocation);
  525.  
  526. }
  527. return;
  528. },
  529.  
  530.  
  531. filter:function(gettxt,frameLocation){
  532.  
  533. /////////////////////////////////////////////////////////
  534.  
  535. str = gettxt;
  536. str = str.replace(/[ | ]*\n/g,''); //去除行尾空白
  537. str = str.replace(/\n[\s| | ]*\r/g,''); //去除多余空行
  538. str = str.replace(/amp;/g,""); //去除URL转码
  539. ///获取一整块
  540. var eBook;
  541. eBook = null;
  542. if(str.match(/电子资源定位/)){
  543. //document.getElementById("footer").textContent=str;
  544. eBook = str.match(/电子资源定位.*?jpg.*?File Extension: url">(.*?)<\/a>/)[1];
  545. }
  546. if(!eBook&&str.indexOf("索书")==-1){
  547. var msg = new LibMeta("SYSU");
  548. msg.state="recommend";
  549. messageCatcher(msg,frameLocation);
  550. return;
  551. }
  552. str = str.match(/全部馆藏(.*?)所有单册借阅状态/g)
  553.  
  554. var txt = str[0];
  555. txt = txt.match(/http:.*?sub_library=/)[0];
  556.  
  557. GM_xmlhttpRequest({ //获取列表
  558. method : 'GET',
  559. synchronous : false,
  560. url : txt,
  561. onload : function (reDetails) {
  562. if (reDetails.status !== 200&&reDetails.status !== 304){
  563. var msg = new LibMeta("SYSU");
  564. msg.state="error";
  565. msg.errorMsg="无法获取馆藏列表";
  566. //alert("ISBN连接错误");//后续版本再处理
  567. messageCatcher(msg,frameLocation);
  568. return;
  569. }
  570. var libra =document.createElement("div");
  571. libra.innerHTML = reDetails.responseText;
  572. isbnFilter.SYSU.getBookinfo(libra.innerHTML,eBook,frameLocation,txt);//回调函数馆藏位置获取
  573. }
  574. });
  575. },
  576.  
  577. /////////////////回调函数馆藏位置获取////////////////////////////////////////
  578. getBookinfo:function(webText,eBook,frameLocation,url){
  579. var hasBook = true;
  580. webText = webText.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"");
  581.  
  582. ///防止无书籍的情况发生
  583. if(webText.indexOf('无匹配单册')!=-1){
  584. var msg = new LibMeta("SYSU");
  585. msg.state="recommend";
  586. messageCatcher(msg,frameLocation);
  587. return null;
  588. }
  589. else{
  590. blockBook = webText.match(/OPAC注释(.*?)<\/tbody>/)[1];
  591. borrowItem = blockBook.match(/<tr>.*?<\/tr>/g);
  592. var loan = new Array();
  593.  
  594. for(k=0;k<borrowItem.length;k++){
  595. loan[k] = borrowItem[k].match(/<!--Loan.*?td1">(.*?)<\/td>.*?date.*?td1">(.*?)<\/td>.*?hour.*?td1>(.*?)<\/td>.*?Sub.*?nowrap="">(.*?)<\/td>.*?Collection.*?nowrap="">(.*?)<\/td>.*?td1">(.*?)<\/td>/);
  596. /////借书类型/时间/到期/分馆/馆藏地/索书号
  597. }
  598. }
  599. /////////////////
  600.  
  601. if(hasBook){
  602. var storeList = new LibMeta("SYSU");
  603. storeList.state="store";
  604. storeList.items= new Array();
  605.  
  606.  
  607. for(s=0;s<borrowItem.length;s++){
  608. //allBook += bookStatus;
  609. storeList.items[s]=new StoreItem("SYSU");
  610. storeList.items[s].storeState=loan[s][1];
  611. storeList.items[s].returnTime=loan[s][2].replace(/<br>/,"");
  612. storeList.items[s].branch=loan[s][4];
  613. storeList.items[s].link=url;
  614. storeList.items[s].location=loan[s][5];
  615. storeList.items[s].bookIndex=loan[s][6];
  616. if(storeList.items[s].storeState.indexOf('外借')!=-1&&storeList.items[s].returnTime.indexOf("在架上")!=-1&&storeList.items[s].storeState.indexOf('闭架')==-1){
  617. storeList.items[s].rentable=true;
  618. }
  619. }
  620.  
  621. if(eBook){
  622.  
  623. var itemsLength=storeList.items.length;
  624. storeList.items[itemsLength]=new StoreItem("SYSU");
  625. storeList.items[itemsLength].link=eBook;
  626. storeList.items[itemsLength].type="eBook";
  627. storeList.items[itemsLength].storeState="电子书";
  628. };
  629. }
  630. messageCatcher(storeList,frameLocation);
  631. return null;
  632.  
  633. //////////////////////完成框架插入//////////////
  634. }
  635. },
  636. //华南理工大学
  637. SCUT:{
  638. respond:function (reDetails,frameLocation) {
  639. if (reDetails.status !== 200&&reDetails.status !== 304){
  640. var msg = new LibMeta("SCUT");
  641. msg.state="error";
  642. msg.errorMsg="ISBN连接错误";
  643. //alert("ISBN连接错误");//后续版本再处理
  644. messageCatcher(msg,frameLocation);
  645. return;
  646. }
  647. if(reDetails.responseText.indexOf('无符合')!=-1){
  648. //alert("ISBN查无此书"); //增加荐购
  649. var msg = new LibMeta("SCUT");
  650. msg.state="recommend";
  651. messageCatcher(msg,frameLocation);
  652. return;
  653. }
  654. isbnFilter.SCUT.filter(reDetails.responseText,frameLocation);
  655.  
  656. },
  657. filter:function(text,frameLocation){
  658. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"");
  659. rowText = text.match(/javascript:book_detail.*?<\/tr>/g);
  660.  
  661. var bookBlock = new Array();
  662. var bookDetail = new Array();
  663. for(s=0;s<rowText.length;s++){
  664. bookBlock[s] = rowText[s].match(/\((\d+\.?\d*)\)">(.*?)<\/a>.*?F">(.*?)<\/TD>.*?F">(.*?)<\/TD>.*?F">(.*?)<\/TD>.*?F">(.*?)<\/TD>.*?F">(.*?)<\/TD>.*?F">(.*?)<\/TD>/);
  665. bookBlock[s].shift();
  666.  
  667. }
  668.  
  669. var list = new LibMeta("SCUT");////构造函数
  670. list.state="booklist";
  671. list.items= new Array();
  672. for(s=0;s<rowText.length;s++){
  673. list.items[s] = new LibItem("SCUT");
  674. list.items[s].link ="http://202.38.232.10/opac/servlet/opac.go?SORTFIELD=CALLNO&SORTORDER=asc&bookid="+bookBlock[s][0]+"&cmdACT=query.bookdetail&libcode=";
  675. list.items[s].bookName = bookBlock[s][1];
  676. list.items[s].author = bookBlock[s][2];
  677. list.items[s].publisher = bookBlock[s][3];
  678. list.items[s].bookIndex = bookBlock[s][6];
  679. list.items[s].pubDate = bookBlock[s][5];
  680. }
  681.  
  682. //进一步获取馆藏
  683. GM_xmlhttpRequest({ //获取列表
  684. method : 'GET',
  685. synchronous : false,
  686. url : list.items[0].link,
  687. onload : function (reDetails) {
  688. if (reDetails.status !== 200&&reDetails.status !== 304){
  689. var msg = new LibMeta("SCUT");
  690. msg.state="error";
  691. msg.errorMsg="无法获取馆藏列表";
  692. messageCatcher(msg,frameLocation);
  693. return;
  694. }
  695. getStoreFilter(reDetails.responseText,frameLocation,list.items[0].link);//回调函数馆藏位置获取
  696. }
  697. });
  698.  
  699.  
  700.  
  701. function getStoreFilter(text,frameLocation,finalUrl){
  702. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"");
  703. text=text.match(/id="queryholding".*?<\/table>/);
  704. var row;
  705. row=text[0].match(/<tr>.*?<\/tr>/g);
  706. row.shift();
  707. var storeBlock = new Array();
  708. for(s=0;s<row.length;s++){
  709. storeBlock[s] = row[s].match(/"8%">(.*?)<\/td>.*?F">(.*?)<\/td.*?8%">(.*?)<\/td>.*?4%">(.*?)<\/td>.*?8%">(.*?)<\/td>.*?8%">(.*?)<\/td>.*?0%">(.*?)<\/td>/);
  710. storeBlock[s].shift();
  711. }
  712. var storeList = new LibMeta("SCUT");
  713. storeList.state="store";
  714. storeList.items= new Array();
  715.  
  716. for(s=0;s<storeBlock.length;s++){
  717. storeList.items[s]=new StoreItem("SCUT");
  718. storeList.items[s].storeState=storeBlock[s][5].replace(/ /g,"");
  719. storeList.items[s].returnTime=storeBlock[s][6];
  720. storeList.items[s].branch=storeBlock[s][0];
  721. storeList.items[s].location = storeBlock[s][1];
  722. storeList.items[s].bookIndex = storeBlock[s][2];
  723. storeList.items[s].link = finalUrl;
  724. if(storeList.items[s].storeState.indexOf('在馆')!=-1&&storeList.items[s].branch.indexOf('停')==-1){
  725. storeList.items[s].rentable=true;
  726. }
  727. }
  728. messageCatcher(storeList,frameLocation);
  729. return;
  730.  
  731. }
  732.  
  733. }
  734. },
  735.  
  736. //南中国一般大学
  737. SCNU:{
  738. respond:function (reDetails,frameLocation) {
  739. if (reDetails.status !== 200&&reDetails.status !== 304){
  740. var msg = new LibMeta("SCNU");
  741. msg.state="error";
  742. msg.errorMsg="ISBN连接错误";
  743. messageCatcher(msg,frameLocation);
  744. return;
  745. }
  746. if(reDetails.responseText.indexOf('没有')!=-1){
  747. var msg = new LibMeta("SCNU");
  748. msg.state="recommend";
  749. messageCatcher(msg,frameLocation);
  750. return;
  751. }
  752.  
  753. isbnFilter.SCNU.filter(reDetails.responseText,frameLocation);
  754.  
  755. },
  756.  
  757. filter:function(text,frameLocation){
  758. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/ /g,"").replace(/\r/g,"");
  759. rowText = text.match(/book_list_info.*?<img/);
  760. var bookBlock = new Array();
  761. var bookDetail = new Array();
  762. for(s=0;s<rowText.length;s++){
  763. bookBlock[s] = rowText[s].match(/marc_no=(\d+\.?\d*)">(.*?)<\/a>(.*?)<\/h3>.*?span>(.*?)<br>(.*?)<\/span>(.*?)<br\/>(.*?)<br\/>/);
  764. bookBlock[s].shift();
  765. }
  766.  
  767. var list = new LibMeta("SCNU");////构造函数
  768. list.state="booklist";
  769. list.items= new Array();
  770. for(s=0;s<rowText.length;s++){
  771. list.items[s] = new LibItem("SCNU");
  772. list.items[s].link ="http://202.116.41.246:8080/opac/item.php?marc_no="+bookBlock[s][0];
  773. list.items[s].bookName = bookBlock[s][1];
  774. list.items[s].author = bookBlock[s][5];
  775. list.items[s].publisher = bookBlock[s][6];
  776. list.items[s].bookIndex = bookBlock[s][2];
  777. }
  778.  
  779. //进一步获取馆藏
  780. GM_xmlhttpRequest({ //获取列表
  781. method : 'GET',
  782. synchronous : false,
  783. url : list.items[0].link,
  784. onload : function (reDetails) {
  785. if (reDetails.status !== 200&&reDetails.status !== 304){
  786. var msg = new LibMeta("SCNU");
  787. msg.state="error";
  788. msg.errorMsg="无法获取馆藏列表";
  789. messageCatcher(msg,frameLocation);
  790. return;
  791. }
  792. getStoreFilter(reDetails.responseText,frameLocation,list.items[0].link);//回调函数馆藏位置获取
  793. }
  794. });
  795.  
  796.  
  797.  
  798. function getStoreFilter(text,frameLocation,finalUrl){
  799. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/\r/g,"").replace(/ /g,"");
  800. var row;
  801. row=text.match(/whitetext.*?left/g);
  802. var storeBlock = new Array();
  803. for(s=0;s<row.length;s++){
  804. storeBlock[s] = row[s].match(/"10%">(.*?)<\/td>.*?title="(.*?)">.*?20%">(.*?)<\/td>/);
  805. storeBlock[s].shift();
  806. }
  807.  
  808. var storeList = new LibMeta("SCNU");
  809. storeList.state="store";
  810. storeList.items= new Array();
  811.  
  812. for(s=0;s<storeBlock.length;s++){
  813. storeList.items[s]=new StoreItem("SCNU");
  814. storeList.items[s].storeState=storeBlock[s][2].replace(/ /g,"");
  815. storeList.items[s].branch=storeBlock[s][1];
  816. storeList.items[s].bookIndex = storeBlock[s][0];
  817. storeList.items[s].link = finalUrl;
  818. if(storeList.items[s].storeState.indexOf('可借')!=-1){
  819. storeList.items[s].rentable=true;
  820. }
  821. }
  822. messageCatcher(storeList,frameLocation);
  823. return;
  824.  
  825. }
  826.  
  827. }
  828. },
  829.  
  830. //广东工业大学
  831. GDUT:{
  832. respond:function (reDetails,frameLocation) {
  833. if (reDetails.status !== 200&&reDetails.status !== 304){
  834. var msg = new LibMeta("GDUT");
  835. msg.state="error";
  836. msg.errorMsg="ISBN连接错误";
  837. //alert("ISBN连接错误");
  838. messageCatcher(msg,frameLocation);
  839. return;
  840. }
  841. if(reDetails.responseText.indexOf('没有')!=-1){
  842. var msg = new LibMeta("GDUT");
  843. msg.state="recommend";
  844.  
  845. messageCatcher(msg,frameLocation);
  846. return;
  847. }
  848.  
  849. isbnFilter.GDUT.filter(reDetails.responseText,frameLocation);
  850.  
  851. },
  852. filter:function(text,frameLocation){
  853. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/\r/g,"").replace(/ /g,"");
  854. rowText = text.match(/class="tb".*?<\/table>/);
  855. var bookBlock = new Array();
  856.  
  857. bookBlock[0]=rowText[0].match(/(bookinfo.aspx\?ctrlno=\d+\.?\d*)".*?blank">(.*?)<\/a>.*?<td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td>/);
  858.  
  859. bookBlock[0].shift();
  860. var list = new LibMeta("GDUT");////构造函数
  861. list.state="booklist";
  862. list.items= new Array();
  863. for(s=0;s<rowText.length;s++){
  864. list.items[s] = new LibItem("GDUT");
  865. list.items[s].link ="http://222.200.98.171:81/"+bookBlock[s][0];
  866. list.items[s].bookName = bookBlock[s][1];
  867. list.items[s].author = bookBlock[s][2];
  868. list.items[s].publisher = bookBlock[s][3];
  869. list.items[s].pubDate = bookBlock[s][4];
  870. }
  871. //进一步获取馆藏
  872. GM_xmlhttpRequest({ //获取列表
  873. method : 'GET',
  874. synchronous : false,
  875. url : list.items[0].link,
  876. onload : function (reDetails) {
  877. if (reDetails.status !== 200&&reDetails.status !== 304){
  878. var msg = new LibMeta("GDUT");
  879. msg.state="error";
  880. msg.errorMsg="无法获取馆藏列表";
  881. messageCatcher(msg,frameLocation);
  882. return;
  883. }
  884.  
  885. getStoreFilter(reDetails.responseText,frameLocation,list.items[0].link);//回调函数馆藏位置获取
  886. }
  887. });
  888.  
  889. function getStoreFilter(text,frameLocation,finalUrl){
  890. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/\r/g,"").replace(/ /g,"");
  891. var row;
  892. row=text.match(/<tbody>.*?<\/tbody>/);
  893. row[0].replace(/ /g,"");
  894. row = row[0].match(/<tr>.*?<\/tr>/g);
  895.  
  896. var storeBlock = new Array();
  897. for(s=0;s<row.length;s++){
  898.  
  899. storeBlock[s] = row[s].match(/showLibInfo.*?'>(.*?)<\/a><\/td><td>(.*?)<\/td><td>(.*?)<\/td>.*?tbr.*?<td>.*?<td>(.*?)<\/td>/);
  900. storeBlock[s].shift();
  901. }
  902.  
  903. var storeList = new LibMeta("GDUT");
  904. storeList.state="store";
  905. storeList.items= new Array();
  906.  
  907. for(s=0;s<storeBlock.length;s++){
  908. storeList.items[s]=new StoreItem("GDUT");
  909. storeList.items[s].storeState=storeBlock[s][3];
  910. storeList.items[s].branch=storeBlock[s][0];
  911. storeList.items[s].bookIndex = storeBlock[s][1];
  912. storeList.items[s].link = finalUrl;
  913. if(storeList.items[s].storeState.indexOf('可供出借')!=-1){
  914. storeList.items[s].rentable=true;
  915. }
  916. }
  917. messageCatcher(storeList,frameLocation);
  918. return;
  919.  
  920. }
  921.  
  922. }
  923. },
  924.  
  925. //外语外贸大学
  926. GDUFS:{
  927. respond:function (reDetails,frameLocation,fullUrl) {
  928. //var fullUrl = reDetails.finalUrl;
  929. if (reDetails.status !== 200&&reDetails.status !== 304){
  930. var msg = new LibMeta("GDUFS");
  931. msg.state="error";
  932. msg.errorMsg="ISBN连接错误";
  933. //alert("ISBN连接错误");//后续版本再处理
  934. messageCatcher(msg,frameLocation);
  935. return;
  936. }
  937. //document.getElementById("footer").textContent=reDetails.responseText;
  938. if(reDetails.responseText.indexOf('indexpage')!=-1){
  939. //alert("ISBN查无此书"); //增加荐购
  940. var msg = new LibMeta("GDUFS");
  941. msg.state="recommend";
  942. //hasBook = false;
  943. //recommendBook();
  944. messageCatcher(msg,frameLocation);
  945. return;
  946. }
  947.  
  948. if(reDetails.responseText.indexOf('Search Results')!=-1){
  949. titleFilter.GDUFS.filter(reDetails.responseText,fullUrl,frameLocation);
  950. }
  951. else{
  952. isbnFilter.GDUFS.filter(reDetails.responseText,frameLocation);
  953. }
  954. return;
  955. },
  956.  
  957. filter:function(gettxt,frameLocation){
  958.  
  959. /////////////////////////////////////////////////////////
  960.  
  961. str = gettxt;
  962. str = str.replace(/[ | ]*\n/g,''); //去除行尾空白
  963. str = str.replace(/\n[\s| | ]*\r/g,''); //去除多余空行
  964. str = str.replace(/amp;/g,""); //去除URL转码
  965.  
  966. ///获取一整块
  967. var eBook;
  968. eBook = null;
  969. if(str.match(/电子资源定位/)){
  970. eBook = str.match(/电子资源定位.*?jpg.*?File Extension: url">(.*?)<\/a>/)[1];
  971. }
  972. if(!eBook&&str.indexOf("索书")==-1){
  973. var msg = new LibMeta("GDUFS");
  974. msg.state="recommend";
  975. messageCatcher(msg,frameLocation);
  976. return;
  977. }
  978. str = str.match(/全部馆藏(.*?)所有单册/g)
  979. var txt = str[0];
  980. txt = txt.match(/http:.*?sub_library=/);
  981. where=txt;
  982.  
  983. GM_xmlhttpRequest({ //获取列表
  984. method : 'GET',
  985. synchronous : false,
  986. url : where[0],
  987. onload : function (reDetails) {
  988. if (reDetails.status !== 200&&reDetails.status !== 304){
  989. var msg = new LibMeta("GDUFS");
  990. msg.state="error";
  991. msg.errorMsg="无法获取馆藏列表";
  992. //alert("ISBN连接错误");//后续版本再处理
  993. messageCatcher(msg,frameLocation);
  994. return;
  995. }
  996. var libra =document.createElement("div");
  997. libra.innerHTML = reDetails.responseText;
  998. isbnFilter.GDUFS.getBookinfo(libra.innerHTML,eBook,frameLocation,where[0]);//回调函数馆藏位置获取
  999. }
  1000. });
  1001. },
  1002.  
  1003. /////////////////回调函数馆藏位置获取////////////////////////////////////////
  1004. getBookinfo:function(webText,eBook,frameLocation,finalUrl){
  1005. var hasBook = true;
  1006. webText = webText.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"");
  1007.  
  1008. ///防止无书籍的情况发生
  1009. if(webText.indexOf('无匹配单册')!=-1){
  1010. var msg = new LibMeta("GDUFS");
  1011. msg.state="recommend";
  1012. messageCatcher(msg,frameLocation);
  1013. }
  1014. else{
  1015. blockBook = webText.match(/OPAC注释(.*?)<\/tbody>/)[1];
  1016. //alert(typeof blockBook);
  1017. borrowItem = blockBook.match(/<tr>.*?<\/tr>/g);
  1018. //alert(borrowItem[0]);
  1019. var loan = new Array();
  1020.  
  1021. for(k=0;k<borrowItem.length;k++){
  1022. loan[k] = borrowItem[k].match(/<!--Loan.*?td1">(.*?)<\/td>.*?date.*?td1">(.*?)<\/td>.*?hour.*?td1>(.*?)<\/td>.*?Sub.*?nowrap="">(.*?)<\/td>.*?Location.*?td1">(.*?)<\/td>/);
  1023. /////借书类型/时间/到期/位置/索书号
  1024. }
  1025. }
  1026. /////////////////
  1027.  
  1028.  
  1029. if(hasBook){
  1030. //alert("hasBook");
  1031. var storeList = new LibMeta("GDUFS");
  1032. storeList.state="store";
  1033. storeList.items= new Array();
  1034.  
  1035.  
  1036. for(s=0;s<borrowItem.length;s++){
  1037.  
  1038. storeList.items[s]=new StoreItem("GDUFS");
  1039. storeList.items[s].storeState=loan[s][1];
  1040. storeList.items[s].returnTime=loan[s][2].replace(/<br>/,"");
  1041. storeList.items[s].branch=loan[s][4];
  1042. storeList.items[s].bookIndex=loan[s][5];
  1043. storeList.items[s].link=finalUrl;
  1044. if(storeList.items[s].storeState.indexOf('外借')!=-1&&storeList.items[s].returnTime.indexOf('在架上')!=-1&&storeList.items[s].storeState.indexOf('闭架')==-1){//闭架无法预约
  1045. storeList.items[s].rentable=true;
  1046. }
  1047. }
  1048. if(eBook){
  1049.  
  1050. var itemsLength=storeList.items.length;
  1051. storeList.items[itemsLength]=new StoreItem("GDUFS");
  1052. storeList.items[itemsLength].link=eBook;
  1053. storeList.items[itemsLength].type="eBook";
  1054. storeList.items[itemsLength].storeState="电子书";
  1055. };
  1056. }
  1057. messageCatcher(storeList,frameLocation);
  1058.  
  1059. //////////////////////完成框架插入//////////////
  1060. }
  1061. },
  1062.  
  1063. //广州中医药大学
  1064. GZHTCM:{
  1065. respond:function (reDetails,frameLocation) {
  1066. if (reDetails.status !== 200&&reDetails.status !== 304){
  1067. var msg = new LibMeta("GZHTCM");
  1068. msg.state="error";
  1069. msg.errorMsg="ISBN连接错误";
  1070. messageCatcher(msg,frameLocation);
  1071. return;
  1072. }
  1073. if(reDetails.responseText.indexOf('没有')!=-1){
  1074. var msg = new LibMeta("GZHTCM");
  1075. msg.state="recommend";
  1076.  
  1077. messageCatcher(msg,frameLocation);
  1078. return;
  1079. }
  1080. isbnFilter.GZHTCM.filter(reDetails.responseText,frameLocation);
  1081.  
  1082. },
  1083.  
  1084. filter:function(text,frameLocation){
  1085. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/ /g,"").replace(/\r/g,"");
  1086. rowText = text.match(/book_list_info.*?<img/);
  1087. //document.getElementById("reviews").textContent=rowText;
  1088.  
  1089. var bookBlock = new Array();
  1090. var bookDetail = new Array();
  1091. for(s=0;s<rowText.length;s++){
  1092. bookBlock[s] = rowText[s].match(/marc_no=(\d+\.?\d*)">(.*?)<\/a>(.*?)<\/h3>.*?span>(.*?)<br>(.*?)<\/span>(.*?)<br\/>(.*?)<br\/>/);
  1093. bookBlock[s].shift();
  1094. }
  1095.  
  1096. var list = new LibMeta("GZHTCM");////构造函数
  1097. list.state="booklist";
  1098. list.items= new Array();
  1099. for(s=0;s<rowText.length;s++){
  1100. list.items[s] = new LibItem("GZHTCM");
  1101. list.items[s].link ="http://210.38.102.131:86/opac/item.php?marc_no="+bookBlock[s][0];
  1102. list.items[s].bookName = bookBlock[s][1];
  1103. list.items[s].author = bookBlock[s][5];
  1104. list.items[s].publisher = bookBlock[s][6];
  1105. list.items[s].bookIndex = bookBlock[s][2];
  1106. }
  1107.  
  1108. //进一步获取馆藏
  1109. GM_xmlhttpRequest({ //获取列表
  1110. method : 'GET',
  1111. synchronous : false,
  1112. url : list.items[0].link,
  1113. onload : function (reDetails) {
  1114. if (reDetails.status !== 200&&reDetails.status !== 304){
  1115. var msg = new LibMeta("GZHTCM");
  1116. msg.state="error";
  1117. msg.errorMsg="无法获取馆藏列表";
  1118. //alert("ISBN连接错误");//后续版本再处理
  1119. messageCatcher(msg,frameLocation);
  1120. return;
  1121. }
  1122. getStoreFilter(reDetails.responseText,frameLocation,list.items[0].link);//回调函数馆藏位置获取
  1123. }
  1124. });
  1125.  
  1126.  
  1127.  
  1128. function getStoreFilter(text,frameLocation,finalUrl){
  1129. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/\r/g,"").replace(/ /g,"");
  1130. var row;
  1131. row=text.match(/whitetext.*?left/g);
  1132. var storeBlock = new Array();
  1133. for(s=0;s<row.length;s++){
  1134. storeBlock[s] = row[s].match(/"10%">(.*?)<\/td>.*?gif"\/>(.*?)<\/td>.*?20%">(.*?)<\/td>/);
  1135. storeBlock[s].shift();
  1136. }
  1137.  
  1138. var storeList = new LibMeta("GZHTCM");
  1139. storeList.state="store";
  1140. storeList.items= new Array();
  1141.  
  1142. for(s=0;s<storeBlock.length;s++){
  1143. storeList.items[s]=new StoreItem("GZHTCM");
  1144. storeList.items[s].storeState=storeBlock[s][2].replace(/ /g,"");
  1145. storeList.items[s].branch=storeBlock[s][1];
  1146. storeList.items[s].bookIndex = storeBlock[s][0];
  1147. storeList.items[s].link = finalUrl;
  1148. if(storeList.items[s].storeState.indexOf('可借')!=-1){
  1149. storeList.items[s].rentable=true;
  1150. }
  1151. }
  1152. messageCatcher(storeList,frameLocation);
  1153. return;
  1154.  
  1155. }
  1156.  
  1157. }
  1158.  
  1159. },
  1160.  
  1161. //广州大学
  1162. GZHU:{
  1163. respond:function (reDetails,frameLocation) {
  1164. if (reDetails.status !== 200&&reDetails.status !== 304){
  1165. var msg = new LibMeta("GZHU");
  1166. msg.state="error";
  1167. msg.errorMsg="ISBN连接错误";
  1168. //alert("ISBN连接错误");//后续版本再处理
  1169. messageCatcher(msg,frameLocation);
  1170. return;
  1171. }
  1172. if(reDetails.responseText.indexOf('找不到')!=-1){
  1173. //alert("ISBN查无此书"); //增加荐购
  1174. var msg = new LibMeta("GZHU");
  1175. msg.state="recommend";
  1176.  
  1177. messageCatcher(msg,frameLocation);
  1178. return;
  1179. }
  1180.  
  1181. isbnFilter.GZHU.filter(reDetails.responseText,frameLocation);
  1182.  
  1183. },
  1184. filter:function(text,frameLocation){
  1185. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/ /g,"").replace(/\r/g,"");
  1186. rowText = text.match(/book_info>.*?<\/div>/g);
  1187.  
  1188. var bookBlock = new Array();
  1189. var bookDetail = new Array();
  1190. for(s=0;s<rowText.length;s++){
  1191. bookBlock[s] = rowText[s].match(/href="(.*?)"target="_blank">(.*?)<\/a><span>(.*?)<\/span>.*?<h4>(.*?)&nbsp;/);
  1192. bookBlock[s].shift();
  1193. }
  1194.  
  1195. var list = new LibMeta("GZHU");////构造函数
  1196. list.state="booklist";
  1197. list.items= new Array();
  1198. for(s=0;s<rowText.length;s++){
  1199. list.items[s] = new LibItem("GZHU");
  1200. list.items[s].link ="http://lib.gzhu.edu.cn:8080"+bookBlock[s][0];
  1201. list.items[s].bookName = bookBlock[s][1];
  1202. list.items[s].author = bookBlock[s][2];
  1203. list.items[s].publisher = bookBlock[s][3];
  1204. }
  1205.  
  1206.  
  1207. //进一步获取馆藏
  1208. GM_xmlhttpRequest({ //获取列表
  1209. method : 'GET',
  1210. synchronous : false,
  1211. url : list.items[0].link,
  1212. onload : function (reDetails) {
  1213. if (reDetails.status !== 200&&reDetails.status !== 304){
  1214. var msg = new LibMeta("GZHU");
  1215. msg.state="error";
  1216. msg.errorMsg="无法获取馆藏列表";
  1217. //alert("ISBN连接错误");//后续版本再处理
  1218. messageCatcher(msg,frameLocation);
  1219. return;
  1220. }
  1221.  
  1222. getStoreFilter(reDetails.responseText,frameLocation,list.items[0].link);//回调函数馆藏位置获取
  1223. }
  1224. });
  1225.  
  1226. function getStoreFilter(text,frameLocation,finalUrl){
  1227. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/\r/g,"").replace(/ /g,"");
  1228. var row;
  1229. var bookIndex = text.match(/索书号.*?<td>(.*?)<\/td>/)[1];
  1230. text=text.match(/holdings_info_content.*?clear/);
  1231.  
  1232. row = text[0].match(/<td>.*?<\/tr>/g);
  1233.  
  1234.  
  1235. var storeBlock= new Array();
  1236. for(s=0;s<row.length;s++){
  1237.  
  1238. storeBlock[s] = row[s].match(/<td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<a.*?<\/tr>/);
  1239. storeBlock[s].shift();
  1240. }
  1241.  
  1242. var storeList = new LibMeta("GZHU");
  1243. storeList.state="store";
  1244. storeList.items= new Array();
  1245.  
  1246. for(s=0;s<storeBlock.length;s++){
  1247. storeList.items[s]=new StoreItem("GZHU");
  1248. storeList.items[s].storeState=storeBlock[s][1];
  1249. storeList.items[s].returnTime=storeBlock[s][3];
  1250. storeList.items[s].branch=storeBlock[s][4];
  1251. storeList.items[s].link=finalUrl;
  1252. storeList.items[s].bookIndex=bookIndex;
  1253. if(storeList.items[s].storeState.indexOf('在馆')!=-1){
  1254. storeList.items[s].rentable=true;
  1255. }
  1256. }
  1257. messageCatcher(storeList,frameLocation);
  1258. return;
  1259.  
  1260. }
  1261.  
  1262.  
  1263.  
  1264. }
  1265. },
  1266.  
  1267. //广州美术学院
  1268. GZARTS:{
  1269. respond:function (reDetails,frameLocation) {
  1270. if (reDetails.status !== 200&&reDetails.status !== 304){
  1271. var msg = new LibMeta("GZARTS");
  1272. msg.state="error";
  1273. msg.errorMsg="ISBN连接错误";
  1274. //alert("ISBN连接错误");
  1275. messageCatcher(msg,frameLocation);
  1276. return;
  1277. }
  1278. if(reDetails.responseText.indexOf('没有')!=-1){
  1279. //alert("ISBN查无此书"); //增加荐购
  1280. var msg = new LibMeta("GZARTS");
  1281. msg.state="recommend";
  1282.  
  1283. messageCatcher(msg,frameLocation);
  1284. return;
  1285. }
  1286.  
  1287.  
  1288. isbnFilter.GZARTS.filter(reDetails.responseText,frameLocation);
  1289.  
  1290. },
  1291. filter:function(text,frameLocation){
  1292. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/\r/g,"").replace(/ /g,"");
  1293. rowText = text.match(/class="tb".*?<\/table>/);
  1294.  
  1295. var bookBlock = new Array();
  1296.  
  1297. bookBlock[0]=rowText[0].match(/(bookinfo.aspx\?ctrlno=\d+\.?\d*)".*?blank">(.*?)<\/a>.*?<td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td>/);
  1298. //alert(bookBlock[0].length);
  1299.  
  1300. bookBlock[0].shift();
  1301. var list = new LibMeta("GZARTS");////构造函数
  1302. list.state="booklist";
  1303. list.items= new Array();
  1304. for(s=0;s<rowText.length;s++){
  1305. list.items[s] = new LibItem("GZARTS");
  1306. list.items[s].link ="http://121.33.246.167/opac/"+bookBlock[s][0];
  1307. list.items[s].bookName = bookBlock[s][1];
  1308. list.items[s].author = bookBlock[s][2];
  1309. list.items[s].publisher = bookBlock[s][3];
  1310. list.items[s].pubDate = bookBlock[s][4];
  1311. }
  1312.  
  1313. //进一步获取馆藏
  1314. GM_xmlhttpRequest({ //获取列表
  1315. method : 'GET',
  1316. synchronous : false,
  1317. url : list.items[0].link,
  1318.  
  1319. onload : function (reDetails) {
  1320. if (reDetails.status !== 200&&reDetails.status !== 304){
  1321. var msg = new LibMeta("GZARTS");
  1322. msg.state="error";
  1323. msg.errorMsg="无法获取馆藏列表";
  1324. //alert("ISBN连接错误");//后续版本再处理
  1325. messageCatcher(msg,frameLocation);
  1326. return;
  1327. }
  1328.  
  1329. getStoreFilter(reDetails.responseText,frameLocation,list.items[0].link);//回调函数馆藏位置获取
  1330. }
  1331. });
  1332.  
  1333. function getStoreFilter(text,frameLocation,finalUrl){
  1334. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/\r/g,"").replace(/ /g,"");
  1335.  
  1336. var row;
  1337. row=text.match(/<tbody>.*?<\/tbody>/);
  1338. row[0].replace(/ /g,"");
  1339.  
  1340. row = row[0].match(/<tr>.*?<\/tr>/g);
  1341.  
  1342. var storeBlock = new Array();
  1343. for(s=0;s<row.length;s++){
  1344.  
  1345. storeBlock[s] = row[s].match(/showLibInfo.*?'>(.*?)<\/a><\/td><td>(.*?)<\/td><td>(.*?)<\/td>.*?tbr.*?<td>.*?<td>(.*?)<\/td>/);
  1346.  
  1347. storeBlock[s].shift();
  1348. }
  1349. var storeList = new LibMeta("GZARTS");
  1350. storeList.state="store";
  1351. storeList.items= new Array();
  1352.  
  1353. for(s=0;s<storeBlock.length;s++){
  1354. storeList.items[s]=new StoreItem("GZARTS");
  1355. storeList.items[s].storeState=storeBlock[s][3];
  1356. //storeList.items[s].returnTime=storeBlock[s][2];
  1357. storeList.items[s].branch=storeBlock[s][0];
  1358. //storeList.items[s].location = storeBlock[s][1];
  1359. storeList.items[s].bookIndex = storeBlock[s][1];
  1360. storeList.items[s].link=finalUrl;
  1361. if(storeList.items[s].storeState.indexOf('可供出借')!=-1){
  1362. storeList.items[s].rentable=true;
  1363. }
  1364. }
  1365. messageCatcher(storeList,frameLocation);
  1366. return;
  1367. }
  1368.  
  1369. }
  1370. },
  1371.  
  1372.  
  1373. //星海音乐学院
  1374. XHCOM:{
  1375. respond:function (reDetails,frameLocation) {
  1376. if (reDetails.status !== 200&&reDetails.status !== 304){
  1377. var msg = new LibMeta("XHCOM");
  1378. msg.state="error";
  1379. msg.errorMsg="ISBN连接错误";
  1380. //alert("ISBN连接错误");
  1381. messageCatcher(msg,frameLocation);
  1382. return;
  1383. }
  1384. if(reDetails.responseText.indexOf('没有')!=-1){
  1385.  
  1386. var msg = new LibMeta("XHCOM");
  1387. msg.state="recommend";
  1388.  
  1389. messageCatcher(msg,frameLocation);
  1390. return;
  1391. }
  1392.  
  1393. isbnFilter.XHCOM.filter(reDetails.responseText,frameLocation);
  1394.  
  1395. },
  1396. filter:function(text,frameLocation){
  1397. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/\r/g,"").replace(/ /g,"");
  1398. rowText = text.match(/class="tb".*?<\/table>/);
  1399.  
  1400. var bookBlock = new Array();
  1401. bookBlock[0]=rowText[0].match(/(bookinfo.aspx\?ctrlno=\d+\.?\d*)".*?blank">(.*?)<\/a>.*?<td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td>/);
  1402. //alert(bookBlock[0].length);
  1403.  
  1404. bookBlock[0].shift();
  1405. var list = new LibMeta("XHCOM");////构造函数
  1406. list.state="booklist";
  1407. list.items= new Array();
  1408. for(s=0;s<rowText.length;s++){
  1409. list.items[s] = new LibItem("XHCOM");
  1410. list.items[s].link ="http://218.192.148.33:81/"+bookBlock[s][0];
  1411. list.items[s].bookName = bookBlock[s][1];
  1412. list.items[s].author = bookBlock[s][2];
  1413. list.items[s].publisher = bookBlock[s][3];
  1414. list.items[s].pubDate = bookBlock[s][4];
  1415. }
  1416.  
  1417.  
  1418.  
  1419. //进一步获取馆藏
  1420. GM_xmlhttpRequest({ //获取列表
  1421. method : 'GET',
  1422. synchronous : false,
  1423. url : list.items[0].link,
  1424.  
  1425. onload : function (reDetails) {
  1426. if (reDetails.status !== 200&&reDetails.status !== 304){
  1427. var msg = new LibMeta("XHCOM");
  1428. msg.state="error";
  1429. msg.errorMsg="无法获取馆藏列表";
  1430. //alert("ISBN连接错误");//后续版本再处理
  1431. messageCatcher(msg,frameLocation);
  1432. return;
  1433. }
  1434. getStoreFilter(reDetails.responseText,frameLocation,list.items[0].link);//回调函数馆藏位置获取
  1435. }
  1436. });
  1437.  
  1438. function getStoreFilter(text,frameLocation,finalUrl){
  1439. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/\r/g,"").replace(/ /g,"");
  1440.  
  1441. var row;
  1442. row=text.match(/<tbody>.*?<\/tbody>/);
  1443. row[0].replace(/ /g,"");
  1444. //alert(row[0]);
  1445. row = row[0].match(/<tr>.*?<\/tr>/g);
  1446.  
  1447. var storeBlock = new Array();
  1448. for(s=0;s<row.length;s++){
  1449.  
  1450. storeBlock[s] = row[s].match(/showLibInfo.*?'>(.*?)<\/a><\/td><td>(.*?)<\/td><td>(.*?)<\/td>.*?tbr.*?<td>.*?<td>(.*?)<\/td>/);
  1451. storeBlock[s].shift();
  1452. }
  1453. var storeList = new LibMeta("XHCOM");
  1454. storeList.state="store";
  1455. storeList.items= new Array();
  1456.  
  1457. for(s=0;s<storeBlock.length;s++){
  1458. storeList.items[s]=new StoreItem("XHCOM");
  1459. storeList.items[s].storeState=storeBlock[s][3];
  1460. //storeList.items[s].returnTime=storeBlock[s][2];
  1461. storeList.items[s].branch=storeBlock[s][0];
  1462. //storeList.items[s].location = storeBlock[s][1];
  1463. storeList.items[s].bookIndex = storeBlock[s][1];
  1464. storeList.items[s].link=finalUrl;
  1465. if(storeList.items[s].storeState.indexOf('可供出借')!=-1){
  1466. storeList.items[s].rentable=true;
  1467. }
  1468. }
  1469. messageCatcher(storeList,frameLocation);
  1470. return;
  1471. }
  1472.  
  1473. }
  1474. },
  1475.  
  1476. //广东药学院,由于编码问题和没提供ISBN检索,暂不支持//
  1477.  
  1478. }
  1479.  
  1480. //函数:提取title搜索元信息
  1481. var titleFilter={
  1482. //中山大学
  1483. SYSU:{
  1484.  
  1485. respond:function(reDetails,frameLocation,fullUrl) {
  1486. if (reDetails.status !== 200&&reDetails.status !== 304){
  1487. var msg = new LibMeta("SYSU");
  1488.  
  1489. msg.state = "error";
  1490. msg.errorMsg = "搜索连接错误";
  1491. messageCatcher(msg,frameLocation);
  1492.  
  1493. return;
  1494. }
  1495. if(reDetails.responseText.indexOf('Search Results')!=-1){
  1496.  
  1497. titleFilter.SYSU.filter(reDetails.responseText,fullUrl,frameLocation);
  1498. return;
  1499. }
  1500. else if(reDetails.responseText.indexOf('记录数')!=-1||reDetails.responseText.indexOf('轮排')!=-1){
  1501. var msg = new LibMeta("SYSU");
  1502. msg.state = "error";
  1503. msg.errorMsg = "搜索页面跳转到了款目/轮排列表页面,<br>此页面无法获取图书详细信息。";
  1504.  
  1505. messageCatcher(msg,frameLocation);
  1506. return;
  1507. }
  1508. else{
  1509. isbnFilter.SYSU.filter(reDetails.responseText,frameLocation);
  1510. return;
  1511.  
  1512. //
  1513. }
  1514. },
  1515.  
  1516. filter:function (txt,urltext,frameLocation){
  1517.  
  1518. str = txt;
  1519. str = str.replace(/[ | ]*\n/g,''); //去除行尾空白
  1520. str = str.replace(/\n[\s| | ]*\r/g,''); //去除多余空行
  1521. str = str.replace(/amp;/g,""); //去除URL转码
  1522. atxt= str.match(/col2>.*?<\/table>/g);
  1523.  
  1524. ///////获取图书馆书本元信息//////
  1525. var bookDetail = new Array();//元信息数组
  1526. atxt.shift();//去除整块信息中的多余信息
  1527.  
  1528. for(s=0;s<atxt.length;s++){
  1529.  
  1530. bookDetail[s] = atxt[s].match(/a href=(.*?)>(.*?)<\/a>.*?top>(.*?)<td.*?top>(.*?)<tr>.*?top>(.*?)<td.*?top>(.*?)<tr>/).slice(1);
  1531. // 超链接/ 书名 /作者 / 索引号/出版社 /年份 /
  1532. }
  1533.  
  1534. ////////框架//////////////////////////////////
  1535.  
  1536. //判断URL类型
  1537. if(urltext.indexOf('ISB')!=-1){
  1538. var allBook = '<div class="gray_ad" id="sysulib"><h2>中大ISBN检索</h2>' +
  1539. '<a href="'+ urltext +'" target="_blank">前往图书馆查看这本书</a>';
  1540. }
  1541. else{
  1542. var allBook = '<div class="gray_ad" id="sysulib"><h2>中大图书馆检索</h2>' +
  1543. '<a href="'+ urltext +'" target="_blank">前往图书馆查看这本书</a>';
  1544. }
  1545.  
  1546. var display;
  1547. var list = new LibMeta("SYSU");////构造函数
  1548. list.state="booklist";
  1549. list.items= new Array();
  1550. for(s=0;s<bookDetail.length;s++){
  1551. if(s>4){
  1552. display=" ;display : none";
  1553. }
  1554. else{
  1555. display="";
  1556. }
  1557.  
  1558. list.items[s] = new LibItem("SYSU");
  1559. list.items[s].link = bookDetail[s][0];
  1560. list.items[s].bookName = bookDetail[s][1];
  1561. list.items[s].author = bookDetail[s][2];
  1562. list.items[s].publisher = bookDetail[s][4];
  1563. list.items[s].pubDate = bookDetail[s][5];
  1564.  
  1565. }
  1566.  
  1567. messageCatcher(list,frameLocation);
  1568. //判断URL
  1569. ///////////////判断URL
  1570.  
  1571. //}
  1572. ////////////插入框架结束//////////////
  1573. }
  1574.  
  1575. },
  1576. //华南理工大学
  1577. SCUT:{
  1578. respond:function (reDetails,frameLocation) {
  1579. if (reDetails.status !== 200&&reDetails.status !== 304){
  1580. var msg = new LibMeta("SCUT");
  1581. msg.state="error";
  1582. msg.errorMsg="全字段连接错误";
  1583. messageCatcher(msg,frameLocation);
  1584. return;
  1585. }
  1586. if(reDetails.responseText.indexOf('无符合')!=-1){
  1587.  
  1588. var msg = new LibMeta("SCUT");
  1589. msg.state="error";
  1590. msg.errorMsg="全字段查无此书";
  1591.  
  1592. messageCatcher(msg,frameLocation);
  1593. return;
  1594. }
  1595.  
  1596. titleFilter.SCUT.filter(reDetails.responseText,frameLocation);
  1597.  
  1598. },
  1599. filter:function(text,frameLocation){
  1600.  
  1601. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"");
  1602. rowText = text.match(/javascript:book_detail.*?<\/tr>/g);
  1603. var bookBlock = new Array();
  1604. var bookDetail = new Array();
  1605. for(s=0;s<rowText.length;s++){
  1606. bookBlock[s] = rowText[s].match(/\((\d+\.?\d*)\)">(.*?)<\/a>.*?F">(.*?)<\/TD>.*?F">(.*?)<\/TD>.*?F">(.*?)<\/TD>.*?F">(.*?)<\/TD>.*?F">(.*?)<\/TD>.*?F">(.*?)<\/TD>/);
  1607.  
  1608. bookBlock[s].shift();
  1609.  
  1610. }
  1611.  
  1612. var list = new LibMeta("SCUT");////构造函数
  1613. list.state="booklist";
  1614. list.items= new Array();
  1615. for(s=0;s<rowText.length;s++){
  1616. list.items[s] = new LibItem("SCUT");
  1617. list.items[s].link ="http://202.38.232.10/opac/servlet/opac.go?SORTFIELD=CALLNO&SORTORDER=asc&bookid="+bookBlock[s][0]+"&cmdACT=query.bookdetail&libcode=";
  1618. list.items[s].bookName = bookBlock[s][1];
  1619. list.items[s].author = bookBlock[s][2];
  1620. list.items[s].publisher = bookBlock[s][3];
  1621. list.items[s].bookIndex = bookBlock[s][6];
  1622. list.items[s].pubDate = bookBlock[s][5];
  1623. }
  1624.  
  1625. messageCatcher(list,frameLocation);
  1626. return;
  1627.  
  1628. }
  1629. },
  1630.  
  1631. //南中国一般大学
  1632. SCNU:{
  1633. respond: function (reDetails, frameLocation) {
  1634. if (reDetails.status !== 200 && reDetails.status !== 304) {
  1635. var msg = new LibMeta('SCNU');
  1636. msg.state = 'error';
  1637. msg.errorMsg = '全字段检索连接错误';
  1638. messageCatcher(msg, frameLocation);
  1639. return;
  1640. }
  1641.  
  1642. if (reDetails.responseText.indexOf('没有') != - 1) {
  1643. //alert("ISBN查无此书"); //增加荐购
  1644. var msg = new LibMeta('SCNU');
  1645. msg.state = 'error';
  1646. msg.errorMsg = '全字段查无此书';
  1647. messageCatcher(msg, frameLocation);
  1648. return;
  1649. }
  1650.  
  1651.  
  1652. titleFilter.SCNU.filter(reDetails.responseText, frameLocation);
  1653. },
  1654. filter: function (text, frameLocation) {
  1655. text = text.replace(/[ | ]*\n/g, '').replace(/\n[\s| | ]*\r/g, '').replace(/amp;/g, '').replace(/ /g, '').replace(/\r/g, '');
  1656. rowText = text.match(/book_list_info.*?<img/g);
  1657. var bookBlock = new Array();
  1658. var bookDetail = new Array();
  1659. for (s = 0; s < rowText.length; s++) {
  1660. bookBlock[s] = rowText[s].match(/marc_no=(\d+\.?\d*)">(.*?)<\/a>(.*?)<\/h3>.*?span>(.*?)<br>(.*?)<\/span>(.*?)<br\/>(.*?)<br\/>/);
  1661. bookBlock[s].shift();
  1662. }
  1663. var list = new LibMeta('SCNU'); ////构造函数
  1664. list.state = 'booklist';
  1665. list.items = new Array();
  1666. for (s = 0; s < rowText.length; s++) {
  1667. list.items[s] = new LibItem('SCNU');
  1668. list.items[s].link = 'http://202.116.41.246:8080/opac/item.php?marc_no=' + bookBlock[s][0];
  1669. list.items[s].bookName = bookBlock[s][1];
  1670. list.items[s].author = bookBlock[s][5];
  1671. list.items[s].publisher = bookBlock[s][6];
  1672. list.items[s].bookIndex = bookBlock[s][2];
  1673.  
  1674. }
  1675. messageCatcher(list,frameLocation);
  1676. return;
  1677.  
  1678. }
  1679.  
  1680. },
  1681.  
  1682. //广东工业大学
  1683. GDUT:{
  1684. respond:function (reDetails,frameLocation) {
  1685. if (reDetails.status !== 200&&reDetails.status !== 304){
  1686. var msg = new LibMeta("GDUT");
  1687. msg.state="error";
  1688. msg.errorMsg="全字段连接错误";
  1689. messageCatcher(msg,frameLocation);
  1690. return;
  1691. }
  1692.  
  1693. if(reDetails.responseText.indexOf('没有')!=-1){
  1694. //alert("ISBN查无此书"); //增加荐购
  1695. var msg = new LibMeta("GDUT");
  1696. msg.state="error";
  1697. msg.errorMsg="全字段查无此书";
  1698. messageCatcher(msg,frameLocation);
  1699. return;
  1700. }
  1701.  
  1702. //document.getElementById("reviews").textContent=reDetails.responseText;
  1703. titleFilter.GDUT.filter(reDetails.responseText,frameLocation);
  1704.  
  1705. },
  1706. filter:function(text,frameLocation){
  1707. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/\r/g,"").replace(/ /g,"");
  1708. rowText = text.match(/(bookinfo.aspx\?ctrlno=\d+\.?\d*)".*?blank">(.*?)<\/a>.*?<td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td>/g);
  1709. var bookBlock = new Array();
  1710.  
  1711. for(s=0;s<rowText.length;s++){
  1712. bookBlock[s]=rowText[s].match(/(bookinfo.aspx\?ctrlno=\d+\.?\d*)".*?blank">(.*?)<\/a>.*?<td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td>/);
  1713. bookBlock[s].shift();
  1714. }
  1715.  
  1716.  
  1717. bookBlock[0].shift();
  1718. var list = new LibMeta("GDUT");////构造函数
  1719. list.state="booklist";
  1720. list.items= new Array();
  1721. for(s=0;s<bookBlock.length;s++){
  1722. list.items[s] = new LibItem("GDUT");
  1723. list.items[s].link ="http://222.200.98.171:81/"+bookBlock[s][0];
  1724. list.items[s].bookName = bookBlock[s][1];
  1725. list.items[s].author = bookBlock[s][2];
  1726. list.items[s].publisher = bookBlock[s][3];
  1727. list.items[s].pubDate = bookBlock[s][4];
  1728. }
  1729. messageCatcher(list,frameLocation);
  1730.  
  1731. }
  1732. },
  1733.  
  1734. //外语外贸大学
  1735. GDUFS:{
  1736. respond:function(reDetails,frameLocation,fullUrl) {
  1737. if (reDetails.status !== 200&&reDetails.status !== 304){
  1738. var msg = new LibMeta("GDUFS");
  1739.  
  1740. msg.state = "error";
  1741. msg.errorMsg = "搜索连接错误";
  1742. messageCatcher(msg,frameLocation);
  1743. return;
  1744. }
  1745.  
  1746.  
  1747. if(reDetails.responseText.indexOf('Search Results')!=-1){
  1748. titleFilter.GDUFS.filter(reDetails.responseText,fullUrl,frameLocation);
  1749. return;
  1750. }
  1751. else if(reDetails.responseText.indexOf('记录数')!=-1||reDetails.responseText.indexOf('轮排')!=-1){
  1752. var msg = new LibMeta("GDUFS");
  1753. msg.state = "error";
  1754. msg.errorMsg = "搜索页面跳转到了款目/轮排列表页面,<br>此页面无法获取图书详细信息。";
  1755.  
  1756. messageCatcher(msg,frameLocation);
  1757. return;
  1758. }
  1759. else{
  1760. isbnFilter.GDUFS.filter(reDetails.responseText,frameLocation);
  1761. return;
  1762.  
  1763. //
  1764. }
  1765. },
  1766.  
  1767. filter:function (txt,urltext,frameLocation){
  1768.  
  1769. str = txt;
  1770. str = str.replace(/[ | ]*\n/g,''); //去除行尾空白
  1771. str = str.replace(/\n[\s| | ]*\r/g,''); //去除多余空行
  1772. str = str.replace(/amp;/g,""); //去除URL转码
  1773.  
  1774. atxt= str.match(/col2>.*?<\/table>/g);
  1775.  
  1776. ///////获取图书馆书本元信息//////
  1777. var bookDetail = new Array();//元信息数组
  1778. atxt.shift();//去除整块信息中的多余信息
  1779.  
  1780. for(s=0;s<atxt.length;s++){
  1781.  
  1782. bookDetail[s] = atxt[s].match(/a href=(.*?)>(.*?)<\/a>.*?top>(.*?)<td.*?top>(.*?)<tr>.*?top>(.*?)<td.*?top>(.*?)<tr>/).slice(1);
  1783. // 超链接/ 书名 /作者 / 索引号/出版社 /年份 /
  1784. }
  1785.  
  1786. ////////框架//////////////////////////////////
  1787.  
  1788.  
  1789. var display;
  1790. var list = new LibMeta("GDUFS");////构造函数
  1791. list.state="booklist";
  1792. list.items= new Array();
  1793. for(s=0;s<bookDetail.length;s++){
  1794. if(s>4){
  1795. display=" ;display : none";
  1796. }
  1797. else{
  1798. display="";
  1799. }
  1800. list.items[s] = new LibItem("GDUFS");
  1801. list.items[s].link = bookDetail[s][0];
  1802. list.items[s].bookName = bookDetail[s][1];
  1803. list.items[s].author = bookDetail[s][2].replace(/<br>/,"").replace(/<br\/>/,"");
  1804. list.items[s].publisher = bookDetail[s][4];
  1805. list.items[s].pubDate = bookDetail[s][5];
  1806.  
  1807. }
  1808.  
  1809. messageCatcher(list,frameLocation);
  1810. //判断URL
  1811. ///////////////判断URL
  1812.  
  1813. //}
  1814. ////////////插入框架结束//////////////
  1815. }
  1816.  
  1817. },
  1818.  
  1819. //广州中医药大学
  1820. GZHTCM:{
  1821. respond:function (reDetails,frameLocation) {
  1822. if (reDetails.status !== 200&&reDetails.status !== 304){
  1823. var msg = new LibMeta("GZHTCM");
  1824. msg.state="error";
  1825. msg.errorMsg="全字段连接错误";
  1826. messageCatcher(msg,frameLocation);
  1827. return;
  1828. }
  1829. if(reDetails.responseText.indexOf('没有')!=-1){
  1830. //alert("ISBN查无此书"); //增加荐购
  1831. var msg = new LibMeta("GZHTCM");
  1832. msg.state="error";
  1833. msg.errorMsg="全字段查无此书";
  1834. messageCatcher(msg,frameLocation);
  1835. return;
  1836. }
  1837.  
  1838. titleFilter.GZHTCM.filter(reDetails.responseText,frameLocation);
  1839.  
  1840. },
  1841.  
  1842. filter:function(text,frameLocation){
  1843.  
  1844. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/ /g,"").replace(/\r/g,"");
  1845. rowText = text.match(/book_list_info.*?<img/g);
  1846. var bookBlock = new Array();
  1847. var bookDetail = new Array();
  1848. for(s=0;s<rowText.length;s++){
  1849. bookBlock[s] = rowText[s].match(/marc_no=(\d+\.?\d*)">(.*?)<\/a>(.*?)<\/h3>.*?span>(.*?)<br>(.*?)<\/span>(.*?)<br\/>(.*?)<br\/>/);
  1850. bookBlock[s].shift();
  1851. }
  1852.  
  1853.  
  1854.  
  1855. var list = new LibMeta("GZHTCM");////构造函数
  1856. list.state="booklist";
  1857. list.items= new Array();
  1858. for(s=0;s<rowText.length;s++){
  1859. list.items[s] = new LibItem("GZHTCM");
  1860. list.items[s].link ="http://210.38.102.131:86/opac/item.php?marc_no="+bookBlock[s][0];
  1861. list.items[s].bookName = bookBlock[s][1];
  1862. list.items[s].author = bookBlock[s][5];
  1863. list.items[s].publisher = bookBlock[s][6];
  1864. list.items[s].bookIndex = bookBlock[s][2];
  1865. }
  1866. messageCatcher(list,frameLocation);
  1867.  
  1868. }
  1869. },
  1870.  
  1871. //广州大学
  1872. GZHU:{
  1873. respond: function (reDetails, frameLocation) {
  1874. if (reDetails.status !== 200 && reDetails.status !== 304) {
  1875. var msg = new LibMeta('GZHU');
  1876. msg.state = 'error';
  1877. msg.errorMsg = '全字段连接错误';
  1878. messageCatcher(msg, frameLocation);
  1879. return;
  1880. }
  1881.  
  1882. if (reDetails.responseText.indexOf('找不到') != - 1) {
  1883. var msg = new LibMeta('GZHU');
  1884. msg.state = 'error';
  1885. msg.errorMsg = '全字段查无此书';
  1886.  
  1887. messageCatcher(msg, frameLocation);
  1888. return;
  1889. }
  1890.  
  1891.  
  1892. titleFilter.GZHU.filter(reDetails.responseText, frameLocation);
  1893. },
  1894. filter: function (text, frameLocation) {
  1895. text = text.replace(/[ | ]*\n/g, '').replace(/\n[\s| | ]*\r/g, '').replace(/amp;/g, '').replace(/ /g, '').replace(/\r/g, '');
  1896. rowText = text.match(/book_info>.*?<\/div>/g);
  1897. var bookBlock = new Array();
  1898. var bookDetail = new Array();
  1899. for (s = 0; s < rowText.length; s++) {
  1900. bookBlock[s] = rowText[s].match(/href="(.*?)"target="_blank">(.*?)<\/a><span>(.*?)<\/span>.*?<h4>(.*?)&nbsp;/);
  1901. bookBlock[s].shift();
  1902. }
  1903. var list = new LibMeta('GZHU'); ////构造函数
  1904. list.state = 'booklist';
  1905. list.items = new Array();
  1906. for (s = 0; s < rowText.length; s++) {
  1907. list.items[s] = new LibItem('GZHU');
  1908. list.items[s].link = 'http://lib.gzhu.edu.cn:8080' + bookBlock[s][0];
  1909. list.items[s].bookName = bookBlock[s][1];
  1910. list.items[s].author = bookBlock[s][2];
  1911. list.items[s].publisher = bookBlock[s][3];
  1912.  
  1913. }
  1914. messageCatcher(list,frameLocation);
  1915.  
  1916. return;
  1917. }
  1918.  
  1919. },
  1920.  
  1921. //广州美术学院
  1922. GZARTS:{
  1923. respond:function (reDetails,frameLocation) {
  1924. if (reDetails.status !== 200&&reDetails.status !== 304){
  1925. var msg = new LibMeta("GZARTS");
  1926. msg.state="error";
  1927. msg.errorMsg="全字段连接错误";
  1928. //alert("ISBN连接错误");
  1929. messageCatcher(msg,frameLocation);
  1930. return;
  1931. }
  1932. if(reDetails.responseText.indexOf('没有')!=-1){
  1933.  
  1934. var msg = new LibMeta("GZARTS");
  1935. msg.state="error";
  1936. msg.errorMsg="全字段查无此书";
  1937.  
  1938. messageCatcher(msg,frameLocation);
  1939. return;
  1940. }
  1941. titleFilter.GZARTS.filter(reDetails.responseText,frameLocation);
  1942.  
  1943. },
  1944. filter:function(text,frameLocation){
  1945. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/\r/g,"").replace(/ /g,"");
  1946. rowText = text.match(/(bookinfo.aspx\?ctrlno=\d+\.?\d*)".*?blank">(.*?)<\/a>.*?<td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td>/g);
  1947. var bookBlock = new Array();
  1948. for(s=0;s<rowText.length;s++){
  1949. bookBlock[s]=rowText[s].match(/(bookinfo.aspx\?ctrlno=\d+\.?\d*)".*?blank">(.*?)<\/a>.*?<td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td>/);
  1950. bookBlock[s].shift();
  1951. }
  1952.  
  1953. bookBlock[0].shift();
  1954. var list = new LibMeta("GZARTS");////构造函数
  1955. list.state="booklist";
  1956. list.items= new Array();
  1957. for(s=0;s<bookBlock.length;s++){
  1958. list.items[s] = new LibItem("GZARTS");
  1959. list.items[s].link ="http://121.33.246.167/opac/"+bookBlock[s][0];
  1960. list.items[s].bookName = bookBlock[s][1];
  1961. list.items[s].author = bookBlock[s][2];
  1962. list.items[s].publisher = bookBlock[s][3];
  1963. list.items[s].pubDate = bookBlock[s][4];
  1964. }
  1965. messageCatcher(list,frameLocation);
  1966.  
  1967. }
  1968. },
  1969.  
  1970.  
  1971. //星海音乐学院
  1972. XHCOM:{
  1973. respond:function (reDetails,frameLocation) {
  1974. if (reDetails.status !== 200&&reDetails.status !== 304){
  1975. var msg = new LibMeta("XHCOM");
  1976. msg.state="error";
  1977. msg.errorMsg="全字段连接错误";
  1978. //alert("ISBN连接错误");
  1979. messageCatcher(msg,frameLocation);
  1980. return;
  1981. }
  1982. if(reDetails.responseText.indexOf('没有')!=-1){
  1983.  
  1984. var msg = new LibMeta("XHCOM");
  1985. msg.state="error";
  1986. msg.errorMsg="全字段查无此书";
  1987.  
  1988. messageCatcher(msg,frameLocation);
  1989. return;
  1990. }
  1991.  
  1992. titleFilter.XHCOM.filter(reDetails.responseText,frameLocation);
  1993.  
  1994. },
  1995. filter:function(text,frameLocation){
  1996. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/\r/g,"").replace(/ /g,"");
  1997. var rowText=text.match(/(bookinfo.aspx\?ctrlno=\d+\.?\d*)".*?blank">(.*?)<\/a>.*?<td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td>/g)
  1998.  
  1999. var bookBlock = new Array();
  2000.  
  2001. for(s=0;s<rowText.length;s++){
  2002. bookBlock[s]=rowText[s].match(/(bookinfo.aspx\?ctrlno=\d+\.?\d*)".*?blank">(.*?)<\/a>.*?<td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td>/);
  2003. bookBlock[s].shift();
  2004. }
  2005.  
  2006. var list = new LibMeta("XHCOM");////构造函数
  2007. list.state="booklist";
  2008. list.items= new Array();
  2009. for(s=0;s<bookBlock.length;s++){
  2010. list.items[s] = new LibItem("XHCOM");
  2011. list.items[s].link ="http://121.33.246.167/opac/"+bookBlock[s][0];
  2012. list.items[s].bookName = bookBlock[s][1];
  2013. list.items[s].author = bookBlock[s][2];
  2014. list.items[s].publisher = bookBlock[s][3];
  2015. list.items[s].pubDate = bookBlock[s][4];
  2016. }
  2017. messageCatcher(list,frameLocation);
  2018.  
  2019. }
  2020. },
  2021.  
  2022. //超星发现全字段
  2023. zhizhen:{
  2024. respond:function (reDetails,frameLocation) {
  2025. if (reDetails.status !== 200&&reDetails.status !== 304){
  2026. var msg = new LibMeta("zhizhen");
  2027. msg.state="error";
  2028. msg.errorMsg="超星发现全字段连接错误";
  2029. //alert("ISBN连接错误");
  2030. messageCatcher(msg,frameLocation);
  2031. return;
  2032. }
  2033. if(reDetails.responseText.indexOf('没有找到')!=-1||reDetails.responseText.indexOf('不在IP')!=-1){
  2034. var msg = new LibMeta("zhizhen");
  2035. msg.state="error";
  2036. msg.errorMsg="超星发现全字段查无此书";
  2037.  
  2038. messageCatcher(msg,frameLocation);
  2039. return;
  2040. }
  2041.  
  2042. titleFilter.zhizhen.filter(reDetails.responseText,frameLocation);
  2043.  
  2044. },
  2045. filter:function(text,frameLocation){
  2046. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/\r/g,"");
  2047. var rowText = text.match(/savelist.*?form/g);
  2048. var bookBlock = new Array();
  2049.  
  2050. for(s=0;s<rowText.length;s++){
  2051. bookBlock[s]=rowText[s].match(/[图书].*?href="(\/detail.*?)" target="_blank">(.*?)<\/a>.*?作者:(.*?)<\/li>.*?出处:(.*?)&nbsp;/);
  2052. if(bookBlock[s]==null){
  2053. bookBlock[s]=bookBlock[s-1];
  2054. continue;
  2055. }
  2056. bookBlock[s].shift();
  2057. //链接|书名|作者|出处
  2058. getInfo = rowText[s].match(/获得途径:<\/span>(.*?)<\/li>/);
  2059. if(getInfo){
  2060. getInfo[1] = getInfo[1].replace(/href="/g,'href="http://ss.zhizhen.com').replace(/href=\//g,'href=http://ss.zhizhen.com/');
  2061. bookBlock[s][4] = getInfo[1];
  2062. //
  2063. }
  2064. else{
  2065. bookBlock[s][4]="无获取途径";
  2066. }
  2067.  
  2068.  
  2069. }
  2070.  
  2071. var list = new LibMeta("zhizhen");////构造函数
  2072. list.state="zhizhen";
  2073. list.items= new Array();
  2074. for(s=0;s<rowText.length;s++){
  2075. list.items[s] = new LibItem("zhizhen");
  2076. list.items[s].link ="http://ss.zhizhen.com"+bookBlock[s][0];
  2077. list.items[s].bookName = bookBlock[s][1];
  2078. list.items[s].author = bookBlock[s][2];
  2079. list.items[s].publisher = bookBlock[s][3];
  2080. list.items[s].extra = bookBlock[s][4];
  2081. }
  2082. messageCatcher(list,frameLocation);
  2083.  
  2084. }
  2085. },
  2086.  
  2087. //超星读书全字段
  2088. chaoxing:{
  2089. respond:function (reDetails,frameLocation) {
  2090. if (reDetails.status !== 200&&reDetails.status !== 304){
  2091. var msg = new LibMeta("chaoxing");
  2092. msg.state="error";
  2093. msg.errorMsg="超星读书全字段连接错误";
  2094. //alert("ISBN连接错误");
  2095. messageCatcher(msg,frameLocation);
  2096. return;
  2097. }
  2098. //document.getElementById("footer").textContent=reDetails.responseText;
  2099. if(reDetails.responseText.indexOf('没有找到')!=-1){
  2100. var msg = new LibMeta("chaoxing");
  2101. msg.state="error";
  2102. msg.errorMsg="超星读书题名查无此书";
  2103. messageCatcher(msg,frameLocation);
  2104. return;
  2105. }
  2106.  
  2107. titleFilter.chaoxing.filter(reDetails.responseText,frameLocation);
  2108.  
  2109. },
  2110. filter:function(text,frameLocation){
  2111. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/\r/g,"");
  2112. var rowText = text.match(/pic_upost.*?name.*?<\/p>/g);
  2113. var bookBlock = new Array();
  2114.  
  2115. for(s=0;s<rowText.length;s++){
  2116. bookBlock[s]=rowText[s].match(/title="(.*?)".*?href="(.*?)".*?class="name".*?<span>(.*?)<\/span>/);
  2117. bookBlock[s].shift();
  2118. //|书名|链接|作者
  2119. }
  2120. var list = new LibMeta("chaoxing");////构造函数
  2121. list.state="chaoxing";
  2122. list.items= new Array();
  2123. for(s=0;s<rowText.length;s++){
  2124. list.items[s] = new LibItem("chaoxing");
  2125. list.items[s].bookName = bookBlock[s][0];
  2126. list.items[s].link ="http://book.chaoxing.com"+bookBlock[s][1];
  2127. list.items[s].author = bookBlock[s][2];
  2128. }
  2129. messageCatcher(list,frameLocation);
  2130. }
  2131. },
  2132.  
  2133. EBSCO:{
  2134. respond:function (reDetails,frameLocation) {
  2135. if (reDetails.status !== 200&&reDetails.status !== 304){
  2136. var msg = new LibMeta("EBSCO");
  2137. msg.state="error";
  2138. msg.errorMsg="EBSCO读书全字段连接错误";
  2139. //alert("ISBN连接错误");
  2140. messageCatcher(msg,frameLocation);
  2141. return;
  2142. }
  2143. //document.getElementById("footer").textContent=reDetails.responseText;
  2144. if(reDetails.responseText.indexOf('没有找到')!=-1){
  2145. var msg = new LibMeta("EBSCO");
  2146. msg.state="error";
  2147. msg.errorMsg="EBSCO读书题名查无此书";
  2148. messageCatcher(msg,frameLocation);
  2149. return;
  2150. }
  2151.  
  2152. titleFilter.EBSCO.filter(reDetails.responseText,frameLocation,reDetails.finalUrl);
  2153.  
  2154. },
  2155. filter:function(text,frameLocation,finalUrl){
  2156. text = text.replace(/[ | ]*\n/g,'').replace(/\n[\s| | ]*\r/g,'').replace(/amp;/g,"").replace(/\r/g,"");
  2157. var rowText = text.match(/title-link-wrapper.*?treelist-group/g);
  2158. //alert(rowText.length);
  2159. var bookBlock = new Array();
  2160. var fullText;
  2161. var abbrUrl=finalUrl.match(/(.*?)results/)[1];
  2162. for(s=0;s<rowText.length;s++){
  2163. //alert(rowText[s]);
  2164. bookBlock[s]=rowText[s].match(/href="(.*?)".*?title="(.*?)".*?caption.*?By:(.*?):(.*?)<p/);
  2165. //link//题名//作者//出版社
  2166. var fullTextLink = null;
  2167. var fullTextLink=rowText[s].match(/title="PDF Full Text" href="(.*?)"/);
  2168. //link//书名//
  2169. bookBlock[s].shift();
  2170. if(fullTextLink) fullTextLink.shift();
  2171. fullTextLink=abbrUrl+fullTextLink;
  2172. if(fullTextLink) bookBlock[s][4]=fullTextLink;
  2173. //document.getElementById("footer").textContent+=s+" "+bookBlock[s]+"\n"+"\n";
  2174. }
  2175. var list = new LibMeta("EBSCO");////构造函数
  2176. list.state="booklist";
  2177. list.items= new Array();
  2178. for(s=0;s<rowText.length;s++){
  2179. list.items[s] = new LibItem("EBSCO");
  2180. list.items[s].bookName = bookBlock[s][1];
  2181. list.items[s].link =bookBlock[s][0];
  2182. list.items[s].author = bookBlock[s][2];
  2183. list.items[s].publisher = bookBlock[s][3];
  2184. if(bookBlock[s][4]) list.items[s].extra = bookBlock[s][4];
  2185. }
  2186. messageCatcher(list,frameLocation);
  2187. }
  2188. },
  2189.  
  2190. //广东药学院,由于编码问题和没提供ISBN检索,暂不支持//
  2191. GDPU:{
  2192. respond:function (reDetails,frameLocation) {
  2193. },
  2194. filter:function(text,frameLocation){
  2195. }
  2196. }
  2197. }
  2198.  
  2199.  
  2200. //////////////////图书馆荐购页面Main//////////////////////////////////////
  2201.  
  2202. libRecommend = {
  2203. SYSU: function () {
  2204. if (document.getElementsByName("Z13_TITLE")&&GM_getValue('doubanTitle')) {
  2205.  
  2206. document.getElementsByName("Z13_TITLE")[0].value=GM_getValue('doubanTitle', 'bookMeta.title');
  2207. document.getElementsByName("Z13_AUTHOR")[0].value=GM_getValue('doubanAuthor', 'bookMeta.author');
  2208. document.getElementsByName("Z13_IMPRINT")[0].value=GM_getValue('doubanPublisher', 'bookMeta.publisher');
  2209. document.getElementsByName("Z13_YEAR")[0].value=GM_getValue('doubanPubdate', 'bookMeta.pubdate');
  2210. document.getElementsByName("Z13_ISBN_ISSN")[0].value=GM_getValue('doubanIsbn', 'bookMeta.isbn');
  2211. document.getElementsByName("Z13_PRICE")[0].value=GM_getValue('doubanPrice', 'bookMeta.price');
  2212. document.getElementsByName("Z68_NO_UNITS")[0].value=2;
  2213. document.getElementsByName("Z303_REC_KEY")[0].value=prefs.libraryId;
  2214. document.getElementsByName("Z46_REQUEST_PAGES")[0].value='豆瓣读书得分: ' + GM_getValue('doubanRating', 'bookMeta.rating');
  2215. if(GM_getValue('doubanLanguage','zh')=="en") document.getElementsByName("LIBRARY")[0].value="02";//语言为外语时
  2216. GM_deleteValue('doubanTitle');
  2217. GM_deleteValue('doubanAuthor');
  2218. GM_deleteValue('doubanPublisher');
  2219. GM_deleteValue('doubanPubdate');
  2220. GM_deleteValue('doubanIsbn');
  2221. GM_deleteValue('doubanPrice');
  2222. GM_deleteValue('doubanRating');
  2223. }
  2224. },
  2225. SCUT: function () {
  2226. var pubDate = document.getElementById('b_date');
  2227. if (!pubDate) {
  2228. return null;
  2229. }
  2230. var publisher = document.getElementById('b_pub');
  2231. var author = document.getElementsByName('F210$c') [0];
  2232. var title = document.getElementsByName('F200$a') [0];
  2233. var ISBN = document.getElementsByName('F010$a') [0];
  2234. var recommendText = document.getElementsByName('F330$a') [0];
  2235. title.value = GM_getValue('doubanTitle', 'bookMeta.title');
  2236. author.value = GM_getValue('doubanAuthor', 'bookMeta.author');
  2237. publisher.value = GM_getValue('doubanPublisher', 'bookMeta.publisher');
  2238. pubDate.value = GM_getValue('doubanPubdate', 'bookMeta.pubdate');
  2239. ISBN.value = GM_getValue('doubanIsbn', 'bookMeta.isbn');
  2240. recommendText.value = '豆瓣读书得分: ' + GM_getValue('doubanRating', 'bookMeta.rating');
  2241. GM_deleteValue('doubanTitle');
  2242. GM_deleteValue('doubanAuthor');
  2243. GM_deleteValue('doubanPublisher');
  2244. GM_deleteValue('doubanPubdate');
  2245. GM_deleteValue('doubanIsbn');
  2246. GM_deleteValue('doubanPrice');
  2247. GM_deleteValue('doubanRating');
  2248. },
  2249. GDUFS: function () {
  2250. if (document.getElementsByName("Z13_TITLE")&&GM_getValue('doubanTitle')) {
  2251.  
  2252. document.getElementsByName("Z13_TITLE")[0].value=GM_getValue('doubanTitle', 'bookMeta.title');
  2253. document.getElementsByName("Z13_AUTHOR")[0].value=GM_getValue('doubanAuthor', 'bookMeta.author');
  2254. document.getElementsByName("Z13_IMPRINT")[0].value=GM_getValue('doubanPublisher', 'bookMeta.publisher');
  2255. document.getElementsByName("Z13_YEAR")[0].value=GM_getValue('doubanPubdate', 'bookMeta.pubdate');
  2256. document.getElementsByName("Z13_ISBN_ISSN")[0].value=GM_getValue('doubanIsbn', 'bookMeta.isbn');
  2257. document.getElementsByName("Z13_PRICE")[0].value=GM_getValue('doubanPrice', 'bookMeta.price');
  2258. document.getElementsByName("Z68_NO_UNITS")[0].value=2;
  2259. document.getElementsByName("Z303_REC_KEY")[0].value=prefs.libraryId;
  2260. document.getElementsByName("Z46_REQUEST_PAGES")[0].value='豆瓣读书得分: ' + GM_getValue('doubanRating', 'bookMeta.rating');
  2261. if(GM_getValue('doubanLanguage','zh')=="en") document.getElementsByName("LIBRARY")[0].value="02";//语言为外语时
  2262. GM_deleteValue('doubanTitle');
  2263. GM_deleteValue('doubanAuthor');
  2264. GM_deleteValue('doubanPublisher');
  2265. GM_deleteValue('doubanPubdate');
  2266. GM_deleteValue('doubanIsbn');
  2267. GM_deleteValue('doubanPrice');
  2268. GM_deleteValue('doubanRating');
  2269. GM_deleteValue('doubanLanguage');
  2270. }
  2271. }
  2272. }
  2273. ///////////////////图书馆荐购页面结束//////////////////
  2274.  
  2275.  
  2276. ///////////////////框架//////////////////
  2277. titleFrame=function(){
  2278.  
  2279. function showOtherFrame(){
  2280.  
  2281. document.getElementById("libTitle").style.display="none";
  2282. document.getElementById("otherTitle").style.display="block";
  2283. document.getElementById("jaysonTitle").style.display="none";
  2284. defineClass=this.getAttribute("data-ready");
  2285. this.setAttribute("class","blue");
  2286. document.getElementById("clickTitle").setAttribute("class","");
  2287. document.getElementById("clickJaysonTitle").setAttribute("class","");
  2288. if(!defineClass){
  2289. this.setAttribute("data-ready","already");
  2290. otherTitle();
  2291. }
  2292. }
  2293.  
  2294. function showOriginFrame(){
  2295. document.getElementById("libTitle").style.display="block";
  2296. document.getElementById("otherTitle").style.display="none";
  2297. document.getElementById("jaysonTitle").style.display="none";
  2298. this.setAttribute("class","blue");
  2299. document.getElementById("clickOtherTitle").setAttribute("class","");
  2300. document.getElementById("clickJaysonTitle").setAttribute("class","");
  2301. }
  2302.  
  2303. function showJaysonFrame(){
  2304.  
  2305. document.getElementById("libTitle").style.display="none";
  2306. document.getElementById("otherTitle").style.display="none";
  2307. document.getElementById("jaysonTitle").style.display="block";
  2308. defineClass=this.getAttribute("data-ready");
  2309. this.setAttribute("class","blue");
  2310. document.getElementById("clickTitle").setAttribute("class","");
  2311. document.getElementById("clickOtherTitle").setAttribute("class","");
  2312. if(!defineClass){
  2313. this.setAttribute("data-ready","already");
  2314. jaysonTitle();//改为谷歌
  2315. }
  2316. }
  2317. var frame = document.createElement("div");
  2318.  
  2319. googleCustomUrl="https://www.google.com/cse?q="+bookMeta.title+"&newwindow=1&cx=006100883259189159113%3Atwgohm0sz8q";
  2320. var otherTabName="超星";
  2321. if(bookMeta.lan=="en") otherTabName="EBSCO";
  2322. frame.innerHTML='<ul class="tabmenu">'+
  2323. '<li id="clickTitle" class="blue"><a>'+schoolInfo[prefs.school].abbrName+'</a></li>'+
  2324. '<li id="clickOtherTitle"><a>'+otherTabName+'</a></li>'+
  2325. '<li id="clickJaysonTitle"><a>'+'谷歌聚合搜索'+'</a></li>'+
  2326. '</ul>'+
  2327. '<div id="libTitle" class="tab_content libBottom">'+'<h2>'+schoolInfo[prefs.school].abbrName+'图书馆全字段检索</h2>'+'</div>'+
  2328. '<div id="otherTitle" class="tab_content libBottom" style="display:none"><div id="mainOtherTitle">'+
  2329. '</div><div id="errorOtherTitle"></div>'+
  2330. '</div>'+
  2331. '<div id="jaysonTitle" class="tab_content libBottom" style="display:none">'+'<h2>'+
  2332. '<a target="_blank" class="gotobtn" href="'+googleCustomUrl+'">前往谷歌聚合搜索</a><br>'+
  2333. '</h2>'+
  2334. '<div id="googleLoading"><li class="loadingSource"><img border="0" src="data:image/gif;base64,R0lGODlhCgAKAJEDAMzMzP9mZv8AAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQFAAADACwAAAAACgAKAAACF5wncgaAGgJzJ647cWua4sOBFEd62VEAACH5BAUAAAMALAEAAAAIAAMAAAIKnBM2IoMDAFMQFAAh+QQFAAADACwAAAAABgAGAAACDJwHMBGofKIRItJYAAAh+QQFAAADACwAAAEAAwAIAAACChxgOBPBvpYQYxYAIfkEBQAAAwAsAAAEAAYABgAAAgoEhmPJHOGgEGwWACH5BAUAAAMALAEABwAIAAMAAAIKBIYjYhOhRHqpAAAh+QQFAAADACwEAAQABgAGAAACDJwncqi7EQYAA0p6CgAh+QQJAAADACwHAAEAAwAIAAACCpRmoxoxvQAYchQAOw=="> 努力加载中...</li></div>'+
  2335. '</div>';
  2336.  
  2337. frame.setAttribute("class","tablist title_div");
  2338.  
  2339. if(location.href.indexOf("ebook")!=-1){
  2340. var aside=document.getElementsByTagName("aside")[0];
  2341. }
  2342. else{
  2343. var aside=document.querySelector(".aside");
  2344. }
  2345.  
  2346. aside.insertBefore(frame,aside.firstChild.nextSibling);
  2347. clickOther=document.getElementById("clickOtherTitle");
  2348. clickOther.addEventListener("click",showOtherFrame,false);
  2349. clickOther=document.getElementById("clickTitle");
  2350. clickOther.addEventListener("click",showOriginFrame,false);
  2351. clickOther=document.getElementById("clickJaysonTitle");
  2352. clickOther.addEventListener("click",showJaysonFrame,false);
  2353. }
  2354. ISBNFrame=function(){
  2355.  
  2356.  
  2357. function showOtherFrame(){
  2358.  
  2359. document.getElementById("libISBN").style.display="none";
  2360. document.getElementById("otherISBN").style.display="block";
  2361. defineClass=this.getAttribute("data-ready");
  2362. this.setAttribute("class","blue");
  2363. document.getElementById("clickISBN").setAttribute("class","");
  2364. if(!defineClass){
  2365. this.setAttribute("data-ready","already");
  2366. otherISBN();
  2367. }
  2368. }
  2369.  
  2370.  
  2371. function showOriginFrame(){
  2372. document.getElementById("libISBN").style.display="block";
  2373. document.getElementById("otherISBN").style.display="none";
  2374. this.setAttribute("class","blue");
  2375. document.getElementById("clickOtherISBN").setAttribute("class","");
  2376. }
  2377.  
  2378. var frame = document.createElement("div");
  2379.  
  2380.  
  2381. var NLCfinalUrl = schoolInfo.NLC.isbnSearchUrl.replace(/%s/,bookMeta.isbn10);
  2382. var CALISfinalUrl = schoolInfo.CALIS.isbnSearchUrl.replace(/%s/,bookMeta.isbn10);
  2383. frame.innerHTML= '<ul class="tabmenu">'+
  2384. '<li id="clickISBN" class="blue"><a>'+schoolInfo[prefs.school].abbrName+'</a></li>'+
  2385. '<li id="clickOtherISBN"><a>其他图书馆</a></li>'+
  2386. '<li id="settingPop"><a>设置</a></li>'+
  2387. '</ul>'+
  2388. '<div id="libISBN" class="tab_content libTop">'+'<h2>'+schoolInfo[prefs.school].abbrName+'图书馆ISBN检索</h2>'+'</div>'+
  2389. '<div id="otherISBN" class="tab_content libTop" style="display:none"><div id="mainOtherISBN">'+
  2390. '<a target="_blank" class="gotobtn" href="'+CALISfinalUrl+'">前往CALIS</a>'+' &nbsp;'+'<a class="gotobtn" target="_blank" href="'+NLCfinalUrl+'">前往国家图书馆</a>'+
  2391. '</div><div id="errorOtherISBN"></div></div>';//+
  2392.  
  2393. frame.setAttribute("class","tablist");
  2394. if(location.href.indexOf("ebook")!=-1){
  2395. var aside=document.getElementsByTagName("aside")[0];
  2396. }
  2397. else{
  2398. var aside=document.querySelector(".aside");
  2399. }
  2400. aside.insertBefore(frame,aside.firstChild);
  2401. clickOther=document.getElementById("clickOtherISBN");
  2402. clickOther.addEventListener("click",showOtherFrame,false);
  2403. clickOther=document.getElementById("clickISBN");
  2404. clickOther.addEventListener("click",showOriginFrame,false);
  2405. document.getElementById("settingPop").addEventListener("click",popSetting,false);
  2406.  
  2407.  
  2408. }
  2409.  
  2410.  
  2411. //////////////////////其它图书馆ISBN//////////////////////////////////
  2412.  
  2413. function otherISBN(){
  2414. for(var key in schoolList){
  2415. if(schoolList[key]!=prefs.school){
  2416. //alert(school);
  2417. mineISBN(schoolList[key],"otherISBN");
  2418. }
  2419. }
  2420. }
  2421.  
  2422. //////////////////////超星其它//////////////////////////////////
  2423.  
  2424. function otherTitle(){
  2425. //////////////////////////超星发现和超星读书
  2426.  
  2427. if(bookMeta.lan=="en"){
  2428. var fullUrl=schoolInfo.EBSCO.anySearchUrl.replace(/%s/,bookMeta.title);//外文图书
  2429. }
  2430. else{
  2431. var fullUrl=schoolInfo.zhizhen.anySearchUrl.replace(/%s/,bookMeta.title);
  2432. var fullUrl2=schoolInfo.chaoxing.anySearchUrl.replace(/%s/,bookMeta.title);
  2433. }
  2434.  
  2435.  
  2436. var frame=document.getElementById("mainOtherTitle");
  2437. var loadingFrame=document.createElement("div");
  2438. loadingFrame.setAttribute("id","otherTitleLoading");
  2439. loadingFrame.innerHTML= '<li class="loadingSource"><img border="0" src="data:image/gif;base64,R0lGODlhCgAKAJEDAMzMzP9mZv8AAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQFAAADACwAAAAACgAKAAACF5wncgaAGgJzJ647cWua4sOBFEd62VEAACH5BAUAAAMALAEAAAAIAAMAAAIKnBM2IoMDAFMQFAAh+QQFAAADACwAAAAABgAGAAACDJwHMBGofKIRItJYAAAh+QQFAAADACwAAAEAAwAIAAACChxgOBPBvpYQYxYAIfkEBQAAAwAsAAAEAAYABgAAAgoEhmPJHOGgEGwWACH5BAUAAAMALAEABwAIAAMAAAIKBIYjYhOhRHqpAAAh+QQFAAADACwEAAQABgAGAAACDJwncqi7EQYAA0p6CgAh+QQJAAADACwHAAEAAwAIAAACCpRmoxoxvQAYchQAOw=="> 努力加载中...</li>'
  2440.  
  2441. var frameLink = document.createElement("a");
  2442. frameLink.setAttribute("target","_blank");
  2443. frameLink.innerHTML="前往查看检索";
  2444. frameLink.setAttribute("href",fullUrl);
  2445. frame.appendChild(frameLink);
  2446. frame.appendChild(loadingFrame);
  2447.  
  2448. if(bookMeta.lan=="zh"){
  2449. GM_xmlhttpRequest({ //获取列表
  2450. method : 'GET',
  2451. synchronous : false,//异步获取
  2452. url : fullUrl,
  2453. onload :function (reDetails){
  2454. titleFilter.zhizhen.respond(reDetails,"otherTitle",fullUrl);
  2455. }
  2456. });
  2457. //////////////////////
  2458. GM_xmlhttpRequest({ //获取列表
  2459. method : 'GET',
  2460. synchronous : false,//异步获取
  2461. url : fullUrl2,
  2462. onload :function (reDetails){
  2463. titleFilter.chaoxing.respond(reDetails,"otherTitle",fullUrl2);
  2464. }
  2465. });
  2466.  
  2467. }
  2468. else{
  2469. GM_xmlhttpRequest({ //获取列表
  2470. method : 'GET',
  2471. synchronous : false,//异步获取
  2472. url : fullUrl,
  2473. onload :function (reDetails){
  2474. titleFilter.EBSCO.respond(reDetails,"otherTitle",fullUrl);
  2475. }
  2476. });
  2477. }
  2478.  
  2479. }
  2480.  
  2481. //////////////////谷歌检索,改自豆藤////////////////////////////
  2482. var jaysonTitle = function(){
  2483. var keyw = bookMeta.title;
  2484. var cid = '006100883259189159113%3Atwgohm0sz8q'
  2485. //http://g.yon.hk/uds/GwebSearch?rsz=filtered_cse&hl=zh_CN&cx=006100883259189159113%3Atwgohm0sz8q&v=1.0&key=notsupplied&q=allintitle%3Aboy
  2486. var getSite = function(){
  2487. return [
  2488. //'https://gs.awei.me/'//'http://g.yh.gs/'
  2489. //,'https://www.ppx.pw/'
  2490. 'http://www.guge.link/'
  2491. //,'https://www.ko50.com/'
  2492. ,'https://www.guge.click/'
  2493. //,'http://gg.cellmean.com/'
  2494. ,'https://google.xface.me/'
  2495. ,'http://google.sidney-aldebaran.me/'
  2496. //,'https://guge.in/'
  2497. //,'http://www.ggooo.net/'
  2498. ,'https://gg.kfd.me/'
  2499. //,'https://www.ko50.com/'
  2500. //,'https://google-hk.wewell.net/'
  2501. //,'http://www.googlestable.cn/'
  2502. //,'http://hisbig.com/'
  2503. //,'http://gg.cellmean.com/'
  2504. ,'https://www.sslpxy.com/'
  2505. ,'http://xueshu.cytbj.com/'
  2506. //,'https://www.nssjs.com/'
  2507. //,'https://hk.g.net.co/'
  2508. ][Math.floor(Math.random() * 7 + 1)-1];
  2509. // ******** Google 镜像 ********
  2510.  
  2511. };
  2512. var googleLoader = function(site){
  2513. var path = site || 'http://www.google.com/';
  2514. // var path = 'https://repigu.com/';
  2515. GM_xmlhttpRequest({
  2516. method: 'GET',
  2517. headers: {
  2518. "User-Agent": "Mozilla/5.0", // If not specified, navigator.userAgent will be used.
  2519. "Accept": "text/html;charset=utf-8" // If not specified, browser defaults will be used.
  2520. },
  2521. url: path + 'uds/GwebSearch?rsz=filtered_cse&hl=zh_CN&cx='+cid+'&v=1.0&key=notsupplied&q=allintitle%3A' + keyw,
  2522. onload: function(resp){
  2523. //alert(resp.status);
  2524. if(resp.status < 200 || resp.status > 300){
  2525. googleLoader(getSite()); // 切换镜像
  2526. return;
  2527. };
  2528. if(resp.responseText.indexOf('Abuse')!==-1){
  2529. //alert("Abuse");
  2530. googleLoader(getSite()); // 切换镜像
  2531. return;
  2532. }
  2533. var date = JSON.parse(resp.responseText);
  2534. var loading =document.getElementById("googleLoading");
  2535. if(loading) loading.parentNode.removeChild(loading);
  2536. var itemNum = date.responseData.results.length; //搜索结果条目数
  2537. if(itemNum == 0){
  2538. document.getElementById("jaysonTitle").innerHTML+='<div>未找到相关内容</div>';
  2539. };
  2540. for(var i=0,j=itemNum; i<j; i++){
  2541. var itemi = date.responseData.results[i]; //itemi 搜索结果条目i
  2542. //alert(itemi);
  2543. var webSite = !!itemi.perResultLabels && itemi.perResultLabels[0].anchor || '';
  2544. //alert(webSite);
  2545. webSite="【"+webSite+"】";
  2546. //如果是图书,则将来源网站改为文档类型
  2547. var docType = itemi.title.match(/\.(txt|pdf|doc|ppt|chm|rar|exe|zip|epub|mobi|caj|jar)/i);
  2548. !!docType && (webSite = '【' + docType[1].toUpperCase() + '】');
  2549.  
  2550. document.getElementById("jaysonTitle").innerHTML += '<li style="font-size: 12px;list-style-type:none"' +'><span class="pl">'+ webSite +'</span><a href="' + decodeURIComponent(itemi.url).replace('pan.baidu.com/wap/link', 'pan.baidu.com/share/link') + '" title="' + itemi.titleNoFormatting + '" target="_blank">' + itemi.title.replace(/_免费高速下载_新浪爱问共享资料|-epub电子书下载.*|–华为网盘.*|-在线下载.*|网盘下载\|115网盘.*|迅雷快传-|\| IMAX\.im 高清影院|资源下载,中文字幕下载,|电影,|下载,|已上映,|,下载《.*|\| 720p 高清电影\(imax.im\)|[\[【\((][^\[\]]*\.(com|cn|net|org|cc)[\]】\))]/gi, '') + '</a></li>';
  2551. };
  2552. },
  2553. onerror: function(){
  2554. googleLoader(getSite());
  2555. return;
  2556. }
  2557. });
  2558. };
  2559. googleLoader(getSite());
  2560. };
  2561. //////////////ISBN搜索xml获取//////////////////
  2562. mineISBN = function(school,frameLocation){
  2563.  
  2564. if(frameLocation=="ISBN"){
  2565. ISBNFrame();
  2566. }
  2567. if(bookMeta.isbn){
  2568. var fullUrl="";
  2569. switch(school){
  2570.  
  2571. case "SCUT":
  2572. case "SCNU":
  2573. case "GZHU":
  2574. case "GDUT":
  2575. case "GZHTCM":
  2576. case "GZARTS":
  2577. case "XHCOM":
  2578. fullUrl =schoolInfo[school].isbnSearchUrl.replace(/%s/,bookMeta.isbn10);
  2579. break;
  2580. case "SYSU":
  2581. case "GDUFS":
  2582.  
  2583. if(bookMeta.isbn&&bookMeta.title.charCodeAt(0)<=122&&bookMeta.isbn[3]!=="7"){
  2584. fullUrl=schoolInfo[school].isbnForeianSearchUrl.replace(/%s/,bookMeta.isbn);
  2585. }
  2586. else{
  2587. fullUrl=schoolInfo[school].isbnSearchUrl.replace(/%s/,bookMeta.isbn);
  2588. }
  2589. break;
  2590. default:
  2591. break;
  2592. }
  2593. if(frameLocation=="ISBN"){
  2594. insertLoading(fullUrl);
  2595. }
  2596. frame = document.getElementById("libISBN"); //此处frame需要删除
  2597.  
  2598. GM_xmlhttpRequest({ //获取列表
  2599. method : 'GET',
  2600. synchronous : false,//异步获取
  2601. url : fullUrl,
  2602. onload :function (reDetails){
  2603.  
  2604. isbnFilter[school].respond(reDetails,frameLocation,fullUrl);
  2605. }
  2606. });
  2607. }
  2608.  
  2609. else{//无ISBN号的情况
  2610. var msg = new LibMeta(school);
  2611. msg.error=true;
  2612. msg.state="error";
  2613. msg.errorMsg = "无法获取ISBN号";
  2614.  
  2615. messageCatcher(msg,frameLocation)
  2616.  
  2617. }
  2618. }
  2619.  
  2620. function insertLoading(fullUrl){
  2621. frame = document.getElementById("libISBN");
  2622. frameLink = document.createElement("a");
  2623. frameLink.setAttribute("target","_blank");
  2624. frameLink.innerHTML="前往图书馆查看这本书";
  2625. frameLink.setAttribute("href",fullUrl);
  2626. frame.appendChild(frameLink);
  2627.  
  2628. loadingFrame=document.createElement("div");
  2629. loadingFrame.setAttribute("id","ISBNLoading");
  2630. loadingFrame.innerHTML= '<li id="loadingSource"><a><img border="0" src="data:image/gif;base64,R0lGODlhCgAKAJEDAMzMzP9mZv8AAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQFAAADACwAAAAACgAKAAACF5wncgaAGgJzJ647cWua4sOBFEd62VEAACH5BAUAAAMALAEAAAAIAAMAAAIKnBM2IoMDAFMQFAAh+QQFAAADACwAAAAABgAGAAACDJwHMBGofKIRItJYAAAh+QQFAAADACwAAAEAAwAIAAACChxgOBPBvpYQYxYAIfkEBQAAAwAsAAAEAAYABgAAAgoEhmPJHOGgEGwWACH5BAUAAAMALAEABwAIAAMAAAIKBIYjYhOhRHqpAAAh+QQFAAADACwEAAQABgAGAAACDJwncqi7EQYAA0p6CgAh+QQJAAADACwHAAEAAwAIAAACCpRmoxoxvQAYchQAOw=="> 努力加载中...</a></li>'
  2631.  
  2632. frame.appendChild(loadingFrame);
  2633. }
  2634. /////////////////////////////////////////
  2635.  
  2636.  
  2637. //////////////书名搜索xml获取//////////////////
  2638. mineTitle = function(school){
  2639. titleFrame();
  2640. if(bookMeta.isbn&&bookMeta.title.charCodeAt(0)<=122&&bookMeta.isbn[3]!=="7"){
  2641. var fullUrl=schoolInfo[school].anyForeianSearchUrl.replace(/%s/,bookMeta.title);
  2642. GM_setValue("doubanLanguage","en");
  2643. }
  2644. else{
  2645. var fullUrl=schoolInfo[school].anySearchUrl.replace(/%s/,bookMeta.title);
  2646. }
  2647.  
  2648. frame = document.getElementById("libTitle");
  2649. var loadingFrame=document.createElement("div");
  2650. loadingFrame.setAttribute("id","titleLoading");
  2651. loadingFrame.innerHTML= '<li id="loadingSource"><img border="0" src="data:image/gif;base64,R0lGODlhCgAKAJEDAMzMzP9mZv8AAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQFAAADACwAAAAACgAKAAACF5wncgaAGgJzJ647cWua4sOBFEd62VEAACH5BAUAAAMALAEAAAAIAAMAAAIKnBM2IoMDAFMQFAAh+QQFAAADACwAAAAABgAGAAACDJwHMBGofKIRItJYAAAh+QQFAAADACwAAAEAAwAIAAACChxgOBPBvpYQYxYAIfkEBQAAAwAsAAAEAAYABgAAAgoEhmPJHOGgEGwWACH5BAUAAAMALAEABwAIAAMAAAIKBIYjYhOhRHqpAAAh+QQFAAADACwEAAQABgAGAAACDJwncqi7EQYAA0p6CgAh+QQJAAADACwHAAEAAwAIAAACCpRmoxoxvQAYchQAOw=="> 努力加载中...</li>'
  2652.  
  2653. var frameLink = document.createElement("a");
  2654. frameLink.setAttribute("target","_blank");
  2655. frameLink.innerHTML="前往图书馆查看这本书";
  2656. frameLink.setAttribute("href",fullUrl);
  2657. frame.appendChild(frameLink);
  2658. frame.appendChild(loadingFrame);
  2659. if(!schoolInfo[school].isGBK){
  2660. GM_xmlhttpRequest({ //获取列表
  2661. method : 'GET',
  2662. synchronous : false,//异步获取
  2663. url : fullUrl,
  2664. onload :function (reDetails){
  2665. titleFilter[school].respond(reDetails,"title",fullUrl);
  2666. }
  2667. });
  2668. }
  2669. else{
  2670. GM_xmlhttpRequest({
  2671. method: 'GET',
  2672. url: 'http://www.baidu.com/s?ie=utf-8&wd=' + encodeURIComponent(bookMeta.title),
  2673. overrideMimeType: 'text/xml; charset=gb2312',
  2674. onload: function(response) {
  2675. //alert("text");
  2676. if (response.status !== 200&&response.status !== 304){
  2677. var msg = new LibMeta(school);
  2678. msg.state="error";
  2679. msg.errorMsg="无法获取远程GBK转码";
  2680. messageCatcher(msg,frameLocation);
  2681. return;
  2682. }
  2683. var keywordGB = String(response.responseText.match(/word=[^'"&]+['"&]/i)).replace(/word=|['"&]/ig,'');
  2684. fullUrl= schoolInfo[school].anySearchUrl.replace(/%s/,keywordGB);
  2685. frameLink.setAttribute("href",fullUrl);
  2686. //alert(fullUrl);
  2687. GM_xmlhttpRequest({ //获取列表
  2688. method : 'GET',
  2689. synchronous : false,//异步获取
  2690. url : fullUrl,
  2691. onload :function (reDetails){
  2692. titleFilter[school].respond(reDetails,"title",fullUrl);
  2693. }
  2694. });
  2695. },
  2696. onerror: function(){
  2697. return;
  2698. }
  2699.  
  2700.  
  2701.  
  2702. });
  2703.  
  2704. }
  2705.  
  2706. }
  2707. /////////////////////////////////////////
  2708.  
  2709. ///////////////ISBN插入框架//////////////////////////////
  2710. ISBNInsert=function(msg,frameLocation){
  2711. var innerContent=document.createElement("div");
  2712. innerContent.innerHTML= msg;
  2713. switch(frameLocation){
  2714. case "ISBN":
  2715. loading =document.getElementById("ISBNLoading");
  2716. loading.parentNode.removeChild(loading);
  2717. frame = document.getElementById("libISBN");
  2718. break;
  2719. case "title":
  2720. loading =document.getElementById("titleLoading");
  2721. loading.parentNode.removeChild(loading);
  2722. frame = document.getElementById("libTitle");
  2723. break;
  2724. case "otherISBN":
  2725. frame = document.getElementById("mainOtherISBN");
  2726. break;
  2727. default:
  2728. break;
  2729. }
  2730. frame.appendChild(innerContent);
  2731. function addStoreListener(){
  2732. GM_setClipboard(this.getAttribute("data-storeInfo"));
  2733.  
  2734. noteInfo = "已复制到粘贴板 "+this.getAttribute("data-storeInfo");
  2735.  
  2736. // Let's check if the browser supports notifications
  2737. if (!("Notification" in window)) {
  2738. confirm("以下信息已复制到粘贴板\n\n"+this.getAttribute("data-storeInfo"));
  2739. }
  2740.  
  2741. // Let's check if the user is okay to get some notification
  2742. else if (Notification.permission === "granted") {
  2743. // If it's okay let's create a notification
  2744. var notification = new Notification(noteInfo);
  2745. }
  2746.  
  2747. // Otherwise, we need to ask the user for permission
  2748. // Note, Chrome does not implement the permission static property
  2749. // So we have to check for NOT 'denied' instead of 'default'
  2750. else if (Notification.permission !== 'denied') {
  2751. Notification.requestPermission(function (permission) {
  2752. // Whatever the user answers, we make sure we store the information
  2753. if (!('permission' in Notification)) {
  2754. Notification.permission = permission;
  2755. }
  2756.  
  2757. // If the user is okay, let's create a notification
  2758. if (permission === "granted") {
  2759. var notification = new Notification(noteInfo);
  2760. }
  2761. else{
  2762. confirm("以下信息已复制到粘贴板\n\n"+this.getAttribute("data-storeInfo"));
  2763. }
  2764. });
  2765. }
  2766. else{
  2767. confirm("以下信息已复制到粘贴板\n\n"+this.getAttribute("data-storeInfo"));
  2768. }
  2769.  
  2770. }
  2771. var storeListener = document.querySelectorAll(".preStoreRegister");
  2772. for(s=0;s<storeListener.length;s++){
  2773. storeListener[s].addEventListener("dblclick",addStoreListener,false);
  2774. storeListener[s].classList.remove("preStoreRegister");
  2775. }
  2776. }
  2777. ///////////////Title插入框架//////////////////////////////
  2778. titleInsert=function(msg,frameLocation){
  2779.  
  2780. var innerContent=document.createElement("div");
  2781. innerContent.innerHTML= msg;
  2782. switch(frameLocation){
  2783. case "ISBN":
  2784. var loading =document.getElementById("ISBNLoading");
  2785. loading.parentNode.removeChild(loading);
  2786. frame = document.getElementById("libISBN");
  2787. break;
  2788. case "title":
  2789. GM_addStyle("#libTitle { max-height: 300px;overflow: auto; }");
  2790. if(loading =document.getElementById("titleLoading")){
  2791. loading.parentNode.removeChild(loading);
  2792. }
  2793. frame = document.getElementById("libTitle");
  2794. break;
  2795. case "otherISBN":
  2796. frame = document.getElementById("mainOtherISBN");
  2797. break;
  2798. case "otherTitle":
  2799. var loading =document.getElementById("otherTitleLoading");
  2800. if(loading) loading.parentNode.removeChild(loading);
  2801. frame = document.getElementById("mainOtherTitle");
  2802. break;
  2803. default:
  2804. break;
  2805. }
  2806. frame.appendChild(innerContent);
  2807. }
  2808.  
  2809. ///////////////Title插入框架//////////////////////////////
  2810. errorInsert=function(msg,frameLocation,school){
  2811. var innerContent=document.createElement("div");
  2812.  
  2813. innerContent.innerHTML= msg;
  2814. switch(frameLocation){
  2815. case "ISBN":
  2816. if(loading =document.getElementById("ISBNLoading")){
  2817. loading.parentNode.removeChild(loading);
  2818. }
  2819.  
  2820. frame = document.getElementById("libISBN");
  2821. break;
  2822. case "title":
  2823. if(loading =document.getElementById("titleLoading")){
  2824. loading.parentNode.removeChild(loading);
  2825. };
  2826. frame = document.getElementById("libTitle");
  2827. break;
  2828. case "otherISBN":
  2829. frame = document.getElementById("errorOtherISBN");
  2830. if(!frame.textContent){
  2831. frame.innerHTML+="以下院校查无此书: "
  2832. }
  2833. frame.innerHTML+=school+"&nbsp|&nbsp";
  2834. break;
  2835. case "otherTitle":
  2836. var loading =document.getElementById("otherTitleLoading");
  2837. if(loading) loading.parentNode.removeChild(loading);
  2838. frame = document.getElementById("errorOtherTitle");
  2839. break;
  2840. default:
  2841. return;
  2842. }
  2843. if(frameLocation!="otherISBN") frame.appendChild(innerContent);
  2844. }
  2845.  
  2846.  
  2847. //////////////豆瓣网页荐购获取/////////////////////////
  2848. recommendBook = function(frameLocation,school){
  2849. var innerContent=document.createElement("div");
  2850. switch(frameLocation){
  2851. case "ISBN":
  2852. loading =document.getElementById("ISBNLoading");
  2853. loading.parentNode.removeChild(loading);
  2854. frame = document.getElementById("libISBN");
  2855. break;
  2856. case "title":
  2857. loading =document.getElementById("titleLoading");
  2858. loading.parentNode.removeChild(loading);
  2859. frame = document.getElementById("libTitle");
  2860. break;
  2861. case "otherISBN":
  2862. frame = document.getElementById("errorOtherISBN");
  2863. if(!frame.textContent){
  2864. frame.innerHTML+="以下院校查无此书: "
  2865. }
  2866. frame.innerHTML+=schoolInfo[school].abbrName+" ";
  2867. return;
  2868. default:
  2869. return;
  2870. }
  2871. function gotoRecommend(){
  2872. GM_setValue('doubanTitle',bookMeta.title);
  2873. GM_setValue('doubanAuthor',bookMeta.author);
  2874. GM_setValue('doubanPublisher',bookMeta.publisher);
  2875. GM_setValue('doubanPubdate',bookMeta.pubdate);
  2876. GM_setValue('doubanIsbn',bookMeta.isbn||bookMeta.bookIndex);
  2877. GM_setValue('doubanPrice',bookMeta.price);
  2878. GM_setValue('doubanRating',bookMeta.rating);
  2879. GM_openInTab(schoolInfo[prefs.school].recommendUrl);
  2880.  
  2881. };
  2882.  
  2883. var style = ('style="' +
  2884. 'display: inline-block; ' +
  2885. 'background: #33A057; ' +
  2886. 'border: 1px solid #2F7B4B; ' +
  2887. 'color: white; ' +
  2888. 'padding: 1px 10px; ' +
  2889. 'border-radius: 3px; ' +
  2890. 'margin-right: 8px;" '
  2891. );
  2892.  
  2893.  
  2894. statBtn = ('<a id="recbtn" rel="modal:open"' +
  2895. style + '>荐购</a>' );
  2896.  
  2897. var allBook = '<ul><li>ISBN查询无此书'+statBtn+'</li></ul>';
  2898. innerContent.innerHTML= allBook;
  2899. frame.appendChild(innerContent);
  2900.  
  2901. button=document.getElementById("recbtn");
  2902. if(button){
  2903. button.addEventListener("click",gotoRecommend,false);
  2904. }
  2905.  
  2906.  
  2907. }
  2908.  
  2909. ///////获取回调数据//////////////
  2910. messageCatcher=function(msg,frameLocation){
  2911. switch(msg.state){
  2912. case "store":
  2913. var allBook="";
  2914. var otherAbbr="";
  2915. if(frameLocation.indexOf("other")!=-1){
  2916.  
  2917. otherAbbr="院校:"+schoolInfo[msg.school].abbrName+" ";
  2918. }
  2919.  
  2920. var attachRent="";
  2921. for(s=0;s<msg.items.length;s++){
  2922. if(msg.items[s].rentable){
  2923. attachRent=' rentable'
  2924. }
  2925. else{
  2926. attachRent='';
  2927. }
  2928. storeInfo = bookMeta.title+" "+schoolInfo[msg.school].name+" ";
  2929. //msg.items[s].bookIndex=null;
  2930. if(msg.items[s].bookIndex) storeInfo+="索书号:"+msg.items[s].bookIndex+" ";
  2931. if(msg.items[s].branch) storeInfo+="分馆:"+msg.items[s].branch+" ";
  2932. if(msg.items[s].location) storeInfo+="馆藏地:"+msg.items[s].location;
  2933. bookStatus = '<ul class="preStoreRegister storelist ft pl more-after'+attachRent+'" data-storeInfo="'+storeInfo+'" '+'title="双击可粘贴馆藏信息到剪贴板"'+'> ' +//+'ondblclick="GM_setClipboard(this.getAttribute('+"'data-storeInfo'"+'))"'
  2934. '<li style="border: none"><a href="'+msg.items[s].link+'" target="_blank">'+otherAbbr+'状态:' + msg.items[s].storeState+
  2935. '<span style="position:relative; "> 应还日期: ' + msg.items[s].returnTime +'</span></a></li>' +
  2936.  
  2937. '<li style="border: none">分馆: ' + msg.items[s].branch + '</li>' +
  2938. '</ul>';
  2939. allBook += bookStatus;
  2940.  
  2941. }
  2942.  
  2943. ISBNInsert(allBook,frameLocation);
  2944. break;
  2945. case "booklist":
  2946. var display;
  2947. var allBook = "";
  2948. var otherAbbr="";
  2949. var extra="";
  2950. //alert(msg.school);
  2951. if(frameLocation.indexOf("other")!=-1){
  2952. if(msg.school=="EBSCO"){
  2953. otherAbbr=schoolInfo[msg.items[0].school].abbrName+" ";
  2954. }
  2955. else{
  2956. otherAbbr="院校:"+schoolInfo[msg.items[0].school].abbrName+" ";
  2957. }
  2958. }
  2959. for(s=0;s<msg.items.length;s++){
  2960. if(s>4){
  2961. display="display : none;";
  2962. }
  2963. else{
  2964. display="";
  2965. }
  2966.  
  2967. if(msg.school=="EBSCO"){
  2968. extra='<li class="getlink"><a target="_blank" href="'+msg.items[s].extra+'">Full Text</a></li>';
  2969. }
  2970.  
  2971. bookStatus = '<ul class="ft pl more-after"> ' +
  2972. '<li style="border: none">'+otherAbbr+'书名:<a href="'+msg.items[s].link+'"target="_blank">' + msg.items[s].bookName+ '</a></li>' +
  2973. '<li style="overflow:hidden;border: none;'+display+'">作者: ' + msg.items[s].author +
  2974. ' 出版社:' + msg.items[s].publisher + '</li>' +extra+
  2975. '</ul>';
  2976. allBook += bookStatus;
  2977. }
  2978.  
  2979. titleInsert(allBook,frameLocation);
  2980. break;
  2981. case "recommend":
  2982.  
  2983. recommendBook(frameLocation,msg.school);
  2984. break;
  2985. case "error":
  2986. var bookStatus = '<ul class="ft pl more-after"> ' +
  2987. '<li style="border: none">' + msg.errorMsg+'</li>' +
  2988. '</ul>';
  2989.  
  2990. errorInsert(bookStatus,frameLocation,schoolInfo[msg.school].abbrName);
  2991. break;
  2992. case "zhizhen"://超星发现
  2993. var display;
  2994. var allBook = "";
  2995. var otherAbbr="";
  2996. otherAbbr=schoolInfo[msg.items[0].school].abbrName+" ";
  2997. for(s=0;s<msg.items.length;s++){
  2998. if(s>4){
  2999. display="display : none;";
  3000. }
  3001. else{
  3002. display="";
  3003. }
  3004. bookStatus = '<ul class="ft pl more-after"> ' +
  3005. '<li style="border: none">'+otherAbbr+'书名:'+'<a href="'+msg.items[s].link+'"target="_blank">' + msg.items[s].bookName+ '</a></li>' +
  3006. '<li><span style="overflow:hidden;border: none;'+display+'">作者: ' + msg.items[s].author +
  3007. ' 出版社:' + msg.items[s].publisher + '</span></li>'+
  3008. '<li><span class="getlink">获取途径:'+msg.items[s].extra+'</span></li>' +
  3009. '</ul>';
  3010. allBook += bookStatus;
  3011. }
  3012. titleInsert(allBook,frameLocation);
  3013. break;
  3014. case "chaoxing"://超星读书
  3015. var display;
  3016. var allBook = "";
  3017. var otherAbbr="";
  3018. otherAbbr=schoolInfo[msg.items[0].school].abbrName+" ";
  3019. for(s=0;s<msg.items.length;s++){
  3020. if(s>4){
  3021. display="display : none;";
  3022. }
  3023. else{
  3024. display="";
  3025. }
  3026. bookStatus = '<ul class="ft pl more-after"> ' +
  3027. '<li style="border: none">'+otherAbbr+'书名:'+'<a href="'+msg.items[s].link+'"target="_blank">' + msg.items[s].bookName+ '</a></li>' +
  3028. '<li><span style="overflow:hidden;border: none;'+display+'">作者: ' + msg.items[s].author + '</span></li>' +
  3029. '</ul>';
  3030. allBook += bookStatus;
  3031. }
  3032. titleInsert(allBook,frameLocation);
  3033. break;
  3034. default:
  3035. alert("defalut");
  3036. break;
  3037. }
  3038.  
  3039. }
  3040. /////////////////////////////////
  3041.  
  3042.  
  3043.  
  3044. GM_addStyle('.recbtn{display: inline-block; background: #33A057;border: 1px solid #2F7B4B; color: white; padding: 1px 10px; border-radius: 3px; margin-right: 8px;cursor:pointer} ')
  3045. GM_registerMenuCommand("图书馆检索设置", popSetting);
  3046. //////////////主函数//////////////////////////
  3047.  
  3048. if(location.href.indexOf('douban')!=-1){
  3049.  
  3050. GM_addStyle(".tablist {position:relative;}"+
  3051. ".tab_content {position: relative;width:295px;margin-bottom:5px;max-height: 300px;overflow: auto;padding:15px 5px 15px 5px;border:1px solid #91a7b4;border-radius:3px;box-shadow:0 2px 3px rgba(0,0,0,0.1);font-size:1.2em;line-height:1.5em;color:#666;background:#F6F6F1;}"+
  3052. ".tabmenu {position:absolute;bottom:100%;margin:0;width:316px;}"+
  3053. ".tabmenu li{display:inline-block;}"+
  3054. ".tabmenu li a {display:block;padding:5px 10px;margin:0 10px 0 0;border:1px solid #91a7b4;border-radius:5px 5px 0 0;background:#F6F6F1;color:#333;text-decoration:none;}#libISBN div ul,#libTitle div ul,#otherISBN div ul,#otherTitle div ul{border-bottom: 1px dashed #ddd;}#errorOtherISBN{font-size:10px}.blue a{background:#37A !important;color:white !important;}.tab_content h2{color:#007722; font:15px/150% Arial,Helvetica,sans-serif;margin: 0 0 12px;}"+
  3055. ".libTop{margin-top:30px;}#clickISBN a,#clickOtherISBN a,#settingPop a{cursor:pointer;}#settingPop{position:relative;float:right;}"+
  3056. ".rentable{background:#E3F1ED!important;}.ft.pl.rentable li a{color:#4f946e;}.ft.pl.rentable li a:hover{background:#007711;color:#FFFFFF;}"+
  3057. ".title_div{margin-top: 35px;}");
  3058. mineISBN(prefs.school,"ISBN");
  3059. mineTitle(prefs.school);
  3060.  
  3061. GM_setValue("doubanTitle",bookMeta.title);
  3062. GM_setValue("doubanAuthor",bookMeta.author);
  3063. GM_setValue('doubanPubdate',bookMeta.pubdate);
  3064. GM_setValue("doubanIsbn",bookMeta.isbn);
  3065. GM_setValue("doubanPublisher",bookMeta.publisher);
  3066. }
  3067.  
  3068.  
  3069. if(location.href.indexOf('http://202.116.64.108:8080/apsm/recommend/recommend.jsp')!=-1){
  3070. libRecommend.SYSU();//中山大学图书馆荐购页面
  3071. }
  3072. if(location.href.indexOf('http://202.38.232.10/opac/servlet/opac.go?cmdACT=recommend.form')!=-1){
  3073. libRecommend.SCUT();//华南理工大学图书馆荐购页面
  3074. }
  3075. if(location.href.indexOf('http://opac.gdufs.edu.cn:8118/apsm/recommend/recommend_nobor.jsp')!=-1){
  3076. libRecommend.SYSU();//广东外语外贸大学图书馆荐购页面
  3077. }
  3078.  
  3079. if(location.href.indexOf('gdtgw.cn')!=-1){//十校互借页面
  3080.  
  3081. if(GM_getValue('gotoRent')==true){
  3082.  
  3083. function clickShow(mutations){ //点击按钮
  3084. function fillForm(mutations){//填写表单
  3085. //document.getElementById("publishTime").value=GM_getValue("doubanPubdate","");
  3086.  
  3087. /*observerRight.disconnect();//去除监听*/
  3088. //var target = document.getElementById("supplier");
  3089. var target = document.querySelector('#supplier');
  3090. var observerSchool = new MutationObserver(function(mutations,obs){
  3091. document.getElementsByName("reader.campusId")[0].value=prefs.school.toLowerCase();
  3092. document.getElementById("supplier").value=GM_getValue("rentSchool","");
  3093. //alert("test");
  3094. obs.disconnect;
  3095. observerRight.disconnect();
  3096.  
  3097.  
  3098. });
  3099. var config = { 'childList': true}
  3100. // 传入目标节点和观察选项
  3101. observerSchool.observe(target, config);
  3102.  
  3103.  
  3104. ///
  3105. //document.getElementsByName("reader.campus")[0].value=prefs.campus;
  3106. document.getElementById("phone").value=prefs.telephone;
  3107. document.getElementById("idNo").value=prefs.studentID;
  3108. document.getElementById("name").value=prefs.name;
  3109. document.getElementById("email").value=prefs.eMail;
  3110. document.getElementsByName("reader.campus")[0].value=prefs.campus;
  3111. document.getElementById("callNo").value=GM_getValue("bookIndex","");
  3112. document.getElementById("title").value=GM_getValue("doubanTitle","");
  3113. document.getElementById("isbn").value=GM_getValue("doubanIsbn","");
  3114. document.getElementById("publishTime").value=GM_getValue("doubanPubdate","");
  3115. document.getElementById("author").value=GM_getValue("doubanAuthor","");
  3116. document.getElementById("publisher").value=GM_getValue("doubanPublisher","");
  3117. }
  3118. ////////////////////////////////////////
  3119.  
  3120.  
  3121. document.getElementById("Map").areas[1].click();
  3122. observerLeft.disconnect();
  3123. var target = document.querySelector('#rightContent');
  3124. var observerRight = new MutationObserver(fillForm);
  3125. var config = { 'childList': true}
  3126. // 传入目标节点和观察选项
  3127. observerRight.observe(target, config);
  3128. }
  3129. ///////////////////////
  3130.  
  3131.  
  3132. var MutationObserver = window.MutationObserver ||
  3133. window.WebKitMutationObserver ||
  3134. window.MozMutationObserver;
  3135. if(MutationObserver){
  3136. // 选择目标节点
  3137. var target = document.querySelector('#leftContent');
  3138.  
  3139. // 创建观察者对象
  3140. var observerLeft = new MutationObserver(clickShow);
  3141. // 配置观察选项:
  3142. var config = { 'childList': true}
  3143. // 传入目标节点和观察选项
  3144. observerLeft.observe(target, config);
  3145. // 随后,你还可以停止观察
  3146.  
  3147. }
  3148. else{
  3149. function clickSecond(){
  3150.  
  3151. document.getElementById("idNo").value=prefs.studentID;
  3152. document.getElementById("campusId").value=prefs.school.toLowerCase();//无法设置,还需要一次监听,或者setTimeout
  3153. document.getElementsByName("reader.email")[0].value=prefs.eMail;
  3154. document.getElementsByName("reader.campus")[0].value=prefs.campus;
  3155. document.getElementsByName("reader.phone")[0].value=prefs.telephone;
  3156. document.getElementById("name").value=prefs.name;
  3157. document.getElementById("supplier").value=GM_getValue("rentSchool","");
  3158. document.getElementById("callNo").value=GM_getValue("bookIndex","");
  3159. document.getElementById("title").value=GM_getValue("doubanTitle","");
  3160. if(GM_getValue("doubanIsbn")) document.getElementById("isbn").value=GM_getValue("doubanIsbn","");
  3161. if(GM_getValue("doubanPubdate","")) document.getElementById("publishTime").value=GM_getValue("doubanPubdate","");
  3162. document.getElementById("author").value=GM_getValue("doubanAuthor","");
  3163. document.getElementById("publisher").value=GM_getValue("doubanPublisher","");
  3164. }
  3165.  
  3166. function clickFirst(){
  3167. document.getElementById("Map").areas[1].click();
  3168. setTimeout(function(){clickSecond()},1000);
  3169. }
  3170.  
  3171. setTimeout(function(){clickFirst()},500);
  3172. }
  3173. GM_setValue('gotoRent',false);
  3174.  
  3175. }
  3176. }
  3177.  
  3178.  
  3179. if(location.href.indexOf('gdufs.edu.cn')!=-1&&prefs.school!="GDUFS"){//广外
  3180.  
  3181. var rentTable=document.getElementsByTagName("table");
  3182. rentTable=rentTable[6];
  3183.  
  3184. function GDUFS_interLending(){
  3185. var bookIndex=this.parentNode.parentNode.cells[5].textContent;
  3186. GM_setValue("bookIndex",bookIndex);
  3187. GM_setValue("rentSchool","gdufs");
  3188. GM_setValue("gotoRent",true);
  3189. GM_openInTab("http://www.gdtgw.cn:8080/#.html");
  3190. }
  3191.  
  3192. for (var s = 1; s < rentTable.rows.length; s++) {
  3193. var recbtn=document.createElement("a");
  3194. recbtn.setAttribute("class","recbtn");
  3195. recbtn.innerHTML="十校互借";
  3196. rentTable.rows[s].cells[9].innerHTML='';
  3197. rentTable.rows[s].cells[9].appendChild(recbtn);
  3198. recbtn.addEventListener("click",GDUFS_interLending,false);
  3199. };
  3200. }
  3201.  
  3202. if(location.href.indexOf('202.116.64.108:8991')!=-1&&prefs.school!="SYSU"){//中大
  3203.  
  3204. var rentTable=document.getElementsByTagName("table");
  3205. rentTable=rentTable[6];
  3206.  
  3207. function SYSU_interLending(){
  3208. var bookIndex=this.parentNode.parentNode.cells[6].textContent;
  3209. GM_setValue("bookIndex",bookIndex);
  3210. GM_setValue("rentSchool","sysu");
  3211. GM_setValue("gotoRent",true);
  3212. GM_openInTab("http://www.gdtgw.cn:8080/#.html");
  3213. }
  3214.  
  3215. for (var s = 1; s < rentTable.rows.length; s++) {
  3216. var recbtn=document.createElement("a");
  3217. recbtn.setAttribute("class","recbtn");
  3218. recbtn.innerHTML="十校互借";
  3219. rentTable.rows[s].cells[9].innerHTML='';
  3220. rentTable.rows[s].cells[9].appendChild(recbtn);
  3221. recbtn.addEventListener("click",SYSU_interLending,false);
  3222. };
  3223. }
  3224.  
  3225. if(location.href.indexOf('http://202.38.232.10/opac/servlet/opac.go')!=-1&&prefs.school!="SCUT"){//华理工
  3226. var rentTable=document.getElementById("queryholding");
  3227. if(rentTable){
  3228. //break;
  3229. //return null;
  3230.  
  3231. function SCUT_interLending(){
  3232. var bookIndex=this.parentNode.parentNode.cells[2].textContent;
  3233.  
  3234. var title=document.getElementById("bookName").getAttribute("value");
  3235.  
  3236. var infoTable=document.getElementsByClassName("left12")[0].getElementsByTagName("table")[0];
  3237. ISBN = infoTable.textContent;
  3238. ISBN = ISBN.replace(/\n/g,"").replace(/ /g,"").match(/ISBN(\d|-)+/)[0].slice(4);
  3239. publisher = infoTable.rows[2].cells[1].textContent;
  3240. pubDate = publisher.match(/\d+/);
  3241. publisher = publisher.slice(0,publisher.indexOf(pubDate)-2);
  3242. author = infoTable.rows[1].cells[1].getElementsByTagName("a")[0].innerHTML;
  3243.  
  3244. GM_setValue("bookIndex",bookIndex);
  3245. GM_setValue("rentSchool","scut");
  3246. GM_setValue("gotoRent",true);
  3247. GM_setValue("doubanTitle",title);
  3248. GM_setValue("doubanPubdate",pubDate);
  3249. GM_setValue("doubanPublisher",publisher);
  3250. GM_setValue("doubanAuthor",author);
  3251. //alert(ISBN);
  3252. GM_setValue("doubanIsbn",ISBN);
  3253. GM_openInTab("http://www.gdtgw.cn:8080/#.html");
  3254. }
  3255. rentTable=rentTable.rows[0].cells[0].getElementsByTagName("table")[0];
  3256. for (var s = 1; s < rentTable.rows.length; s++) {
  3257.  
  3258. var recbtn=document.createElement("a");
  3259. recbtn.setAttribute("class","recbtn");
  3260. recbtn.innerHTML="十校互借";
  3261. var btncell=rentTable.rows[s].cells[3];
  3262. btncell.appendChild(recbtn);
  3263. recbtn.addEventListener("click",SCUT_interLending,false);
  3264. };
  3265. }
  3266. }
  3267.  
  3268. if(location.href.indexOf('lib.gzhu.edu.cn:8080/bookle/search2/detail')!=-1&&prefs.school!="GZHU"){//广州大学
  3269. var rentTable=document.getElementsByClassName("book_holding")[0];
  3270.  
  3271. function GZHU_interLending(){
  3272. var infoTable=document.getElementsByClassName("book_detail")[0];
  3273.  
  3274. var bookIndex=infoTable.rows[5].cells[1].textContent;
  3275. var publisher = infoTable.rows[0].cells[1].textContent;
  3276.  
  3277. var pubDate = publisher.match(/\d+/);
  3278. pubDate=pubDate.toString();
  3279. publisher=publisher.slice(0,publisher.indexOf(pubDate)-1);
  3280. var title=document.getElementsByTagName("title")[0].textContent.slice(13,-1);
  3281. var author=infoTable.rows[1].cells[1].textContent.replace(/\n/g,"").replace(/ /g,"");
  3282. //alert(publisher+bookIndex+pubDate+title);
  3283. GM_setValue("doubanTitle",title);
  3284. if(pubDate) GM_setValue("doubanPubdate",pubDate.toString());
  3285. GM_setValue("doubanPublisher",publisher);
  3286. GM_setValue("doubanAuthor",author);
  3287. //GM_setValue("bookIndex",bookIndex);
  3288. GM_setValue("rentSchool","gzhu");
  3289. GM_setValue("gotoRent",true);
  3290. GM_setValue("doubanTitle",title);
  3291. //GM_setValue("doubanIsbn",bookisbn);
  3292. GM_openInTab("http://www.gdtgw.cn:8080/#.html");
  3293. }
  3294.  
  3295. for (var s = 1; s < rentTable.rows.length; s++) {
  3296.  
  3297. var recbtn=document.createElement("a");
  3298. recbtn.setAttribute("class","recbtn");
  3299. recbtn.innerHTML="十校互借";
  3300. var btncell=rentTable.rows[s].cells[6];
  3301. btncell.appendChild(recbtn);
  3302. recbtn.addEventListener("click",GZHU_interLending,false);
  3303. };
  3304. }
  3305.  
  3306. if(location.href.indexOf('http://210.38.102.131:86/opac/item.php?marc_no=')!=-1&&prefs.school!="GZHTCM"){//广中医
  3307. var rentTable=document.getElementById("item");
  3308.  
  3309. function GZHTCM_interLending(){
  3310.  
  3311. var infoTable=document.getElementsByClassName("booklist");
  3312.  
  3313. var bookIndex=this.parentNode.parentNode.cells[0].textContent;
  3314. var publisher =infoTable[1].getElementsByTagName("dd")[0].textContent;
  3315. var pubDate = publisher.match(/\d+/);
  3316. pubDate=pubDate.toString();
  3317. var ISBN=infoTable[2].getElementsByTagName("dd")[0].textContent.match(/(\d|-)+/);
  3318. ISBN=ISBN[0];
  3319. publisher=publisher.slice(0,publisher.indexOf(pubDate)-1);
  3320. var title=document.getElementsByTagName("title")[0].textContent;
  3321. var author=infoTable[0].getElementsByTagName("dd")[0].textContent;
  3322. author = author.slice(author.indexOf('/')+1)
  3323.  
  3324. GM_setValue("doubanTitle",title);
  3325. GM_setValue("doubanIsbn",ISBN);
  3326. GM_setValue("doubanPubdate",pubDate);
  3327. GM_setValue("doubanPublisher",publisher);
  3328. GM_setValue("doubanAuthor",author);
  3329. GM_setValue("bookIndex",bookIndex);
  3330. GM_setValue("rentSchool","gzhtcm");
  3331. GM_setValue("gotoRent",true);
  3332. GM_openInTab("http://www.gdtgw.cn:8080/#.html");
  3333. }
  3334.  
  3335. for (var s = 1; s < rentTable.rows.length; s++) {
  3336.  
  3337. var recbtn=document.createElement("a");
  3338. recbtn.setAttribute("class","recbtn");
  3339. recbtn.innerHTML="十校互借";
  3340. var btncell=rentTable.rows[s].cells[2];
  3341. btncell.appendChild(recbtn);
  3342. recbtn.addEventListener("click",GZHTCM_interLending,false);
  3343. };
  3344. }
  3345.  
  3346. if(location.href.indexOf('http://202.116.41.246:8080/opac/item.php?marc_no=')!=-1&&prefs.school!="SCNU"){//华师
  3347. var rentTable=document.getElementById("item");
  3348.  
  3349. function SCNU_interLending(){
  3350.  
  3351. var infoTable=document.getElementsByClassName("booklist");
  3352. var bookIndex=this.parentNode.parentNode.cells[0].textContent;
  3353. var publisher =infoTable[1].getElementsByTagName("dd")[0].textContent;
  3354. var pubDate = publisher.match(/\d+/);
  3355. pubDate=pubDate.toString()
  3356. var ISBN=infoTable[2].getElementsByTagName("dd")[0].textContent.match(/(\d|-)+/);
  3357. ISBN=ISBN[0];
  3358. publisher=publisher.slice(0,publisher.indexOf(pubDate)-1);
  3359. var title=document.getElementsByTagName("title")[0].textContent;
  3360. var author=infoTable[0].getElementsByTagName("dd")[0].textContent;
  3361. author = author.slice(author.indexOf('/')+1)
  3362. //alert(publisher+bookIndex+pubDate+title);
  3363. GM_setValue("doubanTitle",title);
  3364. GM_setValue("doubanIsbn",ISBN);
  3365. //alert(GM_getValue("doubanIsbn"));
  3366. GM_setValue("doubanPubdate",pubDate);
  3367. GM_setValue("doubanPublisher",publisher);
  3368. GM_setValue("doubanAuthor",author);
  3369. GM_setValue("bookIndex",bookIndex);
  3370. GM_setValue("rentSchool","scnu");
  3371. GM_setValue("gotoRent",true);
  3372. GM_openInTab("http://www.gdtgw.cn:8080/#.html");
  3373. }
  3374.  
  3375. for (var s = 1; s < rentTable.rows.length; s++) {
  3376. var recbtn=document.createElement("a");
  3377. recbtn.setAttribute("class","recbtn");
  3378. recbtn.innerHTML="十校互借";
  3379. var btncell=rentTable.rows[s].cells[2];
  3380. btncell.appendChild(recbtn);
  3381. recbtn.addEventListener("click",SCNU_interLending,false);
  3382. };
  3383. }
  3384.  
  3385. if(location.href.indexOf('http://222.200.98.171:81/bookinfo.aspx?ctrlno=')!=-1&&prefs.school!="GDUT"){//广东工业大学
  3386. var rentTable=document.getElementById("bardiv").getElementsByTagName("table")[0];
  3387.  
  3388. function GDUT_interLending(){
  3389.  
  3390. var infoTable=document.getElementById("ctl00_ContentPlaceHolder1_bookcardinfolbl");
  3391.  
  3392. var bookIndex=this.parentNode.parentNode.cells[1].textContent;
  3393. var publisher =infoTable.getElementsByTagName("a")[0].innerHTML;
  3394. if(pubDate = infoTable.textContent.match(/\d+\.?\d*/)) pubDate=pubDate.toString();
  3395. var ISBN=infoTable.textContent.replace(/\n/g,"").match(/ISBN(\d|-)+/)[0];
  3396.  
  3397. ISBN=ISBN.slice(4)
  3398. var title=infoTable.textContent.slice(0,infoTable.textContent.indexOf("/")).replace(/ +/g,"");
  3399. var author=infoTable.textContent.slice(infoTable.textContent.indexOf("/")+1,infoTable.textContent.indexOf("—")-1);
  3400.  
  3401. GM_setValue("doubanTitle",title);
  3402. GM_setValue("doubanIsbn",ISBN);
  3403. GM_setValue("doubanPubdate",pubDate);
  3404. GM_setValue("doubanPublisher",publisher);
  3405. GM_setValue("doubanAuthor",author);
  3406. GM_setValue("bookIndex",bookIndex);
  3407. GM_setValue("rentSchool","gdut");
  3408. GM_setValue("gotoRent",true);
  3409. GM_setValue("doubanTitle",title);
  3410. GM_openInTab("http://www.gdtgw.cn:8080/#.html");
  3411. }
  3412.  
  3413. for (var s = 1; s < rentTable.rows.length; s++) {
  3414.  
  3415. var recbtn=document.createElement("a");
  3416. recbtn.setAttribute("class","recbtn");
  3417. recbtn.innerHTML="十校互借";
  3418. var btncell=rentTable.rows[s].cells[6];
  3419. btncell.appendChild(recbtn);
  3420. recbtn.addEventListener("click",GDUT_interLending,false);
  3421. };
  3422. }
  3423.  
  3424. if(location.href.indexOf('http://121.33.246.167/opac/bookinfo.aspx?ctrlno=')!=-1&&prefs.school!="GZARTS"){//广州美术学院
  3425. var rentTable=document.getElementById("bardiv").getElementsByTagName("table")[0];
  3426.  
  3427. function GZARTS_interLending(){
  3428.  
  3429. var infoTable=document.getElementById("ctl00_ContentPlaceHolder1_bookcardinfolbl");
  3430. //alert(infoTable.textContent);
  3431.  
  3432. var bookIndex=this.parentNode.parentNode.cells[1].textContent;
  3433. var publisher =infoTable.getElementsByTagName("a")[0].innerHTML;
  3434. if(pubDate = infoTable.textContent.match(/\d+\.?\d*/)) pubDate=pubDate.toString();
  3435. var ISBN=infoTable.textContent.replace(/\n/g,"").match(/ISBN(\d|-)+/)[0];
  3436.  
  3437. ISBN=ISBN.slice(4)
  3438. var title=infoTable.textContent.slice(0,infoTable.textContent.indexOf("/")).replace(/ +/g,"");
  3439. var author=infoTable.textContent.slice(infoTable.textContent.indexOf("/")+1,infoTable.textContent.indexOf("—")-1);
  3440.  
  3441. GM_setValue("doubanTitle",title);
  3442. GM_setValue("doubanIsbn",ISBN);
  3443. GM_setValue("doubanPubdate",pubDate);
  3444. GM_setValue("doubanPublisher",publisher);
  3445. GM_setValue("doubanAuthor",author);
  3446. GM_setValue("bookIndex",bookIndex);
  3447. GM_setValue("rentSchool","gzarts");
  3448. GM_setValue("gotoRent",true);
  3449. GM_setValue("doubanTitle",title);
  3450. GM_openInTab("http://www.gdtgw.cn:8080/#.html");
  3451. }
  3452.  
  3453. //alert(rentTable.textContent);
  3454. for (var s = 1; s < rentTable.rows.length; s++) {
  3455. //let bookIndex=rentTable.rows[s].cells[5].textContent;
  3456. var recbtn=document.createElement("a");
  3457. recbtn.setAttribute("class","recbtn");
  3458. recbtn.innerHTML="十校互借";
  3459. var btncell=rentTable.rows[s].cells[6];
  3460. btncell.appendChild(recbtn);
  3461. recbtn.addEventListener("click",GZARTS_interLending,false);
  3462. };
  3463. }
  3464.  
  3465. if(location.href.indexOf('http://218.192.148.33:81/bookinfo.aspx?ctrlno=')!=-1&&prefs.school!="XHCOM"){//星海音乐学院
  3466. var rentTable=document.getElementById("bardiv").getElementsByTagName("table")[0];
  3467.  
  3468. function XHCOM_interLending(){
  3469.  
  3470. var infoTable=document.getElementById("ctl00_ContentPlaceHolder1_bookcardinfolbl");
  3471. var bookIndex=this.parentNode.parentNode.cells[1].textContent;
  3472. var publisher =infoTable.getElementsByTagName("a")[0].innerHTML;
  3473. if(pubDate = infoTable.textContent.match(/\d+\.?\d*/)) pubDate=pubDate.toString();
  3474. var ISBN=infoTable.textContent.replace(/\n/g,"").match(/ISBN(\d|-)+/)[0];
  3475.  
  3476. ISBN=ISBN.slice(4)
  3477. var title=infoTable.textContent.slice(0,infoTable.textContent.indexOf("/")).replace(/ +/g,"");
  3478. var author=infoTable.textContent.slice(infoTable.textContent.indexOf("/")+1,infoTable.textContent.indexOf("—")-1);
  3479.  
  3480. GM_setValue("doubanTitle",title);
  3481. GM_setValue("doubanIsbn",ISBN);
  3482. GM_setValue("doubanPubdate",pubDate);
  3483. GM_setValue("doubanPublisher",publisher);
  3484. GM_setValue("doubanAuthor",author);
  3485. GM_setValue("bookIndex",bookIndex);
  3486. GM_setValue("rentSchool","xhcm");
  3487. GM_setValue("gotoRent",true);
  3488. GM_setValue("doubanTitle",title);
  3489. GM_openInTab("http://www.gdtgw.cn:8080/#.html");
  3490. }
  3491.  
  3492. for (var s = 1; s < rentTable.rows.length; s++) {
  3493. //let bookIndex=rentTable.rows[s].cells[5].textContent;
  3494. var recbtn=document.createElement("a");
  3495. recbtn.setAttribute("class","recbtn");
  3496. recbtn.innerHTML="十校互借";
  3497. var btncell=rentTable.rows[s].cells[6];
  3498. btncell.appendChild(recbtn);
  3499. recbtn.addEventListener("click",XHCOM_interLending,false);
  3500. };
  3501. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址