From 2d9a06c6b02ef0f9386d43cbdb722ce868cb6205 Mon Sep 17 00:00:00 2001 From: umbrae Date: Thu, 5 Mar 2009 20:48:20 +0000 Subject: Making readability localized git-svn-id: http://arc90labs-readability.googlecode.com/svn/trunk@5 d4e419ec-0920-11de-bbfd-a7c1bc4c261e --- css/readability.css | 2 +- js/readability-0.1.js | 2 +- js/readability-start.js | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/css/readability.css b/css/readability.css index 04296f9..524e1c0 100755 --- a/css/readability.css +++ b/css/readability.css @@ -57,7 +57,7 @@ #readFooter { display: block; border-top: 1px solid #333; - height: 360px : + height: 360px; margin-bottom: 260px; text-align: center; } diff --git a/js/readability-0.1.js b/js/readability-0.1.js index 5b153df..d1a2ccb 100755 --- a/js/readability-0.1.js +++ b/js/readability-0.1.js @@ -51,7 +51,7 @@ 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("arc90.com/experiments/readability") == -1) { + if (document.styleSheets[k].href != null && document.styleSheets[k].href.lastIndexOf("readability") == -1) { document.styleSheets[k].disabled = true; } } diff --git a/js/readability-start.js b/js/readability-start.js index 9536386..834984e 100755 --- a/js/readability-start.js +++ b/js/readability-start.js @@ -2,9 +2,11 @@ var style = "style-newspaper"; var size = "size-large"; var margin = "margin-wide"; +var baseHref = window.location.toString().match(/.*\//); + var linkStringStart = "javascript:(function(){"; -var linkStringEnd = "';_readability_script=document.createElement('SCRIPT');_readability_script.type='text/javascript';_readability_script.src='http://lab.arc90.com/experiments/readability/js/readability-0.1.js?x='+(Math.random());document.getElementsByTagName('head')[0].appendChild(_readability_script);_readability_css=document.createElement('LINK');_readability_css.rel='stylesheet';_readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';_readability_css.type='text/css';document.getElementsByTagName('head')[0].appendChild(_readability_css);_readability_print_css=document.createElement('LINK');_readability_print_css.rel='stylesheet';_readability_print_css.href='http://lab.arc90.com/experiments/readability/css/readability-print.css';_readability_print_css.media='print';_readability_print_css.type='text/css';document.getElementsByTagName('head')[0].appendChild(_readability_print_css);})();"; +var linkStringEnd = "';_readability_script=document.createElement('SCRIPT');_readability_script.type='text/javascript';_readability_script.src='" + baseHref + "js/readability-0.1.js?x='+(Math.random());document.getElementsByTagName('head')[0].appendChild(_readability_script);_readability_css=document.createElement('LINK');_readability_css.rel='stylesheet';_readability_css.href='" + baseHref + "css/readability.css';_readability_css.type='text/css';_readability_css.media='screen';document.getElementsByTagName('head')[0].appendChild(_readability_css);_readability_print_css=document.createElement('LINK');_readability_print_css.rel='stylesheet';_readability_print_css.href='" + baseHref + "css/readability-print.css';_readability_print_css.media='print';_readability_print_css.type='text/css';document.getElementsByTagName('head')[0].appendChild(_readability_print_css);})();"; $(document).ready(function() { -- cgit v1.2.3