Skip to content

Instantly share code, notes, and snippets.

@isnot
Last active July 8, 2021 07:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isnot/0338b228171c48e609e53beb15dedaf1 to your computer and use it in GitHub Desktop.
Save isnot/0338b228171c48e609e53beb15dedaf1 to your computer and use it in GitHub Desktop.
iitc-plugin-adj-portalname-fontsize
// ==UserScript==
// @id iitc-plugin-adj-portalname-fontsize@isnot
// @name IITC plugin: adj-portalname-fontsize
// @category Tweak
// @version 0.2
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @author isnot
// @updateURL none
// @downloadURL none
// @description [iitc-plugins] adj portal name fontsize
// @include https://*.ingress.com/intel*
// @include http://*.ingress.com/intel*
// @match https://*.ingress.com/intel*
// @match http://*.ingress.com/intel*
// @grant none
// ==/UserScript==
function wrapper(plugin_info) {
// ensure plugin framework is there, even if iitc is not yet loaded
if (typeof window.plugin !== 'function') window.plugin = function() {};
// PLUGIN START ////////////////////////////////////////////////////////
var setup = function() {
addHook('iitcLoaded', function() {
$('<style>')
.prop('type', 'text/css')
.html('.plugin-portal-names {font-size: 14px !important}')
.appendTo('head');
if (window.plugin.portalNames) {
window.plugin.portalNames.NAME_WIDTH = 120;
}
});
};
// PLUGIN END //////////////////////////////////////////////////////////
setup.info = plugin_info; //add the script info data to the function as a property
if(!window.bootPlugins) window.bootPlugins = [];
window.bootPlugins.push(setup);
// if IITC has already booted, immediately run the 'setup' function
if(window.iitcLoaded && typeof setup === 'function') setup();
} // wrapper end
// inject code into site context
var script = document.createElement('script');
var info = {};
if (typeof GM_info !== 'undefined' && GM_info && GM_info.script) info.script = { version: GM_info.script.version, name: GM_info.script.name, description: GM_info.script.description };
script.appendChild(document.createTextNode('('+ wrapper +')('+JSON.stringify(info)+');'));
(document.body || document.head || document.documentElement).appendChild(script);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment