mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-08 20:48:48 +00:00
one page webapp try
This commit is contained in:
@@ -59,7 +59,6 @@ var Nochan = {
|
||||
//$("#channels").append(list_html);
|
||||
|
||||
var card = pre_card;
|
||||
|
||||
if(lists[x][5] == 1)
|
||||
{
|
||||
card.find(".pin").attr("style", "display:block;");
|
||||
@@ -198,6 +197,28 @@ var Nochan = {
|
||||
}else{
|
||||
corn.remove();
|
||||
}
|
||||
},
|
||||
|
||||
to_channel: function(chan){
|
||||
|
||||
$.ajax({
|
||||
url: chan + "/php/channel.php",
|
||||
success: function(e){
|
||||
|
||||
delete Nochan
|
||||
|
||||
socket.disconnect();
|
||||
window.history.pushState("to the channel!", "Title", "/" + chan);
|
||||
$.holdReady(true);
|
||||
$(".mega").remove();
|
||||
$(".mobile-search").remove();
|
||||
$("main").attr("class", "container center-align main");
|
||||
$("body").attr("id", "channelpage");
|
||||
$("header").html($($(e)[0]).html());
|
||||
$("main").html($($(e)[2]).html());
|
||||
$("#scripts").html($($(e)[4]).html());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -219,7 +240,8 @@ $(document).ready(function (){
|
||||
$("#channels").empty();
|
||||
|
||||
var connection_options = {
|
||||
'secure': true
|
||||
'secure': true,
|
||||
'force new connection': true
|
||||
};
|
||||
|
||||
if(window.location.hostname == "zoff.no") add = "https://zoff.no";
|
||||
@@ -289,6 +311,11 @@ $(document).on('click', '#toast-container', function(){
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', ".chan-link", function(e){
|
||||
e.preventDefault();
|
||||
Nochan.to_channel($(this).attr("href"));
|
||||
});
|
||||
|
||||
$(".listen-button").click(function(e){
|
||||
//console.log($(".room-namer").attr("placeholder"));
|
||||
if($(".room-namer").val() == ""){
|
||||
|
||||
Reference in New Issue
Block a user