Created
August 28, 2008 04:14
-
-
Save youpy/7656 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 gist - ubiquity | |
// @namespace http://d.hatena.ne.jp/youpy/ | |
// @include http://gist.github.com/* | |
// @require http://gist.github.com/raw/3242/1a7950e033a207efcfc233ae8d9939b676bdbf46 | |
// ==/UserScript== | |
(function() { | |
var data = $X('id("gist_data")'); | |
if(!data) | |
return; | |
if(data[0].textContent.match(/(CmdUtils\.CreateCommand|makeSearchCommand)/)) { | |
var link = document.createElement('link'); | |
with(link) { | |
setAttribute('rel', 'commands'); | |
setAttribute('href', $X('//a[text()="raw"]')[0].href); | |
setAttribute('name', data[0].textContent.match(/name: ?("((?:\\.|[^"])*)"|'((?:[^']|\\.)*)')/)[3]); | |
} | |
$X('//head')[0].appendChild(link); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment