Commits

Anton Afanasyev  committed 80415dd Merge

Merge with extended

  • Participants
  • Parent commits 3752295, 9592a99
  • Branches backwards-load

Comments (0)

Files changed (1)

File autopagerize.user.js

     error: '#f0f'
 }
 var SITEINFO = [
-    {
-            url:            'http://blogs.msdn.com/b/.*',
-            nextLink:       '//a[@title="Next page"]',
-            pageElements:   function(doc)
-                            {
-                                var elems = getElementsByXPath('//div[@class="wp-pagenavi"]/../../../preceding-sibling::tr[1]', doc);
-                                return elems;
-                                var els=[];
-                                if(elems)
-                                {
-                                    for(var i=1; i<elems.length-1; i++)
-                                    {
-                                        els.push(elems[i]);
-                                    }
-                                }
-                                return els;
-                            },
-            noCues:         true,
-            remainHeight:   600,
-    },
 ];
 var MICROFORMAT = {
     url:          '.*',
 AutoPager.prototype.getPageElements = function(doc) {
     doc = doc || document;
     var elems;
-    if(this.info.pageElement)
-        elems = getElementsByXPath(this.info.pageElement, doc);
 
-    if(!elems && this.info.pageElements)
-        elems = this.info.pageElements(doc);
+    var f = this.info.pageElement;
+    if( typeof( f ) == 'function' )
+        elems = f( doc );
+    else
+        elems = getElementsByXPath( f, doc );
     
     return elems;
 }
 AutoPager.prototype.getPageCount = function( doc ) {
     if ( !this.info.getPgCount )
         return undefined;
-    return getValueFromFuncOrXPath( this.info.getPgCount, doc );
+    return parseInt( getValueFromFuncOrXPath( this.info.getPgCount, doc ) );
 }
 
 AutoPager.prototype.initPageNum = function() {