Show
Ignore:
Timestamp:
11/26/08 00:13:49 (6 weeks ago)
Author:
drry
Message:
  • fixed regexes for the SITEINFO.
  • et cetera.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/opera-userjs/oAutoPagerize.js

    r24798 r24869  
    22// @name           oAutoPagerize 
    33// @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). 
    55// @checkurl       http://svn.coderepos.org/share/lang/javascript/opera-userjs/oAutoPagerize.js 
    66// @include        http://* 
     
    1818// thanks to ma.la. 
    1919// 
    20 // Released under the GPL license 
     20// Released under the GPLv3 
    2121// http://www.gnu.org/copyleft/gpl.html 
    2222// 
     
    5454        var URL = 'http://d.hatena.ne.jp/os0x/searchdiary?word=%2a%5boAutoPagerize%5d'; 
    5555        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'; 
    5757        var AUTO_START = Set.AUTO_START || true; 
    5858        //var CACHE_EXPIRE = 24 * 60 * 60 * 1000; 
     
    9797                /* 
    9898                { 
    99                          url:         'http://twitter\\.com/.*' 
     99                         url:         'https?://(?:explore\\.)?twitter\\.com/' 
    100100                        ,nextLink:    '//div[@class="pagination"]/a[last()]' 
    101101                        ,incremental: { 
     
    109109                */ 
    110110                { 
    111                          url:         'http://m\\.twitter\\.com/.*' 
     111                         url:         'http://m\\.twitter\\.com/' 
    112112                        ,nextLink:    '//h:a[@accesskey="6"]' 
    113113                        ,pageElement: '//h:body/h:ul/h:li' 
     
    115115                }, 
    116116                { 
    117                         url:          'http://images\\.google\\..+/images\\?.+' 
     117                        url:          'http://images\\.google\\.(?:[^.]+\\.)?[^./]+/images\\?.' 
    118118                        ,nextLink:    'id("nn")/parent::a' 
    119119                        ,pageElement: '//table[tbody/tr/td/a[starts-with(@href, "/imgres")]]' 
     
    121121                } 
    122122                ,{ 
    123                         url:           'http://eow\\.alc\\.co\\.jp/.*?/.*?/' 
     123                        url:           'http://eow\\.alc\\.co\\.jp/[^/]+' 
    124124                        ,nextLink:     'id("AutoPagerizeNextLink")' 
    125125                        ,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' 
    127127                } 
    128128        ]); 
     
    169169        } 
    170170        var miscellaneous = []; 
    171         if (/^http:\/\/images\.google\..+\/images\?.+/.test(locationHref)) { 
     171        if (/^http:\/\/images\.google\.(?:[^.]+\.)?[^.\/]+\/images\?./.test(locationHref)) { 
    172172                miscellaneous.push(function(){ 
    173173                        //via http://furyu.tea-nifty.com/annex/2008/04/autopagerizeaut_c163.html 
     
    176176                        if (n) n.href = n.href.replace(/(\?)gbv=2&|&gbv=2(&?)/,'$1$2') + '&gbv=1'; 
    177177                        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(); 
    179179                                // for delete cookie(PREF= .. GBV=1 ..) 
    180180                        },100); 
     
    188188                        a.id = 'AutoPagerizeNextLink'; 
    189189                        a.href = a.href.replace(/javascript:goPage\("(\d+)"\)/,'./?pg=$1'); 
    190                 } 
     190                }; 
    191191                miscellaneous.push(function(){ 
    192192                        alc(document); 
     
    312312                                document.body.appendChild(helpBack); 
    313313                                helpBack.addEventListener('mouseover', function(e){ 
    314                                         if(e.target == helpBack) { 
     314                                        if (e.target == helpBack) { 
    315315                                                helpBack.style.display = 'none'; 
    316316                                        } 
     
    328328                                        setTimeout(function(){ 
    329329                                                self.checkRemain(); 
    330                                                 self.wait=false; 
     330                                                self.wait = false; 
    331331                                        },500); 
    332332                                } 
     
    372372                                try { 
    373373                                        var x = new XMLHttpRequest(); 
    374                                         x.onreadystatechange=function() { 
     374                                        x.onreadystatechange = function() { 
    375375                                                if (x.readyState == 4) { 
    376376                                                        if (x.status <= 200 && x.status < 300) { 
     
    400400                                this.removeIframe = function(){ 
    401401                                        document.body.removeChild(iframe); 
    402                                 } 
     402                                }; 
    403403                                this._frameLoad = function(){ 
    404404                                        self.frameLoad.call(self,iframe); 
    405                                 } 
     405                                }; 
    406406                                iframe.width = 1; 
    407407                                iframe.height = 1; 
     
    437437                                        var pages = getElementsByXPath(this.info.pageElement, htmlDoc); 
    438438                                        var url = this.getNextURL(this.info.nextLink, htmlDoc); 
    439                                         if(!!this.info.incremental){ 
     439                                        if (!!this.info.incremental) { 
    440440                                                var exp = new RegExp(this.info.incremental.nextMatch,'i'); 
    441441                                                var _m = this.info.incremental.nextLink; 
     
    556556                                        i.target = TARGET_WINDOW_NAME; 
    557557                                }); 
    558                         } 
     558                        }; 
    559559                        AutoPager.documentFilters.push(setTargetBlank); 
    560560                } 
     
    573573                                        } 
    574574                                        nlist.push(_item); 
    575                                 } catch (e){ 
     575                                } catch (e) { 
    576576                                        debug(e.description,_item); 
    577577                                } 
     
    606606                                } 
    607607                        }); 
    608                 } 
     608                }; 
    609609 
    610610                // initialize 
     
    658658 
    659659                function debug(message, siteinfo) { 
    660                         if(!DebugMode) return; 
     660                        if (!DebugMode) return; 
    661661                        var params = (function(site){ 
    662662                                var p = []; 
    663                                 for (var k in site){ 
     663                                for (var k in site) { 
    664664                                        if (k == 'data') { 
    665665                                                var data = site[k]; 
    666                                                 for (var j in data){ 
     666                                                for (var j in data) { 
    667667                                                        p.push(j+'='+data[j]); 
    668668                                                } 
     
    679679 
    680680                function log() { 
    681                         if(!DebugMode) return; 
     681                        if (!DebugMode) return; 
    682682                        if (window.opera && window.opera.postError) { 
    683683                                window.opera.postError(arguments); 
    684                         } else if (window.console){ 
     684                        } else if (window.console) { 
    685685                                console.log(arguments); 
    686686                        }