From e4cf1a6fcf03500ac41add5b3e05297c01cacc81 Mon Sep 17 00:00:00 2001 From: naomiaro Date: Wed, 6 Oct 2010 10:40:46 -0400 Subject: [PATCH] side playlist box and gui changes --- htmlUI/html/css/playlist.css | 29 +++++++- htmlUI/html/js/playlist.js | 71 +++++++++++++++---- htmlUI/html/styles_campcaster.css | 24 +++++-- htmlUI/templates/library/results.tpl | 44 ++++++------ htmlUI/templates/library/simpleSearchForm.tpl | 2 +- htmlUI/templates/masterpanel.tpl | 6 +- htmlUI/templates/playlist/editor.tpl | 50 ++++++------- htmlUI/templates/scratchpad/main.tpl | 35 ++++----- htmlUI/templates/script/collector.js.tpl | 6 +- htmlUI/ui_browser.php | 1 + htmlUI/ui_handler.php | 8 +-- htmlUI/ui_playlist.class.php | 7 +- 12 files changed, 190 insertions(+), 93 deletions(-) diff --git a/htmlUI/html/css/playlist.css b/htmlUI/html/css/playlist.css index fe6db805f..d473c9e5f 100644 --- a/htmlUI/html/css/playlist.css +++ b/htmlUI/html/css/playlist.css @@ -55,12 +55,11 @@ } .pl_main { - clear: left; + } .pl_row { background-color: #d5e2ee; - clear:left; cursor:move; } @@ -154,3 +153,29 @@ text-align: right; padding: 6px; } + +#spl_sortable { + list-style-type: none; + padding: 0; + margin: 0; +} + +#spl_head { + background-color: #8BAED1; + font-weight: bold; + color: #ffffff; +} + +.spl_title { + width: 73px; +} + +.spl_artist { + width: 83px; +} + +.spl_empty { + height: 30px; + text-align: center; + padding-top: 10px; +} \ No newline at end of file diff --git a/htmlUI/html/js/playlist.js b/htmlUI/html/js/playlist.js index e06ce00f4..918be0c5f 100644 --- a/htmlUI/html/js/playlist.js +++ b/htmlUI/html/js/playlist.js @@ -1,21 +1,37 @@ $(document).ready(function() { - - $("#pl_sortable").sortable(); + + $('#search_results').find('tr').not('.blue_head').draggable({ + connectToSortable: 'ul#spl_sortable', + helper: 'clone' + }); + + $('#cc_right_panel').find('h1').click(function(){ + $(this).siblings().toggle(); + }); - $("#pl_sortable" ).bind( "sortstop", function(event, ui) { - var li, newPos, oldPos; + function movePLItem(event, ui) { + var ul, li, newPos, oldPos, id_prefix, tag; + tag = ui.item.get(0).tagName + + if( tag === "TR") + return; + + ul = $(this); li = ui.item; - newPos = $(this).children().index(li); - oldPos = li.attr('id').split("_").pop(); + + var temp = li.attr('id').split("_"); + + newPos = ul.children().index(li); + oldPos = temp[1]; + id_prefix = temp[0]; - $.post("ui_handler.php", + $.post('ui_handler.php', { 'act': 'PL.moveItem', 'oldPos': oldPos, 'newPos': newPos }, function(data){ - var ul = $("#pl_sortable"); if(data.error) { var size, @@ -23,10 +39,10 @@ $(document).ready(function() { size = $(ul).children().size(); - tmp_ul = $("