Template/Update (Part 37)
* convert dbtype 'sound'
This commit is contained in:
parent
3f8d5d90e1
commit
3d3e2211e5
7 changed files with 315 additions and 257 deletions
68
template/pages/sound-playlist.tpl.php
Normal file
68
template/pages/sound-playlist.tpl.php
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
namespace Aowow\Template;
|
||||
|
||||
use \Aowow\Lang;
|
||||
|
||||
$this->brick('header');
|
||||
?>
|
||||
<div class="main" id="main">
|
||||
<div class="main-precontents" id="main-precontents"></div>
|
||||
<div class="main-contents" id="main-contents">
|
||||
|
||||
<?php
|
||||
$this->brick('announcement');
|
||||
|
||||
$this->brick('pageTemplate');
|
||||
?>
|
||||
|
||||
<div class="text">
|
||||
<h1><?=$this->h1; ?></h1>
|
||||
|
||||
<?php $this->brick('markup', ['markup' => $this->article]); ?>
|
||||
|
||||
<div id="playlistcontrols" style="margin: 20px"></div><div id="playlisttracks"></div>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
g_audioplaylist.setAudioControls($WH.ge('playlistcontrols'));
|
||||
(function(){
|
||||
var delline = function()
|
||||
{
|
||||
var li = this.parentNode;
|
||||
var siblings = li.parentNode.childNodes;
|
||||
|
||||
for (var id = 0; id < siblings.length; id++)
|
||||
if (siblings[id] === li)
|
||||
break;
|
||||
|
||||
g_audioplaylist.deleteSound(id);
|
||||
li.parentNode.removeChild(li);
|
||||
}
|
||||
|
||||
var l = g_audioplaylist.getList();
|
||||
var ol = $WH.ce('ol');
|
||||
var s, li;
|
||||
for (var x in l)
|
||||
{
|
||||
li = $WH.ce('li');
|
||||
|
||||
s = $WH.ce('span');
|
||||
s.className = 'icon-delete';
|
||||
s.style.cursor = 'pointer';
|
||||
$WH.Tooltip.simple(s, LANG.delete, 'q2');
|
||||
$WH.aE(s, 'click', delline);
|
||||
$WH.ae(li, s);
|
||||
|
||||
s = $WH.ce('span');
|
||||
$WH.st(s, l[x]);
|
||||
$WH.ae(li, s);
|
||||
|
||||
$WH.ae(ol, li);
|
||||
}
|
||||
$WH.ae($WH.ge('playlisttracks'),ol);
|
||||
})();
|
||||
//]]></script></div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div><!-- main-contents -->
|
||||
</div><!-- main -->
|
||||
|
||||
<?php $this->brick('footer'); ?>
|
||||
|
|
@ -1,7 +1,10 @@
|
|||
<?php namespace Aowow; ?>
|
||||
<?php
|
||||
namespace Aowow\Template;
|
||||
|
||||
<?php $this->brick('header'); ?>
|
||||
use \Aowow\Lang;
|
||||
|
||||
$this->brick('header');
|
||||
?>
|
||||
<div class="main" id="main">
|
||||
<div class="main-precontents" id="main-precontents"></div>
|
||||
<div class="main-contents" id="main-contents">
|
||||
|
|
@ -17,68 +20,19 @@
|
|||
$this->brick('redButtons');
|
||||
?>
|
||||
|
||||
<h1><?=$this->name; ?></h1>
|
||||
<h1><?=$this->h1; ?></h1>
|
||||
|
||||
<?php
|
||||
$this->brick('article');
|
||||
$this->brick('markup', ['markup' => $this->article]);
|
||||
|
||||
if ($this->special):
|
||||
?>
|
||||
<div id="playlistcontrols" style="margin: 20px"></div><div id="playlisttracks"></div>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
g_audioplaylist.setAudioControls($WH.ge('playlistcontrols'));
|
||||
(function(){
|
||||
var delline = function()
|
||||
{
|
||||
var li = this.parentNode;
|
||||
var siblings = li.parentNode.childNodes;
|
||||
|
||||
for (var id = 0; id < siblings.length; id++)
|
||||
if (siblings[id] === li)
|
||||
break;
|
||||
|
||||
g_audioplaylist.deleteSound(id);
|
||||
li.parentNode.removeChild(li);
|
||||
}
|
||||
|
||||
var l = g_audioplaylist.getList();
|
||||
var ol = $WH.ce('ol');
|
||||
var s, li;
|
||||
for (var x in l)
|
||||
{
|
||||
li = $WH.ce('li');
|
||||
|
||||
s = $WH.ce('span');
|
||||
s.className = 'icon-delete';
|
||||
s.style.cursor = 'pointer';
|
||||
$WH.Tooltip.simple(s, LANG.delete, 'q2');
|
||||
$WH.aE(s, 'click', delline);
|
||||
$WH.ae(li, s);
|
||||
|
||||
s = $WH.ce('span');
|
||||
$WH.st(s, l[x]);
|
||||
$WH.ae(li, s);
|
||||
|
||||
$WH.ae(ol, li);
|
||||
}
|
||||
$WH.ae($WH.ge('playlisttracks'),ol);
|
||||
})();
|
||||
//]]></script></div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php
|
||||
else:
|
||||
|
||||
if (!empty($this->map)):
|
||||
$this->brick('mapper');
|
||||
endif;
|
||||
$this->brickIf($this->map, 'mapper');
|
||||
?>
|
||||
<ol id="soundfilelist"></ol>
|
||||
<div id="mainsound"></div>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var soundpaths = g_sounds[<?=$this->typeId; ?>].files;
|
||||
soundpaths.sort(function(a, b) { return $WH.stringCompare(a.title, b.title) || $WH.stringCompare(a.id, b.id); });
|
||||
soundpaths.sort(function(a, b) { return $WH.strcmp(a.title, b.title) || $WH.strcmp(a.id, b.id); });
|
||||
// aowow - see $WH.strcmp - soundpaths.sort(function(a, b) { return $WH.stringCompare(a.title, b.title) || $WH.stringCompare(a.id, b.id); });
|
||||
var sounddialog = new Dialog();
|
||||
|
||||
Dialog.templates.sound = {
|
||||
|
|
@ -113,7 +67,7 @@ g_audioplaylist.setAudioControls($WH.ge('playlistcontrols'));
|
|||
sounddialog.show('sound', { data: data, onSubmit: $WH.rf });
|
||||
}
|
||||
|
||||
(new AudioControls()).init(soundpaths,$WH.ge('mainsound'));
|
||||
(new AudioControls()).init(soundpaths, $WH.ge('mainsound'));
|
||||
|
||||
(function(){
|
||||
var ol = $WH.ge('soundfilelist');
|
||||
|
|
@ -135,10 +89,9 @@ g_audioplaylist.setAudioControls($WH.ge('playlistcontrols'));
|
|||
</div>
|
||||
|
||||
<?php
|
||||
$this->brick('lvTabs', ['relTabs' => true]);
|
||||
$this->brick('lvTabs');
|
||||
|
||||
$this->brick('contribute');
|
||||
endif;
|
||||
?>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
<?php namespace Aowow; ?>
|
||||
|
||||
<?php
|
||||
$this->brick('header');
|
||||
$f = $this->filterObj->values // shorthand
|
||||
?>
|
||||
namespace Aowow\Template;
|
||||
|
||||
use \Aowow\Lang;
|
||||
|
||||
$this->brick('header');
|
||||
$f = $this->filter->values; // shorthand
|
||||
?>
|
||||
<div class="main" id="main">
|
||||
<div class="main-precontents" id="main-precontents"></div>
|
||||
<div class="main-contents" id="main-contents">
|
||||
|
|
@ -12,31 +13,32 @@ $f = $this->filterObj->values // shorthand
|
|||
<?php
|
||||
$this->brick('announcement');
|
||||
|
||||
$this->brick('pageTemplate', ['fiQuery' => $this->filterObj->query, 'fiMenuItem' => [101]]);
|
||||
$this->brick('pageTemplate', ['fiQuery' => $this->filter->query, 'fiMenuItem' => [19]]);
|
||||
?>
|
||||
<div class="text"><h1><?=$this->name; ?> <?=$this->brick('redButtons'); ?></h1></div>
|
||||
<div id="fi" style="display: <?=($this->filterObj->query ? 'block' : 'none'); ?>;">
|
||||
<div id="fi" style="display: <?=($this->filter->query ? 'block' : 'none'); ?>;">
|
||||
<form action="?filter=sounds" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div class="text">
|
||||
<?php
|
||||
$this->brick('headIcons');
|
||||
|
||||
$this->brick('redButtons');
|
||||
?>
|
||||
<h1><?=$this->h1; ?></h1>
|
||||
</div>
|
||||
<div class="rightpanel">
|
||||
<div style="float: left"><?=Util::ucFirst(Lang::game('type')).Lang::main('colon'); ?></div>
|
||||
<div style="float: left"><?=Lang::game('type').Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['ty[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="ty[]" size="6" multiple="multiple" class="rightselect">
|
||||
<?php
|
||||
foreach (Lang::sound('cat') as $i => $str):
|
||||
if ($str && $i < 1000):
|
||||
echo ' <option value="'.$i.'"'.(isset($f['ty']) && in_array($i, (array)$f['ty']) ? ' selected' : null).' >'.$str."</option>\n";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
<?=$this->makeOptionsList(Lang::sound('cat'), $f['ty'], 28, fn($v, $k) => $v && $k < 1000); ?>
|
||||
</select>
|
||||
</div>
|
||||
<table>
|
||||
<tr>
|
||||
<td><?=Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td><?=$this->ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td colspan="2">
|
||||
<table><tr>
|
||||
<td> <input type="text" name="na" size="30" <?=(isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null); ?>/></td>
|
||||
<td> <input type="text" name="na" size="30" <?=($f['na'] ? 'value="'.$this->escHTML($f['na']).'" ' : ''); ?>/></td>
|
||||
</tr></table>
|
||||
</td>
|
||||
</tr><tr>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue