mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
ITS WORKIIING
This commit is contained in:
2
static/dist/frontpage.min.js
vendored
2
static/dist/frontpage.min.js
vendored
File diff suppressed because one or more lines are too long
4
static/dist/main.min.js
vendored
4
static/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -53,7 +53,6 @@ socket.on("get_list", function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
socket.on("suggested", function(params){
|
socket.on("suggested", function(params){
|
||||||
console.log(params);
|
|
||||||
var single = true;
|
var single = true;
|
||||||
if(params.id == undefined)
|
if(params.id == undefined)
|
||||||
single = false;
|
single = false;
|
||||||
@@ -72,7 +71,6 @@ $(document).ready(function()
|
|||||||
localStorage.setItem("list_update", "13.06.15");
|
localStorage.setItem("list_update", "13.06.15");
|
||||||
window.location.reload(true);
|
window.location.reload(true);
|
||||||
}
|
}
|
||||||
console.log(Youtube);
|
|
||||||
Youtube.setup_youtube_listener(chan);
|
Youtube.setup_youtube_listener(chan);
|
||||||
Admin.admin_listener();
|
Admin.admin_listener();
|
||||||
List.channel_listener();
|
List.channel_listener();
|
||||||
@@ -354,7 +352,10 @@ $(document).on('click', '#toast-container', function(){
|
|||||||
|
|
||||||
$(".brand-logo").click(function(e){
|
$(".brand-logo").click(function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
console.log("Hellooo");
|
|
||||||
|
console.log("move to frontpage")
|
||||||
|
|
||||||
|
window.history.pushState("to the frontpage!", "Title", "/");
|
||||||
onepage_load();
|
onepage_load();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -432,28 +433,18 @@ function onepage_load(){
|
|||||||
delete socket;
|
delete socket;
|
||||||
delete window.onYouTubeIframeAPIReady;
|
delete window.onYouTubeIframeAPIReady;
|
||||||
|
|
||||||
|
document.title = "Zöff";
|
||||||
|
|
||||||
$("main").attr("class", "center-align container");
|
$("main").attr("class", "center-align container");
|
||||||
$("body").attr("id", "");
|
$("body").attr("id", "");
|
||||||
|
$("body").attr("style", "");
|
||||||
$("header").html($($(e)[0]).html());
|
$("header").html($($(e)[0]).html());
|
||||||
$($(e)[2]).insertAfter("header");
|
$($(e)[2]).insertAfter("header");
|
||||||
$($(e)[4]).insertAfter(".mega");
|
$($(e)[4]).insertAfter(".mega");
|
||||||
$("main").html($($(e)[6]).html());
|
$("main").html($($(e)[6]).html());
|
||||||
|
|
||||||
removejscssfile("main.min", "js");
|
|
||||||
|
|
||||||
$("#scripts").html($($(e)[8]).html());
|
$("#scripts").html($($(e)[8]).html());
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function removejscssfile(filename, filetype){
|
|
||||||
var targetelement=(filetype=="js")? "script" : (filetype=="css")? "link" : "none" //determine element type to create nodelist from
|
|
||||||
var targetattr=(filetype=="js")? "src" : (filetype=="css")? "href" : "none" //determine corresponding attribute to test for
|
|
||||||
var allsuspects=document.getElementsByTagName(targetelement)
|
|
||||||
for (var i=allsuspects.length; i>=0; i--){ //search backwards within nodelist for matching elements to remove
|
|
||||||
if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && allsuspects[i].getAttribute(targetattr).indexOf(filename)!=-1)
|
|
||||||
allsuspects[i].parentNode.removeChild(allsuspects[i]) //remove element by calling parentNode.removeChild()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -199,7 +199,7 @@ var Nochan = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
to_channel: function(chan){
|
to_channel: function(chan, popstate){
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: chan + "/php/channel.php",
|
url: chan + "/php/channel.php",
|
||||||
@@ -208,7 +208,9 @@ var Nochan = {
|
|||||||
delete Nochan
|
delete Nochan
|
||||||
|
|
||||||
socket.disconnect();
|
socket.disconnect();
|
||||||
window.history.pushState("to the channel!", "Title", "/" + chan);
|
|
||||||
|
if(!popstate) window.history.pushState("to the channel!", "Title", "/" + chan);
|
||||||
|
|
||||||
$.holdReady(true);
|
$.holdReady(true);
|
||||||
$(".mega").remove();
|
$(".mega").remove();
|
||||||
$(".mobile-search").remove();
|
$(".mobile-search").remove();
|
||||||
@@ -223,6 +225,14 @@ var Nochan = {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.onpopstate = function(e){
|
||||||
|
var url_split = window.location.href.split("/");
|
||||||
|
|
||||||
|
if(url_split[3] != "" || url_split[3].substring(0,1) != "#"){
|
||||||
|
Nochan.to_channel(url_split[3], true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String.prototype.capitalizeFirstLetter = function() {
|
String.prototype.capitalizeFirstLetter = function() {
|
||||||
@@ -313,7 +323,7 @@ $(document).on('click', '#toast-container', function(){
|
|||||||
|
|
||||||
$(document).on('click', ".chan-link", function(e){
|
$(document).on('click', ".chan-link", function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
Nochan.to_channel($(this).attr("href"));
|
Nochan.to_channel($(this).attr("href"), false);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".listen-button").click(function(e){
|
$(".listen-button").click(function(e){
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ var Youtube = {
|
|||||||
|
|
||||||
setup_youtube_listener: function(channel)
|
setup_youtube_listener: function(channel)
|
||||||
{
|
{
|
||||||
console.log("Setup shit");
|
|
||||||
socket.on("np", function(obj)
|
socket.on("np", function(obj)
|
||||||
{
|
{
|
||||||
Youtube.loaded = false;
|
Youtube.loaded = false;
|
||||||
@@ -224,7 +223,6 @@ var Youtube = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onYouTubeIframeAPIReady: function() {
|
onYouTubeIframeAPIReady: function() {
|
||||||
console.log("helloo?");
|
|
||||||
ytplayer = new YT.Player('player', {
|
ytplayer = new YT.Player('player', {
|
||||||
videoId: "asd",
|
videoId: "asd",
|
||||||
playerVars: { rel:"0", wmode:"transparent", controls: "0" , iv_load_policy: "3", theme:"light", color:"white"},
|
playerVars: { rel:"0", wmode:"transparent", controls: "0" , iv_load_policy: "3", theme:"light", color:"white"},
|
||||||
@@ -237,7 +235,9 @@ var Youtube = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
loadPlayer: function() {
|
loadPlayer: function() {
|
||||||
if($(document.getElementsByTagName('script')[0]).attr("src") == "https://www.youtube.com/iframe_api"){
|
console.log($("script[src='https://www.youtube.com/iframe_api']")["length"]);
|
||||||
|
if($("script[src='https://www.youtube.com/iframe_api']")["length"] == 1){
|
||||||
|
console.log("script exists");
|
||||||
Youtube.onYouTubeIframeAPIReady();
|
Youtube.onYouTubeIframeAPIReady();
|
||||||
}else{
|
}else{
|
||||||
tag = document.createElement('script');
|
tag = document.createElement('script');
|
||||||
|
|||||||
Reference in New Issue
Block a user