Created
December 11, 2009 18:28
-
-
Save tarao/254397 to your computer and use it in GitHub Desktop.
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 characters
// ==UserScript== | |
// @name h2.hatena.ne.jp | |
// @namespace http://orezdnu.org/ | |
// @include http://h2.hatena.ne.jp/* | |
// ==/UserScript== | |
(function() { | |
var stretch = { | |
q: true, | |
}; | |
var expand = { | |
body: true, | |
}; | |
var size = 80; | |
var inputs = document.getElementsByTagName('input'); | |
for (var i=0; i < inputs.length; i++) { | |
if (stretch[inputs[i].name]) { | |
inputs[i].size = size; | |
} else if (expand[inputs[i].name]) { | |
var textarea = document.createElement('textarea'); | |
textarea.name = inputs[i].name; | |
textarea.cols = size; | |
textarea.raws = 5; | |
inputs[i].parentNode.replaceChild(textarea, inputs[i]); | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment