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