forked from sawwashere/CYTUBE-BABYMETAL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBASESCRIPT.js
executable file
·86 lines (73 loc) · 3.58 KB
/
BASESCRIPT.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*!
**| XaeMae Sequenced Module Loader
**|
**@preserve
*/
// -- Channel Namespace --
if (!this[CHANNEL.name])
this[CHANNEL.name] = {};
// -- The Module Library
window[CHANNEL.name].sequenceList = {
'layout': { active: 1, rank: -1, url: "//rawgit.com/sawwashere/CYTUBE-BABYMETAL/master/Custom.js", callback: true },
'channel': { active: 1, rank: -1, url: "//rawgit.com/sawwashere/CYTUBE-BABYMETAL/master/enhanced.js", callback: true },
'Xaekai Modules': { active: 1, rank: -1, url: "//rawgit.com/sawwashere/CYTUBE-BABYMETAL/master/XaekaiModules.js", callback: true },
};
window[CHANNEL.name].sequencePrev = window[CHANNEL.name].sequencePrev || "";
window[CHANNEL.name].sequenceState = window[CHANNEL.name].sequenceState || 0;
window[CHANNEL.name].sequenceIndex = Object.keys(window[CHANNEL.name].sequenceList)
window[CHANNEL.name].sequencerLoader = function (){
// After first run we curry the previous modules callback
// This is mainly used to reassign variables in modules/scripts that don't use module options
if(window[CHANNEL.name].sequencePrev){
setTimeout(window[CHANNEL.name].sequenceList[window[CHANNEL.name].sequencePrev].callback, 0)
window[CHANNEL.name].sequencePrev = "";
}
if(window[CHANNEL.name].sequenceState >= window[CHANNEL.name].sequenceIndex.length){
return (function(){ console.log("Xaekai's Script Sequencer: Loading Complete.") })()
}
var currKey = window[CHANNEL.name].sequenceIndex[window[CHANNEL.name].sequenceState];
if(window[CHANNEL.name].sequenceState < window[CHANNEL.name].sequenceIndex.length){
if(window[CHANNEL.name].sequenceList[currKey].active
&& window[CHANNEL.name].sequenceList[currKey].rank <= CLIENT.rank
){
console.log("Xaekai's Script Sequencer: Loading " + currKey);
window[CHANNEL.name].sequencePrev = currKey;
window[CHANNEL.name].sequenceState++;
$.getScript(window[CHANNEL.name].sequenceList[currKey].url, window[CHANNEL.name].sequencerLoader)
} else {
window[CHANNEL.name].sequenceState++;
window[CHANNEL.name].sequencerLoader()
}
}
};window[CHANNEL.name].sequencerLoader()
$('head').append("<link rel='stylesheet' href='//rawgit.com/sawwashere/CYTUBE-BABYMETAL/master/base.css' />");
$('head').append("<link rel='stylesheet' href='//rawgit.com/sawwashere/CYTUBE-BABYMETAL/master/theme.css' />");
$(".navbar-brand").text("BABYMETAL");
//CountDownTimer('09/14/2016 10:00 PM', 'countdown');
function CountDownTimer(dt, id)
{
var end = new Date(dt);
var _second = 1000;
var _minute = _second * 60;
var _hour = _minute * 60;
var _day = _hour * 24;
var timer;
function showRemaining() {
var now = new Date();
var distance = end - now;
if (distance < 0) {
clearInterval(timer);
document.getElementById(id).innerHTML = 'EXPIRED!';
return;
}
var days = Math.floor(distance / _day);
var hours = Math.floor((distance % _day) / _hour);
var minutes = Math.floor((distance % _hour) / _minute);
var seconds = Math.floor((distance % _minute) / _second);
document.getElementById(id).innerHTML = days + ':';
document.getElementById(id).innerHTML += hours + ':';
document.getElementById(id).innerHTML += minutes + ':';
document.getElementById(id).innerHTML += seconds + '';
}
timer = setInterval(showRemaining, 1000);
}