T
T
templton19822018-08-03 06:50:52
Ember.js
templton1982, 2018-08-03 06:50:52

How to uncompile json map into regular code?

I have some ready-made site written by someone using the ember.js engine.
5b63d0c479deb783336557.png
This code is a kind of json object. And how can I translate this json object into regular code, make corrections and then translate it back into the same map ??
Essentially I need to do the following. A variable is written/read in localStorage. I need to add a suffix to the name of this variable - the name of the current user. I found the name of the required variable in the game.map file.
For example, this line:

$('.user-level').text('Level ' + localStorage.level_progress);

I need to add the username to the level_progress variable: user_name +
level_progress
For example, I would make some function in the global scope
function getNewNameWithPrefix (){
    return 'userv_name'+level_progress;
}

And then just replace in the current code in the .map file
$('.user-level').text('Level ' + localStorage[getNewNameWithPrefix]);

Answer the question

In order to leave comments, you need to log in

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question