-calls this code directly
def buy_item(hero, data=None, *args, **kwargs):
New concept
simplify JS/html and make it more specific.
<button onclick="buyItem(itemPurchasedPopup, {'id': {{ item.id }}});">Buy</button>
-should call python translation and/or verification module.
which would convert this into Python:
-tranlation step
Call this code
controller\store.py
def buy(hero, item):
Current JS code calls Python code directly. This is obviously very fragile and insecure, but I couldn't figure out how else to do it at the time.
I would like to change it to:
e.g.
Current code
In templates\store.html
<button onclick="sendToPy(event, itemPurchasedPopup, 'buy_item', {'id': {{ item.id }}});">Buy</button>
In commands\buy_item.py
-calls this code directly
def buy_item(hero, data=None, *args, **kwargs):
New concept
simplify JS/html and make it more specific.
<button onclick="buyItem(itemPurchasedPopup, {'id': {{ item.id }}});">Buy</button>
-should call python translation and/or verification module.which would convert this into Python: -tranlation step
Call this code controller\store.py def buy(hero, item):