diff options
author | Nick White <git@njw.me.uk> | 2009-10-23 01:46:10 +0100 |
---|---|---|
committer | Nick White <git@njw.me.uk> | 2009-10-23 01:46:10 +0100 |
commit | 7229fb4ad7a548b59320b85ba18aa0cf000f54ad (patch) | |
tree | bd14bc510f79b5737fdb63cd1c90f086684b59f8 /js | |
parent | 9368e2d8e179a6e2972e82678f9facb73a9f7f33 (diff) | |
download | readability-simple-7229fb4ad7a548b59320b85ba18aa0cf000f54ad.tar.bz2 readability-simple-7229fb4ad7a548b59320b85ba18aa0cf000f54ad.zip |
Cleaned up output, formatted for easy including
Removed toolbar
Removed footer
Removed style
Removed body function, so executed on loading
Diffstat (limited to 'js')
-rwxr-xr-x | js/readability.js | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/js/readability.js b/js/readability.js index 383dd0d..869fcad 100755 --- a/js/readability.js +++ b/js/readability.js @@ -14,7 +14,6 @@ if (typeof console == 'undefined') };
}
-(function(){
// some sites use plugins (jCarousel) that when Readability removes scripts
// or does something funky it causes an alert to appear every few seconds,
// to avoid this we'll override the alert and timer methods, we won't need
@@ -26,23 +25,10 @@ if (typeof console == 'undefined') var overlayContainer = document.createElement("DIV");
var articleTitle = document.createElement("H1");
var contentContainer = document.createElement("DIV");
- var articleFooter = document.createElement("DIV");
- var toolBar = document.createElement("DIV");
overlayContainer.id = "readOverlay";
contentContainer.id = "readInner";
- // apply user-selected styling
- document.body.className = readStyle;
- overlayContainer.className = readStyle;
- contentContainer.className = readMargin + " " + readSize;
-
- // set up the toolbar widget
- toolBar.id = "readTools";
- toolBar.innerHTML = '<a href="#" onclick="window.location.reload();return false;" title="Reload original page" id="reload-page">Reload Original Page</a>' +
- '<a href="#" onclick="javascript:window.print();return false;" title="Print page" id="print-page">Print Page</a>' +
- '<a href="#" onclick="emailBox();return false;" title="Email page" id="email-page">Email Page</a>';
-
// we'll use the page title as our title, unfortunately not all sites use
// this well, so we might want to consider say stripping an H1 tag
articleTitle.innerHTML = document.title;
@@ -51,13 +37,7 @@ if (typeof console == 'undefined') // parse the article content and add it to the new content container
contentContainer.appendChild(parseContent());
- // add the footer and contents
- articleFooter.id = "readFooter";
- articleFooter.innerHTML = '<div><a href="http://lab.arc90.com/experiments/readability/"><img src="http://lab.arc90.com/experiments/readability/images/footer-readability.png" width="201" height="66" /></a><a href="http://www.arc90.com/"><img src="http://lab.arc90.com/experiments/readability/images/footer-arc90.png" width="108" height="66" /></a></div><div><a href="http://www.twitter.com/arc90" class="footer-twitterLink">Follow us on Twitter »</a></div><div id="readability-version">' + readabilityVersion + '</div>';
- contentContainer.appendChild(articleFooter);
-
// add the toolbar and then the conent container to our body
- overlayContainer.appendChild(toolBar);
overlayContainer.appendChild(contentContainer);
// for totally hosed HTML, add body node that can"t be found because of bad HTML or something
@@ -69,7 +49,6 @@ if (typeof console == 'undefined') // with all previous body content removed, add our new overlay/main container
document.body.insertBefore(overlayContainer, document.body.firstChild);
-})();
function determineContentScore(score, parent, element)
@@ -761,4 +740,4 @@ function removeStylesheets() function trim(text)
{
return (text || "").replace(/^\s+|\s+$/g, "");
-}
\ No newline at end of file +}
|