Changeset 24869 for lang/javascript/opera-userjs
- Timestamp:
- 11/26/08 00:13:49 (6 weeks ago)
- Files:
-
- 1 modified
-
lang/javascript/opera-userjs/oAutoPagerize.js (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/opera-userjs/oAutoPagerize.js
r24798 r24869 2 2 // @name oAutoPagerize 3 3 // @namespace http://ss-o.net/ 4 // @description loading next page and inserting into current page. oAutoPagerize Support for Opera 9.50, GreaseKit(Safari/WebKit) and Greasemetal(Google Chrome).4 // @description loading next page and inserting into current page. oAutoPagerize supports for Opera 9.62, GreaseKit(Safari/WebKit) and Greasemetal(Google Chrome). 5 5 // @checkurl http://svn.coderepos.org/share/lang/javascript/opera-userjs/oAutoPagerize.js 6 6 // @include http://* … … 18 18 // thanks to ma.la. 19 19 // 20 // Released under the GPL license20 // Released under the GPLv3 21 21 // http://www.gnu.org/copyleft/gpl.html 22 22 // … … 54 54 var URL = 'http://d.hatena.ne.jp/os0x/searchdiary?word=%2a%5boAutoPagerize%5d'; 55 55 var UPDATE_URL = window.opera ? 'http://ss-o.net/userjs/0AutoPagerize.SITEINFO.js' : 'http://ss-o.net/userjs/0AutoPagerize.SITEINFO.user.js'; 56 var VERSION = '1.2. 1';56 var VERSION = '1.2.2'; 57 57 var AUTO_START = Set.AUTO_START || true; 58 58 //var CACHE_EXPIRE = 24 * 60 * 60 * 1000; … … 97 97 /* 98 98 { 99 url: 'http ://twitter\\.com/.*'99 url: 'https?://(?:explore\\.)?twitter\\.com/' 100 100 ,nextLink: '//div[@class="pagination"]/a[last()]' 101 101 ,incremental: { … … 109 109 */ 110 110 { 111 url: 'http://m\\.twitter\\.com/ .*'111 url: 'http://m\\.twitter\\.com/' 112 112 ,nextLink: '//h:a[@accesskey="6"]' 113 113 ,pageElement: '//h:body/h:ul/h:li' … … 115 115 }, 116 116 { 117 url: 'http://images\\.google\\. .+/images\\?.+'117 url: 'http://images\\.google\\.(?:[^.]+\\.)?[^./]+/images\\?.' 118 118 ,nextLink: 'id("nn")/parent::a' 119 119 ,pageElement: '//table[tbody/tr/td/a[starts-with(@href, "/imgres")]]' … … 121 121 } 122 122 ,{ 123 url: 'http://eow\\.alc\\.co\\.jp/ .*?/.*?/'123 url: 'http://eow\\.alc\\.co\\.jp/[^/]+' 124 124 ,nextLink: 'id("AutoPagerizeNextLink")' 125 125 ,pageElement: 'id("resultList")//ul' 126 ,exampleUrl: 'http://eow.alc.co.jp/ are/UTF-8/'126 ,exampleUrl: 'http://eow.alc.co.jp/%E3%81%82%E3%82%8C/UTF-8/ http://eow.alc.co.jp/are' 127 127 } 128 128 ]); … … 169 169 } 170 170 var miscellaneous = []; 171 if (/^http:\/\/images\.google\. .+\/images\?.+/.test(locationHref)) {171 if (/^http:\/\/images\.google\.(?:[^.]+\.)?[^.\/]+\/images\?./.test(locationHref)) { 172 172 miscellaneous.push(function(){ 173 173 //via http://furyu.tea-nifty.com/annex/2008/04/autopagerizeaut_c163.html … … 176 176 if (n) n.href = n.href.replace(/(\?)gbv=2&|&gbv=2(&?)/,'$1$2') + '&gbv=1'; 177 177 setTimeout(function(){ 178 new Image().src ='http://images.google.com/images?gbv=2&hl=ja&q=AutoPagerize?update='+(new Date()).getTime();178 new Image().src = 'http://images.google.com/images?gbv=2&hl=ja&q=AutoPagerize?update='+(new Date()).getTime(); 179 179 // for delete cookie(PREF= .. GBV=1 ..) 180 180 },100); … … 188 188 a.id = 'AutoPagerizeNextLink'; 189 189 a.href = a.href.replace(/javascript:goPage\("(\d+)"\)/,'./?pg=$1'); 190 } 190 }; 191 191 miscellaneous.push(function(){ 192 192 alc(document); … … 312 312 document.body.appendChild(helpBack); 313 313 helpBack.addEventListener('mouseover', function(e){ 314 if (e.target == helpBack) {314 if (e.target == helpBack) { 315 315 helpBack.style.display = 'none'; 316 316 } … … 328 328 setTimeout(function(){ 329 329 self.checkRemain(); 330 self.wait =false;330 self.wait = false; 331 331 },500); 332 332 } … … 372 372 try { 373 373 var x = new XMLHttpRequest(); 374 x.onreadystatechange =function() {374 x.onreadystatechange = function() { 375 375 if (x.readyState == 4) { 376 376 if (x.status <= 200 && x.status < 300) { … … 400 400 this.removeIframe = function(){ 401 401 document.body.removeChild(iframe); 402 } 402 }; 403 403 this._frameLoad = function(){ 404 404 self.frameLoad.call(self,iframe); 405 } 405 }; 406 406 iframe.width = 1; 407 407 iframe.height = 1; … … 437 437 var pages = getElementsByXPath(this.info.pageElement, htmlDoc); 438 438 var url = this.getNextURL(this.info.nextLink, htmlDoc); 439 if (!!this.info.incremental){439 if (!!this.info.incremental) { 440 440 var exp = new RegExp(this.info.incremental.nextMatch,'i'); 441 441 var _m = this.info.incremental.nextLink; … … 556 556 i.target = TARGET_WINDOW_NAME; 557 557 }); 558 } 558 }; 559 559 AutoPager.documentFilters.push(setTargetBlank); 560 560 } … … 573 573 } 574 574 nlist.push(_item); 575 } catch (e) {575 } catch (e) { 576 576 debug(e.description,_item); 577 577 } … … 606 606 } 607 607 }); 608 } 608 }; 609 609 610 610 // initialize … … 658 658 659 659 function debug(message, siteinfo) { 660 if (!DebugMode) return;660 if (!DebugMode) return; 661 661 var params = (function(site){ 662 662 var p = []; 663 for (var k in site) {663 for (var k in site) { 664 664 if (k == 'data') { 665 665 var data = site[k]; 666 for (var j in data) {666 for (var j in data) { 667 667 p.push(j+'='+data[j]); 668 668 } … … 679 679 680 680 function log() { 681 if (!DebugMode) return;681 if (!DebugMode) return; 682 682 if (window.opera && window.opera.postError) { 683 683 window.opera.postError(arguments); 684 } else if (window.console) {684 } else if (window.console) { 685 685 console.log(arguments); 686 686 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)