| %= javascript begin |
| |
| // Create new hint |
| var hint = Object.create(Hint).init(); |
| |
| function openTutorial (o) { |
| var tut = $("#tutorial"); |
| tut.addClass("active"); |
| var iframe = tut.children("iframe"); |
| iframe.attr("src", getTutorialPage()); |
| }; |
| |
| function closeTutorial (o) { |
| $("#tutorial").removeClass("active"); |
| }; |
| |
| function useQuery (o) { |
| var q = o.getAttribute("data-query"); |
| var ql = o.getAttribute("data-query-language"); |
| var qc = o.getAttribute("data-query-cutoff"); |
| if (qc !== 0 && qc !== "0" && qc !== "off" && qc !== null) |
| $("#q-cutoff-field").prop('checked', true); |
| |
| $("#ql-field").val(ql); |
| $("#q-field").val(q); |
| |
| closeTutorial(); |
| }; |
| |
| $("#sidebar").on("click", function () { |
| $(this).toggleClass('active'); |
| }); |
| |
| $("span.location").on("click", function () { |
| $("#sidebar").toggleClass('active'); |
| }); |
| |
| % end |