root / okeanos_site / static / okeanos_static / js / index.js @ 4beadc2f
History | View | Annotate | Download (2 kB)
1 |
(function() {
|
---|---|
2 |
|
3 |
var menu = function(el) { |
4 |
this.el = el;
|
5 |
var menu = this; |
6 |
var resumeVideo = false; |
7 |
var player = window.player;
|
8 |
|
9 |
this.show_menu = function (event) { |
10 |
$("#video iframe").attr("src", ""); |
11 |
var link = $(event.currentTarget); |
12 |
var id = link.attr("href"); |
13 |
var li = $(link.parent()); |
14 |
|
15 |
$(".page").hide(0); |
16 |
$(id).show(0); |
17 |
|
18 |
$("li").removeClass("selected"); |
19 |
$("li").removeClass("current"); |
20 |
$("li .close-button").css("visibility", "hidden"); |
21 |
|
22 |
if (id !== "#video") { |
23 |
try {
|
24 |
$("video")[0].player.pause(); |
25 |
} catch (err) {}
|
26 |
li.addClass("selected");
|
27 |
li.addClass("current");
|
28 |
$(link.parent()).find(".close-button").css("visibility", "visible"); |
29 |
$(".inner-bottom").addClass("in-page"); |
30 |
} else {
|
31 |
$(".inner-bottom").removeClass("in-page"); |
32 |
} |
33 |
event.preventDefault(); |
34 |
//location.hash = id;
|
35 |
} |
36 |
|
37 |
$(".page").hide(); |
38 |
$("#video").show(); |
39 |
$(".menu a").click(this.show_menu); |
40 |
|
41 |
} |
42 |
|
43 |
$(document).ready(function() { |
44 |
if ($.cookie('X-Auth-Token') != null) { |
45 |
$(".testuser").show(); |
46 |
$(".banner-coming").hide(); |
47 |
} |
48 |
|
49 |
window.menu = new menu($(".menu")); |
50 |
window.player = document.getElementById('player');
|
51 |
|
52 |
var validHashes = ["#why","#who","#what"]; |
53 |
var hash = location.hash.toString();
|
54 |
|
55 |
if ($.inArray(location.hash.toString(), validHashes) >= 0) { |
56 |
var selector = "a.page-link[href=" + hash + "]"; |
57 |
link = $("a.page-link[href=" + hash + "]"); |
58 |
link.trigger("click");
|
59 |
} |
60 |
|
61 |
$(".page-link").mousedown(function() { |
62 |
$(this).addClass("click"); |
63 |
}); |
64 |
$(".page-link").mouseup(function() { |
65 |
$(this).removeClass("click"); |
66 |
}); |
67 |
}); |
68 |
})(); |