Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text box #38

Open
alexwarren opened this issue Feb 14, 2015 · 1 comment
Open

Text box #38

alexwarren opened this issue Feb 14, 2015 · 1 comment

Comments

@alexwarren
Copy link
Contributor

Idea for a JS API to get input from a textbox.

[[some section]]:
    textbox({
        placeholder: 'Enter your name',
        attribute: 'name',
        enter: 'next section'
    });

Type your name in the box below.

[[next section]]:
Your name is {name}.

The textbox function (alias of squiffy.textbox) adds a text input to the end of the section. When the player types something and presses enter, the attribute is set and play is moved to the specified section.

We'll want the textbox at the end of the section - currently JS runs before the section is rendered. We should simply add a mechanism to specify a function to run after rendering. Will need to support multiple functions being added.

@pzolla
Copy link

pzolla commented Feb 14, 2015

It would be nice that whatever mechanism you develop it would be flexible enough to allow any JS the option to run before or after; regardless if textbox or other. Someone may want to kick off some JS to act upon the input of the text field for example:

"Input the secret code", a JS function returns something based on the code input.

In my case, I already have the need to run JS, render, and run JS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants