Commit 1442e698 authored by Dimitris Kardarakos's avatar Dimitris Kardarakos

Migrate to latest jquery and go handlebars production

Scripts now use latest jquery. Also, following guidelines (http://handlebarsjs.com/precompilation.html) for proper usage of handlebars in production, templates have been precompiled for best performance. Then, handlebars runtime library substituted the original library.
parent 6323c28a
......@@ -45,29 +45,14 @@
<div id="footer">Based on <a href="https://github.com/jdm/asknot">asknot</a></div>
</div>
<script src="media/js/jquery-1.11.2.min.js"></script>
<script src="media/js/jquery-3.3.1.min.js"></script>
<script src="media/js/handlebars.runtime.js"></script>
<script src="media/js/way.js"></script>
<script src="media/js/displayRender.js"></script>
<script src="media/js/foopy.js"></script>
<script src="media/js/l10n.js"></script>
<script src="media/js/displayRender.js"></script>
<script src="media/js/handlebars-v4.0.11.js"></script>
<script>
$(document).ready(function() {
DisplayRender.addHelpers();
DisplayRender.renderTemplate();
$('#responses div').show();
});
</script>
<script id="group-template" type="text/x-handlebars-template">
{{#each groups}}
<div class="group" {{group_info}}
<ul class="choices">
{{#each choices}}
<li {{choice_info}}</li>
{{/each}}
</ul>
</div>
{{/each}}
</script>
</body>
</html>
This diff is collapsed.
......@@ -242,7 +242,7 @@
}
}
$(window).load(function() {
$(window).on('load',function() {
$('#ok a:first').on('click', investigate);
$('#next a:first').on('click', nextChoice);
$('#back a:first').on('click', takeBack);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
(function() {
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['way'] = template({"1":function(container,depth0,helpers,partials,data) {
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {});
return "<div class=\"group\" "
+ container.escapeExpression(((helper = (helper = helpers.group_info || (depth0 != null ? depth0.group_info : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"group_info","hash":{},"data":data}) : helper)))
+ "\n <ul class=\"choices\">\n"
+ ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.choices : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " </ul>\n</div>\n";
},"2":function(container,depth0,helpers,partials,data) {
var helper;
return " <li "
+ container.escapeExpression(((helper = (helper = helpers.choice_info || (depth0 != null ? depth0.choice_info : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"choice_info","hash":{},"data":data}) : helper)))
+ "</li>\n";
},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1;
return ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.groups : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
},"useData":true});
})();
\ No newline at end of file
{{#each groups}}
<div class="group" {{group_info}}
<ul class="choices">
{{#each choices}}
<li {{choice_info}}</li>
{{/each}}
</ul>
</div>
{{/each}}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment