Readability integration - first draft
[quicknewsreader] / qml / QuickNewsReader / content / js / Readability.js
index d0fd4f7..b7d6e03 100644 (file)
@@ -1,9 +1,9 @@
 /*jslint undef: true, nomen: true, eqeqeq: true, plusplus: true, newcap: true, immed: true, browser: true, devel: true, passfail: false */
 /*global window: false, readConvertLinksToFootnotes: false, readStyle: false, readSize: false, readMargin: false, Typekit: false, ActiveXObject: false */
 
-var dbg = (typeof console !== 'undefined') ? function(s) {
-    console.log("Readability: " + s);
-} : function() {};
+var dbg = function(s) {
+    window.console.log("Readability: " + s);
+};
 
 /*
  * Readability. An Arc90 Lab Experiment. 
@@ -88,7 +88,7 @@ var readability = {
 
         /* Pull out any possible next page link first */
         var nextPageLink = readability.findNextPageLink(document.body);
-        
+
         readability.prepDocument();
 
         /* Build readability's DOM tree */
@@ -1411,12 +1411,12 @@ var readability = {
             articlePage.innerHTML = articlePage.innerHTML + nextPageMarkup;
             return;
         }
-        
+
         /**
          * Now that we've built the article page DOM element, get the page content
          * asynchronously and load the cleaned content into the div we created for it.
         **/
-        (function(pageUrl, thisPage) {
+        var replaceContent = function(pageUrl, thisPage) {
             readability.ajax(pageUrl, {
                 success: function(r) {
 
@@ -1500,7 +1500,7 @@ var readability = {
                     }
                 }
             });
-        }(nextPageLink, articlePage));
+        }(nextPageLink, articlePage);
     },
     
     /**