User:Bryan/OggSearch.js
Jump to navigation
Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
Documentation for this user script can be added at User:Bryan/OggSearch. |
$(function ()
{
if (mw.config.get('wgPageName') == 'Commons:OggSearch')
{
script = document.createElement('script');
script.setAttribute('style', 'text/javascript');
script.setAttribute('src', 'http://toolserver.org/~bryan/ogg/search?format=raw_js');
document.body.appendChild(script);
style = document.createElement('link');
style.setAttribute('rel', 'stylesheet');
style.setAttribute('type', 'text/css');
style.setAttribute('href', 'http://tools.wikimedia.de/~bryan/ogg/ogg-search.css');
var head = document.getElementsByTagName('head')[0];
head.insertBefore(style, head.firstChild);
}
});
function ogg_search(data)
{
el = document.getElementById('bodyContent');
el.innerHTML = data;
document.getElementById('search-form').setAttribute('action',
'http://tools.wikimedia.de/~bryan/ogg/search#search-results');
}