diff options
Diffstat (limited to 'js')
-rwxr-xr-x | js/readability-0.1.js | 2 | ||||
-rwxr-xr-x | js/readability-start.js | 4 |
2 files changed, 4 insertions, 2 deletions
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() {
|