mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +02:00
This commit is contained in:
parent
5d894ec120
commit
afe8586b64
13 changed files with 235 additions and 110 deletions
|
@ -5276,6 +5276,9 @@ if (!class_exists('Video')) {
|
|||
$favoriteBtnAddedStyle = "display: none;";
|
||||
$favoriteBtnStyle = "";
|
||||
}
|
||||
|
||||
$galleryDropDownMenu = Gallery::getVideoDropdownMenu($videos_id);
|
||||
|
||||
$galleryVideoButtons .= '
|
||||
<div class="galleryVideoButtons">
|
||||
<button onclick="addVideoToPlayList(' . $videos_id . ', false, ' . $watchLaterId . ');return false;" class="btn btn-dark btn-xs watchLaterBtnAdded watchLaterBtnAdded' . $videos_id . '" data-toggle="tooltip" data-placement="left" title=' . printJSString("Added On Watch Later", true) . ' style="color: #4285f4;' . $watchLaterBtnAddedStyle . '" ><i class="fas fa-check"></i></button>
|
||||
|
@ -5283,6 +5286,8 @@ if (!class_exists('Video')) {
|
|||
<br>
|
||||
<button onclick="addVideoToPlayList(' . $videos_id . ', false, ' . $favoriteId . ');return false;" class="btn btn-dark btn-xs favoriteBtnAdded favoriteBtnAdded' . $videos_id . '" data-toggle="tooltip" data-placement="left" title=' . printJSString("Added On Favorite", true) . ' style="color: #4285f4; ' . $favoriteBtnAddedStyle . '"><i class="fas fa-check"></i></button>
|
||||
<button onclick="addVideoToPlayList(' . $videos_id . ', true, ' . $favoriteId . ');return false;" class="btn btn-dark btn-xs favoriteBtn favoriteBtn' . $videos_id . ' faa-parent animated-hover" data-toggle="tooltip" data-placement="left" title=' . printJSString("Favorite", true) . ' style="' . $favoriteBtnStyle . '" ><i class="fas fa-heart faa-pulse faa-fast" ></i></button>
|
||||
<br>
|
||||
'.$galleryDropDownMenu.'
|
||||
</div>';
|
||||
}
|
||||
$href = Video::getLink($video['id'], $video['clean_title']);
|
||||
|
@ -5541,7 +5546,7 @@ if (!class_exists('Video')) {
|
|||
|
||||
static public function getAllActiveEPGs() {
|
||||
global $config;
|
||||
$sql = "SELECT * FROM `videos` WHERE status = '".Video::$statusActive."' AND epg_link IS NOT NULL AND epg_link != '';";
|
||||
$sql = "SELECT * FROM `videos` WHERE status = '" . Video::$statusActive . "' AND epg_link IS NOT NULL AND epg_link != '';";
|
||||
$res = sqlDAL::readSql($sql);
|
||||
$fullResult2 = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
|
@ -5556,40 +5561,38 @@ if (!class_exists('Video')) {
|
|||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
|
||||
static public function getEPG($videos_id) {
|
||||
global $config, $_getEPG;
|
||||
|
||||
if(!isset($_getEPG)){
|
||||
|
||||
if (!isset($_getEPG)) {
|
||||
$_getEPG = array();
|
||||
}
|
||||
|
||||
if(!isset($_getEPG[$videos_id])){
|
||||
|
||||
if (!isset($_getEPG[$videos_id])) {
|
||||
$sql = "SELECT * FROM `videos` WHERE id = ? AND epg_link IS NOT NULL AND epg_link != ''";
|
||||
$res = sqlDAL::readSql($sql, 'i', array($videos_id));
|
||||
|
||||
$video = sqlDAL::fetchAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
if(empty($video) || !isValidURL($video['epg_link'])){
|
||||
if (empty($video) || !isValidURL($video['epg_link'])) {
|
||||
$_getEPG[$videos_id] = false;
|
||||
}else{
|
||||
} else {
|
||||
$_getEPG[$videos_id] = $video['epg_link'];
|
||||
}
|
||||
}
|
||||
return $_getEPG[$videos_id];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static public function getEPGLink($videos_id) {
|
||||
global $global;
|
||||
$url = $global['webSiteRootURL'].'plugin/PlayerSkins/epg.php';
|
||||
if(!empty($videos_id)){
|
||||
$url = $global['webSiteRootURL'] . 'plugin/PlayerSkins/epg.php';
|
||||
if (!empty($videos_id)) {
|
||||
$epg = self::getEPG($videos_id);
|
||||
if(!empty($epg)){
|
||||
if (!empty($epg)) {
|
||||
$url = addQueryStringParameter($url, 'videos_id', $videos_id);
|
||||
return $url;
|
||||
}else{
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,35 @@
|
|||
<?php
|
||||
header('Content-Type: application/json');
|
||||
global $global, $config;
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../videos/configuration.php';
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
if (!Permissions::canModerateVideos()) {
|
||||
die('{"error":"'.__("Permission denied").'"}');
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'objects/video.php';
|
||||
if (!is_array($_POST['id'])) {
|
||||
$_POST['id'] = [$_POST['id']];
|
||||
}
|
||||
$id = 0;
|
||||
foreach ($_POST['id'] as $value) {
|
||||
$obj = new Video('', '', $value);
|
||||
$obj->setIsSuggested($_POST['isSuggested']);
|
||||
$id = $obj->save();
|
||||
}
|
||||
|
||||
echo '{"status":"'.$id.'"}';
|
||||
<?php
|
||||
header('Content-Type: application/json');
|
||||
global $global, $config;
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../videos/configuration.php';
|
||||
}
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->msg = '';
|
||||
$obj->error = true;
|
||||
$obj->idsToSave = array();
|
||||
$obj->idSaved = array();
|
||||
|
||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
if (!Permissions::canModerateVideos()) {
|
||||
forbiddenPage('Permission denied');
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'objects/video.php';
|
||||
if (!is_array($_POST['id'])) {
|
||||
$obj->idsToSave = [$_POST['id']];
|
||||
}else{
|
||||
$obj->idsToSave = $_POST['id'];
|
||||
}
|
||||
foreach ($obj->idsToSave as $value) {
|
||||
$video = new Video('', '', $value);
|
||||
$video->setIsSuggested($_POST['isSuggested']);
|
||||
$obj->idSaved[] = $video->save();
|
||||
}
|
||||
|
||||
if(!empty($obj->idSaved)){
|
||||
$obj->error = false;
|
||||
clearCache(true);
|
||||
}
|
||||
|
||||
echo _json_encode($obj);
|
||||
|
|
|
@ -273,4 +273,11 @@ class Gallery extends PluginAbstract {
|
|||
return !empty($obj->{$parameterName});
|
||||
}
|
||||
|
||||
static function getVideoDropdownMenu($videos_id) {
|
||||
global $global;
|
||||
$varsArray = array('videos_id' => $videos_id);
|
||||
$filePath = $global['systemRootPath'] . 'plugin/Gallery/view/videoDropDownMenu.php';
|
||||
return getIncludeFileContent($filePath, $varsArray);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -200,8 +200,7 @@ function createGallerySection($videos, $crc = "", $get = array(), $ignoreAds = f
|
|||
<?php
|
||||
if ($galeryDetails) {
|
||||
?>
|
||||
|
||||
<div class="galeryDetails" style="overflow: hidden;">
|
||||
<div class="galeryDetails">
|
||||
<div class="galleryTags">
|
||||
<!-- category tags -->
|
||||
<?php
|
||||
|
@ -258,33 +257,6 @@ function createGallerySection($videos, $crc = "", $get = array(), $ignoreAds = f
|
|||
</a>
|
||||
</div>
|
||||
<?php
|
||||
if ((!empty($value['description'])) && !empty($obj->Description)) {
|
||||
//$desc = str_replace(array('"', "'", "#", "/", "\\"), array('``', "`", "", "", ""), preg_replace("/\r|\n/", " ", nl2br(trim($value['description']))));
|
||||
$desc = nl2br(trim($value['description']));
|
||||
if (!isHTMLEmpty($desc)) {
|
||||
$duid = uniqid();
|
||||
$titleAlert = str_replace(array('"', "'"), array('``', "`"), $value['title']);
|
||||
?>
|
||||
<button type="button" class="btn-link" onclick='avideoAlert("<?php echo $titleAlert; ?>", "<div style=\"max-height: 300px; overflow-y: scroll;overflow-x: hidden;\" id=\"videoDescriptionAlertContent<?php echo $duid; ?>\" ></div>", "");$("#videoDescriptionAlertContent<?php echo $duid; ?>").html($("#videoDescription<?php echo $duid; ?>").html());return false;' data-toggle="tooltip" title="<?php echo __("Description"); ?>"><i class="far fa-file-alt"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Description"); ?></span></a>
|
||||
<div id="videoDescription<?php echo $duid; ?>" style="display: none;"><?php echo $desc; ?></div>
|
||||
</button>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if (Video::canEdit($value['id'])) { ?>
|
||||
<button type="button" class="btn-link" onclick="avideoModalIframe(webSiteRootURL + 'view/managerVideosLight.php?avideoIframe=1&videos_id=<?php echo $value['id']; ?>');return false;" data-toggle="tooltip" title="<?php echo __("Edit Video"); ?>">
|
||||
<i class="fa fa-edit"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Edit Video"); ?></span>
|
||||
</button>
|
||||
<?php }
|
||||
?>
|
||||
<?php if (!empty($value['trailer1'])) { ?>
|
||||
<button type="button" class="btn-link" onclick="showTrailer('<?php echo parseVideos($value['trailer1'], 1); ?>'); return false;" class="cursorPointer" >
|
||||
<i class="fa fa-video"></i> <?php echo __("Trailer"); ?>
|
||||
</button>
|
||||
<?php }
|
||||
?>
|
||||
<?php
|
||||
echo AVideoPlugin::getGalleryActionButton($value['id']);
|
||||
?>
|
||||
</div>
|
||||
|
@ -436,7 +408,7 @@ function createGalleryLiveSection($videos) {
|
|||
<strong class="title"><?php echo getSEOTitle($video['title']) ?></strong>
|
||||
</a>
|
||||
|
||||
<div class="galeryDetails" style="overflow: hidden;">
|
||||
<div class="galeryDetails">
|
||||
<div class="galleryTags">
|
||||
<?php if (empty($_GET['catName']) && !empty($obj->showCategoryTag)) { ?>
|
||||
<a class="label label-default" href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $video['clean_category']; ?>">
|
||||
|
|
|
@ -68,9 +68,6 @@ h3.galleryTitle{
|
|||
|
||||
.galeryDetails div{
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
padding-right: 5px;
|
||||
margin: 2px 0;
|
||||
}
|
||||
|
@ -164,7 +161,16 @@ a.h6{
|
|||
}
|
||||
.galleryVideo .galleryVideoButtons button:hover{
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
.galleryVideo .galleryVideoButtons div.dropdown .dropdown-menu{
|
||||
margin: -20px auto auto -160px;
|
||||
}
|
||||
.galleryVideo div.galleryVideoButtons > div > ul > li > button{
|
||||
opacity: 1;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
.gallerySerieOverlay{
|
||||
position: absolute;
|
||||
|
|
49
plugin/Gallery/view/videoDropDownMenu.php
Normal file
49
plugin/Gallery/view/videoDropDownMenu.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
require_once __DIR__.'/../../../videos/configuration.php';
|
||||
$video = Video::getVideoLight($videos_id);
|
||||
?>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-dark btn-xs dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<?php
|
||||
if ((!empty($video['description'])) && !empty($obj->Description)) {
|
||||
$desc = nl2br(trim($video['description']));
|
||||
if (!isHTMLEmpty($desc)) {
|
||||
$duid = uniqid();
|
||||
$titleAlert = str_replace(array('"', "'"), array('``', "`"), $video['title']);
|
||||
?>
|
||||
<li>
|
||||
<button type="button" class="btn-link" onclick='avideoAlert("<?php echo $titleAlert; ?>", "<div style=\"max-height: 300px; overflow-y: scroll;overflow-x: hidden;\" id=\"videoDescriptionAlertContent<?php echo $duid; ?>\" ></div>", "");$("#videoDescriptionAlertContent<?php echo $duid; ?>").html($("#videoDescription<?php echo $duid; ?>").html());return false;' data-toggle="tooltip" title="<?php echo __("Description"); ?>"><i class="far fa-file-alt"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Description"); ?></span></a>
|
||||
<div id="videoDescription<?php echo $duid; ?>" style="display: none;"><?php echo $desc; ?></div>
|
||||
</button>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if (!empty($video['trailer1'])) { ?>
|
||||
<li>
|
||||
<button type="button" class="btn-link" onclick="showTrailer('<?php echo parseVideos($video['trailer1'], 1); ?>'); return false;" class="cursorPointer" >
|
||||
<i class="fa fa-video"></i> <?php echo __("Trailer"); ?>
|
||||
</button>
|
||||
|
||||
</li>
|
||||
<?php }
|
||||
?>
|
||||
<?php if (Video::canEdit($video['id'])) { ?>
|
||||
<li>
|
||||
<button type="button" class="btn-link" onclick="avideoModalIframe(webSiteRootURL + 'view/managerVideosLight.php?avideoIframe=1&videos_id=<?php echo $video['id']; ?>');return false;" data-toggle="tooltip" title="<?php echo __("Edit Video"); ?>">
|
||||
<i class="fa fa-edit"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Edit Video"); ?></span>
|
||||
</button>
|
||||
</li>
|
||||
<?php
|
||||
$suggestedBTN = Layout::getSuggestedButton($video['id'], 'btn-link');
|
||||
if (!empty($suggestedBTN)) {
|
||||
echo "<li>{$suggestedBTN}</li>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
|
@ -708,6 +708,19 @@ class Layout extends PluginAbstract {
|
|||
return $cleanList;
|
||||
|
||||
}
|
||||
|
||||
static function getSuggestedButton($videos_id, $class='btn btn-xs'){
|
||||
global $global;
|
||||
if(empty($videos_id)){
|
||||
return '';
|
||||
}
|
||||
if(!Permissions::canAdminVideos()){
|
||||
return '';
|
||||
}
|
||||
$varsArray = array('videos_id'=>$videos_id, 'class'=>$class);
|
||||
$filePath = $global['systemRootPath'] . 'plugin/Layout/suggestedButton.php';
|
||||
return getIncludeFileContent($filePath, $varsArray);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
15
plugin/Layout/suggestedButton.php
Normal file
15
plugin/Layout/suggestedButton.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
$video = new Video('', '', $videos_id);
|
||||
$_class = 'isSuggested btn-warning ';
|
||||
if (empty($video->getIsSuggested())) {
|
||||
$_class = 'isNotSuggested btn-default ';
|
||||
}
|
||||
?>
|
||||
<button type="button"
|
||||
class="suggestBtn <?php echo $_class; ?> <?php echo $class; ?>"
|
||||
onclick="toogleVideoSuggested($(this));return false;"
|
||||
videos_id="<?php echo $videos_id; ?>" >
|
||||
<span class="hidden-md hidden-sm hidden-xs">
|
||||
<span class="unsuggestText btnText"><i class="fas fa-star"></i> <?php echo __("Unsuggest it"); ?></span>
|
||||
<span class="suggestText btnText"><i class="far fa-star"></i> <?php echo __("Suggest it"); ?></span></span>
|
||||
</button>
|
|
@ -176,7 +176,7 @@ function createEPG($channel) {
|
|||
$left = ($minuteSize * $minutesSinceZeroTime) + $timeLineElementSize;
|
||||
$width = ($minuteSize * $minutes);
|
||||
$_stopTime = strtotime($program['stop']);
|
||||
$class = '';
|
||||
$pclass = '';
|
||||
if ($width <= $minimumWidth) {
|
||||
$text = "<!-- too small $width -->";
|
||||
} else {
|
||||
|
@ -185,9 +185,9 @@ function createEPG($channel) {
|
|||
$text = "{$program['title']}<div><small class=\"duration\">{$minutes} Min</small></div>";
|
||||
}
|
||||
if ($_stopTime < $nowTime) {
|
||||
$class = 'finished';
|
||||
$pclass = 'finished';
|
||||
}
|
||||
echo "<div style=\"width: {$width}px; left: {$left}px;\" start=\"{$program['start']}\" stop=\"{$program['stop']}\" minutes=\"{$minutes}\" minutesSinceZeroTime=\"{$minutesSinceZeroTime}\" class=\"{$class}\">"
|
||||
echo "<div style=\"width: {$width}px; left: {$left}px;\" start=\"{$program['start']}\" stop=\"{$program['stop']}\" minutes=\"{$minutes}\" minutesSinceZeroTime=\"{$minutesSinceZeroTime}\" class=\"{$pclass}\">"
|
||||
. "{$text}"
|
||||
. "</div>";
|
||||
}
|
||||
|
|
|
@ -521,6 +521,16 @@ img.rotate-90 {
|
|||
display: none !important;
|
||||
}
|
||||
|
||||
.suggestBtn .btnText{
|
||||
display: none;
|
||||
}
|
||||
.suggestBtn.isNotSuggested .suggestText{
|
||||
display: inline-block;
|
||||
}
|
||||
.suggestBtn.isSuggested .unsuggestText{
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.profileBg {
|
||||
padding: 20px;
|
||||
height: 27vw;
|
||||
|
|
|
@ -1612,7 +1612,7 @@ function avideoModalIframeIsVisible() {
|
|||
modal = $('.swal-modal-iframe-large');
|
||||
} else if ($('.swal-modal-iframe-full').length) {
|
||||
modal = $('.swal-modal-iframe-full');
|
||||
} else if ($('.swal-modal-iframe-full-transparent').length) {
|
||||
} else if ($('.swal-modal-iframe-full-transparent').length) {
|
||||
modal = $('.swal-modal-iframe-full-transparent');
|
||||
} else {
|
||||
modal = $('.swal-modal-iframe');
|
||||
|
@ -2079,9 +2079,9 @@ async function setToolTips() {
|
|||
$(selector).addClass('alreadyTooltip');
|
||||
} catch (e) {
|
||||
console.log('setToolTips', e);
|
||||
setTimeout(function(){
|
||||
setTimeout(function () {
|
||||
setToolTips();
|
||||
},1000);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2684,7 +2684,7 @@ $(document).ready(function () {
|
|||
},
|
||||
hidePleaseWait: function () {
|
||||
clearTimeout(hidePleaseWaitTimeout);
|
||||
hidePleaseWaitTimeout = setTimeout(function(){
|
||||
hidePleaseWaitTimeout = setTimeout(function () {
|
||||
setTimeout(function () {
|
||||
$('#pleaseWaitDialog').addClass('loaded');
|
||||
}, showPleaseWaitTimeOut / 2);
|
||||
|
@ -2693,7 +2693,7 @@ $(document).ready(function () {
|
|||
}, showPleaseWaitTimeOut); // wait for loader animation
|
||||
setTimeout(function () {
|
||||
pleaseWaitIsINUse = false;
|
||||
}, showPleaseWaitTimeOut+1000);
|
||||
}, showPleaseWaitTimeOut + 1000);
|
||||
}, 500);
|
||||
},
|
||||
setProgress: function (valeur) {
|
||||
|
@ -3026,50 +3026,50 @@ function notifyInputIfIsOutOfBounds(selector, min_length, max_length) {
|
|||
var icon = '';
|
||||
var feedback = '';
|
||||
var force_length = parseInt($(selector).attr('maxlength'));
|
||||
|
||||
|
||||
if (text.length == 0 && !isRequired) {
|
||||
|
||||
} else if (isTextOutOfBounds(text, min_length, max_length, isRequired)) {
|
||||
var feedbackIcon = 'fas fa-exclamation';
|
||||
parent.addClass('has-feedback');
|
||||
if(!empty(force_length) && text.length >= force_length){
|
||||
if (!empty(force_length) && text.length >= force_length) {
|
||||
text = text.substr(0, force_length);
|
||||
$(selector).val(text);
|
||||
icon = '<i class="fas fa-exclamation-triangle"></i>';
|
||||
parent.addClass('has-info');
|
||||
notifyInputIfIsOutOfBounds_animateClassTImeout = setTimeout(function(){
|
||||
notifyInputIfIsOutOfBounds_animateClassTImeout = setTimeout(function () {
|
||||
$(selector).addClass(animationInfo);
|
||||
},500);
|
||||
}else if(text.length < min_length || !isRequired){
|
||||
}, 500);
|
||||
} else if (text.length < min_length || !isRequired) {
|
||||
icon = '<i class="fas fa-exclamation-circle"></i>';
|
||||
parent.addClass('has-warning');
|
||||
notifyInputIfIsOutOfBounds_animateClassTImeout = setTimeout(function(){
|
||||
notifyInputIfIsOutOfBounds_animateClassTImeout = setTimeout(function () {
|
||||
$(selector).addClass(animationWarning);
|
||||
},500);
|
||||
}else{
|
||||
}, 500);
|
||||
} else {
|
||||
icon = '<i class="fas fa-exclamation-circle"></i>';
|
||||
parent.addClass('has-error');
|
||||
feedbackIcon = 'fas fa-times';
|
||||
notifyInputIfIsOutOfBounds_animateClassTImeout = setTimeout(function(){
|
||||
notifyInputIfIsOutOfBounds_animateClassTImeout = setTimeout(function () {
|
||||
$(selector).addClass(animationError);
|
||||
},500);
|
||||
}, 500);
|
||||
}
|
||||
feedback = '<i class="'+feedbackIcon+' form-control-feedback" style="right:15px;"></i>';
|
||||
feedback = '<i class="' + feedbackIcon + ' form-control-feedback" style="right:15px;"></i>';
|
||||
} else {
|
||||
console.log('notifyInputIfIsOutOfBounds', text.length, force_length);
|
||||
if(!empty(force_length) && text.length == force_length){
|
||||
notifyInputIfIsOutOfBounds_animateClassTImeout = setTimeout(function(){
|
||||
if (!empty(force_length) && text.length == force_length) {
|
||||
notifyInputIfIsOutOfBounds_animateClassTImeout = setTimeout(function () {
|
||||
$(selector).addClass(animationInfo);
|
||||
},500);
|
||||
}, 500);
|
||||
}
|
||||
icon = '<i class="fas fa-check-circle"></i>';
|
||||
parent.addClass('has-success');
|
||||
}
|
||||
notifyInputIfIsOutOfBounds_removeClassTImeout = setTimeout(function(){
|
||||
notifyInputIfIsOutOfBounds_removeClassTImeout = setTimeout(function () {
|
||||
$(selector).removeClass(animationInfo);
|
||||
$(selector).removeClass(animationError);
|
||||
$(selector).removeClass(animationWarning);
|
||||
},1000);
|
||||
}, 1000);
|
||||
parent.append(feedback + '<small class="help-block">' + icon + ' ' + text.length + ' characters of ' + min_length + '-' + max_length + ' recommended</small>');
|
||||
}
|
||||
|
||||
|
@ -3081,9 +3081,9 @@ function setupFormElement(selector, min_length, max_length, force_length, isRequ
|
|||
} else {
|
||||
$(selector).attr('required', 'required');
|
||||
}
|
||||
if(force_length){
|
||||
if (force_length) {
|
||||
$(selector).attr('maxlength', max_length);
|
||||
$(selector).attr('minlength', min_length);
|
||||
$(selector).attr('minlength', min_length);
|
||||
}
|
||||
$(selector).keyup(function () {
|
||||
notifyInputIfIsOutOfBounds('#' + $(this).attr('id'), $(this).attr('min_length'), $(this).attr('max_length'));
|
||||
|
@ -3111,4 +3111,44 @@ function isTextOutOfBounds(text, min_length, max_length, isRequired) {
|
|||
}
|
||||
//console.log('isTextOutOfBounds 5');
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Usage: setVideoSuggested(videos_id, isSuggested).then((data) => {...}).catch((error) => {console.log(error)});
|
||||
* @param {type} videos_id
|
||||
* @param {type} isSuggested
|
||||
* @returns {Promise}
|
||||
*/
|
||||
async function setVideoSuggested(videos_id, isSuggested) {
|
||||
modal.showPleaseWait();
|
||||
return new Promise((resolve, reject) => {
|
||||
$.ajax({
|
||||
url: webSiteRootURL + 'objects/videoSuggest.php',
|
||||
data: {"id": videos_id, "isSuggested": isSuggested},
|
||||
type: 'post',
|
||||
success: function (data) {
|
||||
modal.hidePleaseWait();
|
||||
avideoResponse(data);
|
||||
resolve(data)
|
||||
},
|
||||
error: function (error) {
|
||||
modal.hidePleaseWait();
|
||||
reject(error)
|
||||
},
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function toogleVideoSuggested(btn){
|
||||
var videos_id = $(btn).attr('videos_id');
|
||||
var isSuggested = $(btn).hasClass('isSuggested');
|
||||
setVideoSuggested(videos_id, !isSuggested).then((data) => {
|
||||
if(!isSuggested){
|
||||
$(btn).removeClass('isNotSuggested btn-default');
|
||||
$(btn).addClass('isSuggested btn-warning');
|
||||
}else{
|
||||
$(btn).addClass('isNotSuggested btn-default');
|
||||
$(btn).removeClass('isSuggested btn-warning');
|
||||
}
|
||||
}).catch((error) => {console.log(error)});
|
||||
}
|
|
@ -2005,16 +2005,10 @@ if (Permissions::canAdminVideos()) {
|
|||
var row_index = $(this).closest('tr').index();
|
||||
var row = $("#grid").bootgrid("getCurrentRows")[row_index];
|
||||
var isSuggested = $(this).hasClass('unsuggest');
|
||||
modal.showPleaseWait();
|
||||
$.ajax({
|
||||
url: webSiteRootURL + 'objects/videoSuggest.php',
|
||||
data: {"id": row.id, "isSuggested": isSuggested},
|
||||
type: 'post',
|
||||
success: function (response) {
|
||||
$("#grid").bootgrid("reload");
|
||||
modal.hidePleaseWait();
|
||||
}
|
||||
});
|
||||
|
||||
setVideoSuggested(row.id, isSuggested).then((data) => {
|
||||
$("#grid").bootgrid("reload");
|
||||
}).catch((error) => {console.log(error)});
|
||||
});
|
||||
grid.find(".command-editlikes").on("click", function (e) {
|
||||
var row_index = $(this).closest('tr').index();
|
||||
|
|
|
@ -61,13 +61,16 @@ $description = getSEODescription(emptyHTML($video['description']) ? $video['titl
|
|||
if (!empty($video['id']) && Video::showYoutubeModeOptions() && Video::canEdit($video['id'])) {
|
||||
?>
|
||||
<div class="btn-group" role="group" aria-label="Basic example">
|
||||
<a href="#" class="btn btn-primary btn-xs" onclick="avideoModalIframe(webSiteRootURL + 'view/managerVideosLight.php?avideoIframe=1&videos_id=<?php echo $video['id']; ?>');return false;" data-toggle="tooltip" title="<?php echo __("Edit Video"); ?>">
|
||||
<button type="button" class="btn btn-primary btn-xs" onclick="avideoModalIframe(webSiteRootURL + 'view/managerVideosLight.php?avideoIframe=1&videos_id=<?php echo $video['id']; ?>');return false;" data-toggle="tooltip" title="<?php echo __("Edit Video"); ?>">
|
||||
<i class="fa fa-edit"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Edit Video"); ?></span>
|
||||
</a>
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-xs" onclick="avideoModalIframeFull(webSiteRootURL + 'view/videoViewsInfo.php?videos_id=<?php echo $video['id']; ?>');
|
||||
return false;">
|
||||
<i class="fa fa-eye"></i> <?php echo __("Views Info"); ?>
|
||||
<i class="fa fa-eye"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Views Info"); ?></span>
|
||||
</button>
|
||||
<?php
|
||||
echo Layout::getSuggestedButton($video['id']);
|
||||
?>
|
||||
</div>
|
||||
<?php }
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue