// ==UserScript== // @id iitc-plugin-LocalStorageManager@GMOogway // @name IITC plugin: Local Storage Manager // @category Controls // @version 0.1.0.20190214 // @author GMOogway // @description [local-2019-02-14] LocalStorageManager plugin by GMOogway. // @downloadURL https://github.com/GMOogway/iitc-plugins/raw/master/local-storage-manager.user.js // @updateURL https://github.com/GMOogway/iitc-plugins/raw/master/local-storage-manager.user.js // @namespace https://github.com/GMOogway/iitc-plugins // @include https://intel.ingress.com/* // @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 = 'local'; plugin_info.dateTimeVersion = '20190214'; plugin_info.pluginId = 'LocalStorageManager'; //END PLUGIN AUTHORS NOTE // PLUGIN START //////////////////////////////////////////////////////// // use own namespace for plugin window.plugin.LocalStorageManager = function() {}; window.plugin.LocalStorageManager.IS_DEBUG = false; window.plugin.LocalStorageManager.getDateTime = function() { var date=new Date(); var year=date.getFullYear(); var month=date.getMonth()+1; var day=date.getDate(); var hour="00"+date.getHours(); hour=hour.substr(hour.length-2); var minute="00"+date.getMinutes(); minute=minute.substr(minute.length-2); var second="00"+date.getSeconds(); second=second.substr(second.length-2); var week=date.getDay(); switch(week) { case 1:week="Monday ";break; case 2:week="Tuesday ";break; case 3:week="Wednesday ";break; case 4:week="Thursday ";break; case 5:week="Friday ";break; case 6:week="Saturday ";break; case 0:week="Sunday ";break; default:week="";break; } return (year+"/"+month+"/"+day+"/"+" "+week+" "+hour+":"+minute+":"+second); } window.plugin.LocalStorageManager.debug = function(msg) { if (window.plugin.LocalStorageManager.IS_DEBUG){ console.log(' '); console.log('********** ' + window.plugin.LocalStorageManager.getDateTime() + ' **********'); console.log(msg); console.log('*************************************************************************'); console.log(' '); } } window.plugin.LocalStorageManager.setupContent = function() { plugin.LocalStorageManager.htmlCallSetBox = 'LocalStorageManager Opt'; var actions = ''; actions += 'Add'; actions += 'Delete'; actions += 'View'; actions += 'Import' actions += 'Export'; plugin.LocalStorageManager.htmlSetbox = '
Select all and press CTRL+C to copy it.
', dialogClass: 'ui-dialog-LocalStorageManager-copy', id: 'plugin-LocalStorageManager-export', title: 'LocalStorageManager Export' }); var json = JSON.parse(data); for(var key in json){ window.plugin.LocalStorageManager.debug(key); window.plugin.LocalStorageManager.debug(json[key]); } window.plugin.LocalStorageManager.optAlert('Export successful.'); }catch(e){ window.plugin.LocalStorageManager.optAlert('Export failed: ' + e + ''); } } window.plugin.LocalStorageManager.optView = function() { var html = ''; var json = JSON.parse(JSON.stringify(localStorage)); window.plugin.LocalStorageManager.debug(json); for(var key in json){ html += '' + key + '' + message + '
'); if (ms === undefined){ $('.alert').delay(2000).fadeOut(); }else{ $('.alert').delay(ms).fadeOut(); } } window.plugin.LocalStorageManager.manualOpt = function() { dialog({ html: plugin.LocalStorageManager.htmlSetbox, dialogClass: 'ui-dialog', id: 'plugin-LocalStorageManager-options', title: 'LocalStorageManager Options' }); } window.plugin.LocalStorageManager.setupCSS = function() { $('