Introduce: TheDesk notice v2

This commit is contained in:
Cutls 2019-08-07 23:27:00 +09:00
parent 95f5ce13ba
commit b909cbe666

View File

@ -133,6 +133,8 @@ function verck(ver) {
if (obj.ID * 1 <= last) {
break;
} else {
if (obj.type == "textv2") {
if (~obj.languages.indexOf(lang.language)) {
var show = true;
if (obj.toot != "") {
var toot = '<button class="btn-flat toast-action" onclick="detEx(\'' + obj.toot + '\',\'main\')">Show</button>';
@ -163,6 +165,8 @@ function verck(ver) {
M.toast({ html: escapeHTML(obj.text) + toot + '<span class="sml grey-text">(スライドして消去)</span>', displayLength: 86400 })
}
}
}
}
}
}
@ -179,6 +183,8 @@ function infowebsocket() {
console.log([tlid, ":Receive Streaming:", JSON.parse(mess.data)]);
var obj = JSON.parse(mess.data);
if (obj.type != "counter") {
if (obj.type == "textv2") {
if (~obj.languages.indexOf(lang.language)) {
localStorage.setItem("last-notice-id", obj.id)
var show = true;
if (obj.toot != "") {
@ -211,6 +217,8 @@ function infowebsocket() {
console.log(escapeHTML(obj.text))
M.toast({ html: escapeHTML(obj.text) + toot + '<span class="sml grey-text">(スライドして消去)</span>', displayLength: 86400 })
}
}
}
} else {
$("#persons").text(obj.text);
}