Created
September 6, 2009 07:57
-
-
Save othree/181706 to your computer and use it in GitHub Desktop.
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 characters
// ==UserScript== | |
// @name Plurk and :w | |
// @fullname Plurk and :w | |
// @author othree | |
// @version 2009-09-09 | |
// @licence (CC) by | |
// @namespace http://othree.net/userscript/plurk/1 | |
// @description strip :w for plurk | |
// @include http://wwww.plurk.com/* | |
// ==/UserScript== | |
function colonw (id) { | |
var target = document.getElementById(id); | |
var fn = target.onkeydown; | |
target.onkeydown = function (evt) { | |
if (evt.keyCode == 13) { | |
var text = target.value; | |
target.value = text.replace(/\s*:w$/, ""); | |
} | |
return fn.call(target, evt); | |
} | |
} | |
colonw('input_small'); | |
colonw('input_big'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment