From a0c6a30225bbbcb51ff2d7826729474b291a3331 Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Wed, 4 Jun 2014 14:02:14 +0200 Subject: [PATCH] =?UTF-8?q?/=20=E2=80=98grepolis.user.js=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- grepolis.user.js | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/grepolis.user.js b/grepolis.user.js index da84c1d..188dff9 100644 --- a/grepolis.user.js +++ b/grepolis.user.js @@ -10,35 +10,25 @@ // // @match http://*.grepolis.com/game/* // -// @version 1.0.28 +// @version 1.0.29 // @updateURL http://git.javil.eu/jan/userscripts/raw/master/grepolis.user.js // ==/UserScript== (function() { console.logCopy = console.log.bind(console); - console.log = function() - { - // Timestamp to prepend - var date = new Date(); - var timestamp = new Date(new Date().getTime() - (new Date().getTimezoneOffset() * 60000)).toJSON(); - + console.log = function() { + var date = new Date(); // Timestamp to prepend + var timestamp = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toJSON(); if (arguments.length) { - // True array copy so we can call .splice() var args = Array.prototype.slice.call(arguments, 0); // If there is a format string then... it must be a string if (typeof arguments[0] === "string") { - // Prepend timestamp to the (possibly format) string args[0] = "%o: " + arguments[0]; - - // Insert the timestamp where it has to be args.splice(1, 0, timestamp); - - // Log the whole array this.logCopy.apply(this, args); } else { - // "Normal" log this.logCopy(timestamp, args); } }