From 7229fb4ad7a548b59320b85ba18aa0cf000f54ad Mon Sep 17 00:00:00 2001 From: Nick White Date: Fri, 23 Oct 2009 01:46:10 +0100 Subject: Cleaned up output, formatted for easy including Removed toolbar Removed footer Removed style Removed body function, so executed on loading --- js/readability.js | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'js') 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 = 'Reload Original Page' + - 'Print Page' + - 'Email Page'; - // 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 = '
Follow us on Twitter »
' + readabilityVersion + '
'; - 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 +} -- cgit v1.2.3