Advertisement
Guest User

jplayer play button issue

a guest
Dec 12th, 2012
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 24.84 KB | None | 0 0
  1. <?php defined('_JEXEC') or die('Restricted access'); // no direct access
  2.  
  3. $document = &JFactory::getDocument();
  4. $jqscript = JURI::root().'modules/mod_jplayer/js/jquery.min.js';
  5. $document->addScript($jqscript);
  6.  
  7. $tempCss = JURI::root().'templates/jmskinner/css/style.css';
  8. $document->addScript($tempCss);
  9.  
  10. $jqscript1 = JURI::root().'modules/mod_jplayer/js/jquery.jplayer.min.js';
  11. $document->addScript($jqscript1);
  12.  
  13. $jqscripplaylist = JURI::root().'modules/mod_jplayer/js/jplayer.playlist.min.js';
  14. $document->addScript($jqscripplaylist);
  15.  
  16. $jpmobile= JURI::root().'modules/mod_jplayer/skin/pink.flag/jplayer.pink.flag.mobile.css';
  17. $document->addStyleSheet($jpmobile);
  18.  
  19. $plskin= JURI::root().'modules/mod_jplayer/skin/pink.flag/jplayer.pink.flag.css';
  20. $document->addStyleSheet($plskin);
  21.  
  22. $styles=JURI::root().'templates' . DS . 'jmskinner'.DS.'css'.DS.'styles.css';
  23. $document->addStyleSheet($styles);
  24.  
  25. $css_pop=JURI::root().'templates' . DS . 'jmskinner'.DS.'css'.DS.'css-pop.js';
  26. $document->addScript($css_pop);
  27.  
  28. $db =& JFactory::getDBO();
  29. $user =& JFactory::getUser();
  30.  
  31. ?>
  32. <script>
  33. document.getElementByClassName('title').style.display="none";              
  34. </script>
  35.  <div id="blanket" style="display:none;"></div>
  36.     <div id="popUpDiv" style="display:none;">
  37.         <p>Current Track Starred</p>
  38.     </div>     
  39. <!--Jplayer  -->
  40. <!-- Add to playlist window-->
  41.     <?php
  42.         if($user->id !== 0)
  43.         {
  44.             ?>
  45.             <div class="reveal-modal" style="width: 390px; display: block; " id="manage">
  46.                 <form>
  47.                   <div id="manage-playlist-panel" class="cpanel" style="display: block; ">
  48.                     <header class="cpanel-header">
  49.                       <h3>Save As...</h3>
  50.                     </header>
  51.                     <p><span>Create New</span><input type="radio" name="chooseType" value="createNew" checked />
  52.                     <span>Use Exist</span>
  53.                     <input type="radio" name="chooseType" value="useExist" /></p>
  54.                     <div class="cpanel-content full">
  55.                       <ol class="list-select">
  56.                     <li>
  57.                       <input type="text" id="save-playlist-name"  class="full autofill list-select-input empty" title="">
  58.                     </li>
  59.                     <li class="note">Or add to an existing playlist:</li>
  60.                     <li>
  61.                                         <select id="existPlayList">
  62.                                         <option value="0">-Select Your Playlist-</option>
  63.                                         <?php
  64.                                                 $query = "select playlist_name,playlist_id from #__jmplayer_playlist where user_id =". $user->id;
  65.                                                 $db->setQuery($query);
  66.                                                 if($db->query())
  67.                                                     {
  68.                                                         if($db->getAffectedRows())
  69.                                                             {
  70.                                                                 $rows =$db->loadRowList();
  71.                                                                 foreach($rows as $row)
  72.                                                                 {  
  73.                                         ?>         
  74.                                         <option value="<?php echo $row[1]; ?>"><?php echo $row[0]; ?></option>
  75.                                         <?php
  76.                                                                 }
  77.                                                         }
  78.                                                 }
  79.                                         ?>     
  80.                                         </select>
  81.                     </li>
  82.                       </ol>
  83.                     </div>
  84.                     <footer class="cpanel-btns">
  85.                          <a class="btn green bevel" id="save-playlist-btn"  >Save</a>      
  86.                     </footer>
  87.                   </div>
  88.                 </form>
  89.                  <a class="close-reveal-modal">&#215;</a>
  90. </div>
  91. <!--End add to playlist window-->
  92. <!-- Add Playlist for each songs -->
  93.     <div class="reveal-modal" style="width: 390px; display: block; " id="manage2">
  94.  
  95.                 <form>
  96.                   <div id="manage-playlist-panel" class="cpanel" style="display: block; ">
  97.                     <header class="cpanel-header">
  98.                       <h3>Save As...</h3>
  99.                     </header>
  100.                     <p><span>Create New</span><input type="radio" name="chooseType2" value="createNew" checked /><span>Use Exist</span><input type="radio" name="chooseType2" value="useExist" /></p>
  101.                     <div class="cpanel-content full">
  102.                       <ol class="list-select">
  103.                     <li>
  104.                       <input type="text" id="save-playlist-name2"  class="full autofill list-select-input empty" title="">
  105.                     </li>
  106.                     <li class="note">Or add to an existing playlist:</li>
  107.                     <li>
  108.                         <select id="existPlayList2">
  109.                             <option value="0">-Select Your Playlist-</option>
  110.                             <?php
  111.                                 $db =& JFactory::getDBO();
  112.                                 $user =& JFactory::getUser();
  113.                                
  114.                                 $query = "select playlist_name,playlist_id from #__jmplayer_playlist where user_id =". $user->id;
  115.                                 $db->setQuery($query);
  116.                                 if($db->query()){
  117.                                     if($db->getAffectedRows()){
  118.                                         $rows =$db->loadRowList();
  119.                                         foreach($rows as $row){
  120.                             ?>
  121.                                             <option value="<?php echo $row[1]; ?>"><?php echo $row[0]; ?></option>
  122.  
  123.                             <?php
  124.                                         }
  125.                                     }
  126.                                 }
  127.                             ?>     
  128.                         </select>
  129.                     </li>
  130.                       </ol>
  131.                     </div>
  132.                     <footer class="cpanel-btns">
  133.                          <a class="btn green bevel" id="save-each-playlist-btn"  >Save</a>     
  134.                     </footer>
  135.                   </div>
  136.                 </form>
  137.                  <a class="close-reveal-modal">&#215;</a>
  138.                 <input type="hidden" id="getId" name="getId"  />
  139. </div>
  140. <div class="reveal-modal" style="width: 390px; display: block; " id="manage3">
  141.                 <form>
  142.                   <div id="manage-playlist-panel" class="cpanel" style="display: block; ">
  143.                     <header class="cpanel-header">
  144.                       <h3>Save As...</h3>
  145.                     </header>
  146.                     <p><span>Create New</span><input type="radio" name="chooseType3" value="createNew" checked /><span>Use Exist</span><input type="radio" name="chooseType3" value="useExist" /></p>
  147.                     <div class="cpanel-content full">
  148.                       <ol class="list-select">
  149.                     <li>
  150.                       <input type="text" id="save-playlist-name3"  class="full autofill list-select-input empty" title="">
  151.                     </li>
  152.                     <li class="note">Or add to an existing playlist:</li>
  153.                     <li>
  154.                         <select id="existPlayList3">
  155.                             <option value="0">-Select Your Playlist-</option>
  156.                             <?php
  157.                                 $db =& JFactory::getDBO();
  158.                                 $user =& JFactory::getUser();
  159.                                
  160.                                 $query = "select playlist_name,playlist_id from #__jmplayer_playlist where user_id =". $user->id;
  161.                                 $db->setQuery($query);
  162.                                 if($db->query())
  163.                                 {
  164.                                     if($db->getAffectedRows())
  165.                                     {
  166.                                         $rows =$db->loadRowList();
  167.                                         foreach($rows as $row)
  168.                                         {  
  169.                             ?>         
  170.                                             <option value="<?php echo $row[1]; ?>"><?php echo $row[0]; ?></option>
  171.  
  172.                             <?php
  173.                                         }
  174.                                     }
  175.                                 }
  176.                             ?>     
  177.                         </select>
  178.                     </li>
  179.                       </ol>
  180.                     </div>
  181.                     <footer class="cpanel-btns">
  182.                          <a class="btn green bevel saveEach" id="save-each-playlist-btn"  >Save</a>    
  183.                     </footer>
  184.                   </div>
  185.                 </form>
  186.                  <a class="close-reveal-modal">&#215;</a>
  187.                 <input type="hidden" id="getId" name="getId"  />
  188. </div>
  189.  
  190.  
  191. <?php } $path = JURI::root(true).DS.'components' . DS . 'com_jmplayer'.DS.'assets'.DS .'jquery.min.js';
  192.  
  193.  ?>
  194.  
  195. <?php $session =& JFactory::getSession();?>
  196.     <div class="tTrackId" style="display:none;"></div>
  197. <script src="<?php echo $path ?>"></script>
  198.  
  199. <script>
  200.     //var j = jQuery.noConflict();
  201.     $(document).ready(function () {
  202.         var id=new Array();
  203.      $(".saveEach").click(function(event)
  204.     {
  205.     var i=0;
  206.     /*$('ul#playlistUl li').each(function()
  207.     {
  208.         id[i] = $(this).attr('id');
  209.         i++;
  210.     });*/
  211.    
  212.     $.ajax({
  213.           type: "POST",
  214.           url: "<?php echo JURI::root().'/setSessionOnClick.php'; ?>",
  215.           data: { name: "John", location: "Boston" }
  216.         }).done(function( msg ) {
  217.          
  218.         $('.tTrackId').html(msg);
  219.    
  220.     id[0] = $('.tTrackId').html();
  221.    
  222.     var fetchurl = "<?php echo JURI::base().'jmplayerplaylist1.php'; ?>";
  223.     var trimmedVal = $.trim( $("#save-playlist-name3").val() );
  224.    
  225.     var typeChoose = $('input:radio[name=chooseType3]:checked').val();
  226.    
  227.     if(id.length > 0){
  228.         if(typeChoose == "createNew"){
  229.             if(trimmedVal == "")
  230.             {
  231.                 alert("Please enter a name of your playlist"); 
  232.                 return false;
  233.             }
  234.             else
  235.             {
  236.                 $.post(fetchurl,{typeChoose: typeChoose , playlist: trimmedVal , idList: id},
  237.                     function(data) {
  238.                         alert(data);
  239.                     $('#sbox-window #sbox-btn-close').trigger('click');
  240.                 });        
  241.             }
  242.         }
  243.         else if(typeChoose == "useExist"){
  244.             var existPlayListId = $('select#existPlayList3 option:selected').val();
  245.             if($('select#existPlayList3 option:selected').val() == "0" || $('select#existPlayList3 option:selected').val() == ""){  
  246.                 alert("Please Choose Any One from Existed Playlist");
  247.                 return false;  
  248.             }
  249.             else
  250.             {
  251.                
  252.                 $.post(fetchurl,{ typeChoose: typeChoose , existPlayListId: existPlayListId, idList: id},
  253.                     function(data)
  254.                     {
  255.                     alert(data);
  256.                     $('#sbox-window #sbox-btn-close').trigger('click');
  257.                 });        
  258.             }
  259.         }
  260.     }            
  261.     else{
  262.         alert("There are no songs, Please choose songs");  
  263.         return false;
  264.     }  
  265.        
  266.     });
  267.      event.preventDefault();
  268.    });
  269.  
  270.    
  271.  
  272. });
  273.  
  274.    
  275. </script>
  276.  
  277.  
  278. <article class="player">
  279. <div id="jquery_jplayer"></div>
  280. <div id="jp_container_1" class="jp-video jp-video-270p">
  281.   <div class="jp-type-playlist">
  282.     <div id="jquery_jplayer_1" class="jp-jplayer"></div>
  283.     <div class="jp-gui">
  284.    
  285.       <div class="jp-video-play"></div>
  286.       <div class="jp-interface">
  287.         <div class="jp-controls-holder">
  288.             <div style="left: 195px;top: -3px;position: absolute;float: left;">
  289.         <div id="title" style="float: left;"></div><div style="float: left;">
  290.             <a onclick="starredCurrentPlaylist();" id="starredLink" style="display:none;" data-reveal-id="currentStarredPopup" ><div class="currentStarred" onclick="popup('popUpDiv')"></div></a>
  291.     <a  id="RemovestarredLink" style="display:none;"><div class="currentStarredRemove"></div></a>
  292.         <div id="starredRecords"></div>
  293.        
  294.         </div>
  295.             </div>
  296.        
  297.  
  298.        <div></div>
  299.           <ul class="jp-controls">
  300.             <li><a href="javascript:;" class="jp-previous" tabindex="1">previous</a></li>
  301.             <li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
  302.             <li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
  303.             <li><a href="javascript:;" class="jp-next" tabindex="1">next</a></li>
  304.             <li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
  305.           </ul>
  306.           <div class="jp-current-time"></div>
  307.           <div class="jp-progress">
  308.             <div class="jp-seek-bar" style="width: 0%;">
  309.               <div class="jp-play-bar" style="width: 0%;"></div>
  310.             </div>
  311.           </div>
  312.           <div class="jp-duration"></div>
  313.           <div class="volumediv">
  314.             <ul class="jp-controls">
  315.               <li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute" style="">mute</a></li>
  316.               <li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute" style="display: none; ">unmute</a></li>
  317.               <li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume" style="">max volume</a></li>
  318.             </ul>
  319.             <div class="jp-volume-bar" style="">
  320.               <div class="jp-volume-bar-value" style="width: 80%; "></div>
  321.             </div>
  322.           </div>
  323.        
  324.        
  325.        
  326.           <ul class="jp-toggles">
  327.         <li> <!--temp-->
  328.         <a rel="nofollow" class="jp-share" title="Add to Starred Songs" onmousedown="this.blur();" rel="nofollow" title="share" href="http://www.facebook.com/share.php?u=<http://www.kandysms.com>" onclick="return fbs_click()" target="_blank"   >  
  329.     share</a>
  330.         </li>
  331.             <!--<li><a href="javascript:;" class="jp-share" tabindex="1" title="share">share</a></li>-->
  332.  
  333.             <!--<li><a href="javascript:;" class="jp-share-off" tabindex="1" title="share off">share off</a></li>-->
  334.             <li><a href="javascript:;" class="jp-shuffle" tabindex="1" title="shuffle">shuffle</a></li>
  335.             <li><a href="javascript:;" class="jp-shuffle-off" tabindex="1" title="shuffle off">shuffle off</a></li>
  336.             <li><a href="javascript:;" class="jp-repeat" tabindex="1" title="repeat">repeat</a></li>
  337.             <li><a href="javascript:;" class="jp-repeat-off" tabindex="1" title="repeat off">repeat off</a></li>
  338.           </ul>
  339.        
  340.         </div>
  341.       </div>
  342.     </div>
  343.     <!--<div class="jp-playlist">
  344.                     <ul>
  345.                          The method Playlist.displayPlaylist() uses this unordered list
  346.                         <li><span class="jp-video-play"><a href="javascript:;" class="jp-video-play-icon" tabindex="1">play</a></span></li>
  347.                     </ul>
  348.               </div>-->
  349.     <div class="jp-no-solution"> <span>Update Required</span> To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>. </div>
  350.   </div>
  351. </div>
  352.       <div class="showplaying">
  353.         <?php // newly added code for playlist show/hide button ?>
  354.         <div><a href="#" id="slidePlaylist"><img src="<?php echo JURI::root(true) ?>/templates/jmskinner/img/hide.png"  id="enabled"/></a></div>
  355.         <?php // newly added code for playlist show/hide button ?>
  356.        
  357.       </div>
  358.  
  359.     </article>
  360. <!--Jplayer  -->
  361. <?php
  362.     $document->addScript("http://code.jquery.com/jquery-latest.js");
  363.     $document->addScript("http://jquery-ui.googlecode.com/svn/tags/latest/ui/jquery.effects.core.js");
  364.    
  365.     $document->addScript("http://jquery-ui.googlecode.com/svn/tags/latest/ui/jquery.effects.slide.js");
  366. ?>
  367. <script>
  368. // newly added code for playlist show/hide
  369.  
  370. $(function() {
  371.  
  372.  
  373. function runEffect(){
  374. if($('#slidePlaylist img').attr("id") === 'disabled'){
  375.     $('#slidePlaylist img').attr("id", "enabled");
  376.     $('#slidePlaylist img').attr("src",'<?php echo JURI::root(true) ?>/templates/jmskinner/img/hide.png');
  377.     $('.main_bg').css('background','none');
  378.     $('.margin_l').css('margin-left','10px');
  379.     $("#drawer").hide();
  380.    
  381. }
  382.  
  383. else if($('#slidePlaylist img').attr("id") === 'enabled'){
  384.     $('#slidePlaylist img').attr("id", "disabled");
  385.     $('#slidePlaylist img').attr("src",'<?php echo JURI::root(true) ?>/templates/jmskinner/img/show.png');
  386.    
  387.     $('.main_bg').removeAttr('style');
  388.     /*$('.margin_l').css('margin-left','263px');*/
  389.     $("#drawer").css('width','277px');
  390.     $("#drawer").css('float','left');
  391.     $("#drawer").show();
  392.    
  393. }
  394. };
  395.    
  396.     $("#slidePlaylist").click(function() {
  397.        
  398.        
  399.         runEffect();
  400.        
  401.     });
  402. });
  403. // End newly added code for playlist show/hide
  404.  
  405. // newly added code for jplayer title
  406.    
  407.     function exc()
  408.         {
  409.         var searchString = 'Test Track123';
  410.         var elements = document.getElementsByClassName('jp-playlist-current');
  411.         for (var i = 0; i < 1; i++) {
  412.                 var searchString = 'jp-playlist-current';
  413.             var element = document.getElementsByTagName('li');
  414.        
  415.             for (var i = 0; i < element.length; i++)
  416.             {
  417.                     if (element[i].innerHTML.indexOf(searchString) !== -1)
  418.                 {
  419.                     var splitOne= element[i].innerHTML.split('"1">');
  420.                     var split1= splitOne[1];
  421.                     var splitTwo= split1.split('<span');
  422.                     var split2= splitTwo[0];
  423.                     document.getElementById('title').innerHTML = split2;
  424.                     document.getElementById('starredLink').style.display = "block";
  425.                     break;
  426.                     }
  427.             }
  428.  
  429.         }
  430.  
  431.  
  432.            
  433.        
  434.  
  435. }  
  436. //End newly added code for jplayer title
  437.  
  438. //newly added code for jplayer starred
  439.  
  440. function starredCurrentPlaylist(){
  441.        
  442.         var searchString = 'Test Track123';
  443.         var elements = document.getElementsByClassName('jp-playlist-current');
  444.        
  445.         for (var i = 0; i < 1; i++) {
  446.                 var searchString = 'jp-playlist-current';
  447.             var element = document.getElementsByTagName('li');
  448.             for (var i = 0; i < element.length; i++) {
  449.                
  450.                     if (element[i].innerHTML.indexOf(searchString) !== -1) {
  451.                      
  452.                 var idStarred= element[i].id;
  453.                
  454.                 document.getElementById('starredLink').style.display = "none";
  455.                 document.getElementById('RemovestarredLink').style.display = "block";
  456.                
  457.                 starredplaylist(idStarred);
  458.                
  459.                
  460.  
  461.                     break;
  462.                     }
  463.             }
  464.            
  465.         }
  466.  
  467.        
  468. }
  469.  
  470. //End newly added code for jplayer starred
  471. </script>
  472.  
  473. <?php
  474. $session =& JFactory::getSession();
  475. $playlistSession= $session->get('sessionPlaylist');
  476. $starredlistSession = $session->get('sessionStarredlist');
  477.  
  478. ?>
  479. <script>
  480. //newly added code for jplayer refresh issues
  481.  
  482.     $(document).ready(function() {
  483.            
  484.         <?php
  485.             if(!empty($playlistSession)){          
  486.                 for($i=0;$i<count($playlistSession);$i++){
  487.         ?>
  488.                     addtoplaylist("<?php echo $playlistSession[$i] ?>");
  489.         <?php
  490.                 }
  491.             }
  492.         ?>
  493.            
  494.         <?php
  495.            
  496.             if(!empty($starredlistSession)){           
  497.                 for($i=0;$i<count($starredlistSession);$i++){
  498.         ?>
  499.                     starredplaylist("<?php echo $starredlistSession[$i] ?>");
  500.         <?php
  501.                 }
  502.             }
  503.         ?>
  504.        
  505.     });
  506.    
  507.     function loadPlaylist(){
  508.        
  509.         var sessionPlaylist="";
  510.         $("ul#playlistUl li").each(function(index) {
  511.                 sessionPlaylist +=  $(this).attr('id') + "|" ;
  512.         });
  513.         $.ajax({
  514.                 type: "POST",
  515.                 url: "index.php?option=com_jmplayer&view=session",
  516.                 data: { sessionPlaylist: sessionPlaylist, mode: 'list1' }
  517.             }).done(function( msg ) {
  518.                 //alert(msg);
  519.         });
  520.     }
  521.  
  522.     /*function loadStarredlist(){
  523.         //alert('kk');
  524.        
  525.         var sessionStarredlist="";
  526.         $("ul#starredlistUl li").each(function(index) {
  527.                 sessionStarredlist +=  $(this).attr('id') + "|" ;
  528.            
  529.            
  530.         });
  531.         $.ajax({
  532.                 type: "POST",
  533.                 url: "index.php?option=com_jmplayer&view=session",
  534.                 data: { sessionStarredlist: sessionStarredlist, mode: 'list2'  }
  535.             }).done(function( msg ) {
  536.                 //alert(msg);
  537.         });
  538.    
  539.     }*/
  540.    
  541. //End of newly added code for jplayer refresh issues
  542. </script>
  543. <script type="text/javascript" language="JavaScript">
  544.        
  545.  
  546.         var myPlaylist = new jPlayerPlaylist({
  547.             jPlayer: "#jquery_jplayer_1",
  548.             cssSelectorAncestor: "#jp_container_1"
  549.         }, {
  550.              playlistOptions: {
  551.     enableRemoveControls: true
  552.   },
  553.             swfPath: "http://www.jplayer.org/latest/js/Jplayer.swf",
  554.                         supplied: "mp3",
  555.                         volume: 1,
  556.                         wmode:"window",
  557.                         solution: "html,flash"
  558.         });
  559.        
  560.         var starPlaylist = new jPlayerPlaylist({
  561.             jPlayer: "#jquery_jplayer_2",
  562.             cssSelectorAncestor: "#jp_container_2"
  563.         }, {
  564.             swfPath: "http://www.jplayer.org/latest/js/Jplayer.swf",
  565.                         supplied: "mp3",
  566.                         volume: 1,
  567.                         wmode:"window",
  568.                         solution: "html,flash"
  569.         });
  570.            
  571.         var yourPlaylist = new jPlayerPlaylist({
  572.             jPlayer: "#jquery_jplayer_3",
  573.             cssSelectorAncestor: "#jp_container_3"
  574.         }, {
  575.             swfPath: "http://www.jplayer.org/latest/js/Jplayer.swf",
  576.                         supplied: "mp3",
  577.                         volume: 1,
  578.                         wmode:"window",
  579.                         solution: "html,flash"
  580.         });
  581.  
  582. //<![CDATA[
  583. $(document).ready(function(){
  584.  
  585.  
  586.  
  587. //      var myPlaylist = new jPlayerPlaylist({
  588. //          jPlayer: "#jquery_jplayer_1",
  589. //          cssSelectorAncestor: "#jp_container_1"
  590. //      }, {
  591. //          swfPath: "js",
  592. //          supplied: "mp3",
  593. //          wmode: "window"
  594. //      });
  595. //     
  596. //      var starPlaylist = new jPlayerPlaylist({
  597. //          jPlayer: "#jquery_jplayer_2",
  598. //          cssSelectorAncestor: "#jp_container_2"
  599. //      }, {
  600. //          swfPath: "js",
  601. //          supplied: "mp3",
  602. //          wmode: "window"
  603. //      });
  604. //         
  605. //      var yourPlaylist = new jPlayerPlaylist({
  606. //          jPlayer: "#jquery_jplayer_3",
  607. //          cssSelectorAncestor: "#jp_container_3"
  608. //      }, {
  609. //          swfPath: "js",
  610. //          supplied: "mp3",
  611. //          wmode: "window"
  612. //      });
  613.      
  614.        
  615. /*----------------------First playlist-----------------------*/        
  616.     $(".playlist-add").click(function(e) {
  617.            
  618.             //var getTitle = $('.jp-playlist-current').find("a.jp-playlist-current").text();
  619.             //$('.jp-controls-holder .title').text(getTitle) ;
  620.            
  621.             var trackdata = $(".playlist-add").each('href');
  622.                        
  623.                 fetchurl = "<?php echo JURI::base().'addtrackdata.php'; ?>";         
  624.                 $.post(fetchurl,{ trackid: trackdata },
  625.                       function(data) {
  626.                       var string = data.split(',');
  627.                         myPlaylist.add({
  628.                             title:string[0],
  629.                             artist:string[1],
  630.                             mp3:string[2],
  631.                             poster: string[3]
  632.                     });
  633.                    
  634.                 //  var trackcount = $("#playtotal").html();
  635.                 var trackcount = parseInt($("#playtotal").html());
  636.                 $("#playtotal").text( trackcount+1);
  637.  
  638.                
  639.                  
  640.                });             
  641.     });
  642. /*----------------------First playlist-----------------------*/    
  643.    
  644. /*----------------------First playlist reove -----------------------*/     
  645.     $("#playlist1remove").click(function() {
  646.             myPlaylist.remove();             
  647.              $("#playtotal").text(0);
  648.     });
  649. /*----------------------First playlist reove -----------------------*/     
  650.    
  651.            
  652. /*----------------------second playlist-----------------------*/           
  653.     $(".ratinglist").click(function() {    
  654.             var trackdata = $(".ratinglist").attr('tabindex'); 
  655.             //alert(trackdata);
  656.             fetchurl = "<?php echo JURI::base().'addtrackdata.php'; ?>";         
  657.      
  658.                 $.post(fetchurl,{ trackid: trackdata },            
  659.                               function(data) {
  660.                               var string = data.split(',');
  661.                                 starPlaylist.add({
  662.                                     title:string[0],
  663.                                     artist:string[1],
  664.                                     mp3:string[2],
  665.                                     poster: string[3]
  666.                                    
  667.                             });        
  668.                    
  669.                     //  var trackcount = $("#playtotal").html();
  670.                     var trackcount = parseInt($("#starredtotal").html());
  671.                     $("#starredtotal").text( trackcount+1);
  672.                    
  673.                  
  674.                      
  675.                    });     
  676.     });
  677. /*----------------------second playlist-----------------------*/       
  678.  
  679. /*----------------------third playlist-----------------------*/        
  680.     $(".moreinfolist").click(function() {      
  681.             var trackdata = $(".moreinfolist").attr('tabindex');   
  682.            
  683. //          tra
  684.             fetchurl = "<?php echo JURI::base().'addtrackdata.php'; ?>";         
  685.      
  686.             $.post(fetchurl,{ trackid: trackdata },            
  687.                           function(data) {
  688.                           var string = data.split(',');
  689.                             yourPlaylist.add({
  690.                                 title:string[0],
  691.                                 artist:string[1],
  692.                                 mp3:string[2],
  693.                                 poster: string[3]
  694.                                
  695.                         });        
  696.                
  697.                 //  var trackcount = $("#playtotal").html();
  698.                 var trackcount = parseInt($("#playlisttotal").html());
  699.                 $("#playlisttotal").text( trackcount+1);
  700.                  
  701.                });                                   
  702.            
  703. });
  704. /*----------------------third  playlist-----------------------*/   
  705.  
  706.    
  707. });
  708.  
  709.  
  710.  function addtoplaylist(trackid)
  711.  {
  712.     var trackdata = trackid;
  713.     var mode = "addPlayList";
  714.     fetchurl = "<?php echo JURI::base().'addtrackdata.php'; ?>";         
  715.     $.post(fetchurl,{ trackid: trackdata },
  716.             function(data) {
  717.             var string = data.split(',');
  718.            
  719.             myPlaylist.add({
  720.                 title:string[0],
  721.                 artist:string[1],
  722.                 mp3:string[2],
  723.                 poster: string[3],
  724.                 id:trackid,
  725.                 mode:mode
  726.                
  727.         });
  728.        
  729.        
  730.            
  731.        
  732.        
  733.     var trackcount = $("#playtotal").html();
  734.     var trackcount = parseInt($("#playtotal").html());
  735.        
  736.     $("#playtotal").text( trackcount+1);
  737.  
  738.         var playfirst = parseInt($("#playtotal").html());
  739.         if(playfirst==1){
  740.             myPlaylist.play();
  741.            
  742.         }
  743.        
  744.     });    
  745.  
  746. }
  747.  
  748.  
  749.  function starredplaylist(trackid){
  750.  
  751.     var trackdata = trackid;   
  752.     var mode = "starredPlayList";
  753.     fetchurl = "<?php echo JURI::base().'starredplaylist.php'; ?>";      
  754.     $.post(fetchurl,{ trackid: trackdata },
  755.             function(data) {
  756.             var string = data.split(',');
  757.            
  758.             starPlaylist.add({
  759.                 title:string[0],
  760.                 artist:string[1],
  761.                 mp3:string[2],
  762.                 poster: string[3],
  763.                 id:trackid,
  764.                 mode:mode
  765.             });
  766.     var trackcount = $("#starredtotal").html();
  767.     var trackcount = parseInt($("#starredtotal").html());
  768.     $("#starredtotal").text( trackcount+1);
  769.     //loadStarredlist();
  770.     });
  771.  
  772.    
  773. }
  774.  
  775. function yourlist(trackid){
  776.  
  777.     var trackdata = trackid;
  778.    
  779.     fetchurl = "<?php echo JURI::base().'addtrackdata.php'; ?>";         
  780.     $.post(fetchurl,{ trackid: trackdata },
  781.             function(data) {
  782.             var string = data.split(',');
  783.             yourPlaylist.add({
  784.                 title:string[0],
  785.                 artist:string[1],
  786.                 mp3:string[2],
  787.                 poster: string[3]
  788.         });
  789.     });
  790. }
  791.  
  792. function playnow(trackid){
  793.  
  794.    
  795. //play now from login play list
  796.     var trackdata = trackid;   
  797.    
  798.     fetchurl = "<?php echo JURI::base().'addtrackdata.php'; ?>";         
  799.     $.post(fetchurl,{ trackid: trackdata },
  800.             function(data) {
  801.             var string = data.split(',');
  802.             myPlaylist.add({
  803.                 title:string[0],
  804.                 artist:string[1],
  805.                 mp3:string[2],
  806.                 poster: string[3]
  807.         });
  808.  
  809.         var trackcount = $("#playtotal").html();
  810.     var trackcount = parseInt($("#playtotal").html());
  811.     $("#playtotal").text( trackcount+1);
  812.         myPlaylist.play();
  813.        
  814.          var getTitle = $('.jp-playlist-current').find("a.jp-playlist-current").html();
  815.             var getArray = getTitle.split('<span');
  816.             if(getArray != "")
  817.             getTitle = getArray[0];
  818.             $('.jp-controls-holder .title').text(getTitle);
  819.     });    
  820.    
  821. }
  822.  
  823.  
  824. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement