/[drupal]/contributions/modules/mp3player/mp3player.js
ViewVC logotype

Diff of /contributions/modules/mp3player/mp3player.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1, Mon Oct 12 22:19:11 2009 UTC revision 1.1.2.1, Mon Oct 12 22:19:11 2009 UTC
# Line 0  Line 1 
1    /**
2    * Implemetation of Drupal Behavior
3    */
4    Drupal.behaviors.mp3players = function(context) {
5      // Render MP3Players
6      $('.mp3player:not(.mp3player-processed)').each(function() {
7        var $thisPlayer = $(this);
8        var playerID = $thisPlayer.attr('id');
9        $thisPlayer.addClass('mp3player-processed');
10    
11        // Check variables so we dont get JS errors
12        if (Drupal.settings.mp3player != undefined && AudioPlayer != undefined && Drupal.settings.mp3player[playerID] != undefined) {
13          var playerValue = Drupal.settings.mp3player[playerID]
14          var soundFileValue = playerValue.audio_url;
15    
16          // Check for extras
17          if (playerValue.extras != null) {
18            soundFileValue = soundFileValue + playerValue.extras;
19          }
20    
21          // Create new player and add code
22          var newPlayer = AudioPlayer.embed(playerID, { soundFile: soundFileValue });
23        }
24      });
25    }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.2.1

  ViewVC Help
Powered by ViewVC 1.1.2