From ddc0e8d2ba94e35256d1bc33409e3973030c9e4c Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Wed, 19 Sep 2012 11:04:01 -0400 Subject: [PATCH 1/2] remove console.log from javascript library :/ --- airtime_mvc/public/js/qtip/jquery.qtip.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/airtime_mvc/public/js/qtip/jquery.qtip.js b/airtime_mvc/public/js/qtip/jquery.qtip.js index 6871a036b..fe9ac3fb5 100644 --- a/airtime_mvc/public/js/qtip/jquery.qtip.js +++ b/airtime_mvc/public/js/qtip/jquery.qtip.js @@ -1247,7 +1247,6 @@ function QTip(target, options, id, attr) position.top -= offset; } else if(overflowBottom > 0 && (my.y !== 'bottom' || overflowTop > 0) ) { - console.log('test'); position.top -= isCenter ? -offset : offset; } if(position.top !== posTop && isCenter) { position.top -= adjust.y; } @@ -3241,4 +3240,4 @@ PLUGINS.bgiframe = function(api) PLUGINS.bgiframe.initialize = 'render'; -}(jQuery, window)); \ No newline at end of file +}(jQuery, window)); From ca0fb969b711da8ef8b5b4463668d5c9c0ffea1f Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Wed, 19 Sep 2012 13:23:06 -0400 Subject: [PATCH 2/2] fix jplayer errors for mp3 and firefox (flash) --- .../scripts/audiopreview/audio-preview.phtml | 4 +- .../airtime/audiopreview/preview_jplayer.js | 49 +++++++++---------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml b/airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml index 3404cf6e1..b4ec52bdf 100644 --- a/airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml +++ b/airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml @@ -7,8 +7,8 @@ blockId" ?> blockIndex" ?> uri)): ?> - uri" ?> - mime" ?> + + audioFileTitle" ?> audioFileArtist" ?> showID)): ?> diff --git a/airtime_mvc/public/js/airtime/audiopreview/preview_jplayer.js b/airtime_mvc/public/js/airtime/audiopreview/preview_jplayer.js index 56a4afa64..0f5a0b0fe 100644 --- a/airtime_mvc/public/js/airtime/audiopreview/preview_jplayer.js +++ b/airtime_mvc/public/js/airtime/audiopreview/preview_jplayer.js @@ -8,6 +8,17 @@ var _idToPostionLookUp; */ $(document).ready(function(){ + $.jPlayer.timeFormat.showHour = true; + + var audioUri = $('.audioUri').text(); + var audioMime = $('.audioMime').text(); + var playlistID = $('.playlistID').text(); + var playlistIndex = $('.playlistIndex').text(); + var showID = $('.showID').text(); + var showIndex = $('.showIndex').text(); + var blockId = $('.blockId').text(); + var blockIndex = $('.blockIndex').text(); + _playlist_jplayer = new jPlayerPlaylist({ jPlayer: "#jquery_jplayer_1", cssSelectorAncestor: "#jp_container_1" @@ -29,33 +40,20 @@ $(document).ready(function(){ addTime: 0, removeTime: 0, shuffleTime: 0 + }, + ready: function(){ + if (playlistID != "" && playlistID !== ""){ + playAllPlaylist(playlistID, playlistIndex); + }else if (audioUri != "") { + playOne(audioUri, audioMime); + }else if (showID != "") { + playAllShow(showID, showIndex); + }else if(blockId != "" && blockIndex != ""){ + playBlock(blockId, blockIndex); + } } }); - - - $.jPlayer.timeFormat.showHour = true; - - var audioUri = $('.audioUri').text(); - var audioMime = $('.audioMime').text(); - var playlistID = $('.playlistID').text(); - var playlistIndex = $('.playlistIndex').text(); - var showID = $('.showID').text(); - var showIndex = $('.showIndex').text(); - var blockId = $('.blockId').text(); - var blockIndex = $('.blockIndex').text(); - var numOfItems = 0; - - if (playlistID != "" && playlistID !== ""){ - playAllPlaylist(playlistID, playlistIndex); - }else if (audioUri != "") { - playOne(audioUri, audioMime); - }else if (showID != "") { - playAllShow(showID, showIndex); - }else if(blockId != "" && blockIndex != ""){ - playBlock(blockId, blockIndex); - } - $("#jp_container_1").on("mouseenter", "ul.jp-controls li", function(ev) { $(this).addClass("ui-state-hover"); }); @@ -63,6 +61,7 @@ $(document).ready(function(){ $("#jp_container_1").on("mouseleave", "ul.jp-controls li", function(ev) { $(this).removeClass("ui-state-hover"); }); + }); /** @@ -223,7 +222,7 @@ function playOne(uri, mime) { if (media) { _playlist_jplayer.option("autoPlay", true); playlist[0] = media; - _playlist_jplayer._initPlaylist(playlist); + _playlist_jplayer.setPlaylist(playlist); _playlist_jplayer.play(0); }