/[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.2.1, Mon Oct 12 22:19:11 2009 UTC revision 1.1.2.2, Tue Oct 13 12:25:31 2009 UTC
# Line 6  Drupal.behaviors.mp3players = function(c Line 6  Drupal.behaviors.mp3players = function(c
6    $('.mp3player:not(.mp3player-processed)').each(function() {    $('.mp3player:not(.mp3player-processed)').each(function() {
7      var $thisPlayer = $(this);      var $thisPlayer = $(this);
8      var playerID = $thisPlayer.attr('id');      var playerID = $thisPlayer.attr('id');
9        var playerData = $thisPlayer.attr('data');
10      $thisPlayer.addClass('mp3player-processed');      $thisPlayer.addClass('mp3player-processed');
11    
12      // Check variables so we dont get JS errors      var playerSettings = new Array();
13      if (Drupal.settings.mp3player != undefined && AudioPlayer != undefined && Drupal.settings.mp3player[playerID] != undefined) {  
14        var playerValue = Drupal.settings.mp3player[playerID]      var playerSettingParts = playerData.split("&");
15        var soundFileValue = playerValue.audio_url;  
16        for ( var i in playerSettingParts) {
17        // Check for extras        var parts = playerSettingParts[i].split("=");
18        if (playerValue.extras != null) {        playerSettings[parts[0]] = parts[1];
         soundFileValue = soundFileValue + playerValue.extras;  
       }  
   
       // Create new player and add code  
       var newPlayer = AudioPlayer.embed(playerID, { soundFile: soundFileValue });  
19      }      }
20    
21        // Create new player and add code
22        var newPlayer = AudioPlayer.embed(playerID, playerSettings);
23    });    });
24  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.2