cryptohopper-dashboard-watchlist
cryptohopper-dashboard-watchlist copied to clipboard
Make Dashboard position indicators hopper-unique
When I set indicators on positions (icon/colored rows), I would like them to be able to be unique for that specific position.
I would use this for instance to mark heavy DCA positions. These same coins are not heavy DCA in other positions/hoppers.
I looked into the possibility of this last night but it seems like the website doesn't make it very easy to determine which hopper you're using. Seems like the only way might be too parse the sidebar html menu to get the hopper IDs and then do a text comparison to the selected hopper name.
This is the only place in code or html that I an find to uniquely identify the hopper ids:

I'm still looking into how to do this... i may have a solution.
I looked into the possibility of this last night but it seems like the website doesn't make it very easy to determine which hopper you're using. Seems like the only way might be too parse the sidebar html menu to get the hopper IDs and then do a text comparison to the selected hopper name.
This is the only place in code or html that I an find to uniquely identify the hopper ids:
![]()
We can get the currently active hopper ID (at least on the dashboard page - haven't checked other pages yet) from the #active_hopper_id hidden input elements value attribute: var hopperID = $('#active_hopper_id').val();
Alternatively we can use the following code to get the current hopper ID which should work for all pages, though it has the caveat that all hoppers would have to have a unique name (not sure if CH enforces this):
var hopperMenu = $('#sidebar-menu>ul>li:first-of-type');
var hopperName = $('>a>span:first-of-type',hopperMenu).text().trim();
var hopperID = $(`>ul>li>a[title="${hopperName}"]`,hopperMenu).prop('href').match(/set=(\d+)/)[1];
We could then add that value to the data stored by GM_setValue();
and use that as a filter to have unique indicators to each hopper.