Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: third_party/readability/js/readability.js

Issue 167963003: Support for distilling prior pages in an article. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « components/dom_distiller/core/page_distiller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Local modifications to this file are described in the README.chromium 5 // Local modifications to this file are described in the README.chromium
6 // file. 6 // file.
7 7
8 var dbg = (typeof console !== 'undefined') ? function(s) { 8 var dbg = (typeof console !== 'undefined') ? function(s) {
9 console.log("Readability: " + s); 9 console.log("Readability: " + s);
10 } : function() {}; 10 } : function() {};
(...skipping 1726 matching lines...) Expand 10 before | Expand all | Expand 10 after
1737 } 1737 }
1738 }; 1738 };
1739 1739
1740 // Extracts long-form content from a page and returns and array where the first 1740 // Extracts long-form content from a page and returns and array where the first
1741 // element is the article title, the second element is HTML containing the 1741 // element is the article title, the second element is HTML containing the
1742 // long-form content, and remaining elements are URLs for images referenced by 1742 // long-form content, and remaining elements are URLs for images referenced by
1743 // that HTML. Each <img> tag in the HTML has an id field set to k - 2, which 1743 // that HTML. Each <img> tag in the HTML has an id field set to k - 2, which
1744 // corresponds to a URL listed at index k in the array returned. 1744 // corresponds to a URL listed at index k in the array returned.
1745 (function () { 1745 (function () {
1746 readability.init(); 1746 readability.init();
1747 var result = new Array(3); 1747 var result = new Array(4);
1748 result[0] = readability.getArticleTitle(); 1748 result[0] = readability.getArticleTitle();
1749 result[1] = readability.getDistilledArticleHTML(); 1749 result[1] = readability.getDistilledArticleHTML();
1750 result[2] = readability.getNextPageLink(); 1750 result[2] = readability.getNextPageLink();
1751 // TODO(shashishekhar): Add actual previous page link here.
1752 result[3] = '';
1751 return result.concat(readability.getImages()); 1753 return result.concat(readability.getImages());
1752 }()) 1754 }())
1753 1755
OLDNEW
« no previous file with comments | « components/dom_distiller/core/page_distiller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698