Template/Update (Part 39)
* implement video suggestion & management
This commit is contained in:
parent
a369244908
commit
cb523353fd
36 changed files with 2465 additions and 16 deletions
135
template/pages/admin/videos.tpl.php
Normal file
135
template/pages/admin/videos.tpl.php
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
<?php
|
||||
namespace Aowow\Template;
|
||||
|
||||
$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>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>User: </td>
|
||||
<td colspan="2"><input type="text" id="usermanage" size="23"></td>
|
||||
<td>» <a href="#" onClick="vi_ManageUser()">Search by User</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Page: </td>
|
||||
<td>
|
||||
<select id="pagetype">
|
||||
<?=$this->makeOptionsList($this->pageTypes, null, 32); ?>
|
||||
</select>
|
||||
</td>
|
||||
<td>#<input type="number" size="6" id="pagetypeid"></td>
|
||||
<td>» <a href="#" onClick="vi_Manage(null, $('#pagetype').val(), parseInt($('#pagetypeid').val()) || 0)">Search by Page</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr />
|
||||
<table style="width:100%;">
|
||||
<thead><tr><th style="width:135px;"><div>Menu</div></th><th style="width:400px;">Pages</th><th>Videos: <span id="videoTotal"></span></th></tr></thead>
|
||||
<tbody><tr>
|
||||
<td id="menu-container" style="vertical-align: top;">
|
||||
<div id="show-all-pages"><?=($this->viNFound ? ' – <a href="?admin=videos&all">Show All</a> ('.$this->viNFound.')' : ''); ?></div>
|
||||
<h4>Mass Select</h4>
|
||||
– <a href="#" onClick="vim_MassSelect(1);">Select All</a><br />
|
||||
– <a href="#" onClick="vim_MassSelect(0);">Deselect All</a><br />
|
||||
– <a href="#" onClick="vim_MassSelect(-1);">Toggle Selection</a><br />
|
||||
– <a href="#" onClick="vim_MassSelect(2);">Select All Pending</a><br />
|
||||
– <a href="#" onClick="vim_MassSelect(5);">Select All Unique</a><br />
|
||||
– <a href="#" onClick="vim_MassSelect(3);">Select All Approved</a><br />
|
||||
– <a href="#" onClick="vim_MassSelect(4);">Select All Sticky</a><br />
|
||||
<div id="withselected" style="display:none;">
|
||||
<h4>Mass Action <b>(0)</b></h4>
|
||||
– <a href="#" id="massapprove">Approve All</a><br />
|
||||
– <a href="#" id="massdelete">Delete All</a><br />
|
||||
– <a href="#" id="masssticky">Sticky All</a><br />
|
||||
</div>
|
||||
</td>
|
||||
<td id="pages-container" style="vertical-align: top;"></td>
|
||||
<td id="data-container" style="vertical-align: top;"><table class="grid" id="theVideosList"><thead><tr>
|
||||
<th>Video</th>
|
||||
<th>Id</th>
|
||||
<th>Title</th>
|
||||
<th>Date</th>
|
||||
<th>Uploader</th>
|
||||
<th>Status</th>
|
||||
<th>Options</th>
|
||||
</tr></thead></table></td>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
var hasLoader = false;
|
||||
function ajaxAnchor(el)
|
||||
{
|
||||
if (!el.href || hasLoader)
|
||||
return;
|
||||
|
||||
$('#withselected').find('h4').append(" ").append(CreateAjaxLoader());
|
||||
hasLoader = true;
|
||||
|
||||
new Ajax(el.href, {
|
||||
method: 'get',
|
||||
onSuccess: function(xhr) {
|
||||
hasLoader = false;
|
||||
$('#withselected img').remove();
|
||||
|
||||
var g = $WH.g_getGets();
|
||||
if (g.type && g.typeid)
|
||||
vi_Manage(null, g.type, g.typeid);
|
||||
else if (g.user)
|
||||
vi_ManageUser();
|
||||
else
|
||||
vi_Refresh();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$WH.ge('usermanage').onkeydown = function(e)
|
||||
{
|
||||
e = $WH.$E(e);
|
||||
if (e.keyCode != 13)
|
||||
return;
|
||||
|
||||
vi_ManageUser();
|
||||
}
|
||||
|
||||
$WH.ge('pagetypeid').onkeydown = function(e)
|
||||
{
|
||||
e = $WH.$E(e);
|
||||
var validKeys = [8, 9, 13, 35, 36, 37, 38, 39, 40, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 173];
|
||||
if (!e.ctrlKey && $WH.in_array(validKeys, e.keyCode) == -1)
|
||||
return false;
|
||||
|
||||
if (e.keyCode == 13 && this.value != '')
|
||||
vi_Manage(null, $('#pagetype').val(), parseInt($('#pagetypeid').val()) || 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
<?php
|
||||
if ($this->getAll):
|
||||
echo " var vi_getAll = true;\n";
|
||||
endif;
|
||||
if ($this->viPages):
|
||||
echo " var vim_videoPages = ".$this->json($this->viPages).";\n";
|
||||
echo " vim_UpdatePages();\n";
|
||||
elseif ($this->viData):
|
||||
echo " var vim_videoData = ".$this->json($this->viData).";\n";
|
||||
echo " vim_UpdateList();\n";
|
||||
endif;
|
||||
?>
|
||||
vi_OnResize();
|
||||
</script>
|
||||
</div>
|
||||
</div><!-- main-contents -->
|
||||
</div><!-- main -->
|
||||
|
||||
<?php $this->brick('footer'); ?>
|
||||
82
template/pages/video.tpl.php
Normal file
82
template/pages/video.tpl.php
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
<?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');
|
||||
|
||||
$this->brick('infobox');
|
||||
|
||||
?>
|
||||
<div class="text">
|
||||
<h1><?=$this->h1; ?></h1>
|
||||
|
||||
<h3><?=$this->viTitle;?></h3>
|
||||
<div class="pad"></div>
|
||||
<div id="vi-container"></div><script type="text/javascript">//<![CDATA[
|
||||
let video = <?=$this->json($this->video); ?>;
|
||||
//]]></script>
|
||||
<a href="#" onClick="VideoViewer.show({ videos: video });"><img class="border" src="<?=$this->url; ?>" width="<?=$this->width; ?>" heigth="<?=$this->height; ?>"></img></a>
|
||||
|
||||
<div class="pad3"></div>
|
||||
|
||||
<form action="?video=complete&<?=$this->destType.'.'.$this->destTypeId.'.'.$this->videoHash; ?>" method="post">
|
||||
<?=Lang::screenshot('caption').Lang::main('colon'); ?><input type="text" name="caption" style="width: 55%" maxlength="200" /> <small> <?=Lang::screenshot('charLimit'); ?></small><br />
|
||||
<div class="pad3"></div>
|
||||
|
||||
<input type="submit" value="<?=Lang::main('submit'); ?>" />
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var
|
||||
captionMaxLen = 200;
|
||||
|
||||
Body = $('#main-contents').find('input[type=text]');
|
||||
TextCounter = $('#main-contents').find('small');
|
||||
|
||||
Body.focus();
|
||||
Body.keyup(function (e) { return UpdateTextCounter(); });
|
||||
Body.keypress(function (e) { // ENTER
|
||||
if (e.keyCode == 13 || captionMaxLen - getCaptionLen() <= 0 )
|
||||
return false;
|
||||
});
|
||||
|
||||
function getCaptionLen()
|
||||
{
|
||||
return Body.val().replace(/(\s+)/g, ' ').replace(/^\s*/, '').replace(/\s*$/, '').length;
|
||||
}
|
||||
|
||||
function UpdateTextCounter()
|
||||
{
|
||||
var text = '(error)';
|
||||
var cssClass = 'q0';
|
||||
var chars = getCaptionLen();
|
||||
var charsLeft = captionMaxLen - chars;
|
||||
|
||||
text = $WH.sprintf(charsLeft == 1 ? LANG.replylength4_format : LANG.replylength3_format, charsLeft);
|
||||
|
||||
if (charsLeft < 25)
|
||||
cssClass = 'q10';
|
||||
else if (charsLeft < 50)
|
||||
cssClass = 'q5';
|
||||
else if (charsLeft < 75)
|
||||
cssClass = 'q11';
|
||||
|
||||
TextCounter.html(text).attr('class', cssClass);
|
||||
}
|
||||
|
||||
//]]></script>
|
||||
</div>
|
||||
</div><!-- main-contents -->
|
||||
</div><!-- main -->
|
||||
|
||||
<?php $this->brick('footer'); ?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue