Several updates
This commit is contained in:
parent
fb05359073
commit
6b483dafba
8 changed files with 19 additions and 7 deletions
|
@ -71,7 +71,7 @@
|
||||||
gtag('config', 'UA-113151733-4');
|
gtag('config', 'UA-113151733-4');
|
||||||
</script>
|
</script>
|
||||||
<div id="scripts">
|
<div id="scripts">
|
||||||
<script type="application/ecmascript" src="js/load.js" defer></script>
|
<script type="application/javascript" src="js/load.js" defer></script>
|
||||||
</div>
|
</div>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
//Source: https://www.movable-type.co.uk/scripts/sha1.html
|
//Source: https://www.movable-type.co.uk/scripts/sha1.html
|
||||||
|
|
||||||
|
/*
|
||||||
declare class TextEncoder {
|
declare class TextEncoder {
|
||||||
encode(msg) : ArrayBuffer;
|
encode(msg) : ArrayBuffer;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
namespace sha {
|
namespace sha {
|
||||||
export function sha1(message: string | ArrayBuffer) : PromiseLike<ArrayBuffer> {
|
export function sha1(message: string | ArrayBuffer) : PromiseLike<ArrayBuffer> {
|
||||||
let buffer = message instanceof ArrayBuffer ? message : new TextEncoder().encode(message);
|
let buffer = message instanceof ArrayBuffer ? message : new TextEncoder().encode(message);
|
||||||
|
|
|
@ -57,6 +57,7 @@ namespace app {
|
||||||
l();
|
l();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(typeof Module === "undefined")
|
if(typeof Module === "undefined")
|
||||||
this["Module"] = {};
|
this["Module"] = {};
|
||||||
app.initialize();
|
app.initialize();
|
||||||
|
|
|
@ -327,7 +327,7 @@ class MusicInfoManager extends ClientInfoManager {
|
||||||
botid: bot.properties.client_database_id,
|
botid: bot.properties.client_database_id,
|
||||||
action: 1
|
action: 1
|
||||||
}).then(updated => this.triggerUpdate()).catch(error => {
|
}).then(updated => this.triggerUpdate()).catch(error => {
|
||||||
createErrorModal("Failed to execute play", "Failed to execute play.<br>{}".format(error)).open();
|
createErrorModal("Failed to execute play", MessageHelper.formatMessage("Failed to execute play.<br>{}", error)).open();
|
||||||
this.triggerUpdate();
|
this.triggerUpdate();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -340,7 +340,7 @@ class MusicInfoManager extends ClientInfoManager {
|
||||||
botid: bot.properties.client_database_id,
|
botid: bot.properties.client_database_id,
|
||||||
action: 2
|
action: 2
|
||||||
}).then(updated => this.triggerUpdate()).catch(error => {
|
}).then(updated => this.triggerUpdate()).catch(error => {
|
||||||
createErrorModal("Failed to execute pause", "Failed to execute pause.<br>{}".format(error)).open();
|
createErrorModal("Failed to execute pause", MessageHelper.formatMessage("Failed to execute pause.<br>{}", error)).open();
|
||||||
this.triggerUpdate();
|
this.triggerUpdate();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ $(document).on("mousedown",function (e) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
type BodyCreator = (() => JQuery | string) | string | JQuery;
|
type BodyCreator = (() => JQuery | JQuery[] | string) | string | JQuery | JQuery[];
|
||||||
const ModalFunctions = {
|
const ModalFunctions = {
|
||||||
divify: function (val: JQuery) {
|
divify: function (val: JQuery) {
|
||||||
if(val.length > 1) return $.spawn("div").append(val);
|
if(val.length > 1) return $.spawn("div").append(val);
|
||||||
|
@ -13,6 +13,12 @@ const ModalFunctions = {
|
||||||
|
|
||||||
jqueriefy: function(val: BodyCreator) : JQuery {
|
jqueriefy: function(val: BodyCreator) : JQuery {
|
||||||
if($.isFunction(val)) val = val();
|
if($.isFunction(val)) val = val();
|
||||||
|
if($.isArray(val)) {
|
||||||
|
let result = $.spawn("div");
|
||||||
|
for(let element of val)
|
||||||
|
this.jqueriefy(element).appendTo(result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
switch (typeof val){
|
switch (typeof val){
|
||||||
case "string": return $("<div>" + val + "</div>");
|
case "string": return $("<div>" + val + "</div>");
|
||||||
case "object": return val as JQuery;
|
case "object": return val as JQuery;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
tsc -p tsconfig/tsconfig_release.json
|
tsc -p tsconfig/tsconfig_release.json
|
||||||
uglifyjs -c --source-map --verbose -o generated/js/client.min.js generated/js/client.js
|
#uglifyjs -c --source-map --verbose -o generated/js/client.min.js generated/js/client.js
|
||||||
|
mv generated/js/client.js generated/js/client.min.js
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "none",
|
"module": "none",
|
||||||
"target": "es6",
|
"target": "es2016",
|
||||||
"sourceMap": true
|
"sourceMap": true
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "none",
|
"module": "none",
|
||||||
"target": "es5",
|
"target": "es2016",
|
||||||
"sourceMap": true
|
"sourceMap": true
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
|
|
Loading…
Add table
Reference in a new issue