Fixed pane and repos

master
Celso González 2022-05-31 04:48:16 +02:00
parent 96edeeafb3
commit fb62d3319d
1 changed files with 18 additions and 14 deletions

View File

@ -2,10 +2,10 @@
// @id iitc-plugin-uniques-go@mitago // @id iitc-plugin-uniques-go@mitago
// @name IITC plugin: Uniques go data sender // @name IITC plugin: Uniques go data sender
// @category Misc // @category Misc
// @version 0.0.1 // @version 0.0.2
// @namespace https://github.com/xificurk/iitc-plugins // @namespace https://git.mitago.net/ingress/uniques-go-userscript
// @updateURL https://raw.githubusercontent.com/xificurk/iitc-plugins/master/dist/portal-highlighter-uniques-opacity.mesta.js // @updateURL https://git.mitago.net/ingress/uniques-go-userscript/raw/branch/master/uniques-go.user.js
// @downloadURL https://raw.githubusercontent.com/xificurk/iitc-plugins/master/dist/portal-highlighter-uniques-opacity.usser.js // @downloadURL https://git.mitago.net/ingress/uniques-go-userscript/raw/branch/master/uniques-go.user.js
// @description Uniques go data sender // @description Uniques go data sender
// @include https://intel.ingress.com/* // @include https://intel.ingress.com/*
// @include http://intel.ingress.com/* // @include http://intel.ingress.com/*
@ -15,10 +15,6 @@
// @include http://*.ingress.com/intel* // @include http://*.ingress.com/intel*
// @match https://*.ingress.com/intel* // @match https://*.ingress.com/intel*
// @match http://*.ingress.com/intel* // @match http://*.ingress.com/intel*
// @include https://*.ingress.com/mission/*
// @include http://*.ingress.com/mission/*
// @match https://*.ingress.com/mission/*
// @match http://*.ingress.com/mission/*
// @grant none // @grant none
// ==/UserScript== // ==/UserScript==
@ -30,8 +26,8 @@ function wrapper(plugin_info) {
//PLUGIN AUTHORS: writing a plugin outside of the IITC build environment? if so, delete these lines!! //PLUGIN AUTHORS: writing a plugin outside of the IITC build environment? if so, delete these lines!!
//(leaving them in place might break the 'About IITC' page or break update checks) //(leaving them in place might break the 'About IITC' page or break update checks)
plugin_info.buildName = 'mitago'; plugin_info.buildName = 'mitago';
plugin_info.dateTimeVersion = '202200529.014500'; plugin_info.dateTimeVersion = '202200531.044700';
plugin_info.pluginId = 'uniques-go'; plugin_info.pluginId = 'uniquesgo';
//END PLUGIN AUTHORS NOTE //END PLUGIN AUTHORS NOTE
@ -57,13 +53,13 @@ function wrapper(plugin_info) {
} }
window.plugin.uniquesgo.AjaxOK = function (result) { window.plugin.uniquesgo.AjaxOK = function (result) {
let a = '' let a = '';
$.each(result, function(i, val) { $.each(result, function(i, val) {
if val > 0 { if (val > 0) {
a += i + ': ' + val + '<br/>'; a += i + ': ' + val + '<br/>';
} }
}); });
alert(a) alert(a);
} }
window.plugin.uniquesgo.getPortals = function() { window.plugin.uniquesgo.getPortals = function() {
@ -92,10 +88,18 @@ function wrapper(plugin_info) {
return retval; return retval;
} }
window.plugin.uniquesgo.onPaneChanged = function(pane) {
if(pane === "plugin-portalslist")
window.plugin.uniquesgo.sendPL();
else
$("#uniquesgo").remove()
};
var setup = function() { var setup = function() {
if (window.useAppPanes()) { if (window.useAppPanes()) {
//FIXME //FIXME
app.addPane("plugin-portalslist", "Portals list", "ic_action_paste"); app.addPane("plugin-uniquesgo", "Send portals to mitago", "ic_action_paste");
addHook("paneChanged", window.plugin.uniquesgo.onPaneChanged);
} else { } else {
$('#toolbox').append('<a onclick="window.plugin.uniquesgo.sendPL()" title="Sends the portal list to mitago.net [t]" accesskey="t">Send portals</a>'); $('#toolbox').append('<a onclick="window.plugin.uniquesgo.sendPL()" title="Sends the portal list to mitago.net [t]" accesskey="t">Send portals</a>');
} }