fixed indentation on speech-search plugin to match the others

updated description to be clear it isn't for firefox
This commit is contained in:
Jon Atkins 2013-05-14 18:16:00 +01:00
parent 41f78f614d
commit 2990e938a6

View File

@ -5,7 +5,7 @@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Allow speech input for location search (webkit only for now)
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Allow speech input for location search (webkit only for now - NOT Firefox)
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
@ -13,37 +13,37 @@
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if (typeof window.plugin !== 'function') window.plugin = function() {};
// ensure plugin framework is there, even if iitc is not yet loaded
if (typeof window.plugin !== 'function') window.plugin = function() {};
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.speechSearch = function() {};
// PLUGIN START ////////////////////////////////////////////////////////
window.plugin.speechSearch.setup = function() {
// use own namespace for plugin
window.plugin.speechSearch = function() {};
window.plugin.speechSearch.setup = function() {
// Give the search input the speech attribute
$("#geosearch").attr("x-webkit-speech", "");
// Immediately search without further input
$("#geosearch").bind("webkitspeechchange", function() {
$("#geosearch").trigger($.Event("keypress", {keyCode: 13}));
});
};
};
var setup = window.plugin.speechSearch.setup;
var setup = window.plugin.speechSearch.setup;
// PLUGIN END //////////////////////////////////////////////////////////
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));