integration/js/home.js
author veltr
Thu, 16 May 2013 15:01:43 +0200
changeset 10 34df8e58b6fc
parent 8 7a5de13173b1
child 9 e3d551eda5a6
permissions -rw-r--r--
Added some code to bootstrap Metadataplayer
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     1
(function(){
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     2
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     3
    $(document).on('click', 'a.open-modal', function(e){
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     4
        e.preventDefault();
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     5
        var modalRemote = $(this).attr('href'),
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     6
            typeMedia = $(this).attr('data-type-media'),
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     7
            modalTitleInfo = $(this).attr('data-title'),
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     8
            titleFront;
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     9
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    10
        switch(typeMedia){
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    11
            case 'video' : titleFront = '<i class="icon-film"></i> Vidéo - '+modalTitleInfo; break;
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    12
            case 'image' : titleFront = '<i class="icon-picture"></i> Image - '+modalTitleInfo; break;
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    13
        }
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    14
        $('#modal-template .modal-header h3').html(titleFront);
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    15
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    16
        $("#modal-template .modal-body").load(modalRemote, function() { 
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    17
            $("#modal-template").modal("show"); 
8
7a5de13173b1 hide bibliotheque link on home and resource page
Anthony Ly <anthonyly.com@gmail.com>
parents: 6
diff changeset
    18
            $("#modal-template").find(".bibliotheque-link").hide();
6
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    19
        });
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    20
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    21
    });
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    22
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    23
})(jQuery);