Revisions
-
Constellation revised this gist
May 1, 2009 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 @@ -6,15 +6,13 @@ // @include https://twitter.com/* // ==/UserScript== (function autopager(unsafeWindow,loaded){ if (!loaded && window.opera && document.readyState == 'interactive') { document.addEventListener('DOMContentLoaded', function(){autopager(unsafeWindow,true);}, false); return; } var state = true; var remainHeight = 400; var loading = false; var filter = function(){ loading = false; @@ -37,7 +35,10 @@ function click_more(){ var event = document.createEvent('MouseEvents'); event.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); get_more().dispatchEvent(event); loading = true; } function get_more(){ return document.getElementById('more'); } })(this.contentWindow||this.unsafeWindow||window,0); -
os0x revised this gist
May 1, 2009 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 @@ -6,6 +6,7 @@ // @include https://twitter.com/* // ==/UserScript== // まだちゃんと動いてません (function autopager(unsafeWindow,loaded){ if (!loaded && window.opera && document.readyState == 'interactive') { document.addEventListener('DOMContentLoaded', function(){autopager(unsafeWindow,true);}, false); -
os0x created this gist
May 1, 2009 .There are no files selected for viewing
This file contains hidden or 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,42 @@ // ==UserScript== // @name twitter.AutoPager // @namespace http://ss-o.net/ // @version 0.1 // @include http://twitter.com/* // @include https://twitter.com/* // ==/UserScript== (function autopager(unsafeWindow,loaded){ if (!loaded && window.opera && document.readyState == 'interactive') { document.addEventListener('DOMContentLoaded', function(){autopager(unsafeWindow,true);}, false); return; } var state = true; var remainHeight = 400; var more = document.getElementById('more'); var loading = false; var filter = function(){ loading = false; }; if (typeof unsafeWindow.onPageChange === 'function') { var _onPageChange = unsafeWindow.onPageChange; unsafeWindow.onPageChange = function(){ _onPageChange(); filter(); }; } else { unsafeWindow.onPageChange = filter; } window.addEventListener('scroll', function(){ if (loading) return; var remain = document.documentElement.scrollHeight - window.innerHeight - window.pageYOffset; if (state && remain < remainHeight) click_more(); }, false); function click_more(){ var event = document.createEvent('MouseEvents'); event.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); more.dispatchEvent(event); loading = true; } })(this.contentWindow||this.unsafeWindow||window,0);