Created
September 10, 2009 07:55
-
-
Save hail2u/184401 to your computer and use it in GitHub Desktop.
Revisions
-
hail2u revised this gist
Nov 6, 2009 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ (function () { function addLink (d) { Array.forEach(d.getElementsByTagName("a"), function (a) { if (a.href.match(/\.(pdf|ppt|tiff?)$/i) && !a.href.match(/docs\.google\.com/) && !a.href.match(/q=related:/i)) { var gdico = document.createElement("img"); gdico.setAttribute("src", "http://docs.google.com/favicon.ico"); gdico.setAttribute("style", "border:none;"); -
hail2u revised this gist
Nov 6, 2009 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,8 @@ // @name View PDF/PPT/TIFF with Google Document Viewer // @namespace http://hail2u.net/ // @description Insert a Google Docs icon for viewing PDF/PPT/TIFF with Google Document Viewer. // @include http://* // @include https://* // @exclude http://docs.google.com/* // ==/UserScript== -
hail2u revised this gist
Nov 6, 2009 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ gdico.setAttribute("src", "http://docs.google.com/favicon.ico"); gdico.setAttribute("style", "border:none;"); var gdv = document.createElement("a"); gdv.setAttribute("href", "http://docs.google.com/gview?url=" + encodeURIComponent(a.href) + "&hl=ja"); gdv.appendChild(gdico); a.parentNode.insertBefore(gdv, a.nextSibling); a.parentNode.insertBefore(document.createTextNode(" "), a.nextSibling); -
hail2u revised this gist
Nov 1, 2009 . 1 changed file with 30 additions and 4 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,10 +28,36 @@ }, false); if (typeof LDR !== undefined) { var w = unsafeWindow; var watcher = { callAddLink: function (d) { this.cancel(); addLink(d); }, setup: function (feed) { this.cancel(); var item_count = feed.items.length; var d = document.getElementById("right_container"); var self = this; this.timeoutID = setInterval(function () { if (d.getElementsByClassName("item").length === item_count) { self.callAddLink(d); } }, 1000); }, cancel: function () { if (typeof this.timeoutID === "number") { clearInterval(this.timeoutID); delete this.timeoutID; } } }; w.register_hook('after_printfeed', function (feed) { watcher.setup(feed); }); } })(); -
hail2u revised this gist
Nov 1, 2009 . 1 changed file with 10 additions and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,7 +23,15 @@ addLink(document); document.body.addEventListener('AutoPagerize_DOMNodeInserted', function (e) { addLink(e.target); }, false); if (typeof LDR !== undefined) { unsafeWindow.register_hook('before_printfeed', function (feed) { feed.items.forEach(function (item) { addLink(item.body); }); }); } })(); -
hail2u revised this gist
Oct 20, 2009 . 1 changed file with 23 additions and 9 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,29 @@ // ==UserScript== // @name View PDF/PPT/TIFF with Google Document Viewer // @namespace http://hail2u.net/ // @description Insert a Google Docs icon for viewing PDF/PPT/TIFF with Google Document Viewer. // @exclude http://docs.google.com/* // ==/UserScript== (function () { function addLink (d) { Array.forEach(d.getElementsByTagName("a"), function (a) { if (a.href.match(/\.(pdf|ppt|tiff?)$/i) && !a.href.match(/q=related:/)) { var gdico = document.createElement("img"); gdico.setAttribute("src", "http://docs.google.com/favicon.ico"); gdico.setAttribute("style", "border:none;"); var gdv = document.createElement("a"); gdv.setAttribute("href", "http://docs.google.com/gview?url=" + encodeURIComponent(a.href) + "&a=b"); gdv.appendChild(gdico); a.parentNode.insertBefore(gdv, a.nextSibling); a.parentNode.insertBefore(document.createTextNode(" "), a.nextSibling); } }); } addLink(document); document.body.addEventListener('AutoPagerize_DOMNodeInserted', function (evt) { addLink(evt.target); }, false); })(); -
hail2u created this gist
Sep 10, 2009 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ // ==UserScript== // @name View PDF/PPT with Google Document Viewer // @namespace http://hail2u.net/ // @description Insert a "[GDV]" link for viewing PDF/PPT with Google Document Viewer. // @exclude http://docs.google.com/* // ==/UserScript== Array.forEach(document.getElementsByTagName("a"), function (a) { if (a.href.match(/\.(pdf|ppt)$/)) { var gdv = document.createElement("a"); gdv.setAttribute("href", "http://docs.google.com/gview?url=" + encodeURIComponent(a.href) + "&a=b"); gdv.appendChild(document.createTextNode("[GDV]")); a.parentNode.insertBefore(gdv, a.nextSibling); } });