d2jsp
Log InRegister
d2jsp Forums > d2jsp > General Help > Site Suggestions >
Poll > Additional Functionality In The Gold Logs
Prev123410Next
Closed New Topic New Poll
  Guests cannot view or vote in polls. Please register or login.
Member
Posts: 26,038
Joined: Sep 5 2007
Gold: 12,350.00
Nov 7 2020 09:42pm
Bump
Member
Posts: 30,724
Joined: Aug 31 2008
Gold: 15,001.93
Trader: Trusted
Nov 8 2020 01:19am
Quote (Qry @ Nov 2 2020 11:37pm)
I'm torn. Would be nice but I believe only very few people would use that to its full extend. And no matter how neat the implementation turns out, simply exporting the gold logs and importing them in Excel is more powerful. Null'ed as I really don't mind but probably not worth the development time....


ya but I have no idea how to properly do this, so +1 to this idea.
Member
Posts: 12,703
Joined: May 17 2013
Gold: 12,935.00
Nov 8 2020 10:55am
I have created the sent/received feature as a tampermonkey script (among other small additions) which looks like this:



here you go:

Code
// ==UserScript==
// @name D2jsp Gold Additions
// @namespace D2jspGoldAdditions
// @version 1
// @description Add overview of total gold moved for the month + more features.
// @author Klexmoo
// @match https://*.d2jsp.org/gold.php*
// @grant none
// ==/UserScript==


const toFixedFloat = (num) => parseFloat(num.toFixed(2)).toLocaleString(undefined, { minimumFractionDigits:2, maximumFractionDigits:2 })

var parent = document.getElementById('itgr').parentElement;
parent.removeChild(document.querySelector('#sALb'))
var goldInSpan = document.getElementById('itgr');
var goldOutSpan = document.getElementById('itgs');
var goldSpan = document.createElement('span');
var goldIn = 0;
var goldOut = 0;
const myID = w;

var total = Array.isArray(g) ? g.reduce((sum, arr) => {
if (arr[0] == myID) {
goldOut += arr[2];
return sum - arr[2];
} else {
goldIn += arr[2];
return sum + arr[2];
}
}, 0) : 0.0;

goldInSpan.innerHTML = toFixedFloat(goldIn);
goldOutSpan.innerHTML = toFixedFloat(goldOut);
goldSpan.innerHTML = ` / Total: ${toFixedFloat(total)} `;
parent.appendChild(goldSpan);

const allRows = g.slice(0);
gdt = (d) => {
return new Date(d * 1000).toLocaleString('en-GB');
}

try {
bL();
} catch(error){}

function updateRows(event){
switch (event.target.value) {
case 'All':
g = allRows.slice(0);
break;
case 'Received':
g = allRows.filter(arr => arr[1] === myID);
break;
case 'Sent':
g = allRows.filter(arr => arr[0] === myID);
break;
default:
return;
}
try {
bL();
} catch(error){}
};

function createSelect() {
let selectReference = document.getElementsByClassName('p3 ce')[0].children.item(1);

let selectElement = document.createElement("select");
selectElement.setAttribute("id", "newFeatureSelect");
selectElement.onchange=updateRows;

let insertedNode = selectReference.parentElement.insertBefore(selectElement, selectReference.nextSibling);

for (let i = 0; i < 2; i++) {
const element = document.createTextNode("\u00A0");
insertedNode.parentElement.insertBefore(element, insertedNode);
}

const options = ['All', 'Received', 'Sent'];

options.forEach(option => {
let optionElement = document.createElement("option");
optionElement.setAttribute("value", option);
let textNode = document.createTextNode(option);
optionElement.appendChild(textNode);
document.getElementById("newFeatureSelect").appendChild(optionElement);
})
}
createSelect();



This post was edited by Klexmoo on Nov 8 2020 11:09am
Member
Posts: 26,038
Joined: Sep 5 2007
Gold: 12,350.00
Nov 11 2020 04:17pm
Bump
Member
Posts: 26,038
Joined: Sep 5 2007
Gold: 12,350.00
Nov 12 2020 06:32pm
Bump
Retired Moderator
Posts: 18,271
Joined: Feb 7 2009
Gold: 224,649.14
Trader: Mediator
Nov 19 2020 05:19am
Well a similar suggestion already exists since 2012. The result was the excel export (.csv). Still not a huge fan of it that there is no search/filter function in the gold logs. Mainly because it’s the most important history.
Maybe this might happen sometime. Between 2012 and 2020 has quite some years passed.

History:

https://forums.d2jsp.org/topic.php?t=65072786&f=258&o=750

https://forums.d2jsp.org/topic.php?t=75096353&f=258&p=530545897#p530545897

This post was edited by Cel on Nov 19 2020 05:24am
Member
Posts: 26,038
Joined: Sep 5 2007
Gold: 12,350.00
Nov 19 2020 08:56am
Quote (Cel @ 19 Nov 2020 12:19)
Well a similar suggestion already exists since 2012. The result was the excel export (.csv). Still not a huge fan of it that there is no search/filter function in the gold logs. Mainly because it’s the most important history.
Maybe this might happen sometime. Between 2012 and 2020 has quite some years passed.

History:

https://forums.d2jsp.org/topic.php?t=65072786&f=258&o=750

https://forums.d2jsp.org/topic.php?t=75096353&f=258&p=530545897#p530545897


This is not really the same application here.

Read my post here : https://forums.d2jsp.org/topic.php?t=84148709&f=258&p=564455347

Quote
The export of logs is more of archiving while my idea is more of the direct management of fg transfers.
Member
Posts: 24,016
Joined: Nov 15 2009
Gold: 10,275.00
Nov 19 2020 09:14am
I like the sent/recieved and forum bank filters so overall I think it would be beneficial.

However, I can see big complications with marking FG transactions as donations. One example could be a user accidentally checking the Donation box when it is an item transaction.
Member
Posts: 39,266
Joined: Jul 1 2007
Gold: 109,561.32
Nov 25 2020 03:39am
Love this idea, would be great, along with the search by user Penguin mentioned
Member
Posts: 12,703
Joined: May 17 2013
Gold: 12,935.00
Nov 28 2020 06:22pm
I think the user search feature is also very useful, so I have now implemented it in my tampermonkey script.

It looks like this:


The code to use in a tampermonkey script if you are interested:

Code
// ==UserScript==
// @name D2jsp Gold Additions
// @namespace D2jspGoldAdditions
// @version 1
// @description Add overview of total gold moved for the month + more features.
// @author Klexmoo
// @match https://*.d2jsp.org/gold.php*
// @grant none
// ==/UserScript==


const toFixedFloat = (num) => parseFloat(num.toFixed(2)).toLocaleString(undefined, { minimumFractionDigits:2, maximumFractionDigits:2 })

var parent = document.getElementById('itgr').parentElement;
parent.removeChild(document.querySelector('#sALb'))
var goldInSpan = document.getElementById('itgr');
var goldOutSpan = document.getElementById('itgs');
var goldSpan = document.createElement('span');
var goldIn = 0;
var goldOut = 0;
const myID = w;

var total = Array.isArray(g) ? g.reduce((sum, arr) => {
if (arr[0] == myID) {
goldOut += arr[2];
return sum - arr[2];
} else {
goldIn += arr[2];
return sum + arr[2];
}
}, 0) : 0.0;

goldInSpan.innerHTML = toFixedFloat(goldIn);
goldOutSpan.innerHTML = toFixedFloat(goldOut);
goldSpan.innerHTML = ` / Total: ${toFixedFloat(total)} `;
parent.appendChild(goldSpan);

const allRows = g.slice(0);
gdt = (d) => {
return new Date(d * 1000).toLocaleString('en-GB');
}

try {
bL();
} catch(error){}

function updateRows(event){
switch (event.target.value) {
case 'All':
g = allRows.slice(0);
break;
case 'Received':
g = allRows.filter(arr => arr[1] === myID);
break;
case 'Sent':
g = allRows.filter(arr => arr[0] === myID);
break;
default:
return;
}
try {
bL();
} catch(error){}
};

function createSelect() {
let selectReference = document.getElementsByClassName('p3 ce')[0].children.item(1);

let selectElement = document.createElement("select");
selectElement.setAttribute("id", "newFeatureSelect");
selectElement.onchange=updateRows;

let insertedNode = selectReference.parentElement.insertBefore(selectElement, selectReference.nextSibling);

for (let i = 0; i < 2; i++) {
const element = document.createTextNode("\u00A0");
insertedNode.parentElement.insertBefore(element, insertedNode);
}

const options = ['All', 'Received', 'Sent'];

options.forEach(option => {
let optionElement = document.createElement("option");
optionElement.setAttribute("value", option);
let textNode = document.createTextNode(option);
optionElement.appendChild(textNode);
document.getElementById("newFeatureSelect").appendChild(optionElement);
})
}
createSelect();

function searchTransactions(username){
if (!username) g = allRows.slice(0);
g = allRows.filter((row) => row[8].toLowerCase().includes(username.toLowerCase()));
try {
bL();
} catch(error){}
}

function createUserSearch() {
const infoDiv = document.getElementsByClassName('p3 ce')[0];
let newDiv = document.createElement('div');
newDiv.style['text-align'] = 'center';
newDiv.style['margin-top'] = '15px';

let newInput = document.createElement('input');
newInput.oninput=(event) => searchTransactions(event.target.value);
let inputDescription = document.createTextNode('User search: ');
newDiv.appendChild(inputDescription);
newDiv.appendChild(newInput);
let insertedDiv = infoDiv.parentElement.insertBefore(newDiv, infoDiv.nextSibling);
}
createUserSearch()


This post was edited by Klexmoo on Nov 28 2020 06:32pm
Go Back To Site Suggestions Topic List
Prev123410Next
Closed New Topic New Poll