/ ‘grepolis.user.js’
This commit is contained in:
parent
e2aa2d0d9e
commit
0b42685d08
@ -10,30 +10,12 @@
|
|||||||
//
|
//
|
||||||
// @match http://*.grepolis.com/game/*
|
// @match http://*.grepolis.com/game/*
|
||||||
//
|
//
|
||||||
// @version 1.0.48
|
// @version 1.0.49
|
||||||
// @updateURL http://git.javil.eu/jan/userscripts/raw/master/grepolis.user.js
|
// @updateURL http://git.javil.eu/jan/userscripts/raw/master/grepolis.user.js
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
console.logCopy = console.log.bind(console);
|
|
||||||
console.log = function() {
|
|
||||||
var date = new Date(); // Timestamp to prepend
|
|
||||||
var timestamp = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toJSON();
|
|
||||||
if (arguments.length) {
|
|
||||||
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") {
|
|
||||||
args[0] = "%s: " + arguments[0];
|
|
||||||
args.splice(1, 0, timestamp);
|
|
||||||
this.logCopy.apply(this, args);
|
|
||||||
} else {
|
|
||||||
this.logCopy(timestamp, args);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
lastAmounts = "";
|
lastAmounts = "";
|
||||||
console.log("Initializing...");
|
console.log("Initializing...");
|
||||||
windows = {};
|
windows = {};
|
||||||
@ -61,10 +43,9 @@
|
|||||||
logWindowElement.empty();
|
logWindowElement.empty();
|
||||||
|
|
||||||
function log(xText) {
|
function log(xText) {
|
||||||
console.log(xText);
|
|
||||||
var date = new Date(); // Timestamp to prepend
|
var date = new Date(); // Timestamp to prepend
|
||||||
var timestamp = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toJSON();
|
var timestamp = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toJSON();
|
||||||
logWindowElement.append(timestamp + ": " + xText + "<br />");
|
logWindowElement.append('<span title="' + timestamp +'">' + xText + "</span><br />");
|
||||||
logWindowElement.scrollTop(logWindowElement[0].scrollHeight);
|
logWindowElement.scrollTop(logWindowElement[0].scrollHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user