Giter VIP home page Giter VIP logo

ingressliveinventory's People

Contributors

eisfrei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ingressliveinventory's Issues

Inconsistent usage of IITC request api

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?

Add key markers to map?

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.

Sample screenshot:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.