Skip to content

Instantly share code, notes, and snippets.

@othree
Created September 6, 2009 07:57
Show Gist options
  • Save othree/181706 to your computer and use it in GitHub Desktop.
Save othree/181706 to your computer and use it in GitHub Desktop.
// ==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