mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-04 02:09:22 +02:00
Autohide navbar
This commit is contained in:
parent
1a5003be06
commit
331b83e89f
5 changed files with 104 additions and 76 deletions
|
@ -1808,16 +1808,17 @@ function url_get_contents($url, $ctx = "", $timeout = 0) {
|
|||
// If is URL try wget First
|
||||
if (empty($ctx)) {
|
||||
$filename = getTmpDir("YPTurl_get_contents") . md5($url);
|
||||
wget($url, $filename);
|
||||
$result = file_get_contents($filename);
|
||||
unlink($filename);
|
||||
if(!empty($result)){
|
||||
if (filter_var($url, FILTER_VALIDATE_URL)) {
|
||||
_session_start();
|
||||
$_SESSION = $session;
|
||||
_mysql_connect();
|
||||
if(wget($url, $filename)){
|
||||
$result = file_get_contents($filename);
|
||||
unlink($filename);
|
||||
if(!empty($result)){
|
||||
if (filter_var($url, FILTER_VALIDATE_URL)) {
|
||||
_session_start();
|
||||
$_SESSION = $session;
|
||||
_mysql_connect();
|
||||
}
|
||||
return remove_utf8_bom($result);
|
||||
}
|
||||
return remove_utf8_bom($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3277,6 +3278,9 @@ function wget($url, $filename) {
|
|||
//echo $cmd;
|
||||
exec($cmd);
|
||||
wgetRemoveLock($url);
|
||||
if(!file_exists($filename)){
|
||||
return false;
|
||||
}
|
||||
if (filesize($filename) > 1000000) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -5,11 +5,10 @@ require_once $global['systemRootPath'] . 'plugin/Plugin.abstract.php';
|
|||
|
||||
class CustomizeAdvanced extends PluginAbstract {
|
||||
|
||||
|
||||
public function getDescription() {
|
||||
$txt = "Fine Tuning your AVideo";
|
||||
$help = "<br><small><a href='https://github.com/WWBN/AVideo/wiki/Advanced-Customization-Plugin' target='__blank'><i class='fas fa-question-circle'></i> Help</a></small>";
|
||||
return $txt.$help;
|
||||
return $txt . $help;
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
|
@ -85,29 +84,30 @@ class CustomizeAdvanced extends PluginAbstract {
|
|||
$o->type = "textarea";
|
||||
$o->value = "";
|
||||
$obj->footerHTMLCode = $o;
|
||||
$obj->signInOnRight= true;
|
||||
$obj->signInOnLeft= true;
|
||||
$obj->forceCategory= false;
|
||||
$obj->autoPlayAjax= false;
|
||||
$obj->signInOnRight = true;
|
||||
$obj->signInOnLeft = true;
|
||||
$obj->forceCategory = false;
|
||||
$obj->autoPlayAjax = false;
|
||||
|
||||
$plugins = Plugin::getAllEnabled();
|
||||
//import external plugins configuration options
|
||||
foreach ($plugins as $value) {
|
||||
$p = AVideoPlugin::loadPlugin($value['dirName']);
|
||||
if (is_object($p)) {
|
||||
$foreginObjects=$p->getCustomizeAdvancedOptions();
|
||||
if($foreginObjects)
|
||||
{
|
||||
foreach($foreginObjects as $optionName => $defaultValue)
|
||||
$obj->{$optionName}=$defaultValue;
|
||||
$foreginObjects = $p->getCustomizeAdvancedOptions();
|
||||
if ($foreginObjects) {
|
||||
foreach ($foreginObjects as $optionName => $defaultValue)
|
||||
$obj->{$optionName} = $defaultValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$obj->disableHelpLeftMenu= false;
|
||||
$obj->disableAboutLeftMenu= false;
|
||||
$obj->disableContactLeftMenu= false;
|
||||
$obj->disableNavbar= false;
|
||||
$obj->disableHelpLeftMenu = false;
|
||||
$obj->disableAboutLeftMenu = false;
|
||||
$obj->disableContactLeftMenu = false;
|
||||
$obj->disableNavbar = false;
|
||||
$obj->disableNavBarInsideIframe = true;
|
||||
$obj->autoHideNavbar = true;
|
||||
$obj->videosCDN = "";
|
||||
$obj->useFFMPEGToGenerateThumbs = false;
|
||||
$obj->thumbsWidthPortrait = 170;
|
||||
|
@ -153,12 +153,13 @@ class CustomizeAdvanced extends PluginAbstract {
|
|||
$o->value = "";
|
||||
$obj->videoNotFoundText = $o;
|
||||
$obj->siteMapRowsLimit = 100;
|
||||
$obj->showPrivateVideosOnSitemap= false;
|
||||
$obj->showPrivateVideosOnSitemap = false;
|
||||
$obj->enableOldPassHashCheck = true;
|
||||
$obj->disableHTMLDescription = false;
|
||||
$obj->disableTopMenusInsideIframe = true;
|
||||
$obj->disableVideoSwap = false;
|
||||
$obj->makeSwapVideosOnlyForAdmin = false;
|
||||
$obj->disableCopyEmbed = false;
|
||||
$obj->disableDownloadVideosList = false;
|
||||
|
||||
$parse = parse_url($global['webSiteRootURL']);
|
||||
$domain = str_replace(".", "", $parse['host']);
|
||||
|
@ -169,9 +170,9 @@ class CustomizeAdvanced extends PluginAbstract {
|
|||
return $obj;
|
||||
}
|
||||
|
||||
public function getHelp(){
|
||||
if(User::isAdmin()){
|
||||
return "<h2 id='CustomizeAdvanced help'>CustomizeAdvanced (admin)</h2><p>".$this->getDescription()."</p><table class='table'><tbody><tr><td>EnableWavesurfer</td><td>Enables the visualisation for audio. This will always download full audio first, so with big audio-files, you might better disable it.</td></tr><tr><td>commentsMaxLength</td><td>Maximum lenght for comments in videos</td></tr><tr><td>disableYoutubePlayerIntegration</td> <td>Disables the integrating of youtube-videos and just embed them.</td></tr><tr><td>EnableMinifyJS</td><td>Minify your JS. Clear videos/cache after changing this option.</td></tr></tbody></table>";
|
||||
public function getHelp() {
|
||||
if (User::isAdmin()) {
|
||||
return "<h2 id='CustomizeAdvanced help'>CustomizeAdvanced (admin)</h2><p>" . $this->getDescription() . "</p><table class='table'><tbody><tr><td>EnableWavesurfer</td><td>Enables the visualisation for audio. This will always download full audio first, so with big audio-files, you might better disable it.</td></tr><tr><td>commentsMaxLength</td><td>Maximum lenght for comments in videos</td></tr><tr><td>disableYoutubePlayerIntegration</td> <td>Disables the integrating of youtube-videos and just embed them.</td></tr><tr><td>EnableMinifyJS</td><td>Minify your JS. Clear videos/cache after changing this option.</td></tr></tbody></table>";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
@ -184,10 +185,10 @@ class CustomizeAdvanced extends PluginAbstract {
|
|||
global $global, $config;
|
||||
$obj = $this->getDataObject();
|
||||
$video = Video::getVideo($videos_id, "viewable", true);
|
||||
if(!empty($video['rrating']) && empty($_GET['rrating'])){
|
||||
if (!empty($video['rrating']) && empty($_GET['rrating'])) {
|
||||
$suffix = strtoupper(str_replace("-", "", $video['rrating']));
|
||||
eval("\$show = \$obj->askRRatingConfirmationBeforePlay_$suffix;");
|
||||
if(!empty($show)){
|
||||
if (!empty($show)) {
|
||||
include "{$global['systemRootPath']}plugin/CustomizeAdvanced/confirmRating.php";
|
||||
exit;
|
||||
}
|
||||
|
@ -199,8 +200,11 @@ class CustomizeAdvanced extends PluginAbstract {
|
|||
|
||||
$obj = $this->getDataObject();
|
||||
$content = '';
|
||||
if($obj->disableTopMenusInsideIframe){
|
||||
$content .= '<script>$(function () {if(inIframe()){$("#mainNavBar").fadeOut();}});</script>';
|
||||
if ($obj->disableNavBarInsideIframe) {
|
||||
$content .= '<script>$(function () {if(inIframe()){$("#mainNavBar").fadeOut();}});</script>';
|
||||
}
|
||||
if ($obj->autoHideNavbar) {
|
||||
$content .= '<script>$(function () {$("#mainNavBar").autoHidingNavbar();});</script>';
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
@ -208,7 +212,7 @@ class CustomizeAdvanced extends PluginAbstract {
|
|||
public function getHTMLMenuRight() {
|
||||
global $global;
|
||||
$obj = $this->getDataObject();
|
||||
if($obj->filterRRating){
|
||||
if ($obj->filterRRating) {
|
||||
include $global['systemRootPath'] . 'plugin/CustomizeAdvanced/menuRight.php';
|
||||
}
|
||||
}
|
||||
|
@ -216,7 +220,7 @@ class CustomizeAdvanced extends PluginAbstract {
|
|||
public function getHTMLMenuLeft() {
|
||||
global $global;
|
||||
$obj = $this->getDataObject();
|
||||
if($obj->filterRRating){
|
||||
if ($obj->filterRRating) {
|
||||
include $global['systemRootPath'] . 'plugin/CustomizeAdvanced/menuLeft.php';
|
||||
}
|
||||
}
|
||||
|
@ -224,31 +228,30 @@ class CustomizeAdvanced extends PluginAbstract {
|
|||
public static function getVideoWhereClause() {
|
||||
$sql = "";
|
||||
$obj = AVideoPlugin::getObjectData("CustomizeAdvanced");
|
||||
if($obj->filterRRating && isset($_GET['rrating'])){
|
||||
if($_GET['rrating']==="0"){
|
||||
if ($obj->filterRRating && isset($_GET['rrating'])) {
|
||||
if ($_GET['rrating'] === "0") {
|
||||
$sql .= " AND v.rrating = ''";
|
||||
}else if(in_array($_GET['rrating'],Video::$rratingOptions)){
|
||||
} else if (in_array($_GET['rrating'], Video::$rratingOptions)) {
|
||||
$sql .= " AND v.rrating = '{$_GET['rrating']}'";
|
||||
}
|
||||
}
|
||||
return $sql;
|
||||
}
|
||||
|
||||
public function getVideosManagerListButton(){
|
||||
public function getVideosManagerListButton() {
|
||||
$btn = "";
|
||||
if(User::isAdmin()){
|
||||
if (User::isAdmin()) {
|
||||
$btn = '<button type="button" class="btn btn-default btn-light btn-sm btn-xs btn-block " onclick="updateDiskUsage(\' + row.id + \');" data-row-id="right" data-toggle="tooltip" data-placement="left" title="Update Disk usage"><i class="fas fa-chart-line"></i> Update Disk Usage</button>';
|
||||
$btn .= '<button type="button" class="btn btn-default btn-light btn-sm btn-xs btn-block " onclick="removeThumbs(\' + row.id + \');" data-row-id="right" data-toggle="tooltip" data-placement="left" title="RemoveThumbs"><i class="fas fa-images"></i> Remove Thumbs</button>';
|
||||
}
|
||||
return $btn;
|
||||
}
|
||||
|
||||
|
||||
public function getHeadCode(){
|
||||
public function getHeadCode() {
|
||||
global $global;
|
||||
$baseName = basename($_SERVER['REQUEST_URI']);
|
||||
$js = "";
|
||||
if($baseName === 'mvideos'){
|
||||
if ($baseName === 'mvideos') {
|
||||
$js .= "<script>function updateDiskUsage(videos_id){
|
||||
modal.showPleaseWait();
|
||||
\$.ajax({
|
||||
|
@ -258,7 +261,7 @@ class CustomizeAdvanced extends PluginAbstract {
|
|||
success: function (response) {
|
||||
if(response.error){
|
||||
swal({
|
||||
title: \"".__("Sorry!")."\",
|
||||
title: \"" . __("Sorry!") . "\",
|
||||
text: response.msg,
|
||||
type: \"error\",
|
||||
html: true
|
||||
|
@ -279,13 +282,13 @@ class CustomizeAdvanced extends PluginAbstract {
|
|||
success: function (response) {
|
||||
if(response.error){
|
||||
swal({
|
||||
title: \"".__("Sorry!")."\",
|
||||
title: \"" . __("Sorry!") . "\",
|
||||
text: response.msg,
|
||||
icon: \"error\"
|
||||
});
|
||||
}else{
|
||||
swal({
|
||||
title: \"".__("Success!")."\",
|
||||
title: \"" . __("Success!") . "\",
|
||||
text: \"\",
|
||||
icon: \"success\"
|
||||
});
|
||||
|
@ -298,5 +301,4 @@ class CustomizeAdvanced extends PluginAbstract {
|
|||
return $js;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -63,8 +63,8 @@ $jsFiles[] = "view/js/seetalert/sweetalert.min.js";
|
|||
$jsFiles[] = "view/js/bootpag/jquery.bootpag.min.js";
|
||||
$jsFiles[] = "view/js/bootgrid/jquery.bootgrid.js";
|
||||
$jsFiles[] = "view/bootstrap/bootstrapSelectPicker/js/bootstrap-select.min.js";
|
||||
//$jsFiles[] = "view/js/bootstrap-toggle/bootstrap-toggle.min.js";
|
||||
$jsFiles[] = "view/js/js-cookie/js.cookie.js";
|
||||
$jsFiles[] = "view/js/bootstrap-toggle/bootstrap-toggle.min.js";
|
||||
$jsFiles[] = "view/js/jquery.bootstrap-autohidingnavbar.min.js";
|
||||
$jsFiles[] = "view/css/flagstrap/js/jquery.flagstrap.min.js";
|
||||
$jsFiles[] = "view/js/webui-popover/jquery.webui-popover.min.js";
|
||||
$jsFiles[] = "view/js/bootstrap-list-filter/bootstrap-list-filter.min.js";
|
||||
|
|
10
view/js/jquery.bootstrap-autohidingnavbar.min.js
vendored
Normal file
10
view/js/jquery.bootstrap-autohidingnavbar.min.js
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
/*
|
||||
* Bootstrap Auto-Hiding Navbar - v4.0.0
|
||||
* An extension for Bootstrap's fixed navbar which hides the navbar while the page is scrolling downwards and shows it the other way. The plugin is able to show/hide the navbar programmatically as well.
|
||||
* http://www.virtuosoft.eu/code/bootstrap-autohidingnavbar/
|
||||
*
|
||||
* Made by István Ujj-Mészáros
|
||||
* Under Apache License v2.0 License
|
||||
*/
|
||||
|
||||
!function(s,t,e,o){var n,h="autoHidingNavbar",a=s(t),r=s(e),i=null,u=null,l=70,f=0,d=null,c=a.height(),g=!0,m={disableAutohide:!1,showOnUpscroll:!0,showOnBottom:!0,hideOffset:"auto",animationDuration:200,navbarOffset:0};function p(t,e){this.element=s(t),this.settings=s.extend({},m,e),this._defaults=m,this._name=h,this.init()}function w(t){if(g){t.element.addClass("navbar-hidden").animate({top:-1*parseInt(t.element.css("height"),10)+t.settings.navbarOffset},{queue:!1,duration:t.settings.animationDuration});try{s(".dropdown.open .dropdown-toggle, .dropdown.show .dropdown-toggle",t.element).dropdown("toggle")}catch(t){}g=!1,t.element.trigger("hide.autoHidingNavbar")}}function O(t){g||(t.element.removeClass("navbar-hidden").animate({top:0},{queue:!1,duration:t.settings.animationDuration}),g=!0,t.element.trigger("show.autoHidingNavbar"))}function b(t){t.settings.disableAutohide||(f=(new Date).getTime(),function(t){var e=a.scrollTop(),i=e-d;if(d=e,i<0){if(g)return;(t.settings.showOnUpscroll||e<=n)&&O(t)}else if(0<i){if(!g)return t.settings.showOnBottom&&e+c===r.height()&&O(t);n<=e&&w(t)}}(t))}p.prototype={init:function(){var t;return this.elements={navbar:this.element},this.setDisableAutohide(this.settings.disableAutohide),this.setShowOnUpscroll(this.settings.showOnUpscroll),this.setShowOnBottom(this.settings.showOnBottom),this.setHideOffset(this.settings.hideOffset),this.setAnimationDuration(this.settings.animationDuration),n="auto"===this.settings.hideOffset?parseInt(this.element.css("height"),10):this.settings.hideOffset,t=this,r.on("scroll."+h,function(){(new Date).getTime()-f>l?b(t):(clearTimeout(i),i=setTimeout(function(){b(t)},l))}),a.on("resize."+h,function(){clearTimeout(u),u=setTimeout(function(){c=a.height()},l)}),this.element},setDisableAutohide:function(t){return this.settings.disableAutohide=t,this.element},setShowOnUpscroll:function(t){return this.settings.showOnUpscroll=t,this.element},setShowOnBottom:function(t){return this.settings.showOnBottom=t,this.element},setHideOffset:function(t){return this.settings.hideOffset=t,this.element},setAnimationDuration:function(t){return this.settings.animationDuration=t,this.element},show:function(){return O(this),this.element},hide:function(){return w(this),this.element},destroy:function(){return r.off("."+h),a.off("."+h),O(this),s.data(this,"plugin_"+h,null),this.element}},s.fn[h]=function(e){var i,n=arguments;return e===o||"object"==typeof e?this.each(function(){s.data(this,"plugin_"+h)||s.data(this,"plugin_"+h,new p(this,e))}):"string"==typeof e&&"_"!==e[0]&&"init"!==e?(this.each(function(){var t=s.data(this,"plugin_"+h);t instanceof p&&"function"==typeof t[e]&&(i=t[e].apply(t,Array.prototype.slice.call(n,1)))}),i!==o?i:this):void 0}}(jQuery,window,document);
|
|
@ -603,6 +603,9 @@
|
|||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
<?php
|
||||
if(empty($advancedCustom->disableDownloadVideosList)){
|
||||
?>
|
||||
<div class="btn-group pull-right" role="group">
|
||||
<a href="<?php echo $global['webSiteRootURL']; ?>objects/videos.txt.php?type=seo" target="_blank" class="btn btn-default btn-sm">
|
||||
<i class="fas fa-download"></i> <?php echo __("Download your videos list"); ?> (SEO .txt file)
|
||||
|
@ -612,6 +615,7 @@
|
|||
</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
if ((User::isAdmin()) && (!$config->getDisable_youtubeupload())) {
|
||||
?>
|
||||
<div class="alert alert-info">
|
||||
|
@ -1769,8 +1773,16 @@ if (User::isAdmin()) {
|
|||
formatters: {
|
||||
"commands": function (column, row)
|
||||
{
|
||||
var embedBtn = '<button type="button" class="btn btn-xs btn-default command-embed" id="embedBtn' + row.id + '" onclick="getEmbedCode(' + row.id + ')" data-toggle="tooltip" data-placement="left" title="<?php echo str_replace("'", "\\'", __("Copy embed code")); ?>"><span class="fa fa-copy" aria-hidden="true"></span> <span id="copied' + row.id + '" style="display:none;"><?php echo str_replace("'", "\\'", __("Copied")); ?></span></button>'
|
||||
var embedBtn = '';
|
||||
<?php
|
||||
if(empty($advancedCustom->disableCopyEmbed)){
|
||||
?>
|
||||
embedBtn += '<button type="button" class="btn btn-xs btn-default command-embed" id="embedBtn' + row.id + '" onclick="getEmbedCode(' + row.id + ')" data-toggle="tooltip" data-placement="left" title="<?php echo str_replace("'", "\\'", __("Copy embed code")); ?>"><span class="fa fa-copy" aria-hidden="true"></span> <span id="copied' + row.id + '" style="display:none;"><?php echo str_replace("'", "\\'", __("Copied")); ?></span></button>'
|
||||
embedBtn += '<input type="hidden" id="embedInput' + row.id + '" value=\'<?php echo str_replace("{embedURL}", "{$global['webSiteRootURL']}vEmbed/' + row.id + '", str_replace("'", "\"", $advancedCustom->embedCodeTemplate)); ?>\'/>';
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
var editBtn = '<button type="button" class="btn btn-xs btn-default command-edit" data-row-id="' + row.id + '" data-toggle="tooltip" data-placement="left" title="<?php echo str_replace("'", "\\'", __("Edit")); ?>"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></button>'
|
||||
var deleteBtn = '<button type="button" class="btn btn-default btn-xs command-delete" data-row-id="' + row.id + '" data-toggle="tooltip" data-placement="left" title="<?php echo str_replace("'", "\\'", __("Delete")); ?>"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>';
|
||||
var activeBtn = '<button style="color: #090" type="button" class="btn btn-default btn-xs command-active" data-row-id="' + row.id + '" data-toggle="tooltip" data-placement="left" title="<?php echo str_replace("'", "\\'", __("Inactivate")); ?>"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span></button>';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue