IITC-CE / ingress-intel-total-conversion

intel.ingress.com total conversion user script with some new features. Should allow easier extension of the intel map.
https://iitc.app
ISC License
285 stars 110 forks source link

Simplify mobile panes API #220

Open johnd0e opened 5 years ago

johnd0e commented 5 years ago

This API came from here: https://github.com/iitc-project/ingress-intel-total-conversion/pull/675

Here are typical changes needed for plugin to use it: https://github.com/iitc-project/ingress-intel-total-conversion/pull/697/files or 69aad81933fe0657fdf39d36103adef76a37d837.

That involves android.addPane + addHook("paneChanged",... + handling that hook + additional css.

Imho it is very excessive and inconvenient.

johnd0e commented 5 years ago

I'm going to replace this with more simple and straightforward API, involving single call. Like this:

addMobilePane(id,title,icon,onFocus)

where onFocus is function that should return html element to show.

That's all. No need to handle anything. No need in special css (in most cases).