summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorumbrae <umbrae@d4e419ec-0920-11de-bbfd-a7c1bc4c261e>2009-03-10 21:23:05 +0000
committerumbrae <umbrae@d4e419ec-0920-11de-bbfd-a7c1bc4c261e>2009-03-10 21:23:05 +0000
commit9b01fdde97812e680c284539063e671ae778d2f8 (patch)
treec32541e9fe2d7a6c8be4b275c7a562bb01b1517d
parent014c69513f913fef6147a2c6664e17845724f3db (diff)
downloadreadability-simple-9b01fdde97812e680c284539063e671ae778d2f8.tar.bz2
readability-simple-9b01fdde97812e680c284539063e671ae778d2f8.zip
Committing broken code in case we ever need to come back to it.
git-svn-id: http://arc90labs-readability.googlecode.com/svn/trunk@23 d4e419ec-0920-11de-bbfd-a7c1bc4c261e
-rwxr-xr-xjs/readability.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/js/readability.js b/js/readability.js
index fe2e3bb..3f5dbb5 100755
--- a/js/readability.js
+++ b/js/readability.js
@@ -1,4 +1,5 @@
var readabilityVersion = "0.3";
+var readabilityRemovedStyles = [];
(function(){
var objOverlay = document.createElement("div");
@@ -39,10 +40,16 @@ function restoreDocument() {
document.styleSheets[k].disabled = (document.styleSheets[k].href.lastIndexOf("readability") != -1);
// Enable all style tags in head:
+ for(var styleIndex = 0; styleIndex < readabilityRemovedStyles.length; styleIndex++)
+ {
+ document.getElementsByTagName('head')[0].appendChild(readabilityRemovedStyles[styleIndex]);
+ }
+ /*
var styleTags = document.getElementsByTagName("style");
for (var j=0;j < styleTags.length; j++)
styleTags[j].disabled = false;
-
+ */
+
return false;
}
@@ -108,9 +115,14 @@ function grabArticle() {
// REMOVES ALL STYLESHEETS ...
for (var k=0;k < document.styleSheets.length; k++)
+ {
if (document.styleSheets[k].href != null && document.styleSheets[k].href.lastIndexOf("readability") == -1)
- document.styleSheets[k].disabled = true;
-
+ {
+ readabilityRemovedStyles.push(document.styleSheets[k].ownerNode);
+ document.styleSheets[k].ownerNode.parentNode.removeChild(document.styleSheets[k].ownerNode);
+ }
+ }
+
// Remove all style tags in head (not doing this on IE) :
var styleTags = document.getElementsByTagName("style");
for (var j=0;j < styleTags.length; j++)