Created
October 12, 2012 20:54
-
-
Save jiggliemon/3881443 to your computer and use it in GitHub Desktop.
An example for a proposed `SML like` syntax within the module development portal.
This file contains hidden or 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
{% assign poll = fetch_module_data('some poll id') %} | |
/* | |
poll | |
id | |
question | |
options | |
results | |
... more ... | |
*/ | |
<div id="poll"> | |
<h3>{{ poll.question }}</h3> | |
<dl> | |
<dt>Please select an option</dt> | |
{% for option in poll.options %} | |
<dd><a href="#poll:option">{{ option.to_s }}</a></dd> | |
{% endfor %} | |
</dl> | |
</div> | |
<script> | |
var Poll = Tabs.getModule('poll') | |
var pollInstance = new Poll('#poll', { | |
events: { | |
submit: function () { | |
} | |
,success: function (submissionID, results) { | |
// somehow show the results here. | |
} | |
} | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment