// ==UserScript== // @author Zaso // @name Scroll Sleep // @category Tweaks // @version 0.0.3.20200216.174030 // @description A control to enable/disable the zoom map by scroll mouse. // @id scroll-sleep@Zaso // @namespace https://github.com/IITC-CE/ingress-intel-total-conversion // @downloadURL https://raw.githubusercontent.com/IITC-CE/Community-plugins/master/dist/Zaso/scroll-sleep.user.js // @updateURL https://raw.githubusercontent.com/IITC-CE/Community-plugins/master/dist/Zaso/scroll-sleep.meta.js // @match https://intel.ingress.com/* // @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 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) plugin_info.buildName = 'ZasoItems'; plugin_info.dateTimeVersion = '2020-02-16-174030'; plugin_info.pluginId = 'scroll-sleep'; //END PLUGIN AUTHORS NOTE // PLUGIN START //////////////////////////////////////////////////////// // History // 0.0.3 Headers changed. Ready for IITC-CE // 0.0.2 Original sript // use own namespace for plugin window.plugin.scrollSleep = function(){}; window.plugin.scrollSleep.status = true; window.plugin.scrollSleep.STORAGE = 'plugin-scrollSleep'; window.plugin.scrollSleep.saveStorage = function(){ window.localStorage[window.plugin.scrollSleep.STORAGE] = JSON.stringify(window.plugin.scrollSleep.status); } window.plugin.scrollSleep.loadStorage = function(){ window.plugin.scrollSleep.status = JSON.parse(window.localStorage[window.plugin.scrollSleep.STORAGE]); } window.plugin.scrollSleep.checkStorage = function(){ if(!window.localStorage[window.plugin.scrollSleep.STORAGE]){ window.localStorage[window.plugin.scrollSleep.STORAGE] = true; } } window.plugin.scrollSleep.switchStatus = function(){ if(window.plugin.scrollSleep.status){ window.plugin.scrollSleep.scrollOff(); }else{ window.plugin.scrollSleep.scrollOn(); } } window.plugin.scrollSleep.scrollOn = function(){ $('a.scrollMouseControlButton').removeClass('disabled'); window.plugin.scrollSleep.status = true; window.plugin.scrollSleep.saveStorage(); map.scrollWheelZoom.enable(); } window.plugin.scrollSleep.scrollOff = function(){ $('a.scrollMouseControlButton').addClass('disabled'); window.plugin.scrollSleep.status = false; window.plugin.scrollSleep.saveStorage(); map.scrollWheelZoom.disable(); } window.plugin.scrollSleep.setupCSS = function() { $('