Skip to content

Commit

Permalink
Add a class on the body that we can improve the youtube layout
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel authored and daniel committed Jan 11, 2019
1 parent b521f6a commit faf13be
Show file tree
Hide file tree
Showing 58 changed files with 198 additions and 84 deletions.
120 changes: 100 additions & 20 deletions admin/design_first_page.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<?php
$defaultSwitch = false;
$youtubeSwitch = Plugin::isEnabledByName('YouTube');
$gallerySwitch = Plugin::isEnabledByName('Gallery');
$netflixSwitch = Plugin::isEnabledByName('YouPHPFlix2');
if(empty($netflixSwitch) && empty($gallerySwitch)){
if (empty($netflixSwitch) && empty($gallerySwitch) && empty($youtubeSwitch)) {
$defaultSwitch = true;
}
?>
<div class="row">
<div class="col-xs-4">
<div class="col-xs-3">
<div class="panel panel-default">
<div class="panel-heading">
Default
<div class="material-switch pull-right">
<input class="" data-toggle="toggle" type="checkbox" id="defaultSwitch" <?php echo $defaultSwitch?"checked":""; ?>>
<input class="" data-toggle="toggle" type="checkbox" id="defaultSwitch" <?php echo $defaultSwitch ? "checked" : ""; ?>>
<label for="defaultSwitch" class="label-primary"></label>
</div>
</div>
Expand All @@ -21,12 +22,12 @@
</div>
</div>
</div>
<div class="col-xs-4">
<div class="col-xs-3">
<div class="panel panel-default">
<div class="panel-heading">
Netflix
<div class="material-switch pull-right">
<input class="" data-toggle="toggle" type="checkbox" id="netflixSwitch" <?php echo $netflixSwitch?"checked":""; ?>>
<input class="" data-toggle="toggle" type="checkbox" id="netflixSwitch" <?php echo $netflixSwitch ? "checked" : ""; ?>>
<label for="netflixSwitch" class="label-primary"></label>
</div>
</div>
Expand All @@ -35,12 +36,12 @@
</div>
</div>
</div>
<div class="col-xs-4">
<div class="col-xs-3">
<div class="panel panel-default">
<div class="panel-heading">
Gallery
<div class="material-switch pull-right">
<input class="" data-toggle="toggle" type="checkbox" id="gallerySwitch" <?php echo $gallerySwitch?"checked":""; ?>>
<input class="" data-toggle="toggle" type="checkbox" id="gallerySwitch" <?php echo $gallerySwitch ? "checked" : ""; ?>>
<label for="gallerySwitch" class="label-primary"></label>
</div>
</div>
Expand All @@ -49,15 +50,31 @@
</div>
</div>
</div>
<div class="col-xs-3">
<div class="panel panel-default">
<div class="panel-heading">
YouTube
<div class="material-switch pull-right">
<input class="" data-toggle="toggle" type="checkbox" id="youtubeSwitch" <?php echo $youtubeSwitch ? "checked" : ""; ?>>
<label for="youtubeSwitch" class="label-primary"></label>
</div>
</div>
<div class="panel-body">
<img src="<?php echo $global['webSiteRootURL']; ?>admin/img/youtube.jpg" class="img-responsive">
</div>
</div>
</div>
</div>
<script>
function checkSwitch() {
var defaultSwitch = $('#defaultSwitch').is(":checked");
var netflixSwitch = $('#netflixSwitch').is(":checked");
var gallerySwitch = $('#gallerySwitch').is(":checked");
if (!defaultSwitch && !netflixSwitch && !gallerySwitch) {
var youtubeSwitch = $('#youtubeSwitch').is(":checked");
if (!defaultSwitch && !netflixSwitch && !gallerySwitch && !youtubeSwitch) {
$('#netflixSwitch').prop('checked', false);
$('#gallerySwitch').prop('checked', false);
$('#youtubeSwitch').prop('checked', false);
$('#defaultSwitch').prop('checked', true);
}
}
Expand All @@ -66,6 +83,7 @@ function checkSwitch() {
if ($(this).is(":checked")) {
$('#netflixSwitch').prop('checked', false);
$('#gallerySwitch').prop('checked', false);
$('#youtubeSwitch').prop('checked', false);
}
checkSwitch();

Expand All @@ -81,11 +99,18 @@ function checkSwitch() {
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": 'default'},
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": false},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": 'default'},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
}
});
}
Expand All @@ -97,9 +122,10 @@ function checkSwitch() {
if ($(this).is(":checked")) {
$('#gallerySwitch').prop('checked', false);
$('#defaultSwitch').prop('checked', false);
$('#youtubeSwitch').prop('checked', false);
}
checkSwitch();

modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
Expand All @@ -108,15 +134,22 @@ function checkSwitch() {
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": true},
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": 'netflix'},
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": true},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": 'netflix'},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
}
});
}
Expand All @@ -128,26 +161,73 @@ function checkSwitch() {
if ($(this).is(":checked")) {
$('#netflixSwitch').prop('checked', false);
$('#defaultSwitch').prop('checked', false);
$('#youtubeSwitch').prop('checked', false);
}
checkSwitch();

modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": true},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": 'default'},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
}
});
}
});
}
});
});
$('#youtubeSwitch').change(function (e) {
if ($(this).is(":checked")) {
$('#gallerySwitch').prop('checked', false);
$('#defaultSwitch').prop('checked', false);
$('#netflixSwitch').prop('checked', false);
}
checkSwitch();

modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": false},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": 'default'},
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": true},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": 'default'},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
}
});
}
Expand Down
Binary file added admin/img/youtube.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function addItem(MenuAdmin $menu) {
}
</style>
</head>
<body>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
Expand Down
2 changes: 1 addition & 1 deletion install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<script src="../view/js/jquery-3.3.1.min.js" type="text/javascript"></script>
</head>

