Last active
December 17, 2015 11:39
-
-
Save vimtaku/5603486 to your computer and use it in GitHub Desktop.
unity reference default select
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 unity_reference_switch | |
// @namespace unity_reference_switch | |
// @include http://docs.unity3d.com/Documentation/ScriptReference/*.html | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
var selectLanguage = "C#"; | |
var codes = document.getElementsByClassName("code"); | |
setTimeout(function() { | |
for (var i = 0; i < codes.length; i++) { | |
var code = codes[i]; | |
var codeText = code.getAttribute("code_lang_name"); | |
if (selectLanguage != codeText) { | |
code.style.display = 'none'; | |
continue; | |
} | |
var span = document.getElementsByClassName('cSelect-Selected')[0]; | |
span.innerHTML = selectLanguage; | |
code.style.display = 'block'; | |
} | |
}, 0); | |
}()); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment