summaryrefslogtreecommitdiff
path: root/js/readability-start.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/readability-start.js')
-rwxr-xr-xjs/readability-start.js21
1 files changed, 8 insertions, 13 deletions
diff --git a/js/readability-start.js b/js/readability-start.js
index 4263ab2..3d6d654 100755
--- a/js/readability-start.js
+++ b/js/readability-start.js
@@ -1,25 +1,24 @@
-var defaultMargin = "margin-wide";
-var defaultSize = "size-large";
-var defaultStyle = "style-newspaper";
+var margin = "margin-wide";
+var size = "size-large";
+var style = "style-newspaper";
var baseHref = window.location.toString().match(/.*\//);
var linkStart = "javascript:(function(){";
-var linkEnd = "var elements=document.getElementsByTagName('HEAD');var headElement;if(elements.length>=1){headElement=elements[0];}else{headElement=document.createElement('HEAD');document.documentElement.appendChild(headElement);}_readability_script=document.createElement('SCRIPT');_readability_script.type='text/javascript';_readability_script.src='" + basehref + "js/readability.js?x='+(Math.random());headElement.insertBefore(_readability_script,headElement.firstChild);_readability_css=document.createElement('LINK');_readability_css.rel='stylesheet';_readability_css.href='" + basehref + "css/readability.css';_readability_css.type='text/css';headElement.insertBefore(_readability_css,headElement.firstChild);_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';headElement.insertBefore(_readability_print_css,headElement.firstChild);})();";
+var linkEnd = "var elements=document.getElementsByTagName('HEAD');var headElement;if(elements.length>=1){headElement=elements[0];}else{headElement=document.createElement('HEAD');document.documentElement.appendChild(headElement);}_readability_script=document.createElement('SCRIPT');_readability_script.type='text/javascript';_readability_script.src='" + baseHref + "js/readability.js?x='+Math.random();headElement.insertBefore(_readability_script,headElement.firstChild);_readability_css=document.createElement('LINK');_readability_css.rel='stylesheet';_readability_css.href='" + baseHref + "css/readability.css';_readability_css.type='text/css';headElement.insertBefore(_readability_css,headElement.firstChild);_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';headElement.insertBefore(_readability_print_css,headElement.firstChild);})();";
$(document).ready(function()
{
- // load example with defaults
- applyChange("margin", defaultMargin);
- applyChange("size", defaultSize);
- applyChange("style", defaultStyle);
+ // load example with defaults at first
+ applyChange("margin", margin);
+ applyChange("size", size);
+ applyChange("style", style);
// helper that takes the user input and customizes the bookmarklet source
function applyChange(property, value)
{
var example = document.getElementById("example");
var article = document.getElementById("articleContent");
- var size, style, margin;
// determine the property that is being changed
switch (property)
@@ -49,10 +48,6 @@ $(document).ready(function()
applyChange(this.name, this.value);
});
- $("#settings input").bind("click", function(){
- applyChange(this.name, this.value);
- });
-
// the user needs to drag the bookmarklet link to their bookmarks bar, but
// if they don't notify them what to do (unique case for IE)
$("#bookmarkletLink").bind("click", function(){