New Features
1. Async. function problem solved.
- BEFORE
The project was working manually due to async function problem in Steem.js API.
3 buttons to be used simultaneously visualy confirming data is loaded to div.
- AFTER
Async. function problem solved with call to external function.
var flagger = document.getElementById("input_flagger").value
steem.api.getAccounts([flagger], function(err, response) {
The result is sent to an external function.
No promise or callback used.
calc(result,flagger);
});
This way the manual operation is cancelled and the DIV is loaded automatically.
We have the complete RESULT array in CALC function to operate.
Additionally, a "SPINNER" to the upper left corner is added to inform the user he has to wait.
2. Date Selection added.
- BEFORE
There was no date selection, the data was analysed as from the beginning.
Hence, there exists a limitation for 10 000 data.
- AFTER
Date selector is added to the project.
With selected date, the data is seperated in FOR loop with IF statement.
for (let i = 0; i < result.length; i++) {
if ((result[i][1].op[0] == 'vote') && (result[i][1].op[1].voter = flagger) && (result[i][1].op[1].weight < 0) && (result[i][1].op[1].author != flagger)&&(result[i][1].timestamp>selectedDate)) {
With above code, the downvotes "after the selected date" is filtered.
3. Hyperlinks to the downvoted posts added.
- BEFORE
Hyperlinks of the downvoted posts didn't exist.
- AFTER
Hyperlinks are added, so user can see the downvoted posts and comments.
var str ="https://steemit.com/@"+result[i][1].op[1].author+"/"+result[i][1].op[1].permlink;
var lin=(result[i][1].op[1].permlink).substring(0,70)+".......";
Hyperlinks are limited with 70 characters to fit the DIV.
4. Analysis Modal window added.
- BEFORE
Analysis were limited.
- AFTER
Analysis is shown in a seperate modal window, full sorted from maximum times downvoted user to minimum.
The sorting code :
Links
GitHub : https://github.com/firedreamgames/steemflag
WebPage : https://steemflag.neocities.org
Proof of Work
Connect
@FireDream - Steemit
@firedream#3528 - Discord
Posted on Utopian.io - Rewarding Open Source Contributors