blob: 3aa8eda4a3879219d79b4f360fba2b74a8f73573 [file] [log] [blame]
Nils Diewald4af3f0b2014-06-25 01:43:17 +00001%= javascript begin
2
Nils Diewaldeca30442014-11-18 20:33:54 +00003// Create new hint
4var hint = Object.create(Hint).init();
Nils Diewald4af3f0b2014-06-25 01:43:17 +00005
6function openTutorial (o) {
7 var tut = $("#tutorial");
8 tut.addClass("active");
9 var iframe = tut.children("iframe");
Nils Diewald4e9fbcb2014-07-15 11:45:09 +000010 iframe.attr("src", getTutorialPage());
Nils Diewald4af3f0b2014-06-25 01:43:17 +000011};
12
13function closeTutorial (o) {
14 $("#tutorial").removeClass("active");
15};
16
17function useQuery (o) {
18 var q = o.getAttribute("data-query");
19 var ql = o.getAttribute("data-query-language");
Nils Diewaldf49633a2014-11-08 22:33:25 +000020 var qc = o.getAttribute("data-query-cutoff");
Nils Diewalde8e88052014-11-10 16:32:02 +000021 if (qc !== 0 && qc !== "0" && qc !== "off" && qc !== null)
22 $("#q-cutoff-field").prop('checked', true);
23
Nils Diewald4af3f0b2014-06-25 01:43:17 +000024 $("#ql-field").val(ql);
25 $("#q-field").val(q);
Nils Diewalde8e88052014-11-10 16:32:02 +000026
Nils Diewald4af3f0b2014-06-25 01:43:17 +000027 closeTutorial();
28};
29
Nils Diewald7cad8402014-07-08 17:06:56 +000030$("#sidebar").on("click", function () {
Nils Diewald4af3f0b2014-06-25 01:43:17 +000031 $(this).toggleClass('active');
32});
33
Nils Diewald7cad8402014-07-08 17:06:56 +000034$("span.location").on("click", function () {
35 $("#sidebar").toggleClass('active');
36});
37
Nils Diewald4af3f0b2014-06-25 01:43:17 +000038% end