From 39c3d23a79705caa7441a3cce47ed26ff9d7599b Mon Sep 17 00:00:00 2001 From: JJfutbol Date: Thu, 9 Jul 2009 01:51:25 +0000 Subject: - updated css, deployed readability on lab.arc90.com had some changes not included - added user font size and family styles to print css - added twitter link to index page and styles to css - updated readability-start.js to now use a dynamic lookup of the baseHref - added check for console object, creates blank object if not defined - this way we can hold onto the current debugging for now safely git-svn-id: http://arc90labs-readability.googlecode.com/svn/trunk@60 d4e419ec-0920-11de-bbfd-a7c1bc4c261e --- js/readability-start.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'js/readability-start.js') 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(){ -- cgit v1.2.3