openexchangerates / javascript-sandbox-console

a mini interactive javascript console for library/plugin demos and homepages
http://openexchangerates.github.io/javascript-sandbox-console/
MIT License
319 stars 58 forks source link

Can I initialize the sandbox providing a few commands? #17

Open marco-faustinelli opened 9 years ago

marco-faustinelli commented 9 years ago

I'd like to specify a few commands that will be executed in front of the user as soon as the sandbox initializes. In this way the console user will find a few variables already valorized the way I want.

Please note I am not talking about importing a short JS file that contains those commands. What I mean is providing an array of commands in string format to be read and sent to Model.evaluate

This will keep those commands in the visible history of the console just before the user starts typing in his own commands. The pre-evalued commands will give the user a description of the scenario in which I want him to operate.

How can I do that? Is it possible?