Statistics
| Branch: | Tag: | Revision:

root / okeanos_site / static / okeanos_static / js / index.js @ 8b5381f3

History | View | Annotate | Download (1.8 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
            } else {
27
            }
28
            event.preventDefault();
29
            //location.hash = id;
30
        }
31
        
32
        $(".page").hide();
33
        $("#video").show();
34
        $(".menu a").click(this.show_menu);
35
        
36
    }
37

    
38
    $(document).ready(function() {
39
        if ($.cookie('X-Auth-Token') != null) {
40
            $(".testuser").show();
41
            $(".banner-coming").hide();
42
        }
43

    
44
        window.menu = new menu($(".menu"));
45
        window.player = document.getElementById('player');
46

    
47
        var validHashes = ["#why","#who","#what"];
48
        var hash = location.hash.toString();
49

    
50
        if ($.inArray(location.hash.toString(), validHashes) >= 0) {
51
            var selector = "a.page-link[href=" + hash + "]";
52
            link = $("a.page-link[href=" + hash + "]");
53
            link.trigger("click");
54
        }
55

    
56
        $(".page-link").mousedown(function() {
57
            $(this).addClass("click");
58
        });
59
        $(".page-link").mouseup(function() {
60
            $(this).removeClass("click");
61
        });
62
    });
63
})();