<?vlc --[[
vim:syntax=html
<!--  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
<  playlist: VLC media player web interface - playlist dialog
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
<  Copyright (C) 2005-2006 the VideoLAN team
<  $Id$
< 
<  Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
< 
<  This program is free software; you can redistribute it and/or modify
<  it under the terms of the GNU General Public License as published by
<  the Free Software Foundation; either version 2 of the License, or
<  (at your option) any later version.
< 
<  This program is distributed in the hope that it will be useful,
<  but WITHOUT ANY WARRANTY; without even the implied warranty of
<  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
<  GNU General Public License for more details.
< 
<  You should have received a copy of the GNU General Public License
<  along with this program; if not, write to the Free Software
<  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
This dialog needs the following dialogs to be fully functional: <none>
]]?>

<div id="playlist" class="dialog" >
  <div class="title">
    Playlist
    <img class="close" src="old/images/white_cross_small.png" alt="Close" onclick="hide('playlist');"/>
  </div>
  <div class="controls">
    <table>
      <tr>
        <td>
          <!--<button id="btn_delete" onmouseover="button_over(this);" onmouseout="button_out(this);">
            <img src="old/images/delete.png" alt="Delete" />
            <span class="btn_text">Delete</span>
          </button>-->
          <button id="btn_empty" onclick="pl_empty();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Empty" >
            <img src="old/images/empty.png" alt="Empty" />
            <span class="btn_text">Empty</span>
          </button>
          <button id="btn_shuffle" onclick="pl_shuffle();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Shuffle" >
            <img src="old/images/shuffle.png" alt="Shuffle" />
            <span class="btn_text">Shuffle</span>
          </button>
          <button id="btn_loop" onclick="pl_loop();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Loop" >
            <img src="old/images/loop.png" alt="Loop" />
            <span class="btn_text">Loop</span>
          </button>
          <button id="btn_repeat" onclick="pl_repeat();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Repeat" >
            <img src="old/images/repeat.png" alt="Repeat" />
            <span class="btn_text">Repeat</span>
          </button>
        </td>
        <td onmouseout="hide_menu('menu_sort');" onmouseover="show_menu('menu_sort');" >
          <button id="btn_sort" title="Sort" >
            <img src="old/images/sort.png" alt="Sort" />
            <span class="btn_text">Sort</span>
          </button>
          <div id="menu_sort" class="menu" >
            <div class="menuout" onclick="pl_sort('title',0);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Title ascending" >Title</div>
            <div class="menuout" onclick="pl_sort('title',1);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Title descending" >Title reverse</div>
            <div class="menuout" onclick="pl_sort('artist',0);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Artist ascending" >Artist</div>
            <div class="menuout" onclick="pl_sort('artist',1);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Artist ascending" >Artist reverse</div>
            <div class="menuout" onclick="pl_sort('album',0);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Album ascending" >Album</div>
            <div class="menuout" onclick="pl_sort('album',1);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Album ascending" >Album reverse</div>
            <div class="menuout" onclick="pl_sort('genre',0);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Genre ascending" >Genre</div>
            <div class="menuout" onclick="pl_sort('genre',1);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Genre ascending" >Genre reverse</div>
            <div class="menuout" onclick="pl_sort('random',0);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Randomize" >Random</div>
            <div class="menuout" onclick="pl_sort('id',0);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Id ascending" >Id</div>
            <div class="menuout" onclick="pl_sort('id',1);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Id descending" >Id reverse</div>
          </div>
        </td>
        <td onmouseover="show_menu('menu_sd');" onmouseout="hide_menu('menu_sd');">
          <button id="btn_sd" title="Services Discovery" >
            <img src="old/images/sd.png" alt="Services Discovery" />
            <span class="btn_text">Services Discovery</span>
          </button>
          <div id="menu_sd" class="menu" >
          <?vlc
            local sd = vlc.sd.get_services_names()
            for n,ln in pairs(sd) do
              print([[<div class="menuout" onclick='pl_sd("]]..vlc.strings.encode_uri_component(n)..[[");hide_menu("menu_sd");' onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Toggle ]]..ln..[[" >]]..ln..[[</div>]])
            end
          ?>
          </div>
        </td>
	<td style='width: 30px'></td>
        <td>
          <span class="btn_text">Live search:</span>
          <input title="Live search" type="text" value="<?vlc if _G.search_key then print(search_key) else print('<search>') end ?>" id="search" onfocus="if( this.value == '<search>' ) this.value = ''" onblur="if( this.value == '' ) reset_search()" onchange="update_playlist_search(this.value)" onkeyup="update_playlist_search(this.value)" />
          <button id="btn_search_reset" onclick="reset_search()" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Reset search">
            <img src="old/images/reset.png" alt="Reset" />
            <span class="btn_text">Reset</span>
          </button>
        </td>
      </tr>
    </table>
  </div>
  <div id="playtree">
    (?)
  </div>
</div>
