diff --git a/pub/code/mouseless-autoscroll.user.js b/pub/code/mouseless-autoscroll.user.js new file mode 100644 index 0000000..942c626 --- /dev/null +++ b/pub/code/mouseless-autoscroll.user.js @@ -0,0 +1,203 @@ +// ==UserScript== +// @name mouseless-autoscroll +// @namespace Utopiah +// @description autoscroll without using your hands (keep them for the coffee cup ;) +// @include * +// @exclude *://mail.google.com/mail/* +// @require http://ecmanaut.googlecode.com/svn/trunk/lib/gm/$x$X.js +// ==/UserScript== + +// the require script is a part of ecmanaut grand project +// to re-organize the world starting with the annoying interface to the DOM API + +/* + * Script homepage : http://userscripts.org/forums/1/topics/2150 + * To do : check the homepage + */ + + + + +//=================================== Configuration ======================================= + +var SPEED_STEP=1; // step size for increase and decrease of speed +var BASE_TIME=6; // default scrolling speed in speed-step +var MAX_SLOWEST_SPEED=10; // define the slowest speed-step + +var speed=GM_getValue("speed", BASE_TIME); // load last speed value + +var timer = null; // handle for the periodic call to the scrolling function + +//=================================== Core ============================================= + +// loop as fast as required, don't loop when speed is inferior to the small timestep +function reset_timer() { + if (timer) { window.clearTimeout(timer); }; + if (speed >= MAX_SLOWEST_SPEED) timer = null; + else timer = window.setInterval(scroll, Math.exp(speed)); +} + +// actually scroll the window one pixel down +function scroll () { window.scrollBy(0, 1); }; + // Reminder : use window.scrollBy(0, -1) to scroll up + +// call the scrolling loop +reset_timer(); + + +//=================================== Interface ========================================= + + +function scroll_faster () { + if(speed>=SPEED_STEP){ speed-=SPEED_STEP; } + // else { find a way to display to the user we reached the maximum speed... any idea ? } + hideallbuttons(); + // instead each action should individually self-clean their picture with a setTimeout + // that would need 5 different functions because of the setTimeout Greasemonkey specificity + // (especially since we can't specify parameters within setTimeout call in GM afaik) + var button = document.getElementById('button_faster'); button.style.visibility="visible"; + setTimeout(hideallbuttons,2000); + reset_timer(); +}; +function scroll_slower () { + if(speed>=MAX_SLOWEST_SPEED-SPEED_STEP) { speed=MAX_SLOWEST_SPEED; scroll_pause(); return;} + if(speed where blurHandler does the same as focusHandler, but backwards +// basically removing and adding the event listeners so they don't keep triggering and crash firefox \ No newline at end of file diff --git a/pub/code/reverted_pim_links.user.js b/pub/code/reverted_pim_links.user.js new file mode 100644 index 0000000..f4f892b --- /dev/null +++ b/pub/code/reverted_pim_links.user.js @@ -0,0 +1,81 @@ +// ==UserScript== +// @name reverted PIM links +// @namespace Utopiah +// @description overlay so that a visited page indexed in a PIM displays a link back +// @include * +// @exclude *://mail.google.com/mail/* +// @require http://ecmanaut.googlecode.com/svn/trunk/lib/gm/$x$X.js +// ==/UserScript== + +// the require script is a part of ecmanaut grand project +// to re-organize the world starting with the annoying interface to the DOM API + +/* + * Script homepage : from http://userscripts.org/ somewhere? + * + * to do + * find a way (visiting a special URL?) to (re)generate the data store on demand (not at each boot) + * apply to Person/ + * cf ealier idea http://wiki.seedea.org/Oimp/Socialannotating + * add links to the database + * note that date is optional but the source is not + * delicious-20100730.htm + * emails + * IRC/IM + +34269 links using +for SCANNETWORK in $(ls ~/irclogs/); do grep http ~/irclogs/$SCANNETWORK/* | sed "s/.* <\(.*\)> .*http\(.*\)/http\2 \1 on $SCANNETWORK/"; done | wc -l + +19881 freenode +5834 blinkenshell +4867 testing +2354 seedeabitlbee +1325 mozilla +7 rezosup +for SCANNETWORK in $(ls ~/irclogs/); do echo -n -e "$SCANNETWORK\t" && grep http ~/irclogs/$SCANNETWORK/* | sed "s/.* <\(.*\)> .*http\(.*\)/http\2 \1 on $SCANNETWORK/" | wc -l; done | awk '{print $2 "\t" $1}' | sort -n -r + + * + */ + + +// configuration +var script_name = "rPIMlinks"; +var PIM_URL = "http://fabien.benetou.fr/"; + +// actual script + +//load URLs in data store (greasemonkey.scriptvals in about:config in prefs.js) +// load the entire set of links +// merging linksloaded_prefs.js to prefs.js +// C:\Documents and Settings\tyflser\Application Data\Mozilla\Firefox\Profiles\aosia15p.default +// e.g. user_pref("greasemonkey.scriptvals.Utopiah/reverted PIM links.rPIMlinks http://www.wikipedia.com/wiki/Simulacra_and_Simulation", "ReadingNotes/LeSpectateurEmancipe"); + +//everytime a page is loaded + +//get the current URL +PIMpages = GM_getValue(script_name+" "+document.URL,"fail"); + +//if the current URL is in data store +if (PIMpages != "fail") +{ + //display link + var pages = PIMpages.split(" "); + var myDiv = document.createElement('div'); + while (page = pages.shift()){ + myDiv.innerHTML += "

"+page+"

"; + } + document.body.appendChild(myDiv); +} + + +function addGlobalStyle(css) { + var head, style; + head = document.getElementsByTagName('head')[0]; + if (!head) { return; } + style = document.createElement('style'); + style.type = 'text/css'; + style.innerHTML = css; + head.appendChild(style); +} + +addGlobalStyle(''); diff --git a/pub/code/virtualblinders.user.js b/pub/code/virtualblinders.user.js new file mode 100644 index 0000000..67ebeee --- /dev/null +++ b/pub/code/virtualblinders.user.js @@ -0,0 +1,17 @@ +// ==UserScript== +// @name VirtualBlinders +// @namespace Utopiah +// @description Stay focus, damnit! +// @include *youtube.com* +// ==/UserScript== + +GM_xmlhttpRequest({ + method: "GET", + url: "http://fabien.benetou.fr/pub/currenttask", + onload: function(response) { + res = response.responseText; + if (res == 'Reading\n' || res == 'Programming\n'){ + document.body.innerHTML="You should be focusing on "+res+" instead,\nare you sure you need that information from that website?"; + } + } +});