Skip to content
Browse files

Merge branch 'master' of git@github.com:philippbosch/aotp-jentsch

  • Loading branch information...
2 parents 2d32fef + d9e3895 commit 67ca38f3eab773644b0071b7ad5e66c8e6f96e50 philippbosch committed Jan 10, 2010
Showing with 45 additions and 40 deletions.
  1. BIN media/favicon.ico
  2. +39 −0 media/js/player.js
  3. +3 −0 templates/base.html
  4. +3 −40 templates/music/player.html
View
BIN media/favicon.ico
Binary file not shown.
View
39 media/js/player.js
@@ -0,0 +1,39 @@
+var currentTrack = -1;
+
+function nextTrack() {
+ currentTrack++;
+ if (!tracks[currentTrack]) currentTrack = 0;
+ $('#background').fadeOut(1000, function() {
+ $(this).attr('src', tracks[currentTrack].image);
+ $(this).load(function() {
+ $(this).fadeIn(1000);
+ });
+ });
+ var volume = $('#player').data("jPlayer.config").volume;
+ var interval = window.setInterval(function() {
+ var currentVolume = $('#player').data("jPlayer.config").volume;
+ if (currentVolume <= 0) {
+ window.clearInterval(interval);
+ $('#player').volume(volume);
+ $('#player').setFile(tracks[currentTrack].audio).play();
+ return;
+ }
+ $('#player').volume(currentVolume-1);
+ }, 10);
+}
+
+$(document).ready(function(){
+ $("#player").jPlayer({
+ ready: function () {
+ nextTrack();
+ },
+ swfPath: MEDIA_URL + 'player'
+ });
+ $('#player').onSoundComplete(function() {
+ nextTrack();
+ });
+ $("#skip").click(function() {
+ nextTrack();
+ });
+});
+
View
3 templates/base.html
@@ -2,11 +2,14 @@
<html lang="{{ LANGUAGE_CODE }}">
<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{% block site_name %}jentsch{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/reset.css" />
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/screen.css" />
<script src="{{ MEDIA_URL }}js/jquery.js" type="text/javascript"></script>
<script src="{{ MEDIA_URL }}player/jquery.jplayer.js" type="text/javascript"></script>
+ <link rel="icon" href="{{ MEDIA_URL }}favicon.ico" type="image/vnd.microsoft.icon" />
+ <link rel="shortcut icon" href="{{ MEDIA_URL }}favicon.ico" type="image/vnd.microsoft.icon" />
{% block extra_scripts %}{% endblock %}
</head>
View
43 templates/music/player.html
@@ -5,51 +5,14 @@
var tracks = [
{% for track in tracks %}{'audio': '{{ MEDIA_URL }}{{ track.audio_file }}', 'image': '{{ MEDIA_URL }}{{ track.image_file }}'}{% if not forloop.last %},{% endif %}{% endfor %}
];
- var currentTrack = -1;
-
- function nextTrack() {
- currentTrack++;
- if (!tracks[currentTrack]) currentTrack = 0;
- $('#background').fadeOut(1000, function() {
- $(this).attr('src', tracks[currentTrack].image);
- $(this).load(function() {
- $(this).fadeIn(1000);
- });
- });
- var volume = $('#player').data("jPlayer.config").volume;
- var interval = window.setInterval(function() {
- var currentVolume = $('#player').data("jPlayer.config").volume;
- if (currentVolume <= 0) {
- window.clearInterval(interval);
- $('#player').volume(volume);
- $('#player').setFile(tracks[currentTrack].audio).play();
- return;
- }
- $('#player').volume(currentVolume-1);
- }, 10);
- }
-
- $(document).ready(function(){
- $("#player").jPlayer({
- ready: function () {
- nextTrack();
- },
- swfPath: '{{ MEDIA_URL }}player'
- });
- $('#player').onSoundComplete(function() {
- nextTrack();
- });
- $("#skip").click(function() {
- nextTrack();
- });
- });
-
+ var MEDIA_URL = '{{ MEDIA_URL }}';
</script>
+ <script src="{{ MEDIA_URL }}js/player.js" type="text/javascript"></script>
{% endblock %}
{% block content %}
<img src="{{ MEDIA_URL }}img/jentsch_font.png" alt="JENTSCH" id="logo" />
- <img id="background" alt="" />
+ <img id="background" src="" alt="" />
<div id="player"></div>
<div id="skip"><img src="{{ MEDIA_URL }}img/jentsch_skip.png" alt="skip track" /></div>
{% endblock %}

0 comments on commit 67ca38f

Please sign in to comment.
Something went wrong with that request. Please try again.