Skip to content

Instantly share code, notes, and snippets.

@jiggliemon
Created October 12, 2012 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jiggliemon/3881443 to your computer and use it in GitHub Desktop.
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.
{% 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