Open tb52s7 opened 11 years ago
Some sort of batch key management system would be nice as a separate plugin or to incorporate into the existing Keys plugin. Clear keys could be one of its first options.
I really would like to know how to clear keys in firefox. There has to be an easy way to do this. Can anybody tell me how?
I'd love to see the keys sync database use a Google spreadsheet instead of the opaque file it currently uses. That would give an easy way to do the bulk edits you describe.
So here's the solution. :) Run the following Javascript command on the Intel map page: localStorage.removeItem('plugin-keys-data')
In Firefox, you can go to the web developer/scratchpad menu which will open a new window. Have the main window to the intel map and enter the command in the other window. Choose Execute and then do a Ctrl+F5 refresh on the map and all the stored keys will be gone.
Ok kelemvor33, thank you very much for trying to help me out, HOWEVER, I was NOT able to clear keys using the following methods in Firefox spanish version 21 with IITC 0.12.0 build may 22:
This is sooooooo fricken frustrating. I'm not a js programmer. I followed the instructions perfectly. I even improvised. WTF am I doing wrong?
Please first see the above post. So, now that you know what did NOT clear my keys, I will tell you what DID clear my keys:
So there you have it. I cleared my keys off the map. They still exist.... SOMEWHERE..... no idea where that is, but hey as long as my map is now reading a blank plugin-keys-data object then I don't fricken care. Firefox can eat all my old keys, I don't care. Firefox can save all my old keys for posterity, I don't care - as long as I don't have to look at them anymore. And if I ever run out of whatever weird storage this system uses because I have iterated my plugin-keys-data object too many times, then I'll get back on here and ask about the crap again so hopefully next time I don't have to spend another 2 hours explaining how I couldn't figure this bs out, again.
I am also having difficulty removing keys in chrome. I've tried; localStorage.removeItem('plugin-keys-data') javascript:localStorage.removeItem('plugin-keys-data')
having this built in would be nice.
How dificult would it be to just cycle through all the keys and set there count to zero.
This would not be difficult. The object window.plugin.keys.keys
is an associative array keyed by portal guids. That's easy enough to loop through either using the jQuery each()
function or pure JavaScript using Object.keys(window.plugin.keys.keys).forEach(...)
. From there, copy appropriate code from the window.plugin.keys.addKey()
function. One possibility ...
Object.keys(window.plugin.keys.keys).forEach(function (guid, i, array) {
delete plugin.keys.keys[guid];
plugin.keys.updateQueue[guid] = null;
plugin.keys.storeLocal(plugin.keys.KEY);
plugin.keys.storeLocal(plugin.keys.UPDATE_QUEUE);
plugin.keys.updateDisplayCount();
window.runHooks('pluginKeysUpdateKey', {guid: guid, count: newCount});
});
plugin.keys.delaySync();
However, there are probably some efficiencies to be gained by move the following out of the loop:
plugin.keys.storeLocal(plugin.keys.KEY);
plugin.keys.storeLocal(plugin.keys.UPDATE_QUEUE);
plugin.keys.updateDisplayCount();
I'm not sure what moving those would do to the window.runHooks('pluginKeysUpdateKey', {guid: guid, count: newCount})
.
Another solution for the original problem, Use "portals-list" to view the portals you used the keys on. Scroll to the right and adjust key levels accordingly.
Previously I have gone through my keys list in the game and entered all my keys into IITC for the desktop. Then I used a bunch of keys, and now I'm in the position where if I go enter all my keys back in the same way I did last time, it won't be accurate because many of the keys I've already entered are still listed in IITC when they shouldn't be, since I already burned them making links. So, how do I clear every key back to zero to start over? I tried but couldn't figure out how to do this in Firefox.