diff options
author | davehauenstein <davehauenstein@d4e419ec-0920-11de-bbfd-a7c1bc4c261e> | 2009-04-17 20:41:52 +0000 |
---|---|---|
committer | davehauenstein <davehauenstein@d4e419ec-0920-11de-bbfd-a7c1bc4c261e> | 2009-04-17 20:41:52 +0000 |
commit | d50002c3b430b192e1ecec4126bf31f13cd6e5f6 (patch) | |
tree | d7edaa9a0089258545e93b393412ddff3e6a9e16 /js/es | |
parent | 023a90eba43c51519943f58724fa51d373a1974d (diff) | |
download | readability-simple-d50002c3b430b192e1ecec4126bf31f13cd6e5f6.tar.bz2 readability-simple-d50002c3b430b192e1ecec4126bf31f13cd6e5f6.zip |
added aditional files for spanish support, added redirect if coming from a spanish language preferred browser
git-svn-id: http://arc90labs-readability.googlecode.com/svn/trunk@35 d4e419ec-0920-11de-bbfd-a7c1bc4c261e
Diffstat (limited to 'js/es')
-rw-r--r-- | js/es/readability-start.js | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/js/es/readability-start.js b/js/es/readability-start.js new file mode 100644 index 0000000..8183527 --- /dev/null +++ b/js/es/readability-start.js @@ -0,0 +1,50 @@ +var style = "style-newspaper";
+var size = "size-large";
+var margin = "margin-wide";
+
+
+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.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);})();";
+
+$(document).ready(function() {
+
+ $("#bookmarkletLink").attr("href", linkStringStart + "readStyle='" + style + "';readSize='" + size + "';readMargin='" + margin + linkStringEnd);
+
+ function applyChange(s,y) {
+ var example = document.getElementById("example");
+ var article = document.getElementById("articleContent");
+
+ switch(s){
+ case "style":
+ style = y;
+ break
+ case "size":
+ size = y;
+ break
+ case "margin":
+ margin = y;
+ break
+ }
+ example.className = style;
+ article.className = margin + " " + size;
+ $("#bookmarkletLink").attr("href", linkStringStart + "readStyle='" + style + "';readSize='" + size + "';readMargin='" + margin + linkStringEnd);
+ }
+
+ $("#settings input").bind("click", function(){
+ applyChange(this.name, this.value);
+ });
+ $("#settings input").bind("click", function(){
+ applyChange(this.name, this.value);
+ });
+ $("#bookmarkletLink").bind("click", function(){
+ if($.browser.msie){
+ alert("Para empezar a usar Readability, click derecho y selecciona 'Agrega a favoritos...' para guardar este link en la barra de marcadores de tu navegador.");
+ }
+ else {
+ alert("Para empezar a usar Readability, arrastra este link a la barra de marcadores de tu navegador.");
+ }
+ return false;
+ });
+
+});
+
|