width of player is now saved and applied

This commit is contained in:
Kasper Rynning-Tønnesen
2015-12-10 17:23:27 +01:00
parent b05bef2d01
commit 7ba5edb897
4 changed files with 18 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@@ -11,6 +11,7 @@ var Crypt = {
conf_pass = Crypt.decrypt(Crypt.create_cookie(chan.toLowerCase()), chan.toLowerCase()); conf_pass = Crypt.decrypt(Crypt.create_cookie(chan.toLowerCase()), chan.toLowerCase());
} }
Hostcontroller.change_enabled(conf_arr.remote); Hostcontroller.change_enabled(conf_arr.remote);
Youtube.set_width(conf_arr["width"]);
}, },
decrypt: function(cookie, name){ decrypt: function(cookie, name){
@@ -144,6 +145,15 @@ var Crypt = {
return encrypted.toString(); return encrypted.toString();
}, },
get_width: function(){
return conf_arr["width"];
},
set_width: function(val){
conf_arr["width"] = val;
Crypt.encrypt(conf_arr, "_opt");
},
getCookie: function(name) { getCookie: function(name) {
var value = "; " + document.cookie; var value = "; " + document.cookie;
var parts = value.split("; " + name + "="); var parts = value.split("; " + name + "=");

View File

@@ -79,10 +79,12 @@ $(document).ready(function()
}, },
stop: function(event, ui) { stop: function(event, ui) {
$('iframe').css('pointer-events','auto'); $('iframe').css('pointer-events','auto');
Crypt.set_width($(this).width());
}, },
handles: "e", handles: "e",
minWidth: 350 minWidth: 350
}); });
/* /*
if(localStorage[chan.toLowerCase()]) if(localStorage[chan.toLowerCase()])
{ {

View File

@@ -162,6 +162,10 @@ var Youtube = {
} }
}, },
set_width: function(val){
$(".video-container").width(val);
},
notifyUser: function(id, title) { notifyUser: function(id, title) {
title = title.replace(/\\\'/g, "'").replace(/"/g,"'").replace(/&/g,"&"); title = title.replace(/\\\'/g, "'").replace(/"/g,"'").replace(/&/g,"&");
if (Notification.permission === "granted" && document.hidden && id != "30H2Z8Lr-4c" && !window.mobilecheck()) { if (Notification.permission === "granted" && document.hidden && id != "30H2Z8Lr-4c" && !window.mobilecheck()) {