<body>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
if (file_exists('../videos/configuration.php')) {
require_once '../videos/configuration.php';
Expand Down
2 changes: 1 addition & 1 deletion locale/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function listAll($dir) {
</style>
</head>

<body>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'].'view/include/navbar.php';
?>
Expand Down
3 changes: 3 additions & 0 deletions objects/include_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
require_once $global['systemRootPath'].'objects/user.php';
require_once $global['systemRootPath'].'plugin/YouPHPTubePlugin.php';
if(class_exists("Plugin")){YouPHPTubePlugin::getStart();}
if(empty($global['bodyClass'])){
$global['bodyClass'] = "";
}
else{error_log("Class Plugin Not found: {$_SERVER['REQUEST_URI']}");}
$global['allowedExtension'] = array('gif', 'jpg', 'mp4', 'webm', 'mp3', 'ogg');
$advancedCustom = YouPHPTubePlugin::getObjectDataIfEnabled("CustomizeAdvanced");
Expand Down
2 changes: 1 addition & 1 deletion objects/userRecoverPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
?>
</head>

<body>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
Expand Down
2 changes: 1 addition & 1 deletion plugin/AD_Server/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
include $global['systemRootPath'] . 'plugin/AD_Server/index_head.php';
?>
</head>
<body>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
include $global['systemRootPath'] . 'plugin/AD_Server/index_body.php';
Expand Down
2 changes: 1 addition & 1 deletion plugin/Audit/page/editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<style>
</style>
</head>
<body>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
Expand Down
2 changes: 1 addition & 1 deletion plugin/CloneSite/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
?>
<link rel="stylesheet" type="text/css" href="<?php echo $global['webSiteRootURL']; ?>view/css/DataTables/datatables.min.css"/>
</head>
<body>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
Expand Down
2 changes: 1 addition & 1 deletion plugin/FBTube/view/modeFacebook.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</script>
</head>

<body>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
Expand Down
2 changes: 1 addition & 1 deletion plugin/Gallery/view/modeGallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<?php include $global['systemRootPath'] . 'view/include/head.php'; ?>
</head>

<body>
<body class="<?php echo $global['bodyClass']; ?>">
<?php include $global['systemRootPath'] . 'view/include/navbar.php'; ?>
<div class="container-fluid gallery" itemscope itemtype="http://schema.org/VideoObject">
<div class="row text-center" style="padding: 10px;">
Expand Down
2 changes: 1 addition & 1 deletion plugin/Live/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<script src="<?php echo $global['webSiteRootURL']; ?>js/video.js/video.js" type="text/javascript"></script>
<script src="<?php echo $global['webSiteRootURL']; ?>plugin/Live/view/videojs-contrib-hls.min.js" type="text/javascript"></script>
</head>
<body>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
Expand Down
2 changes: 1 addition & 1 deletion plugin/Live/view/modeYoutubeLive.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<meta property="og:image:height" content="<?php echo $imgh; ?>" />
</head>

<body>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
$lt = new LiveTransmition($t['id']);
Expand Down
2 changes: 1 addition & 1 deletion plugin/LiveChat/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
include $global['systemRootPath'] . 'view/include/head.php';
?>
</head>
<body>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
Expand Down
2 changes: 1 addition & 1 deletion plugin/LiveLinks/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
include $global['systemRootPath'] . 'view/include/head.php';
?>
</head>
<body>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
Expand Down
2 changes: 1 addition & 1 deletion plugin/LiveLinks/view/Live.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<meta property="og:image:height" content="<?php echo $imgh; ?>" />
</head>

<body>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
Expand Down
2 changes: 1 addition & 1 deletion plugin/PlayerSkins/playerSample.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</style>
</head>

<body>
<body class="<?php echo $global['bodyClass']; ?>">
<video id="mainVideo" poster="<?php echo $global['webSiteRootURL']; ?>plugin/PlayerSkins/bg.jpg" controls
class="video-js vjs-default-skin vjs-big-play-centered" loop style="height: 100%; width: 100%;">
<source src="bg.mp4" type="video/mp4">
Expand Down
2 changes: 1 addition & 1 deletion plugin/PredefinedCategory/page/editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
}
</style>
</head>
<body>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
Expand Down
Loading

0 comments on commit faf13be

Please sign in to comment.