can add a playlist to scratchpad from search/browse, popups are gone from adding to playlist, removing from playlist.

This commit is contained in:
naomiaro 2010-10-14 20:39:45 -04:00
parent 69f526b572
commit ea07030cd8
7 changed files with 58 additions and 24 deletions

View File

@ -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.

View File

@ -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}

View File

@ -57,7 +57,7 @@
<input type="button" class="button_large" onClick="collector_clearAll('PL', 'PL.removeItem')" value="##Clear Playlist##" />
</div>
<div class="pl_container_button">
<input type="button" class="button_large" onClick="popup('{$UI_BROWSER}?popup[]=PL.confirmRelease', 'PL.confirmRelease', 400, 50)" value="##Close Playlist##">
<input type="button" class="button_large" onClick="popup('{$UI_BROWSER}?popup[]=PL.confirmRelease', 'PL.confirmRelease', 1,1)" value="##Close Playlist##">
<input type="button" class="button_large" value="##Description##" onClick="location.href='{$UI_BROWSER}?act=PL.editMetaData'">
<input type="button" class="button_large" value="##Delete Playlist##" onClick="popup('{$UI_BROWSER}?popup[]=PL.confirmDelete', 'PL.deleteActive', 400, 50)">
</div>

View File

@ -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)

View File

@ -1,6 +1,5 @@
{literal}
<script type="text/javascript">
// www.jjam.de - Kontextmen<65> mit JavaScript - Version 15.12.2002
// Browser detection
ie5 = (document.getElementById && document.all && document.styleSheets) ? 1 : 0;
@ -11,19 +10,19 @@ contextmenuStatus = 0;
document.onclick = hidecontextmenu;
function contextmenu(param) {
function contextmenu(param, type) {
var contextmenuHeader = "<div class='contextmenu' id='contextmenu' style='position: absolute; top: -1000; left: 0; z-index: 100'>" +
"<ul>";
var contextmenuFooter = "</ul></div>";
var contextmenuHtml = '';
var sp2 = "&nbsp;&nbsp;";
var sp5 = sp2 + sp2 + "&nbsp;"; // Leerzeichen als Abstandshalter (flexibler und code-sparender als eine aufwendige Tabellenkonstruktion) ;
var oF = "onfocus = 'if (this.blur) this.blur()'"; // Um h<>sslichen Linkrahmen in einigen Browsern zu vermeiden;
var sp5 = sp2 + sp2 + "&nbsp;";
var oF = "onfocus = 'if (this.blur) this.blur()'";
var entry = new Array();
//contextmenuStatus = 0;
for (var i = 1; i < contextmenu.arguments.length; ++i) {
for (var i = 2; i < contextmenu.arguments.length; ++i) {
switch (contextmenu.arguments[i]) {
{/literal}
case "PL.release":
@ -71,7 +70,7 @@ function contextmenu(param) {
break;
case "SP.addItem":
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: hpopup('{$UI_HANDLER}?act=SP.addItem&id="+param+"')\" "+oF+">&nbsp;##Add to ScratchPad##&nbsp;</a></li>";
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: hpopup('{$UI_HANDLER}?act=SP.addItem&id="+param+"&type="+type+"')\" "+oF+">&nbsp;##Add to ScratchPad##&nbsp;</a></li>";
break;
case "SP.removeItem":

View File

@ -114,7 +114,7 @@ switch ($_REQUEST['act']) {
break;
case "SP.addItem":
$uiHandler->SCRATCHPAD->addItem($_REQUEST['id']);
$uiHandler->SCRATCHPAD->addItem($_REQUEST['id'], $_REQUEST['type']);
$uiHandler->SCRATCHPAD->setReload();
break;
@ -297,7 +297,7 @@ switch ($_REQUEST['act']) {
case "PL.activate":
if ($uiHandler->PLAYLIST->activate($_REQUEST['id']) === TRUE) {
$uiHandler->SCRATCHPAD->addItem($_REQUEST['id'], TRUE);
$uiHandler->SCRATCHPAD->addItem($_REQUEST['id'], 'playlist');
}
$uiHandler->PLAYLIST->setReload();
break;
@ -308,7 +308,7 @@ switch ($_REQUEST['act']) {
if ($ids) {
//$uiHandler->SCRATCHPAD->addItem($ids);
}
$uiHandler->SCRATCHPAD->addItem($ui_tmpid, TRUE);
$uiHandler->SCRATCHPAD->addItem($ui_tmpid, 'playlist');
}
$uiHandler->PLAYLIST->setRedirect('_2PL.editMetaData');
break;
@ -319,8 +319,7 @@ switch ($_REQUEST['act']) {
$uiHandler->SCRATCHPAD->addItem($_REQUEST['id']);
}
}
$uiHandler->PLAYLIST->setReload();
break;
die('{"jsonrpc" : "2.0"}');
case "PL.setClipLength":
$uiHandler->PLAYLIST->setClipLength($_REQUEST['pos'], $_REQUEST['cueIn'], $_REQUEST['cueOut']);
@ -332,8 +331,9 @@ switch ($_REQUEST['act']) {
case "PL.removeItem":
$uiHandler->PLAYLIST->removeItem($_REQUEST['id']);
$uiHandler->PLAYLIST->setReload();
break;
//$uiHandler->PLAYLIST->setReload();
//break;
die('{"jsonrpc" : "2.0"}');
case "PL.release":
$uiHandler->PLAYLIST->release();

View File

@ -129,7 +129,7 @@ class uiScratchPad
* One or more media IDs.
* @return boolean
*/
public function addItem($ids, $playlist=FALSE)
public function addItem($ids, $type=null)
{
if (!$this->Base->STATIONPREFS[UI_SCRATCHPAD_MAXLENGTH_KEY]) {
if (UI_WARNING) {
@ -149,10 +149,10 @@ class uiScratchPad
$scratchpad = $this->get();
foreach ($ids as $id) {
if($playlist === FALSE)
$item = $this->Base->getMetaInfo($id);
else
if($type === 'playlist')
$item = $this->Base->getPLMetaInfo($id);
else
$item = $this->Base->getMetaInfo($id);
foreach ($scratchpad as $key => $val) {
if ($val['id'] == $item['id']) {