root / okeanos_site / static / okeanos_static / js / index.js @ 04774a3d
History | View | Annotate | Download (1.9 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 |
li.addClass("selected");
|
24 |
li.addClass("current");
|
25 |
$(link.parent()).find(".close-button").css("visibility", "visible"); |
26 |
$(".inner-bottom").addClass("in-page"); |
27 |
} else {
|
28 |
$(".inner-bottom").removeClass("in-page"); |
29 |
} |
30 |
event.preventDefault(); |
31 |
//location.hash = id;
|
32 |
} |
33 |
|
34 |
$(".page").hide(); |
35 |
$("#video").show(); |
36 |
$(".menu a").click(this.show_menu); |
37 |
|
38 |
} |
39 |
|
40 |
$(document).ready(function() { |
41 |
if ($.cookie('X-Auth-Token') != null) { |
42 |
$(".testuser").show(); |
43 |
$(".banner-coming").hide(); |
44 |
} |
45 |
|
46 |
window.menu = new menu($(".menu")); |
47 |
window.player = document.getElementById('player');
|
48 |
|
49 |
var validHashes = ["#why","#who","#what"]; |
50 |
var hash = location.hash.toString();
|
51 |
|
52 |
if ($.inArray(location.hash.toString(), validHashes) >= 0) { |
53 |
var selector = "a.page-link[href=" + hash + "]"; |
54 |
link = $("a.page-link[href=" + hash + "]"); |
55 |
link.trigger("click");
|
56 |
} |
57 |
|
58 |
$(".page-link").mousedown(function() { |
59 |
$(this).addClass("click"); |
60 |
}); |
61 |
$(".page-link").mouseup(function() { |
62 |
$(this).removeClass("click"); |
63 |
}); |
64 |
}); |
65 |
})(); |