mirror of
https://github.com/KevinMidboe/zoff.git
synced 2026-01-09 19:15:34 +00:00
Updated what to cache, and updated offline-page
This commit is contained in:
20
offline.html
20
offline.html
@@ -21,19 +21,12 @@
|
|||||||
<meta property="og:description" content="The Shared (free) YouTube radio. Being built around the YouTube search and video API it enables the creation of collaborative and shared live playlists, with billions of videos and songs to choose from, all for free and without registration. Enjoy!"/>
|
<meta property="og:description" content="The Shared (free) YouTube radio. Being built around the YouTube search and video API it enables the creation of collaborative and shared live playlists, with billions of videos and songs to choose from, all for free and without registration. Enjoy!"/>
|
||||||
<meta property="og:type" content="website"/>
|
<meta property="og:type" content="website"/>
|
||||||
<link rel="manifest" href="/manifest.json">
|
<link rel="manifest" href="/manifest.json">
|
||||||
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.min.css">
|
|
||||||
<link tyle="text/css" rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
|
|
||||||
<link type="text/css" rel="stylesheet" href="/static/css/materialize.min.css" />
|
<link type="text/css" rel="stylesheet" href="/static/css/materialize.min.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="/static/css/style.css" title="Default" />
|
<link rel="stylesheet" type="text/css" href="/static/css/style.css" title="Default" />
|
||||||
<link rel="icon" id="favicon" type="image/png" href="/static/images/favicon.png"/>
|
<link rel="icon" id="favicon" type="image/png" href="/static/images/favicon.png"/>
|
||||||
<script type="text/javascript" src="/static/dist/lib/jquery-2.1.3.min.js"></script>
|
<script type="text/javascript" src="/static/dist/lib/jquery-2.1.3.min.js"></script>
|
||||||
<script type="text/javascript" src="/static/dist/lib/jquery-ui-1.10.3.min.js"></script>
|
<script type="text/javascript" src="/static/dist/lib/jquery-ui-1.10.3.min.js"></script>
|
||||||
<script type="text/javascript" src="/static/dist/lib/materialize.min.js"></script>
|
<script type="text/javascript" src="/static/dist/lib/materialize.min.js"></script>
|
||||||
<script type="text/javascript" src="/static/dist/lib/socket.io-1.4.5.js"></script>
|
|
||||||
<script type="text/javascript" src="/static/dist/lib/jquery.lazyload.js"></script>
|
|
||||||
<script type="text/javascript" src="/static/dist/lib/color-thief.js"></script>
|
|
||||||
<script type="text/javascript" src="/static/dist/lib/sha256.js"></script>
|
|
||||||
<script type="text/javascript" src="/static/dist/lib/aes.js"></script>
|
|
||||||
</head>
|
</head>
|
||||||
<body class="noselect cursor-default">
|
<body class="noselect cursor-default">
|
||||||
<header>
|
<header>
|
||||||
@@ -45,7 +38,6 @@
|
|||||||
<a href="//zoff.no" class="brand-logo hide-on-med-and-up">Zöff</a>
|
<a href="//zoff.no" class="brand-logo hide-on-med-and-up">Zöff</a>
|
||||||
<ul id="nav-mobile" class="right hide-on-med-and-down">
|
<ul id="nav-mobile" class="right hide-on-med-and-down">
|
||||||
<li><a class="modal-trigger waves-effect waves-red" title="Need help with the site?" onclick="$('#help').openModal()">Help</a></li>
|
<li><a class="modal-trigger waves-effect waves-red" title="Need help with the site?" onclick="$('#help').openModal()">Help</a></li>
|
||||||
<li><a class="waves-effect green" title="Remote control a Zöff player" href="https://remote.zoff.no">Remote</a></li>
|
|
||||||
<li><a class="modal-trigger waves-effect waves-orange" onclick="$('#about').openModal()">About</a></li>
|
<li><a class="modal-trigger waves-effect waves-orange" onclick="$('#about').openModal()">About</a></li>
|
||||||
<li><a class="modal-trigger waves-effect waves-yellow" onclick="$('#legal').openModal()">Legal</a></li>
|
<li><a class="modal-trigger waves-effect waves-yellow" onclick="$('#legal').openModal()">Legal</a></li>
|
||||||
<li><a class="waves-effect waves-purple" href="https://github.com/zoff-music/">GitHub</a></li>
|
<li><a class="waves-effect waves-purple" href="https://github.com/zoff-music/">GitHub</a></li>
|
||||||
@@ -180,12 +172,7 @@
|
|||||||
<ul id="footer-buttons">
|
<ul id="footer-buttons">
|
||||||
<li>
|
<li>
|
||||||
<a class="modal-trigger waves-effect cyan darken-2 btn help-button-footer" title="Need help with the site?" onclick="$('#help').openModal()">
|
<a class="modal-trigger waves-effect cyan darken-2 btn help-button-footer" title="Need help with the site?" onclick="$('#help').openModal()">
|
||||||
<i class="material-icons left footer-button-icon">info_outline</i>HELP
|
<i class="mdi-action-info left footer-button-icon"></i>HELP
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a class="modal-trigger waves-effect blue-grey darken-2 btn help-button-footer hide-on-small-only" id="embed-button" title="Want to embed this channel?" onclick="$('#embed').openModal()">
|
|
||||||
<i class="material-icons left footer-button-icon">code</i>EMBED
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@@ -219,11 +206,6 @@
|
|||||||
<i class="mdi-action-payment left footer-button-icon"></i>Donate
|
<i class="mdi-action-payment left footer-button-icon"></i>Donate
|
||||||
</a>
|
</a>
|
||||||
</form>
|
</form>
|
||||||
<p class="hide-on-small-only">
|
|
||||||
<a id="qr-code-link" target="_blank" href="//chart.googleapis.com/chart?chs=500x500&cht=qr&chl=https://zoff.no&choe=UTF-8&chld=L%7C1" >
|
|
||||||
<img id="qr-code-image-link" class="card rounded" src="//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.no&choe=UTF-8&chld=L%7C1" alt="QRCode for link" title="QR code for this page, for easy sharing!" />
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
<ul id="footer-buttons">
|
<ul id="footer-buttons">
|
||||||
<li>
|
<li>
|
||||||
<a class="modal-trigger waves-effect cyan darken-2 btn help-button-footer" title="Need help with the site?" onclick="$('#help').openModal()">
|
<a class="modal-trigger waves-effect cyan darken-2 btn help-button-footer" title="Need help with the site?" onclick="$('#help').openModal()">
|
||||||
<i class="material-icons left footer-button-icon">info_outline</i>HELP
|
<i class="mdi-action-info left footer-button-icon"></i>HELP
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@@ -1,17 +1,10 @@
|
|||||||
var version = 'v2.7';
|
var version = 'v2.8';
|
||||||
var CACHE_FILES = [
|
var CACHE_FILES = [
|
||||||
'https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.no/&choe=UTF-8&chld=L%7C1',
|
|
||||||
'https://fonts.googleapis.com/icon?family=Material+Icons',
|
|
||||||
'/static/dist/lib/jquery-2.1.3.min.js',
|
'/static/dist/lib/jquery-2.1.3.min.js',
|
||||||
'/static/dist/lib/jquery-ui-1.10.3.min.js',
|
|
||||||
'/static/images/favicon.png',
|
'/static/images/favicon.png',
|
||||||
'/static/css/materialize.min.css',
|
'/static/css/materialize.min.css',
|
||||||
'/static/css/style.css',
|
'/static/css/style.css',
|
||||||
'/static/dist/lib/materialize.min.js',
|
'/static/dist/lib/materialize.min.js',
|
||||||
'/static/dist/lib/socket.io-1.4.5.js',
|
|
||||||
'/static/dist/lib/jquery.lazyload.js',
|
|
||||||
'/static/dist/lib/color-thief.js',
|
|
||||||
'/static/dist/main.min.js',
|
|
||||||
'/static/images/squareicon_small.png',
|
'/static/images/squareicon_small.png',
|
||||||
'/static/images/GitHub_Logo.png',
|
'/static/images/GitHub_Logo.png',
|
||||||
'/static/images/facebook.png',
|
'/static/images/facebook.png',
|
||||||
@@ -19,8 +12,7 @@ var CACHE_FILES = [
|
|||||||
'/offline.html',
|
'/offline.html',
|
||||||
'/static/font/roboto/Roboto-Light.woff2',
|
'/static/font/roboto/Roboto-Light.woff2',
|
||||||
'/static/font/roboto/Roboto-Regular.woff2',
|
'/static/font/roboto/Roboto-Regular.woff2',
|
||||||
'/static/font/roboto/Roboto-Thin.woff2',
|
'/static/font/roboto/Roboto-Thin.woff2'
|
||||||
'/static/images/loading.png'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
self.addEventListener("install", function(event) {
|
self.addEventListener("install", function(event) {
|
||||||
|
|||||||
2
static/dist/embed.min.js
vendored
2
static/dist/embed.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
@@ -97,4 +97,4 @@ var Chat = {
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ var Crypt = {
|
|||||||
Crypt.conf_pass = Crypt.decrypt(Crypt.create_cookie(chan.toLowerCase()), chan.toLowerCase());
|
Crypt.conf_pass = Crypt.decrypt(Crypt.create_cookie(chan.toLowerCase()), chan.toLowerCase());
|
||||||
}
|
}
|
||||||
Hostcontroller.change_enabled(conf_arr.remote);
|
Hostcontroller.change_enabled(conf_arr.remote);
|
||||||
if(conf_arr["width"] != 100) Player.set_width(conf_arr["width"]);
|
if(conf_arr.width != 100) Player.set_width(conf_arr.width);
|
||||||
if(conf_arr["name"] != undefined && conf_arr["name"] != "") Chat.namechange(conf_arr["name"]);
|
if(conf_arr.name !== undefined && conf_arr.name !== "") Chat.namechange(conf_arr.name);
|
||||||
},
|
},
|
||||||
|
|
||||||
decrypt: function(cookie, name){
|
decrypt: function(cookie, name){
|
||||||
@@ -61,7 +61,7 @@ var Crypt = {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
var CookieDate = new Date;
|
var CookieDate = new Date();
|
||||||
CookieDate.setFullYear(CookieDate.getFullYear( ) +1);
|
CookieDate.setFullYear(CookieDate.getFullYear( ) +1);
|
||||||
document.cookie = cookie+"="+encrypted.toString()+";expires="+CookieDate.toGMTString()+";path=/;";
|
document.cookie = cookie+"="+encrypted.toString()+";expires="+CookieDate.toGMTString()+";path=/;";
|
||||||
},
|
},
|
||||||
@@ -103,7 +103,7 @@ var Crypt = {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
var CookieDate = new Date;
|
var CookieDate = new Date();
|
||||||
CookieDate.setFullYear(CookieDate.getFullYear( ) +1);
|
CookieDate.setFullYear(CookieDate.getFullYear( ) +1);
|
||||||
|
|
||||||
document.cookie = name+"="+encrypted.toString()+";expires="+CookieDate.toGMTString()+";path=/;";
|
document.cookie = name+"="+encrypted.toString()+";expires="+CookieDate.toGMTString()+";path=/;";
|
||||||
@@ -133,7 +133,7 @@ var Crypt = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
get_pass: function(chan){
|
get_pass: function(chan){
|
||||||
if(Crypt.conf_pass != undefined) return Crypt.conf_pass.passwords[chan];
|
if(Crypt.conf_pass !== undefined) return Crypt.conf_pass.passwords[chan];
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -159,11 +159,11 @@ var Crypt = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
get_width: function(){
|
get_width: function(){
|
||||||
return conf_arr["width"];
|
return conf_arr.width;
|
||||||
},
|
},
|
||||||
|
|
||||||
set_width: function(val){
|
set_width: function(val){
|
||||||
conf_arr["width"] = val;
|
conf_arr.width = val;
|
||||||
Crypt.encrypt(conf_arr, "_opt");
|
Crypt.encrypt(conf_arr, "_opt");
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -172,4 +172,4 @@ var Crypt = {
|
|||||||
var parts = value.split("; " + name + "=");
|
var parts = value.split("; " + name + "=");
|
||||||
if (parts.length == 2) return parts.pop().split(";").shift();
|
if (parts.length == 2) return parts.pop().split(";").shift();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ $(document).ready(function(){
|
|||||||
socket = io.connect(''+add+':8880', connection_options);
|
socket = io.connect(''+add+':8880', connection_options);
|
||||||
|
|
||||||
socket.on("get_list", function(){
|
socket.on("get_list", function(){
|
||||||
setTimeout(function(){socket.emit('list', chan.toLowerCase())},1000);
|
setTimeout(function(){socket.emit('list', chan.toLowerCase());},1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("viewers", function(view)
|
socket.on("viewers", function(view)
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ var Helper = {
|
|||||||
|
|
||||||
sample: function() {
|
sample: function() {
|
||||||
if (Date.now() - lastSample >= SAMPLE_RATE * 2) {
|
if (Date.now() - lastSample >= SAMPLE_RATE * 2) {
|
||||||
socket.removeAllListeners()
|
socket.removeAllListeners();
|
||||||
socket.disconnect();
|
socket.disconnect();
|
||||||
socket.connect();
|
socket.connect();
|
||||||
Player.setup_all_listeners();
|
Player.setup_all_listeners();
|
||||||
@@ -146,8 +146,12 @@ var Helper = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
rgbToHsl: function(arr, light){
|
rgbToHsl: function(arr, light){
|
||||||
r = arr[0], g = arr[1], b = arr[2];
|
r = arr[0];
|
||||||
r /= 255, g /= 255, b /= 255;
|
g = arr[1];
|
||||||
|
b = arr[2];
|
||||||
|
r /= 255;
|
||||||
|
g /= 255;
|
||||||
|
b /= 255;
|
||||||
var max = Math.max(r, g, b), min = Math.min(r, g, b);
|
var max = Math.max(r, g, b), min = Math.min(r, g, b);
|
||||||
var h, s, l = (max + min) / 2;
|
var h, s, l = (max + min) / 2;
|
||||||
|
|
||||||
@@ -192,7 +196,7 @@ var Helper = {
|
|||||||
send_mail: function(from, message){
|
send_mail: function(from, message){
|
||||||
|
|
||||||
|
|
||||||
if(from != "" && message != ""){
|
if(from !== "" && message !== ""){
|
||||||
|
|
||||||
$("#submit-contact-form").addClass("hide");
|
$("#submit-contact-form").addClass("hide");
|
||||||
$("#send-loader").removeClass("hide");
|
$("#send-loader").removeClass("hide");
|
||||||
@@ -214,16 +218,16 @@ var Helper = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});*/
|
});*/
|
||||||
var from = $("#contact-form-from").val();
|
from = $("#contact-form-from").val();
|
||||||
var message = $("#contact-form-message").val();
|
message = $("#contact-form-message").val();
|
||||||
$("#contact-container").empty();
|
$("#contact-container").empty();
|
||||||
newWindow = window.open("mailto:contact@zoff.no?Subject=Contact%20Zoff&Body=" + message, "_blank");
|
newWindow = window.open("mailto:contact@zoff.no?Subject=Contact%20Zoff&Body=" + message, "_blank");
|
||||||
$("#contact-container").html("Something went wrong, sorry about that. You could instead try with your own mail-client: <a title='Open in client' href='mailto:contact@zoff.no?Subject=Contact%20Zoff&Body=" + message + "'>contact@zoff.no</a>");
|
$("#contact-container").html("Something went wrong, sorry about that. You could instead try with your own mail-client: <a title='Open in client' href='mailto:contact@zoff.no?Subject=Contact%20Zoff&Body=" + message + "'>contact@zoff.no</a>");
|
||||||
setTimeout(function(){newWindow.close()},500);
|
setTimeout(function(){newWindow.close();},500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
||||||
$(document).on('submit', '#contact-form', function(e){
|
$(document).on('submit', '#contact-form', function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -237,7 +241,7 @@ $(document).on('submit', '#contact-form', function(e){
|
|||||||
|
|
||||||
Element.prototype.remove = function() {
|
Element.prototype.remove = function() {
|
||||||
this.parentElement.removeChild(this);
|
this.parentElement.removeChild(this);
|
||||||
}
|
};
|
||||||
|
|
||||||
NodeList.prototype.remove = HTMLCollection.prototype.remove = function() {
|
NodeList.prototype.remove = HTMLCollection.prototype.remove = function() {
|
||||||
for(var i = 0, len = this.length; i < len; i++) {
|
for(var i = 0, len = this.length; i < len; i++) {
|
||||||
@@ -245,10 +249,10 @@ NodeList.prototype.remove = HTMLCollection.prototype.remove = function() {
|
|||||||
this[i].parentElement.removeChild(this[i]);
|
this[i].parentElement.removeChild(this[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
String.prototype.startsWith = function(searchString, position) {
|
String.prototype.startsWith = function(searchString, position) {
|
||||||
position = position || 0;
|
position = position || 0;
|
||||||
return this.indexOf(searchString, position) === position;
|
return this.indexOf(searchString, position) === position;
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ var Hostcontroller = {
|
|||||||
|
|
||||||
host_listener: function(id) {
|
host_listener: function(id) {
|
||||||
|
|
||||||
if(Hostcontroller.old_id == null) Hostcontroller.old_id = id;
|
if(Hostcontroller.old_id === null) Hostcontroller.old_id = id;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
socket.removeAllListeners(id);
|
socket.removeAllListeners(id);
|
||||||
@@ -14,7 +14,7 @@ var Hostcontroller = {
|
|||||||
Hostcontroller.old_id = id;
|
Hostcontroller.old_id = id;
|
||||||
}
|
}
|
||||||
var codeURL = "https://remote."+window.location.hostname+"/"+id;
|
var codeURL = "https://remote."+window.location.hostname+"/"+id;
|
||||||
$("#code-text").text(id)
|
$("#code-text").text(id);
|
||||||
$("#code-qr").attr("src", "https://chart.googleapis.com/chart?chs=221x221&cht=qr&choe=UTF-8&chld=L|1&chl="+codeURL);
|
$("#code-qr").attr("src", "https://chart.googleapis.com/chart?chs=221x221&cht=qr&choe=UTF-8&chld=L|1&chl="+codeURL);
|
||||||
$("#code-link").attr("href", codeURL);
|
$("#code-link").attr("href", codeURL);
|
||||||
if(!began)
|
if(!began)
|
||||||
@@ -48,7 +48,7 @@ var Hostcontroller = {
|
|||||||
|
|
||||||
window.history.pushState("object or string", "Title", "/"+chan.toLowerCase());
|
window.history.pushState("object or string", "Title", "/"+chan.toLowerCase());
|
||||||
}else if(arr[0] == "pause")
|
}else if(arr[0] == "pause")
|
||||||
Player.ytplayer.pauseVideo()
|
Player.ytplayer.pauseVideo();
|
||||||
else if(arr[0] == "play")
|
else if(arr[0] == "play")
|
||||||
Player.ytplayer.playVideo();
|
Player.ytplayer.playVideo();
|
||||||
else if(arr[0] == "skip")
|
else if(arr[0] == "skip")
|
||||||
@@ -60,4 +60,4 @@ var Hostcontroller = {
|
|||||||
enabled = val;
|
enabled = val;
|
||||||
document.getElementsByName("remote_switch")[0].checked = enabled;
|
document.getElementsByName("remote_switch")[0].checked = enabled;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ var List = {
|
|||||||
if(!song_info.now_playing){
|
if(!song_info.now_playing){
|
||||||
|
|
||||||
var add = List.generateSong(song_info, transition, false, true, false);
|
var add = List.generateSong(song_info, transition, false, true, false);
|
||||||
if(i == 0) {
|
if(i === 0) {
|
||||||
$("#wrapper").prepend(add);
|
$("#wrapper").prepend(add);
|
||||||
} else {
|
} else {
|
||||||
$("#wrapper > div:nth-child(" + (i) + ")").after(add);
|
$("#wrapper > div:nth-child(" + (i) + ")").after(add);
|
||||||
@@ -314,4 +314,4 @@ var List = {
|
|||||||
scrollBottom: function(){
|
scrollBottom: function(){
|
||||||
$("#wrapper").scrollTop($("#wrapper")[0].scrollHeight);
|
$("#wrapper").scrollTop($("#wrapper")[0].scrollHeight);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ var Mobile_remote = {
|
|||||||
id: "",
|
id: "",
|
||||||
|
|
||||||
get_input: function(value) {
|
get_input: function(value) {
|
||||||
if(Mobile_remote.id == "") {
|
if(Mobile_remote.id === "") {
|
||||||
Mobile_remote.set_id(value.toLowerCase());
|
Mobile_remote.set_id(value.toLowerCase());
|
||||||
} else {
|
} else {
|
||||||
Mobile_remote.set_channel(value.toLowerCase());
|
Mobile_remote.set_channel(value.toLowerCase());
|
||||||
@@ -56,4 +56,4 @@ var Mobile_remote = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ var Player = {
|
|||||||
console.log("video_id variable: " + video_id);
|
console.log("video_id variable: " + video_id);
|
||||||
console.log("---------------------------------");
|
console.log("---------------------------------");
|
||||||
}
|
}
|
||||||
if(obj.length == 0){
|
if(obj.length === 0){
|
||||||
|
|
||||||
document.getElementById('song-title').innerHTML = "Empty channel. Add some songs!";
|
document.getElementById('song-title').innerHTML = "Empty channel. Add some songs!";
|
||||||
$("#player_overlay").height($("#player").height());
|
$("#player_overlay").height($("#player").height());
|
||||||
@@ -35,19 +35,19 @@ var Player = {
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
//console.log("gotten new song");
|
//console.log("gotten new song");
|
||||||
if(previous_video_id == undefined)
|
if(previous_video_id === undefined)
|
||||||
previous_video_id = obj[0][0]["id"];
|
previous_video_id = obj[0][0].id;
|
||||||
else if(previous_video_id != video_id)
|
else if(previous_video_id != video_id)
|
||||||
previous_video_id = video_id;
|
previous_video_id = video_id;
|
||||||
|
|
||||||
video_id = obj[0][0]["id"];
|
video_id = obj[0][0].id;
|
||||||
conf = obj[1][0];
|
conf = obj[1][0];
|
||||||
time = obj[2];
|
time = obj[2];
|
||||||
seekTo = time - conf["startTime"];
|
seekTo = time - conf.startTime;
|
||||||
song_title = obj[0][0]["title"];
|
song_title = obj[0][0].title;
|
||||||
duration = obj[0][0]["duration"];
|
duration = obj[0][0].duration;
|
||||||
|
|
||||||
if(mobile_beginning && Helper.mobilecheck() && seekTo == 0)
|
if(mobile_beginning && Helper.mobilecheck() && seekTo === 0)
|
||||||
seekTo = 1;
|
seekTo = 1;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
@@ -79,7 +79,7 @@ var Player = {
|
|||||||
if(!durationBegun)
|
if(!durationBegun)
|
||||||
Player.durationSetter();
|
Player.durationSetter();
|
||||||
}
|
}
|
||||||
if(Player.ytplayer.getDuration() > seekTo || Player.ytplayer.getDuration() == 0)
|
if(Player.ytplayer.getDuration() > seekTo || Player.ytplayer.getDuration() === 0)
|
||||||
Player.ytplayer.seekTo(seekTo);
|
Player.ytplayer.seekTo(seekTo);
|
||||||
Player.after_load = video_id;
|
Player.after_load = video_id;
|
||||||
|
|
||||||
@@ -170,8 +170,8 @@ var Player = {
|
|||||||
|
|
||||||
errorHandler: function(newState)
|
errorHandler: function(newState)
|
||||||
{
|
{
|
||||||
if(newState.data == 5 || newState.data == 100
|
if(newState.data == 5 || newState.data == 100 ||
|
||||||
|| newState.data == 101 || newState.data == 150)
|
newState.data == 101 || newState.data == 150)
|
||||||
{
|
{
|
||||||
/*if(Player.count == 2){
|
/*if(Player.count == 2){
|
||||||
Player.count = 0;*/
|
Player.count = 0;*/
|
||||||
@@ -298,12 +298,12 @@ var Player = {
|
|||||||
/*try{
|
/*try{
|
||||||
//duration = Player.ytplayer.getDuration();
|
//duration = Player.ytplayer.getDuration();
|
||||||
}catch(e){};*/
|
}catch(e){};*/
|
||||||
if(duration != undefined){
|
if(duration !== undefined){
|
||||||
try{
|
try{
|
||||||
if(!Player.stopInterval) durationBegun = true;
|
if(!Player.stopInterval) durationBegun = true;
|
||||||
dMinutes = Math.floor(duration / 60);
|
dMinutes = Math.floor(duration / 60);
|
||||||
dSeconds = duration - dMinutes * 60;
|
dSeconds = duration - dMinutes * 60;
|
||||||
currDurr = Player.ytplayer.getCurrentTime() != undefined ? Math.floor(Player.ytplayer.getCurrentTime()) : seekTo;
|
currDurr = Player.ytplayer.getCurrentTime() !== undefined ? Math.floor(Player.ytplayer.getCurrentTime()) : seekTo;
|
||||||
if(currDurr > duration)
|
if(currDurr > duration)
|
||||||
currDurr = duration;
|
currDurr = duration;
|
||||||
minutes = Math.floor(currDurr / 60);
|
minutes = Math.floor(currDurr / 60);
|
||||||
@@ -312,7 +312,7 @@ var Player = {
|
|||||||
per = (100 / duration) * currDurr;
|
per = (100 / duration) * currDurr;
|
||||||
if(per >= 100)
|
if(per >= 100)
|
||||||
per = 100;
|
per = 100;
|
||||||
else if(duration == 0)
|
else if(duration === 0)
|
||||||
per = 0;
|
per = 0;
|
||||||
$("#bar").width(per+"%");
|
$("#bar").width(per+"%");
|
||||||
}catch(e){
|
}catch(e){
|
||||||
@@ -323,7 +323,7 @@ var Player = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
loadPlayer: function() {
|
loadPlayer: function() {
|
||||||
if($("script[src='https://www.youtube.com/iframe_api']")["length"] == 1){
|
if($("script[src='https://www.youtube.com/iframe_api']").length == 1){
|
||||||
Player.onYouTubeIframeAPIReady();
|
Player.onYouTubeIframeAPIReady();
|
||||||
}else{
|
}else{
|
||||||
tag = document.createElement('script');
|
tag = document.createElement('script');
|
||||||
@@ -333,4 +333,4 @@ var Player = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ var Playercontrols = {
|
|||||||
$(".video-container").toggleClass("click-through");
|
$(".video-container").toggleClass("click-through");
|
||||||
$(".page-footer").toggleClass("padding-bottom-extra");
|
$(".page-footer").toggleClass("padding-bottom-extra");
|
||||||
}
|
}
|
||||||
}else if(Player.ytplayer.getPlayerState() == 2 || Player.ytplayer.getPlayerState() == 0)
|
} else if(Player.ytplayer.getPlayerState() == 2 || Player.ytplayer.getPlayerState() === 0)
|
||||||
{
|
{
|
||||||
Player.ytplayer.playVideo();
|
Player.ytplayer.playVideo();
|
||||||
if(Helper.mobilecheck() && !/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream){
|
if(Helper.mobilecheck() && !/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream){
|
||||||
@@ -193,4 +193,4 @@ var Playercontrols = {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -29,12 +29,12 @@ $(document).ready(function (){
|
|||||||
}).responseText;
|
}).responseText;
|
||||||
|
|
||||||
git_info = $.parseJSON(git_info);
|
git_info = $.parseJSON(git_info);
|
||||||
$("#latest-commit").html("Latest Commit: <br>"
|
$("#latest-commit").html("Latest Commit: <br>" +
|
||||||
+ git_info[0].commit.author.date.substring(0,10)
|
git_info[0].commit.author.date.substring(0,10) +
|
||||||
+ ": " + git_info[0].committer.login
|
": " + git_info[0].committer.login +
|
||||||
+ "<br><a href='"+git_info[0].html_url+"'>"
|
"<br><a href='"+git_info[0].html_url+"'>" +
|
||||||
+ git_info[0].sha.substring(0,10) + "</a>: "
|
git_info[0].sha.substring(0,10) + "</a>: " +
|
||||||
+ git_info[0].commit.message+"<br");
|
git_info[0].commit.message+"<br");
|
||||||
|
|
||||||
/*var _isChrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
|
/*var _isChrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
@@ -104,7 +104,7 @@ var Remotecontroller = {
|
|||||||
$(".rc").css("display", "block");
|
$(".rc").css("display", "block");
|
||||||
|
|
||||||
//document.getElementById("base").setAttribute("onsubmit", "control(); return false;");
|
//document.getElementById("base").setAttribute("onsubmit", "control(); return false;");
|
||||||
$("#remote-text").text("Controlling "+ id.toUpperCase())
|
$("#remote-text").text("Controlling "+ id.toUpperCase());
|
||||||
document.getElementById("search").setAttribute("length", "18");
|
document.getElementById("search").setAttribute("length", "18");
|
||||||
document.getElementById("search").setAttribute("maxlength", "18");
|
document.getElementById("search").setAttribute("maxlength", "18");
|
||||||
$("#forsearch").html("Type new channel name to change to");
|
$("#forsearch").html("Type new channel name to change to");
|
||||||
@@ -133,4 +133,4 @@ var Remotecontroller = {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ var Suggestions = {
|
|||||||
if(single){
|
if(single){
|
||||||
Suggestions.createSuggested(params);
|
Suggestions.createSuggested(params);
|
||||||
}else{
|
}else{
|
||||||
for(x in params){
|
for(var x in params){
|
||||||
Suggestions.createSuggested(params[x]);
|
Suggestions.createSuggested(params[x]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ var Suggestions = {
|
|||||||
var video_id = song.id;
|
var video_id = song.id;
|
||||||
var video_title = song.snippet.title;
|
var video_title = song.snippet.title;
|
||||||
|
|
||||||
duration = duration.replace("PT","").replace("H","h ").replace("M","m ").replace("S","s")
|
duration = duration.replace("PT","").replace("H","h ").replace("M","m ").replace("S","s");
|
||||||
|
|
||||||
$("#suggest-song-html").append(List.generateSong({id: video_id, title: video_title, length: secs, duration: duration}, false, false, false));
|
$("#suggest-song-html").append(List.generateSong({id: video_id, title: video_title, length: secs, duration: duration}, false, false, false));
|
||||||
});
|
});
|
||||||
@@ -65,8 +65,8 @@ var Suggestions = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
checkUserEmpty: function(){
|
checkUserEmpty: function(){
|
||||||
var length = $("#user-suggest-html").children().length
|
var length = $("#user-suggest-html").children().length;
|
||||||
if(length == 0){
|
if(length === 0){
|
||||||
if(!Helper.contains($("#user_suggests").attr("class").split(" "), "hide"))
|
if(!Helper.contains($("#user_suggests").attr("class").split(" "), "hide"))
|
||||||
$("#user_suggests").addClass("hide");
|
$("#user_suggests").addClass("hide");
|
||||||
}else{
|
}else{
|
||||||
@@ -74,4 +74,4 @@ var Suggestions = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user