eisfrei / ingressliveinventory Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
https://www.reddit.com/r/Ingress/comments/lgpvq6/iitc_plugin_to_show_core_inventory/gmsyphb/
One bug I've found: it seems to group frackers, beacons and fireworks all together. IITC says I have 44 Frackers, while stock intel says I have 3 frackers, 20 fireworks and 21 beacons.
After opening inventory through the portal view, portal view doesn’t close by clicking “back” button
Currently, when viewing portal detail the number of keys will be displayed but no other info.
Displaying the capsule(s) the key is in would be a great extra bit of info rather than opening the inventory view and scrolling through to find the portal name.
The function to check subscription uses plain JQuery request:
function checkSubscription(callback) {
var versionStr = niantic_params.CURRENT_VERSION;
var post_data = JSON.stringify({
v: versionStr
});
var result = $.ajax({
url: '/r/getHasActiveSubscription',
type: 'POST',
data: post_data,
context: {},
dataType: 'json',
success: [(data) => callback(null, data)],
error: [(data) => callback(data)],
contentType: 'application/json; charset=utf-8',
beforeSend: function (req) {
req.setRequestHeader('accept', '*/*');
req.setRequestHeader('X-CSRFToken', readCookie('csrftoken'));
}
});
return result;
}
While the function to load the inventory uses a call to IITC api:
window.postAjax('getInventory', {
"lastQueryTimestamp": 0
}, (data, textStatus, jqXHR) => {
localStorage[KEY_SETTINGS] = JSON.stringify({
data: data,
expires: Date.now() + 10 * 60 * 1000, // request data only once per five minutes, or we might hit a rate limit
settings: settings
});
prepareData(data);
}, (data, textStatus, jqXHR) => {
console.error(data);
});
It might be worth refactoring the checkSubscription function to use IITC's window.postAjax as well?
Hi,
Would you be interested in integrating some functionality from this code to your code?
https://github.com/Temetz/IngressPlayerInventoryMap/blob/main/playerInventoryMap.user.js
This would allow displaying portal markers on the portals the player has a key for.
Its based on your portal history plugin.
I think it would be fairly simple to just add this sort of functionality to your code.
Simply adding a layergroup and adding markers to it as the inventory is loaded.
Might be able to make this feature later tonight if interested.
Line 242 compares sA and sb. sb is undefined, so that always returns false.
From: if (sA === sb) {
To: if (sA === sB) {
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.