mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-08 20:48:48 +00:00
Fix for firefox not working
This commit is contained in:
@@ -216,7 +216,6 @@ function get_list_ajax() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function contextListener(that, event) {
|
function contextListener(that, event) {
|
||||||
console.log(that, event, this);
|
|
||||||
var parent = that.parentElement;
|
var parent = that.parentElement;
|
||||||
var suggested = false;
|
var suggested = false;
|
||||||
if(parent.id.indexOf("suggested-") > -1) suggested = true;
|
if(parent.id.indexOf("suggested-") > -1) suggested = true;
|
||||||
@@ -642,8 +641,8 @@ function change_offline(enabled, already_offline){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function pagination_results(e) {
|
function pagination_results(e) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
var that = this;
|
var that = e;
|
||||||
var pageToken = that.getAttribute("data-pagination");
|
var pageToken = that.getAttribute("data-pagination");
|
||||||
var searchInput = that.getAttribute("data-original-search");
|
var searchInput = that.getAttribute("data-original-search");
|
||||||
|
|
||||||
@@ -653,9 +652,10 @@ function pagination_results(e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleEvent(e, target, tried, type) {
|
function handleEvent(e, target, tried, type) {
|
||||||
if(e.path) {
|
var path = e.path || (e.composedPath && e.composedPath());
|
||||||
for(var y = 0; y < e.path.length; y++) {
|
if(path) {
|
||||||
var target = e.path[y];
|
for(var y = 0; y < path.length; y++) {
|
||||||
|
var target = path[y];
|
||||||
if(dynamicListeners[type] && dynamicListeners[type]["#" + target.id]) {
|
if(dynamicListeners[type] && dynamicListeners[type]["#" + target.id]) {
|
||||||
dynamicListeners[type]["#" + target.id].call(e, target);
|
dynamicListeners[type]["#" + target.id].call(e, target);
|
||||||
return;
|
return;
|
||||||
@@ -669,25 +669,8 @@ function handleEvent(e, target, tried, type) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if(dynamicListeners[type] && dynamicListeners[type]["#" + target.id]) {
|
|
||||||
dynamicListeners[type]["#" + target.id].call(e, target);
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
if(target.classList == undefined) return;
|
|
||||||
for(var i = 0; i < target.classList.length; i++) {
|
|
||||||
if(dynamicListeners[type] && dynamicListeners[type]["." + target.classList[i]]) {
|
|
||||||
dynamicListeners[type]["." + target.classList[i]].call(e, target);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(target.parentElement != undefined && target.parentElement.classList != undefined) {
|
|
||||||
handleEvent(e, target.parentElement, false, type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function addListener(type, element, callback) {
|
function addListener(type, element, callback) {
|
||||||
if(dynamicListeners[type] == undefined) dynamicListeners[type] = {};
|
if(dynamicListeners[type] == undefined) dynamicListeners[type] = {};
|
||||||
|
|||||||
@@ -592,6 +592,9 @@ var Helper = {
|
|||||||
var captcha_response = grecaptcha.getResponse();
|
var captcha_response = grecaptcha.getResponse();
|
||||||
Helper.ajax({
|
Helper.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
data: {
|
data: {
|
||||||
from: from,
|
from: from,
|
||||||
message: message,
|
message: message,
|
||||||
@@ -606,6 +609,14 @@ var Helper = {
|
|||||||
Helper.setHtml("#contact-container", "");
|
Helper.setHtml("#contact-container", "");
|
||||||
Helper.setHtml("#contact-container", "Something went wrong, sorry about that. You could instead try with your own mail-client: <a title='Open in client' href='mailto:contact@zoff.me?Subject=Contact%20Zoff'>contact@zoff.me</a>")
|
Helper.setHtml("#contact-container", "Something went wrong, sorry about that. You could instead try with your own mail-client: <a title='Open in client' href='mailto:contact@zoff.me?Subject=Contact%20Zoff'>contact@zoff.me</a>")
|
||||||
}
|
}
|
||||||
|
}, error: function(data) {
|
||||||
|
if(data == "success"){
|
||||||
|
Helper.setHtml("#contact-container", "");
|
||||||
|
Helper.setHtml("#contact-container", "Mail has been sent, we'll be back with you shortly.")
|
||||||
|
}else{
|
||||||
|
Helper.setHtml("#contact-container", "");
|
||||||
|
Helper.setHtml("#contact-container", "Something went wrong, sorry about that. You could instead try with your own mail-client: <a title='Open in client' href='mailto:contact@zoff.me?Subject=Contact%20Zoff'>contact@zoff.me</a>")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ var List = {
|
|||||||
Helper.css(wrapperChildren.slice(List.page, List.page + List.can_fit), "display", "inline-flex");
|
Helper.css(wrapperChildren.slice(List.page, List.page + List.can_fit), "display", "inline-flex");
|
||||||
} else {
|
} else {
|
||||||
Helper.css(wrapperChildren.slice(List.page - List.can_fit, List.page), "display", "inline-flex");
|
Helper.css(wrapperChildren.slice(List.page - List.can_fit, List.page), "display", "inline-flex");
|
||||||
Helper.addClass(wrapperChildren.slice(List.page, List.page + List.can_fit), "hide");
|
Helper.css(wrapperChildren.slice(List.page, List.page + List.can_fit), "display", "none");
|
||||||
List.page = List.page - List.can_fit < 0 ? 0 : List.page - List.can_fit;
|
List.page = List.page - List.can_fit < 0 ? 0 : List.page - List.can_fit;
|
||||||
}
|
}
|
||||||
if(List.page == 0 && document.querySelector(".prev_page").style.display != "none"){
|
if(List.page == 0 && document.querySelector(".prev_page").style.display != "none"){
|
||||||
|
|||||||
@@ -381,15 +381,15 @@ addListener("click", "#settings", function(event) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".accept-delete", function(event) {
|
addListener("click", ".accept-delete", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
emit("delete_all", {channel: chan.toLowerCase()});
|
emit("delete_all", {channel: chan.toLowerCase()});
|
||||||
M.Modal.getInstance(document.getElementById("delete_song_alert")).close();
|
M.Modal.getInstance(document.getElementById("delete_song_alert")).close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
addListener("click", "#chat_submit", function(event){
|
addListener("click", "#chat_submit", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
event.stopPropagation();
|
this.stopPropagation();
|
||||||
Chat.chat(document.getElementById("chatForm").input);
|
Chat.chat(document.getElementById("chatForm").input);
|
||||||
document.getElementById("chat_submit").focus();
|
document.getElementById("chat_submit").focus();
|
||||||
//return true;
|
//return true;
|
||||||
@@ -397,7 +397,7 @@ addListener("click", "#chat_submit", function(event){
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", "#offline-mode", function(event){
|
addListener("click", "#offline-mode", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
if(!Crypt.get_offline()){
|
if(!Crypt.get_offline()){
|
||||||
change_offline(true, offline);
|
change_offline(true, offline);
|
||||||
} else{
|
} else{
|
||||||
@@ -406,13 +406,13 @@ addListener("click", "#offline-mode", function(event){
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener("submit", "#thumbnail_form", function(event){
|
addListener("submit", "#thumbnail_form", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
emit("suggest_thumbnail", {channel: chan, thumbnail: document.getElementById("chan_thumbnail").value});
|
emit("suggest_thumbnail", {channel: chan, thumbnail: document.getElementById("chan_thumbnail").value});
|
||||||
document.getElementById("chan_thumbnail").value = "";
|
document.getElementById("chan_thumbnail").value = "";
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("submit", "#description_form", function(event){
|
addListener("submit", "#description_form", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
emit("suggest_description", {channel: chan, description: document.getElementById("chan_description").value});
|
emit("suggest_description", {channel: chan, description: document.getElementById("chan_description").value});
|
||||||
document.getElementById("chan_description").value = "";
|
document.getElementById("chan_description").value = "";
|
||||||
});
|
});
|
||||||
@@ -429,26 +429,26 @@ addListener("click", "#playpause-overlay", function(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", '#cookieok', function(event) {
|
addListener("click", '#cookieok', function(e) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
M.Toast.getInstance(this.parentElement).dismiss();
|
M.Toast.getInstance(e.parentElement).dismiss();
|
||||||
localStorage.ok_cookie = true;
|
localStorage.ok_cookie = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".connect_error", function(event){
|
addListener("click", ".connect_error", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
M.Toast.getInstance(this.parentElement).dismiss();
|
M.Toast.getInstance(this.parentElement).dismiss();
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".extra-button-search", function(event){
|
addListener("click", ".extra-button-search", function(e){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
document.getElementById("search").value = this.getAttribute("data-text");
|
document.getElementById("search").value = e.getAttribute("data-text");
|
||||||
Search.search(this.getAttribute("data-text"));
|
Search.search(e.getAttribute("data-text"));
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".extra-button-delete", function(event){
|
addListener("click", ".extra-button-delete", function(e){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
this.parentElement.remove();
|
e.parentElement.remove();
|
||||||
if(document.querySelector(".not-imported-container").children.length === 0){
|
if(document.querySelector(".not-imported-container").children.length === 0){
|
||||||
Helper.toggleClass(".not-imported", "hide");
|
Helper.toggleClass(".not-imported", "hide");
|
||||||
}
|
}
|
||||||
@@ -460,9 +460,9 @@ addListener("click", "#context-menu-overlay", function(event) {
|
|||||||
Helper.addClass(".context-menu-root", "data-id", "");
|
Helper.addClass(".context-menu-root", "data-id", "");
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".copy-context-menu", function(event) {
|
addListener("click", ".copy-context-menu", function(e) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
var that = this;
|
var that = e;
|
||||||
var parent = that.parentElement;
|
var parent = that.parentElement;
|
||||||
var id = parent.getAttribute("data-id");
|
var id = parent.getAttribute("data-id");
|
||||||
if(id != "") {
|
if(id != "") {
|
||||||
@@ -483,9 +483,9 @@ addListener("click", ".copy-context-menu", function(event) {
|
|||||||
document.getElementsByClassName("context-menu-root")[0].setAttribute("data-id", "");
|
document.getElementsByClassName("context-menu-root")[0].setAttribute("data-id", "");
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".find-context-menu", function(event) {
|
addListener("click", ".find-context-menu", function(e) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
var that = this;
|
var that = e;
|
||||||
var parent = that.parentElement;
|
var parent = that.parentElement;
|
||||||
var id = parent.getAttribute("data-id");
|
var id = parent.getAttribute("data-id");
|
||||||
Search.search(id, false, true);
|
Search.search(id, false, true);
|
||||||
@@ -497,8 +497,8 @@ addListener("click", ".find-context-menu", function(event) {
|
|||||||
document.getElementsByClassName("context-menu-root")[0].setAttribute("data-id", "");
|
document.getElementsByClassName("context-menu-root")[0].setAttribute("data-id", "");
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".delete-context-menu", function(event) {
|
addListener("click", ".delete-context-menu", function(e) {
|
||||||
var that = this;
|
var that = e;
|
||||||
if(that.classList.contains("context-menu-disabled")) {
|
if(that.classList.contains("context-menu-disabled")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -525,7 +525,7 @@ addListener("click", ".delete-context-menu", function(event) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
addListener("click", "#closePlayer", function(event){
|
addListener("click", "#closePlayer", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
socket.emit("change_channel");
|
socket.emit("change_channel");
|
||||||
try{
|
try{
|
||||||
if(chromecastAvailable){
|
if(chromecastAvailable){
|
||||||
@@ -552,7 +552,7 @@ document.addEventListener("keydown", function(event) {
|
|||||||
} else if(find_start && event.keyCode == 70){
|
} else if(find_start && event.keyCode == 70){
|
||||||
find_start = false;
|
find_start = false;
|
||||||
find_started = !find_started;
|
find_started = !find_started;
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
if(find_started){
|
if(find_started){
|
||||||
Helper.toggleClass("#find_div", "hide");
|
Helper.toggleClass("#find_div", "hide");
|
||||||
document.getElementById("find_input").focus();
|
document.getElementById("find_input").focus();
|
||||||
@@ -579,11 +579,11 @@ document.addEventListener("keydown", function(event) {
|
|||||||
document.querySelector("#find_input") != document.activeElement &&
|
document.querySelector("#find_input") != document.activeElement &&
|
||||||
document.querySelector("#import_spotify") != document.activeElement) {
|
document.querySelector("#import_spotify") != document.activeElement) {
|
||||||
if(Player.player.getPlayerState() == 1) {
|
if(Player.player.getPlayerState() == 1) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
Player.player.pauseVideo();
|
Player.player.pauseVideo();
|
||||||
return false;
|
return false;
|
||||||
} else if(Player.player.getPlayerState() == 2 || Player.player.getPlayerState() == 5) {
|
} else if(Player.player.getPlayerState() == 2 || Player.player.getPlayerState() == 5) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
Player.player.playVideo();
|
Player.player.playVideo();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -617,7 +617,7 @@ document.addEventListener("keyup", function(event) {
|
|||||||
if(document.querySelectorAll(".search-container").length != 0 && !document.querySelector(".search-container").classList.contains("hide")){
|
if(document.querySelectorAll(".search-container").length != 0 && !document.querySelector(".search-container").classList.contains("hide")){
|
||||||
Helper.toggleClass("#results", "hide");
|
Helper.toggleClass("#results", "hide");
|
||||||
}
|
}
|
||||||
} else if(event.keyCode == 13 && window.location.path != "/" && document.querySelector("#search").value == "fireplace" && !document.querySelector(".search-container").classList.contains("hide") && window.location.pathname != "/") {
|
} else if(event.keyCode == 13 && window.location.path != "/" && document.querySelectorAll("#search").length > 0 && document.querySelector("#search").value == "fireplace" && !document.querySelector(".search-container").classList.contains("hide") && window.location.pathname != "/") {
|
||||||
clearTimeout(timeout_search);
|
clearTimeout(timeout_search);
|
||||||
Helper.setHtml("#results", "");
|
Helper.setHtml("#results", "");
|
||||||
document.querySelector("#search").value = "";
|
document.querySelector("#search").value = "";
|
||||||
@@ -694,30 +694,30 @@ document.addEventListener("submit", function(event) {
|
|||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
addListener("change", "#width_embed", function(event) {
|
addListener("change", "#width_embed", function(event) {
|
||||||
var that = event.target;
|
var that = this.target;
|
||||||
embed_width = that.value;
|
embed_width = that.value;
|
||||||
document.getElementById("embed-area").value = embed_code(embed_autoplay, embed_width, embed_height, color, embed_videoonly);
|
document.getElementById("embed-area").value = embed_code(embed_autoplay, embed_width, embed_height, color, embed_videoonly);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("change", "#height_embed", function(event) {
|
addListener("change", "#height_embed", function(event) {
|
||||||
var that = event.target;
|
var that = this.target;
|
||||||
embed_height = that.value;
|
embed_height = that.value;
|
||||||
document.getElementById("embed-area").value = embed_code(embed_autoplay, embed_width, embed_height, color, embed_videoonly);
|
document.getElementById("embed-area").value = embed_code(embed_autoplay, embed_width, embed_height, color, embed_videoonly);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".prev_page", function(event) {
|
addListener("click", ".prev_page", function(event) {
|
||||||
//addListener("click", ".prev_page", function(event){
|
//addListener("click", ".prev_page", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
List.dynamicContentPage(-1);
|
List.dynamicContentPage(-1);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".modal-close", function(event){
|
addListener("click", ".modal-close", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
addListener("change", ".password_protected", function(event) {
|
addListener("change", ".password_protected", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
if(this.checked) {
|
if(this.checked) {
|
||||||
M.Modal.getInstance(document.getElementById("user_password")).open();
|
M.Modal.getInstance(document.getElementById("user_password")).open();
|
||||||
document.getElementById("user-pass-input").focus();
|
document.getElementById("user-pass-input").focus();
|
||||||
@@ -729,7 +729,7 @@ addListener("change", ".password_protected", function(event) {
|
|||||||
});*/
|
});*/
|
||||||
|
|
||||||
addListener("submit", "#user-password-channel-form", function(event) {
|
addListener("submit", "#user-password-channel-form", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
if(user_auth_started) {
|
if(user_auth_started) {
|
||||||
temp_user_pass = document.getElementById("user-pass-input").value;
|
temp_user_pass = document.getElementById("user-pass-input").value;
|
||||||
|
|
||||||
@@ -745,18 +745,18 @@ addListener("submit", "#user-password-channel-form", function(event) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".change_user_pass_btn", function(event) {
|
addListener("click", ".change_user_pass_btn", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
user_change_password = true;
|
user_change_password = true;
|
||||||
M.Modal.getInstance(document.getElementById("user_password")).open();
|
M.Modal.getInstance(document.getElementById("user_password")).open();
|
||||||
document.getElementById("user-pass-input").focus();
|
document.getElementById("user-pass-input").focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("contextmenu", "#context-menu-overlay", function(event) {
|
addListener("contextmenu", "#context-menu-overlay", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".submit-user-password", function(event) {
|
addListener("click", ".submit-user-password", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
if(user_auth_started) {
|
if(user_auth_started) {
|
||||||
temp_user_pass = document.getElementById("user-pass-input").value;
|
temp_user_pass = document.getElementById("user-pass-input").value;
|
||||||
document.getElementById("user-pass-input").value = "";
|
document.getElementById("user-pass-input").value = "";
|
||||||
@@ -794,31 +794,31 @@ addListener("click", ".close-user-password", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".delete-all-songs", function(event){
|
addListener("click", ".delete-all-songs", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
M.Modal.getInstance(document.getElementById("delete_song_alert")).open();
|
M.Modal.getInstance(document.getElementById("delete_song_alert")).open();
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".extra-add-text", function(){
|
addListener("click", ".extra-add-text", function(e){
|
||||||
this.select();
|
e.select();
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".next_page", function(event){
|
addListener("click", ".next_page", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
List.dynamicContentPage(1);
|
List.dynamicContentPage(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".last_page", function(event){
|
addListener("click", ".last_page", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
List.dynamicContentPage(10);
|
List.dynamicContentPage(10);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".first_page", function(event){
|
addListener("click", ".first_page", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
List.dynamicContentPage(-10);
|
List.dynamicContentPage(-10);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".donate-button", function(event) {
|
addListener("click", ".donate-button", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
ga('send', 'event', "button-click", "donate");
|
ga('send', 'event', "button-click", "donate");
|
||||||
M.Modal.getInstance(document.getElementById("donate")).open();
|
M.Modal.getInstance(document.getElementById("donate")).open();
|
||||||
});
|
});
|
||||||
@@ -840,27 +840,27 @@ addListener("change", '#view_channels_select', function(event) {
|
|||||||
currently_showing_channels = parseInt(that.value);
|
currently_showing_channels = parseInt(that.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("input", '#color_embed', function(){
|
addListener("input", '#color_embed', function(e){
|
||||||
var that = this;
|
var that = e;
|
||||||
color = that.value.substring(1);
|
color = that.value.substring(1);
|
||||||
document.getElementById("embed-area").value = embed_code(embed_autoplay, embed_width, embed_height, color, embed_videoonly);
|
document.getElementById("embed-area").value = embed_code(embed_autoplay, embed_width, embed_height, color, embed_videoonly);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".chan-link", function(event){
|
addListener("click", ".chan-link", function(e){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
var href = this.href.replace(window.location.protocol + "//" + window.location.hostname + "/", "");
|
var href = e.href.replace(window.location.protocol + "//" + window.location.hostname + "/", "");
|
||||||
Frontpage.to_channel(href, false);
|
Frontpage.to_channel(href, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".listen-button", function(event){
|
addListener("click", ".listen-button", function(event){
|
||||||
if(document.querySelector(".room-namer").value === ""){
|
if(document.querySelector(".room-namer").value === ""){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
Frontpage.to_channel(document.querySelector(".room-namer").getAttribute("placeholder"));
|
Frontpage.to_channel(document.querySelector(".room-namer").getAttribute("placeholder"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("submit", ".channel-finder", function(event){
|
addListener("submit", ".channel-finder", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
Frontpage.to_channel(document.querySelector(".room-namer").value);
|
Frontpage.to_channel(document.querySelector(".room-namer").value);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
@@ -877,11 +877,11 @@ addListener("change", '.offline_switch_class', function()
|
|||||||
change_offline(offline, !offline);
|
change_offline(offline, !offline);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("change", '.conf', function()
|
addListener("change", '.conf', function(e)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
if(this.classList.contains("password_protected")) {
|
if(e.classList.contains("password_protected")) {
|
||||||
if(this.checked) {
|
if(e.checked) {
|
||||||
M.Modal.getInstance(document.getElementById("user_password")).open();
|
M.Modal.getInstance(document.getElementById("user_password")).open();
|
||||||
document.getElementById("user-pass-input").focus();
|
document.getElementById("user-pass-input").focus();
|
||||||
} else {
|
} else {
|
||||||
@@ -899,7 +899,7 @@ addListener("click", "#clickme", function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", "#listExport", function(event){
|
addListener("click", "#listExport", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
if(!youtube_authenticated){
|
if(!youtube_authenticated){
|
||||||
var nonce = Helper.randomString(29);
|
var nonce = Helper.randomString(29);
|
||||||
window.callback = function(data) {
|
window.callback = function(data) {
|
||||||
@@ -928,7 +928,7 @@ addListener("click", "#listExport", function(event){
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".export-spotify-auth", function(event){
|
addListener("click", ".export-spotify-auth", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
var nonce = Helper.randomString(29);
|
var nonce = Helper.randomString(29);
|
||||||
window.callback = function(data) {
|
window.callback = function(data) {
|
||||||
access_token_data = data;
|
access_token_data = data;
|
||||||
@@ -953,7 +953,7 @@ addListener("click", ".export-spotify-auth", function(event){
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener("submit", "#listImport", function(event){
|
addListener("submit", "#listImport", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
var url = document.getElementById("import").value.split("https://www.youtube.com/playlist?list=");
|
var url = document.getElementById("import").value.split("https://www.youtube.com/playlist?list=");
|
||||||
if(document.getElementById("import").value !== "" && url.length == 2){
|
if(document.getElementById("import").value !== "" && url.length == 2){
|
||||||
Search.importPlaylist(url[1]);
|
Search.importPlaylist(url[1]);
|
||||||
@@ -971,7 +971,7 @@ addListener("submit", "#listImport", function(event){
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener("submit", "#listImportZoff", function(event) {
|
addListener("submit", "#listImportZoff", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
var new_channel = document.getElementById("import_zoff").value;
|
var new_channel = document.getElementById("import_zoff").value;
|
||||||
document.getElementById("import_zoff").value = "";
|
document.getElementById("import_zoff").value = "";
|
||||||
if(new_channel == "") {
|
if(new_channel == "") {
|
||||||
@@ -982,13 +982,13 @@ addListener("submit", "#listImportZoff", function(event) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".import-zoff", function(event) {
|
addListener("click", ".import-zoff", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
Helper.addClass(".import-zoff-container", "hide");
|
Helper.addClass(".import-zoff-container", "hide");
|
||||||
Helper.removeClass(".zoff_add_field", "hide");
|
Helper.removeClass(".zoff_add_field", "hide");
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("submit", "#listImportSpotify", function(event){
|
addListener("submit", "#listImportSpotify", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
if(spotify_authenticated && document.getElementById("import_spotify").value !== ""){
|
if(spotify_authenticated && document.getElementById("import_spotify").value !== ""){
|
||||||
var url = document.getElementById("import_spotify").value.split("https://open.spotify.com/user/");
|
var url = document.getElementById("import_spotify").value.split("https://open.spotify.com/user/");
|
||||||
if(url.length == 2) {
|
if(url.length == 2) {
|
||||||
@@ -1012,39 +1012,39 @@ addListener("submit", "#listImportSpotify", function(event){
|
|||||||
document.getElementById("import_spotify").value = "";
|
document.getElementById("import_spotify").value = "";
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("change", "#autoplay", function() {
|
addListener("change", "#autoplay", function(e) {
|
||||||
if(this.checked) embed_autoplay = "&autoplay";
|
if(e.checked) embed_autoplay = "&autoplay";
|
||||||
else embed_autoplay = "";
|
else embed_autoplay = "";
|
||||||
document.getElementById("embed-area").value = embed_code(embed_autoplay, embed_width, embed_height, color, embed_videoonly);
|
document.getElementById("embed-area").value = embed_code(embed_autoplay, embed_width, embed_height, color, embed_videoonly);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("change", "#videoonly", function() {
|
addListener("change", "#videoonly", function(e) {
|
||||||
if(this.checked) embed_videoonly = "&videoonly";
|
if(e.checked) embed_videoonly = "&videoonly";
|
||||||
else embed_videoonly = "";
|
else embed_videoonly = "";
|
||||||
document.getElementById("embed-area").value = embed_code(embed_autoplay, embed_width, embed_height, color, embed_videoonly);
|
document.getElementById("embed-area").value = embed_code(embed_autoplay, embed_width, embed_height, color, embed_videoonly);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", "#playbutton_remote", function(event) {
|
addListener("click", "#playbutton_remote", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
Mobile_remote.play_remote();
|
Mobile_remote.play_remote();
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", "#pausebutton_remote", function(event) {
|
addListener("click", "#pausebutton_remote", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
Mobile_remote.pause_remote();
|
Mobile_remote.pause_remote();
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", "#skipbutton_remote", function(event) {
|
addListener("click", "#skipbutton_remote", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
Mobile_remote.skip_remote();
|
Mobile_remote.skip_remote();
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".skip_next_client", function(event) {
|
addListener("click", ".skip_next_client", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("submit", "#remoteform", function(event) {
|
addListener("submit", "#remoteform", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
Mobile_remote.get_input(document.getElementById("remote_channel").value);
|
Mobile_remote.get_input(document.getElementById("remote_channel").value);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1057,22 +1057,22 @@ addListener("click", ".chat-tab", function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".prev", function(event){
|
addListener("click", ".prev", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
List.skip(false);
|
List.skip(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".skip", function(event){
|
addListener("click", ".skip", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
List.skip(true);
|
List.skip(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", "#chan", function(event){
|
addListener("click", "#chan", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
List.show();
|
List.show();
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("submit", "#adminForm", function(event){
|
addListener("submit", "#adminForm", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
Admin.pass_save();
|
Admin.pass_save();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1119,7 +1119,7 @@ addListener("click", ".suggested-link", function(event){
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".import-spotify-auth", function(event){
|
addListener("click", ".import-spotify-auth", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
var nonce = Helper.randomString(29);
|
var nonce = Helper.randomString(29);
|
||||||
window.callback = function(data) {
|
window.callback = function(data) {
|
||||||
access_token_data = data;
|
access_token_data = data;
|
||||||
@@ -1144,45 +1144,45 @@ addListener("click", ".import-spotify-auth", function(event){
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".import-youtube", function(event){
|
addListener("click", ".import-youtube", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
Helper.css(".youtube_unclicked", "display", "none");
|
Helper.css(".youtube_unclicked", "display", "none");
|
||||||
Helper.css(".youtube_clicked", "display", "block");
|
Helper.css(".youtube_clicked", "display", "block");
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("submit", "#chatForm", function(event){
|
addListener("submit", "#chatForm", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
event.stopPropagation();
|
this.stopPropagation();
|
||||||
Chat.chat(document.getElementById("chatForm").input);
|
Chat.chat(document.getElementById("chatForm").input);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", "#shuffle", function(event)
|
addListener("click", "#shuffle", function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
Admin.shuffle();
|
Admin.shuffle();
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", "#search-btn", function(event)
|
addListener("click", "#search-btn", function(event)
|
||||||
{
|
{
|
||||||
//event.preventDefault();
|
this.preventDefault();
|
||||||
Search.showSearch();
|
Search.showSearch();
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", "#song-title", function(event)
|
addListener("click", "#song-title", function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
Search.showSearch();
|
Search.showSearch();
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", "#admin-lock", function(event)
|
addListener("click", "#admin-lock", function(event)
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
Admin.log_out();
|
Admin.log_out();
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", "#closeSettings", function(event)
|
addListener("click", "#closeSettings", function(event)
|
||||||
{
|
{
|
||||||
//event.preventDefault();
|
//this.preventDefault();
|
||||||
Admin.hide_settings();
|
Admin.hide_settings();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1216,15 +1216,15 @@ window.addEventListener("resize", function(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".result-object", function(event){
|
addListener("click", ".result-object", function(e){
|
||||||
var html = event.target;
|
var html = this.target;
|
||||||
var substr = event.target.outerHTML.substring(0,4);
|
var substr = this.target.outerHTML.substring(0,4);
|
||||||
if(substr != "<i c" && !html.classList.contains("waves-effect") && !html.classList.contains("result-start") && !html.classList.contains("result-end") && !html.classList.contains("result-get-more-info")){
|
if(substr != "<i c" && !html.classList.contains("waves-effect") && !html.classList.contains("result-start") && !html.classList.contains("result-end") && !html.classList.contains("result-get-more-info")){
|
||||||
var id = this.getAttribute("data-video-id");
|
var id = e.getAttribute("data-video-id");
|
||||||
var title = this.getAttribute("data-video-title");
|
var title = e.getAttribute("data-video-title");
|
||||||
var original_length = this.getAttribute("data-video-length");
|
var original_length = e.getAttribute("data-video-length");
|
||||||
var start = parseInt(this.querySelector(".result-start").value);
|
var start = parseInt(e.querySelector(".result-start").value);
|
||||||
var end = parseInt(this.querySelector(".result-end").value);
|
var end = parseInt(e.querySelector(".result-end").value);
|
||||||
if(end > original_length) {
|
if(end > original_length) {
|
||||||
end = original_length;
|
end = original_length;
|
||||||
}
|
}
|
||||||
@@ -1236,7 +1236,7 @@ addListener("click", ".result-object", function(event){
|
|||||||
try {
|
try {
|
||||||
var length = parseInt(end) - parseInt(start);
|
var length = parseInt(end) - parseInt(start);
|
||||||
Search.submitAndClose(id, title, length, start, end);
|
Search.submitAndClose(id, title, length, start, end);
|
||||||
} catch(event) {
|
} catch(err) {
|
||||||
M.toast({html: "Only numbers are accepted as song start and end parameters..", displayLength: 3000, classes: "red lighten"});
|
M.toast({html: "Only numbers are accepted as song start and end parameters..", displayLength: 3000, classes: "red lighten"});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1244,7 +1244,7 @@ addListener("click", ".result-object", function(event){
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".result-get-more-info", function(event) {
|
addListener("click", ".result-get-more-info", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
var that = this;
|
var that = this;
|
||||||
var parent = that.parentElement.parentElement.parentElement.parentElement;
|
var parent = that.parentElement.parentElement.parentElement.parentElement;
|
||||||
var videoId = parent.getAttribute("data-video-id");
|
var videoId = parent.getAttribute("data-video-id");
|
||||||
@@ -1259,12 +1259,15 @@ addListener("click", ".result-get-more-info", function(event) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
addListener("click", '#submit-contact-form', function(event) {
|
addListener("click", '#submit-contact-form', function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
document.getElementById("contact-form").submit();
|
var message = document.getElementById("contact-form-message").value;
|
||||||
|
var from = document.getElementById("contact-form-from").value;
|
||||||
|
Helper.send_mail(from, message);
|
||||||
|
//document.getElementById("contact-form").submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("submit", '#contact-form', function(event){
|
addListener("submit", '#contact-form', function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
var message = document.getElementById("contact-form-message").value;
|
var message = document.getElementById("contact-form-message").value;
|
||||||
var from = document.getElementById("contact-form-from").value;
|
var from = document.getElementById("contact-form-from").value;
|
||||||
|
|
||||||
@@ -1272,12 +1275,12 @@ addListener("submit", '#contact-form', function(event){
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".send-error-modal", function(event) {
|
addListener("click", ".send-error-modal", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
document.getElementById("error-report-form").submit();
|
document.getElementById("error-report-form").submit();
|
||||||
})
|
})
|
||||||
|
|
||||||
addListener("submit", "#error-report-form", function(event) {
|
addListener("submit", "#error-report-form", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
var captcha_response = grecaptcha.getResponse();
|
var captcha_response = grecaptcha.getResponse();
|
||||||
Helper.removeClass("#send-loader", "hide");
|
Helper.removeClass("#send-loader", "hide");
|
||||||
Helper.ajax({
|
Helper.ajax({
|
||||||
@@ -1304,13 +1307,13 @@ addListener("submit", "#error-report-form", function(event) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", "#add-many", function(event){
|
addListener("click", "#add-many", function(e){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
event.stopPropagation();
|
this.stopPropagation();
|
||||||
var id = this.getAttribute("data-video-id");
|
var id = e.getAttribute("data-video-id");
|
||||||
var title = this.getAttribute("data-video-title");
|
var title = e.getAttribute("data-video-title");
|
||||||
var original_length = this.getAttribute("data-video-length");
|
var original_length = e.getAttribute("data-video-length");
|
||||||
var parent = this.parentElement.parentElement;
|
var parent = e.parentElement.parentElement;
|
||||||
|
|
||||||
var start = parseInt(parent.querySelectorAll(".result-start")[0].value);
|
var start = parseInt(parent.querySelectorAll(".result-start")[0].value);
|
||||||
var end = parseInt(parent.querySelectorAll(".result-end")[0].value);
|
var end = parseInt(parent.querySelectorAll(".result-end")[0].value);
|
||||||
@@ -1324,7 +1327,7 @@ addListener("click", "#add-many", function(event){
|
|||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
var length = parseInt(end) - parseInt(start);
|
var length = parseInt(end) - parseInt(start);
|
||||||
this.parentElement.parentElement.parentElement.remove();
|
e.parentElement.parentElement.parentElement.remove();
|
||||||
Search.submit(id, title, length, false, 0, 1, start, end);
|
Search.submit(id, title, length, false, 0, 1, start, end);
|
||||||
} catch(event) {
|
} catch(event) {
|
||||||
M.toast({html: "Only numbers are accepted as song start and end parameters..", displayLength: 3000, classes: "red lighten"});
|
M.toast({html: "Only numbers are accepted as song start and end parameters..", displayLength: 3000, classes: "red lighten"});
|
||||||
@@ -1333,22 +1336,21 @@ addListener("click", "#add-many", function(event){
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".vote-container", function(event, target){
|
addListener("click", ".vote-container", function(e, target){
|
||||||
console.log(this, target, event);
|
var id = e.getAttribute("data-video-id");
|
||||||
var id = event.getAttribute("data-video-id");
|
|
||||||
List.vote(id, "pos");
|
List.vote(id, "pos");
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".delete_button", function(event){
|
addListener("click", ".delete_button", function(e){
|
||||||
var id = this.getAttribute("data-video-id");
|
var id = e.getAttribute("data-video-id");
|
||||||
List.vote(id, "del");
|
List.vote(id, "del");
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".add-suggested", function(event){
|
addListener("click", ".add-suggested", function(e){
|
||||||
var id = this.getAttribute("data-video-id");
|
var id = e.getAttribute("data-video-id");
|
||||||
var title = this.getAttribute("data-video-title");
|
var title = e.getAttribute("data-video-title");
|
||||||
var length = this.getAttribute("data-video-length");
|
var length = e.getAttribute("data-video-length");
|
||||||
var added_by = this.getAttribute("data-added-by");
|
var added_by = e.getAttribute("data-added-by");
|
||||||
Search.submit(id, title, parseInt(length), false, 0, 1, 0, parseInt(length));
|
Search.submit(id, title, parseInt(length), false, 0, 1, 0, parseInt(length));
|
||||||
if(added_by == "user") {
|
if(added_by == "user") {
|
||||||
number_suggested = number_suggested - 1;
|
number_suggested = number_suggested - 1;
|
||||||
@@ -1366,14 +1368,14 @@ addListener("click", ".add-suggested", function(event){
|
|||||||
Helper.removeElement("#suggested-" + id);
|
Helper.removeElement("#suggested-" + id);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".del_suggested", function(event){
|
addListener("click", ".del_suggested", function(e){
|
||||||
var id = this.getAttribute("data-video-id");
|
var id = e.getAttribute("data-video-id");
|
||||||
|
|
||||||
Helper.removeElement("#suggested-" + id);
|
Helper.removeElement("#suggested-" + id);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".del_user_suggested", function(event){
|
addListener("click", ".del_user_suggested", function(e){
|
||||||
var id = this.getAttribute("data-video-id");
|
var id = e.getAttribute("data-video-id");
|
||||||
Helper.removeElement("#suggested-" + id);
|
Helper.removeElement("#suggested-" + id);
|
||||||
|
|
||||||
number_suggested = number_suggested - 1;
|
number_suggested = number_suggested - 1;
|
||||||
@@ -1396,24 +1398,24 @@ addListener("click", '#toast-container', function(){
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", "#embed-area", function(){
|
addListener("click", "#embed-area", function(e){
|
||||||
this.select();
|
e.select();
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".brand-logo-navigate", function(event){
|
addListener("click", ".brand-logo-navigate", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
|
|
||||||
window.history.pushState("to the frontpage!", "Title", "/");
|
window.history.pushState("to the frontpage!", "Title", "/");
|
||||||
Channel.onepage_load();
|
Channel.onepage_load();
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", "#player_bottom_overlay", function(event){
|
addListener("click", "#player_bottom_overlay", function(event){
|
||||||
if(event.target.id == "closePlayer") return;
|
if(this.target.id == "closePlayer") return;
|
||||||
Frontpage.to_channel(chan.toLowerCase(), false);
|
Frontpage.to_channel(chan.toLowerCase(), false);
|
||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", ".generate-channel-name", function(event) {
|
addListener("click", ".generate-channel-name", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
Helper.ajax({
|
Helper.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: "/api/generate_name",
|
url: "/api/generate_name",
|
||||||
@@ -1427,7 +1429,7 @@ addListener("click", ".generate-channel-name", function(event) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener("click", "#close_find_form_button", function(event) {
|
addListener("click", "#close_find_form_button", function(event) {
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
find_start = false;
|
find_start = false;
|
||||||
find_started = false;
|
find_started = false;
|
||||||
Helper.toggleClass("#find_div", "hide");
|
Helper.toggleClass("#find_div", "hide");
|
||||||
@@ -1440,7 +1442,7 @@ addListener("click", "#close_find_form_button", function(event) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener("submit", "#find_form", function(event){
|
addListener("submit", "#find_form", function(event){
|
||||||
event.preventDefault();
|
this.preventDefault();
|
||||||
if(this.find_value.value != find_word) {
|
if(this.find_value.value != find_word) {
|
||||||
find_word = this.find_value.value;
|
find_word = this.find_value.value;
|
||||||
found_array = [];
|
found_array = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user