您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Show timestamps
当前为
// ==UserScript== // @name MHQ ago // @namespace none // @version 2018.11.26.1057 // @description Show timestamps // @supportURL https://Discord.me/TheShoeStore // @author technical13 // @match https://www.munzee.com/m/* // @grant none // ==/UserScript== // jshint esversion: 6 var isDebug = false; var intVerbosity = 0; const ver = '2018.11.26.1057'; const scriptName = 'MHQ ago v' + ver; function log( intV, strConsole, strLog, ...arrArgs ) { if ( strConsole === undefined ) { strConsole = 'log'; } if ( strLog === undefined ) { strLog = '%o'; } if ( intVerbosity >= intV && ( strConsole === 'groupEnd' ) ) { console[ strConsole ](); } if ( intV === 0 || ( isDebug && intVerbosity >= intV ) ) { console[ strConsole ]( '[%i]: %s: ' + strLog, intV, scriptName, ...arrArgs ); } } const intParamsStart = ( document.URL.indexOf( '?' ) + 1 ); const strParams = document.URL.substr( intParamsStart ); const arrParamSets = strParams.split( '&' ); var objParams = {}; arrParamSets.forEach( function( strParam ) { let arrParam = strParam.split( '=' ); let strParamName = ( arrParam[ 0 ].toLowerCase() || '' ); if ( strParamName === 'verbosity' ) { isDebug = toBoolean( arrParam[ 1 ] ); intVerbosity = ( arrParam[ 1 ] ? ( parseInt( arrParam[ 1 ] ) < 0 ? 0 : ( parseInt( arrParam[ 1 ] ) > 9 ? 9 : parseInt( arrParam[ 1 ] ) ) ) : 9 ); } else if ( strParamName === 'debug' ) { isDebug = toBoolean( arrParam[ 1 ] ); intVerbosity = 1; } } ); log( 1, 'warn', 'Debug mode is on with verbosity level: %o', intVerbosity ); log( 1, 'groupCollapsed', 'Verbosity options: (click to expand)' ); log( 1, 'log', '1) Summary\n2) Parameters retrieved from URL\n3) Variables set to objParams\n4) Function returns\n9) ALL debugging info and this notice.' ); log( 1, 'groupEnd' ); function toBoolean( val ) { const arrTrue = [ undefined, null, '', true, 'true', 1, '1', 'on', 'yes' ]; val = ( typeof( val ) === 'string' ? val.toLowerCase() : val ); log( 4, 'log', 'toBoolean() is returning: %o', ( arrTrue.indexOf( val ) !== -1 ? true : false ) ); return ( arrTrue.indexOf( val ) !== -1 ? true : false ); } const objTimeStringHQ = { year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', timeZone: 'America/Chicago', timeZoneName: 'short', hour12: false }; ( function() { 'use strict'; $( '.deployed-at' ).each( function( i, elem ) { var strDeployed = new Date( $( elem ).attr( 'data-deployed-at' ) ); $( elem ).text( strDeployed.toLocaleDateString( 'en-US', objTimeStringHQ ) + ' (' + $( elem ).text() + ')' ); } ); $( '.captured-at' ).each( function( i, elem ) { var strCaptured = new Date( $( elem ).attr( 'data-captured-at' ) ); $( elem ).text( strCaptured.toLocaleDateString( 'en-US', objTimeStringHQ ) + ' (' + $( elem ).text() + ')' ); } ); } )();