contextmenu on left/mouseover
This commit is contained in:
parent
9129b24e57
commit
99125718f6
14 changed files with 239 additions and 84 deletions
25
livesupport/modules/htmlUI/var/formmask/make_localisations.php
Executable file
25
livesupport/modules/htmlUI/var/formmask/make_localisations.php
Executable file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
/*
|
||||
this is used to extract all "label"-fields from metadataform for adding to localizer
|
||||
*/
|
||||
|
||||
include ('metadata.inc.php');
|
||||
|
||||
function flat($in)
|
||||
{
|
||||
global $ret;
|
||||
|
||||
foreach ($in as $key=>$val) {
|
||||
if (is_array($val)) {
|
||||
flat($val);
|
||||
} else {
|
||||
if ($key==='label')
|
||||
echo "##$val##\r";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#print_r($mask);
|
||||
flat($mask);
|
||||
?>
|
25
livesupport/modules/htmlUI/var/formmask/make_relations.php
Executable file
25
livesupport/modules/htmlUI/var/formmask/make_relations.php
Executable file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
/*
|
||||
this is used to extract relations between label and fieldname from metadataform.
|
||||
*/
|
||||
|
||||
include ('metadata.inc.php');
|
||||
|
||||
function flat($in)
|
||||
{
|
||||
global $ret;
|
||||
|
||||
foreach ($in as $key=>$val) {
|
||||
if (is_array($val)) {
|
||||
flat($val);
|
||||
} else {
|
||||
if ($key==='label')
|
||||
echo "'".$in['element']."' => '".$in['label']."',<br>";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#print_r($mask);
|
||||
flat($mask);
|
||||
?>
|
62
livesupport/modules/htmlUI/var/formmask/mdata_relations.inc.php
Executable file
62
livesupport/modules/htmlUI/var/formmask/mdata_relations.inc.php
Executable file
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
$relations = array(
|
||||
'dc:title' => 'Title',
|
||||
'dc:creator' => 'Creator',
|
||||
'dc:type' => 'Genre',
|
||||
'dc:format' => 'File format',
|
||||
'dcterms:extent' => 'Length',
|
||||
'dc:title' => 'Title',
|
||||
'dc:creator' => 'Creator',
|
||||
'dc:source' => 'Album',
|
||||
'ls:year' => 'Year',
|
||||
'dc:type' => 'Genre',
|
||||
'dc:description' => 'Description',
|
||||
'dc:format' => 'Format',
|
||||
'ls:bpm' => 'BPM',
|
||||
'ls:rating' => 'Rating',
|
||||
'dcterms:extent' => 'Length',
|
||||
'ls:encoded_by' => 'Encoded by',
|
||||
'ls:track_num' => 'Track number',
|
||||
'ls:disc_num' => 'Disc number',
|
||||
'ls:mood' => 'Mood',
|
||||
'dc:publisher' => 'Label',
|
||||
'ls:composer' => 'Composer',
|
||||
'ls:bitrate' => 'Bitrate',
|
||||
'ls:channels' => 'Channels',
|
||||
'ls:samplerate' => 'Sample rate',
|
||||
'ls:encoder' => 'Encoder software used',
|
||||
'ls:crc' => 'Checksum',
|
||||
'ls:lyrics' => 'Lyrics',
|
||||
'ls:orchestra' => 'Orchestra or band',
|
||||
'ls:conductor' => 'Conductor',
|
||||
'ls:lyricist' => 'Lyricist',
|
||||
'ls:originallyricist' => 'Original lyricist',
|
||||
'ls:radiostationname' => 'Radio station name',
|
||||
'ls:audiofileinfourl' => 'Audio file information web page',
|
||||
'ls:artisturl' => 'Artist web page',
|
||||
'ls:audiosourceurl' => 'Audio source web page',
|
||||
'ls:radiostationurl' => 'Radio station web page',
|
||||
'ls:buycdurl' => 'Buy CD web page',
|
||||
'ls:isrcnumber' => 'ISRC number',
|
||||
'ls:catalognumber' => 'Catalog number',
|
||||
'ls:originalartist' => 'Original artist',
|
||||
'dc:rights' => 'Copyright',
|
||||
'dc:title' => 'Title',
|
||||
'dcterms:temporal' => 'Report date/time',
|
||||
'dcterms:spatial' => 'Report location',
|
||||
'dcterms:entity' => 'Report organizations',
|
||||
'dc:description' => 'Description',
|
||||
'dc:creator' => 'Creator',
|
||||
'dc:subject' => 'Subject',
|
||||
'dc:type' => 'Genre',
|
||||
'dc:format' => 'Format',
|
||||
'dc:contributor' => 'Contributor',
|
||||
'dc:language' => 'Language',
|
||||
'dc:rights' => 'Copyright',
|
||||
'dc:title' => 'Title',
|
||||
'dc:creator' => 'Creator',
|
||||
'dcterms:extent' => 'Length',
|
||||
'dc:description' => 'Description',
|
||||
|
||||
'ls:url' => 'Stream URL'
|
||||
);
|
|
@ -27,7 +27,7 @@
|
|||
{include file="script/basics.js.tpl"}
|
||||
{include file="script/contextmenu.js.tpl"}
|
||||
{include file="script/collector.js.tpl"}
|
||||
{include file="script/alt.js.tpl"}
|
||||
{include file="script/alttext.js.tpl"}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
onMouseover="showAlt('Some info about file ID {$i.id}')"
|
||||
onMouseout="hideAlt()"
|
||||
{UIBROWSER->getMDataArr id=$i.id assign="_metaarr"}
|
||||
|
||||
onMouseover="showalttext('{foreach from=$_metaarr.metadata key=_key item=_item}{$_key}: {$_item}<br>{/foreach}')"
|
||||
onMouseout="hidealttext()"
|
||||
onClick="return contextmenu('{$i.id}'
|
||||
, 'SP.addItem'
|
||||
|
||||
|
@ -34,3 +36,5 @@ onClick="return contextmenu('{$i.id}'
|
|||
{/if}
|
||||
{/if}
|
||||
)"
|
||||
|
||||
{assign var="_metaarr" value=NULL}
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
onMouseover="showAlt('Some info about file ID {$i.id}')"
|
||||
onMouseout="hideAlt()"
|
||||
{UIBROWSER->getMDataArr id=$i.id assign="_metaarr"}
|
||||
|
||||
onMouseover="showalttext('{foreach from=$_metaarr.metadata key=_key item=_item}{$_key}: {$_item}<br>{/foreach}')"
|
||||
onMouseout="hidealttext()"
|
||||
onClick="return contextmenu('{$i.attrs.id}', {if $i.type|lower == "audioclip"}'listen', '{$i.gunid}', {/if} 'PL.removeItem')"
|
||||
|
||||
{assign var="_metaarr" value=NULL}
|
||||
|
|
40
livesupport/modules/htmlUI/var/templates/scheduler/actionhandler.tpl
Executable file
40
livesupport/modules/htmlUI/var/templates/scheduler/actionhandler.tpl
Executable file
|
@ -0,0 +1,40 @@
|
|||
{UIBROWSER->getMDataArr id=$i.id assign="_metaarr"}
|
||||
|
||||
onMouseover="showalttext('{foreach from=$_metaarr.metadata key=_key item=_item}{$_key}: {$_item}<br>{/foreach}')"
|
||||
onMouseout="hidealttext()"
|
||||
onClick="hidealttextnow(); return contextmenu('{$i.id}'
|
||||
, 'SP.removeItem'
|
||||
|
||||
{if $i.type == 'audioclip'}
|
||||
, 'listen', '{$i.gunid}'
|
||||
{if $_PL_activeId}
|
||||
, 'PL.addItem'
|
||||
{else}
|
||||
, 'PL.create'
|
||||
{/if}
|
||||
, 'edit', 'delete'
|
||||
{/if}
|
||||
|
||||
{if $i.type == 'webstream'}
|
||||
{if $_PL_activeId}
|
||||
, 'PL.addItem'
|
||||
{else}
|
||||
, 'PL.create'
|
||||
{/if}
|
||||
, 'edit', 'delete'
|
||||
{/if}
|
||||
|
||||
{if $i.type == 'playlist'}
|
||||
{if $_PL_activeId}
|
||||
{if $_PL_activeId == $i.id}
|
||||
, 'PL.release'
|
||||
{else}
|
||||
, 'PL.addItem', 'delete'
|
||||
{/if}
|
||||
{else}
|
||||
, 'PL.activate', 'PL.create', 'delete'
|
||||
{/if}
|
||||
{/if}
|
||||
)"
|
||||
|
||||
{assign var="_metaarr" value=NULL}
|
|
@ -1,4 +1,2 @@
|
|||
{include file="scheduler/mouseOver.js.tpl"}
|
||||
|
||||
{assign var="view" value=$SCHEDULER->curr.view}
|
||||
{include file="scheduler/$view.tpl"}
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
{literal}
|
||||
<script type="text/javascript">
|
||||
|
||||
var mouseoverWidth = 150;
|
||||
var mouseoverHeight = 0;
|
||||
var duration = 0;
|
||||
|
||||
var mouseoverHeader = "<div id='mouseoverText' style='position:absolute; top: -250; left: 0; z-index: 100; background-color: #ffcacb; padding: 2px; width: " + mouseoverWidth + "'>";
|
||||
var mouseoverFooter = "</div>";
|
||||
document.write('<div id="mouseoverContainer"></div>');
|
||||
|
||||
function mouseoverShow(text)
|
||||
{
|
||||
document.getElementById('mouseoverContainer').innerHTML = mouseoverHeader + text + mouseoverFooter;
|
||||
document.onmouseover = mouseoverPlace;
|
||||
}
|
||||
|
||||
function mouseoverPlace(e)
|
||||
{
|
||||
if (ie5) {
|
||||
var corr = 5;
|
||||
if (event.clientX > mouseoverWidth) xPos = event.clientX - mouseoverWidth + document.body.scrollLeft;
|
||||
else xPos = event.clientX + document.body.scrollLeft;
|
||||
if (event.clientY > mouseoverHeight) yPos = event.clientY - mouseoverHeight + document.body.scrollTop;
|
||||
else yPos = event.clientY + document.body.scrollTop;
|
||||
}
|
||||
else {
|
||||
var corr = 10;
|
||||
if (e.pageX > mouseoverWidth + window.pageXOffset) xPos = e.pageX - mouseoverWidth;
|
||||
else xPos = e.pageX;
|
||||
if (e.pageY > mouseoverHeight + window.pageYOffset) yPos = e.pageY - mouseoverHeight;
|
||||
else yPos = e.pageY;
|
||||
}
|
||||
|
||||
document.getElementById("mouseoverText").style.left = xPos - corr;
|
||||
document.getElementById("mouseoverText").style.top = yPos;
|
||||
mouseoverStatus = 1;
|
||||
document.onmouseover = null;
|
||||
}
|
||||
|
||||
function mouseoverHide(e) {
|
||||
if (mouseoverStatus == 1) {
|
||||
setTimeout("document.getElementById('mouseoverText').style.top =- 250", duration);
|
||||
mouseoverStatus = 0;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
{/literal}
|
|
@ -1,6 +1,8 @@
|
|||
onMouseover="showAlt('Some info about file ID {$i.id}')"
|
||||
onMouseout="hideAlt()"
|
||||
onClick="return contextmenu('{$i.id}'
|
||||
{UIBROWSER->getMDataArr id=$i.id assign="_metaarr"}
|
||||
|
||||
onMouseover="showalttext('{foreach from=$_metaarr.metadata key=_key item=_item}{$_key}: {$_item}<br>{/foreach}')"
|
||||
onMouseout="hidealttext()"
|
||||
onClick="hidealttextnow(); return contextmenu('{$i.id}'
|
||||
, 'SP.removeItem'
|
||||
|
||||
{if $i.type == 'audioclip'}
|
||||
|
@ -34,3 +36,5 @@ onClick="return contextmenu('{$i.id}'
|
|||
{/if}
|
||||
{/if}
|
||||
)"
|
||||
|
||||
{assign var="_metaarr" value=NULL}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
{literal}
|
||||
<script type="text/javascript">
|
||||
|
||||
document.write('<div id="altContainer"></div>');
|
||||
altWidth = 200;
|
||||
altHeight = 0;
|
||||
document.write('<div id="alttextContainer"></div>');
|
||||
alttextWidth = 200;
|
||||
alttextHeight = 0;
|
||||
|
||||
function showAlt(param) {
|
||||
var altHeader = "<div class='alt' id='alt' style='position: absolute; top: -250; left: 0; z-index: 99'>";
|
||||
var altFooter = "</div>";
|
||||
var altHtml = '';
|
||||
function showalttext(param) {
|
||||
var alttextHeader = "<div class='alttext' id='alttext' style='position: absolute; top: -250; left: 0; z-index: 99'>";
|
||||
var alttextFooter = "</div>";
|
||||
var alttextHtml = '';
|
||||
|
||||
var sp2 = " ";
|
||||
var sp5 = sp2 + sp2 + " "; // Leerzeichen als Abstandshalter (flexibler und code-sparender als eine aufwendige Tabellenkonstruktion) ;
|
||||
|
@ -16,15 +16,15 @@
|
|||
var entry = new Array();
|
||||
//contextmenuStatus = 0;
|
||||
|
||||
altHtml = altHtml + param;
|
||||
alttextHtml = alttextHtml + param;
|
||||
|
||||
document.getElementById('altContainer').innerHTML = altHeader + altHtml + altFooter;
|
||||
document.onmouseover = showAltNow;
|
||||
document.getElementById('alttextContainer').innerHTML = alttextHeader + alttextHtml + alttextFooter;
|
||||
document.onmouseover = showalttextthan;
|
||||
|
||||
//return false;
|
||||
}
|
||||
|
||||
function showAltNow(e) { // alert("now");
|
||||
function showalttextthan(e) { // alert("now");
|
||||
if (ie5) {
|
||||
if (event.clientX + contextmenuWidth > document.body.clientWidth) xPos = event.clientX - contextmenuWidth + document.body.scrollLeft;
|
||||
else xPos = event.clientX + document.body.scrollLeft;
|
||||
|
@ -32,37 +32,49 @@
|
|||
else yPos = event.clientY + document.body.scrollTop;
|
||||
}
|
||||
else {
|
||||
if (e.pageX + contextmenuWidth + 20 > window.innerWidth) xPos = e.pageX - altWidth/2;
|
||||
else xPos = e.pageX - altWidth/2;
|
||||
if (e.pageY + contextmenuHeight +20 > window.innerHeight) yPos = e.pageY - altHeight/2 +5;
|
||||
else yPos = e.pageY - altHeight/2 +5;
|
||||
if (e.pageX + contextmenuWidth + 20 > window.innerWidth) xPos = e.pageX - alttextWidth/2;
|
||||
else xPos = e.pageX - alttextWidth/2;
|
||||
if (e.pageY + contextmenuHeight +20 > window.innerHeight) yPos = e.pageY - alttextHeight/2 + 15;
|
||||
else yPos = e.pageY - alttextHeight/2 + 15;
|
||||
}
|
||||
|
||||
setTimeout("document.getElementById('alt').style.left = xPos; document.getElementById('alt').style.top = yPos;", 1000);
|
||||
|
||||
alttexthide = false;
|
||||
setTimeout("showalttextnow("+xPos+", "+yPos+")", 1000);
|
||||
document.onmouseover = null;
|
||||
|
||||
}
|
||||
|
||||
function hideAlt() {
|
||||
setTimeout("document.getElementById('alt').style.top = -250", 1000);
|
||||
function showalttextnow(xPos, yPos) {
|
||||
if (!alttexthide) {
|
||||
document.getElementById('alttext').style.left = xPos;
|
||||
document.getElementById('alttext').style.top = yPos;
|
||||
}
|
||||
}
|
||||
|
||||
function hidealttext() {
|
||||
alttexthide = true;
|
||||
setTimeout("hidealttextnow()", 1000);
|
||||
}
|
||||
|
||||
function hidealttextnow() {
|
||||
document.getElementById('alttext').style.top = -250;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
#alt {
|
||||
#alttext {
|
||||
font-size : 80%;
|
||||
float: left;
|
||||
width: 200px;
|
||||
list-style: none;
|
||||
line-height: 20px;
|
||||
padding: 0;
|
||||
margin: 0px 0 0 0px;
|
||||
padding: 4px;
|
||||
margin: 0px 0px 0px 0px;
|
||||
display: block;
|
||||
clear: left;
|
||||
background: #eee;
|
||||
border-top: 1px solid #ACB3BA;
|
||||
background: yellow;
|
||||
border: 1px solid #ACB3BA;
|
||||
}
|
||||
</style>
|
||||
{/literal}
|
|
@ -14,6 +14,7 @@ class uiBrowser extends uiBase {
|
|||
function uiBrowser(&$config)
|
||||
{
|
||||
$this->uiBase($config);
|
||||
$this->mdatarecords =& $_SESSION[UI_MDATA_REC_SESSNAME];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -356,6 +357,34 @@ class uiBrowser extends uiBase {
|
|||
}
|
||||
|
||||
|
||||
function getMDataArr($param)
|
||||
{
|
||||
extract($param);
|
||||
static $records, $relations;
|
||||
$arr =& $records[$id];
|
||||
|
||||
if (is_array($arr)) return $arr;
|
||||
|
||||
require_once dirname(__FILE__).'/formmask/mdata_relations.inc.php';
|
||||
|
||||
require_once 'XML/Unserializer.php';
|
||||
$handler =& new XML_Unserializer;
|
||||
$handler->unserialize($this->getMdata($id));
|
||||
$arr = $handler->getUnserializedData();
|
||||
|
||||
foreach ($arr['metadata'] as $key=>$val) {
|
||||
if ($relations[$key]) {
|
||||
unset($arr['metadata'][$key]);
|
||||
$arr['metadata'][$relations[tra($key)]] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
ksort($arr['metadata']);
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* metaDataForm
|
||||
*
|
||||
|
|
|
@ -31,6 +31,7 @@ define('UI_STATIONINFO_SESSNAME', 'STATIONINFO');
|
|||
define('UI_SEARCH_SESSNAME', 'L_SEARCH');
|
||||
define('UI_PLAYLIST_SESSNAME', 'PLAYLIST');
|
||||
define('UI_BROWSE_SESSNAME', 'L_BROWSE');
|
||||
define('UI_MDATA_REC_SESSNAME', 'MDATAREC');
|
||||
|
||||
## Metadata Keys
|
||||
define('UI_MDATA_KEY_TITLE', 'dc:title');
|
||||
|
|
|
@ -388,7 +388,7 @@ class uiScheduler extends uiCalendar
|
|||
function _isError($r)
|
||||
{
|
||||
if (is_array($r['error'])) {
|
||||
$this->Base->_retMsg('Error: $1', str_replace("\n", "\\n", addslashes($r['error']['message'])));
|
||||
#$this->Base->_retMsg('Error: $1', str_replace("\n", "\\n", addslashes($r['error']['message'])));
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue