// ==UserScript== // @author Zaso // @name Last Action Timestamp // @category Info // @version 0.0.3.20200216.174029 // @description Estimate the portal decaying. // @id last-action-timestamp@Zaso // @namespace https://github.com/IITC-CE/ingress-intel-total-conversion // @downloadURL https://raw.githubusercontent.com/IITC-CE/Community-plugins/master/dist/Zaso/last-action-timestamp.user.js // @updateURL https://raw.githubusercontent.com/IITC-CE/Community-plugins/master/dist/Zaso/last-action-timestamp.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-174029'; plugin_info.pluginId = 'last-action-timestamp'; //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.lastAction = function() {}; window.plugin.lastAction.convertTimestamp = function(timestamp){ var dt = window.unixTimeToDateTimeString(timestamp, true); return dt; } window.plugin.lastAction.appendDetails = function(data){ var guid = window.selectedPortal; var p = window.portals[guid]; var t = p.options.timestamp; var dt = window.plugin.lastAction.convertTimestamp(t); if(dt !== undefined && dt !== null){ dt = dt.slice(0, -4); var helpTxt = 'The action is a recharge, deploy, upgrade, install a mod, link, fire, expires, but not hack or get xm'; var html = 'Last action: '+dt+''; $('#portaldetails .linkdetails').before('
'+html+'
'); } } //--------------------------------------------------------------------------------------- // Append the stylesheet //--------------------------------------------------------------------------------------- window.plugin.lastAction.setupCSS = function(){ $('