summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorumbrae <umbrae@d4e419ec-0920-11de-bbfd-a7c1bc4c261e>2009-03-10 20:41:26 +0000
committerumbrae <umbrae@d4e419ec-0920-11de-bbfd-a7c1bc4c261e>2009-03-10 20:41:26 +0000
commit014c69513f913fef6147a2c6664e17845724f3db (patch)
tree70a35f937300f99038524c016f98dc23480f2df8
parent595106078a7475afe2cfdcefe385aaf79e7e1565 (diff)
downloadreadability-simple-014c69513f913fef6147a2c6664e17845724f3db.tar.bz2
readability-simple-014c69513f913fef6147a2c6664e17845724f3db.zip
Make sure we only initialize body's readability object once.
git-svn-id: http://arc90labs-readability.googlecode.com/svn/trunk@22 d4e419ec-0920-11de-bbfd-a7c1bc4c261e
-rwxr-xr-xjs/readability.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/js/readability.js b/js/readability.js
index 64abcdc..fe2e3bb 100755
--- a/js/readability.js
+++ b/js/readability.js
@@ -7,7 +7,9 @@ var readabilityVersion = "0.3";
objOverlay.id = "readOverlay";
objinnerDiv.id = "readInner";
- document.body.readability = {"contentScore": 0, originalHTML: document.body.innerHTML.toString()};
+ // If we've already called readability once, leave the original content there.
+ if(typeof document.body.readability == 'undefined')
+ document.body.readability = {"contentScore": 0, originalHTML: document.body.innerHTML.toString()};
// Apply user-selected styling:
document.body.className = readStyle;