Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify the argument panel. when creating new demos, developer only
need to fillin a python dict with types and names of each argument.
- Loading branch information
foulwall
committed
Jun 3, 2013
1 parent
367ba23
commit b16be7b
Showing
10 changed files
with
192 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<form name="arguments"> | ||
{% for argument in arguments %} | ||
{% if argument.argument_label %} | ||
<label> {{ argument.argument_label }} </label> | ||
{% elif argument.argument_name %} | ||
<label> {{ argument.argument_name }} </label> | ||
{% endif %} | ||
{% if argument.argument_type == 'decimal' %} | ||
<input type="text" value="{{ argument.argument_default }}" name="{{ argument.argument_name }}" onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')"></br> | ||
{% elif argument.argument_type == 'integer' %} | ||
<input type="text" value="{{ argument.argument_default }}" name="{{ argument.argument_name }}" onkeyup="value=value.replace(/[^\d]/g,'')"> | ||
{% elif argument.argument_type == 'select' %} | ||
<select name="{{ argument.argument_name }}" > | ||
{% for item in argument.argument_items %} | ||
<option value="{{ item }}" {% if item == argument.argument_default %} selected {% endif %}>{{ item }} </option> | ||
{% endfor %} | ||
</select> <br/> | ||
{% elif argument.argument_type == 'button-group' %} | ||
<div class="btn-group"> | ||
{% for item in argument.argument_items %} | ||
<button type="button" class="btn btn-small btn-primary" id="{{ item }}" onclick="{{ item }}_action();"> | ||
{{ item }} | ||
</button> | ||
{% endfor %} | ||
</div> | ||
{% elif argument.argument_type == 'div' %} | ||
<div {% if argument.argument_id %} id="{{ argument.argument_id}}" {% endif %} | ||
{% if argument.argument_class %} class="{{ argument.argument_class }}" {% endif %} | ||
></div> | ||
{% endif %} | ||
{% endfor %} | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.