From ea07030cd84d4637af61e7cc93e566027667e3f0 Mon Sep 17 00:00:00 2001 From: naomiaro Date: Thu, 14 Oct 2010 20:39:45 -0400 Subject: [PATCH] can add a playlist to scratchpad from search/browse, popups are gone from adding to playlist, removing from playlist. --- htmlUI/html/js/playlist.js | 17 +++++++++++++-- htmlUI/templates/library/actionhandler.tpl | 3 ++- htmlUI/templates/playlist/editor.tpl | 2 +- htmlUI/templates/script/collector.js.tpl | 25 ++++++++++++++++++++-- htmlUI/templates/script/contextmenu.js.tpl | 13 ++++++----- htmlUI/ui_handler.php | 14 ++++++------ htmlUI/ui_scratchpad.class.php | 8 +++---- 7 files changed, 58 insertions(+), 24 deletions(-) diff --git a/htmlUI/html/js/playlist.js b/htmlUI/html/js/playlist.js index 507e3374d..6dc08fac3 100644 --- a/htmlUI/html/js/playlist.js +++ b/htmlUI/html/js/playlist.js @@ -70,8 +70,21 @@ $(document).ready(function() { id = tr.find("input").attr('name'); - hpopup('ui_handler.php?act=PL.addItem&id='+id); - + $.post("ui_handler.php", + + { 'act': 'PL.addItem', 'id': id }, + + function(data){ + + if(data.error){ + alert(data.error); + } + + location.reload(); + }, + + "json" + ); } //PL main editor. diff --git a/htmlUI/templates/library/actionhandler.tpl b/htmlUI/templates/library/actionhandler.tpl index 48be54848..a80ac5c99 100644 --- a/htmlUI/templates/library/actionhandler.tpl +++ b/htmlUI/templates/library/actionhandler.tpl @@ -1,4 +1,4 @@ -onClick="return contextmenu('{$i.id}' +onClick="return contextmenu('{$i.id}' , '{$i.type}' , 'SP.addItem' {if $i.type|lower == 'audioclip'} @@ -34,6 +34,7 @@ onClick="return contextmenu('{$i.id}' {else} , 'SCHEDULER.addPL' , 'PL.addItem' + , 'PL.activate' , 'delete' {/if} {else} diff --git a/htmlUI/templates/playlist/editor.tpl b/htmlUI/templates/playlist/editor.tpl index 974270ceb..03fb84c9a 100644 --- a/htmlUI/templates/playlist/editor.tpl +++ b/htmlUI/templates/playlist/editor.tpl @@ -57,7 +57,7 @@
- +
diff --git a/htmlUI/templates/script/collector.js.tpl b/htmlUI/templates/script/collector.js.tpl index 7eb4b7809..0850303b4 100644 --- a/htmlUI/templates/script/collector.js.tpl +++ b/htmlUI/templates/script/collector.js.tpl @@ -24,8 +24,29 @@ function collector_submit(formname, action, script, name, width, height) return; {literal} } - if (name) popup (script + '?act=' + action + href, popup, width, height); - else hpopup(script + '?act=' + action + href); + if (name){ + popup (script + '?act=' + action + href, popup, width, height); + } + else { + //alert(action); + //hpopup(script + '?act=' + action + href); + + $.post(script + '?act=' + action + href, + + {}, + + function(data){ + + if(data.error){ + alert(data.error); + } + + location.reload(); + }, + + "json" + ); + } } function collector_switchAll(formname) diff --git a/htmlUI/templates/script/contextmenu.js.tpl b/htmlUI/templates/script/contextmenu.js.tpl index 801d65b3f..7b8be1fd0 100644 --- a/htmlUI/templates/script/contextmenu.js.tpl +++ b/htmlUI/templates/script/contextmenu.js.tpl @@ -1,6 +1,5 @@ {literal}