Merge branch 'master' of https://github.com/cutls/TheDesk into gh-pages
This commit is contained in:
commit
4dcec3f240
|
@ -585,6 +585,7 @@ p:not(:last-child) {
|
||||||
display: block;
|
display: block;
|
||||||
margin-right: 1px;
|
margin-right: 1px;
|
||||||
float: left;
|
float: left;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.nsfw-media {
|
.nsfw-media {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
|
@ -137,6 +137,10 @@ $(function ($) {
|
||||||
//矢印:選択
|
//矢印:選択
|
||||||
if (e.code == "ArrowLeft") {
|
if (e.code == "ArrowLeft") {
|
||||||
//left
|
//left
|
||||||
|
if ($("#imagemodal").hasClass("open")) {
|
||||||
|
imgCont('next');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (selectedColumn > 0) {
|
if (selectedColumn > 0) {
|
||||||
selectedColumn--
|
selectedColumn--
|
||||||
}
|
}
|
||||||
|
@ -144,6 +148,9 @@ $(function ($) {
|
||||||
return false;
|
return false;
|
||||||
} else if (e.code == "ArrowUp") {
|
} else if (e.code == "ArrowUp") {
|
||||||
//up
|
//up
|
||||||
|
if ($("#imagemodal").hasClass("open")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (selectedToot > 0) {
|
if (selectedToot > 0) {
|
||||||
selectedToot--
|
selectedToot--
|
||||||
}
|
}
|
||||||
|
@ -151,6 +158,10 @@ $(function ($) {
|
||||||
return false;
|
return false;
|
||||||
} else if (e.code == "ArrowRight") {
|
} else if (e.code == "ArrowRight") {
|
||||||
//right
|
//right
|
||||||
|
if ($("#imagemodal").hasClass("open")) {
|
||||||
|
imgCont('prev');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (selectedColumn < $(".tl-box").length - 1) {
|
if (selectedColumn < $(".tl-box").length - 1) {
|
||||||
selectedColumn++
|
selectedColumn++
|
||||||
}
|
}
|
||||||
|
@ -158,6 +169,9 @@ $(function ($) {
|
||||||
return false;
|
return false;
|
||||||
} else if (e.code == "ArrowDown") {
|
} else if (e.code == "ArrowDown") {
|
||||||
//down
|
//down
|
||||||
|
if ($("#imagemodal").hasClass("open")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
selectedToot++
|
selectedToot++
|
||||||
tootSelector(selectedColumn, selectedToot)
|
tootSelector(selectedColumn, selectedToot)
|
||||||
return false;
|
return false;
|
||||||
|
@ -206,19 +220,6 @@ $(function ($) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//イメージビューワー切り替え
|
|
||||||
if (e.keyCode === 37 && wv) {
|
|
||||||
if ($("#imagemodal").hasClass("open")) {
|
|
||||||
imgCont('prev');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (e.keyCode === 39 && wv) {
|
|
||||||
if ($("#imagemodal").hasClass("open")) {
|
|
||||||
imgCont('next');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
//クリアボタン
|
//クリアボタン
|
||||||
$("#clear").click(function () {
|
$("#clear").click(function () {
|
||||||
|
|
|
@ -174,4 +174,29 @@ $.mb_substr = function (str, begin, end) {
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
|
//ソートするやつ
|
||||||
|
function object_array_sort(data, key, order, fn) {
|
||||||
|
var num_a = -1;
|
||||||
|
var num_b = 1;
|
||||||
|
if (order === 'asc') {
|
||||||
|
num_a = 1;
|
||||||
|
num_b = -1;
|
||||||
|
}
|
||||||
|
data = data.sort(function (a, b) {
|
||||||
|
var x = a[key];
|
||||||
|
var y = b[key];
|
||||||
|
if (x > y) return num_a;
|
||||||
|
if (x < y) return num_b;
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
var arrObj = {};
|
||||||
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
arrObj[data[i]['family']] = data[i];
|
||||||
|
}
|
||||||
|
data = [];
|
||||||
|
for (var key in arrObj) {
|
||||||
|
data.push(arrObj[key]);
|
||||||
|
}
|
||||||
|
fn(data);
|
||||||
|
}
|
||||||
localStorage.removeItem("errors");
|
localStorage.removeItem("errors");
|
|
@ -160,7 +160,6 @@ ipc.on('memory', function (event, arg) {
|
||||||
})
|
})
|
||||||
//update.html
|
//update.html
|
||||||
ipc.on('prog', function (event, arg) {
|
ipc.on('prog', function (event, arg) {
|
||||||
console.log(arg)
|
|
||||||
postMessage(["updateProg", arg], "*")
|
postMessage(["updateProg", arg], "*")
|
||||||
})
|
})
|
||||||
ipc.on('mess', function (event, arg) {
|
ipc.on('mess', function (event, arg) {
|
||||||
|
|
|
@ -29,7 +29,6 @@ function post(mode, postvis) {
|
||||||
}
|
}
|
||||||
if (domain != "kirishima.cloud") {
|
if (domain != "kirishima.cloud") {
|
||||||
if (mode != "pass" && !$("#cw").hasClass("cw-avail") && (str.length > cw_sent || (str.split("\n").length - 1) > cw_ltres)) {
|
if (mode != "pass" && !$("#cw").hasClass("cw-avail") && (str.length > cw_sent || (str.split("\n").length - 1) > cw_ltres)) {
|
||||||
console.log("out")
|
|
||||||
var plus = str.replace(/\n/g, "").slice(0, 10) + "...";
|
var plus = str.replace(/\n/g, "").slice(0, 10) + "...";
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: lang.lang_post_cwtitle,
|
title: lang.lang_post_cwtitle,
|
||||||
|
@ -43,7 +42,6 @@ function post(mode, postvis) {
|
||||||
showCloseButton: true,
|
showCloseButton: true,
|
||||||
focusConfirm: false,
|
focusConfirm: false,
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
console.log(result)
|
|
||||||
if (result.dismiss == "cancel") {
|
if (result.dismiss == "cancel") {
|
||||||
//btn3:sonomama
|
//btn3:sonomama
|
||||||
post("pass")
|
post("pass")
|
||||||
|
|
|
@ -66,7 +66,7 @@ input.addEventListener("focus", function () {
|
||||||
}
|
}
|
||||||
var domain = localStorage.getItem("domain_" + acct_id);
|
var domain = localStorage.getItem("domain_" + acct_id);
|
||||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||||
suggest = "https://" + domain + "/api/v1/search?q=" + q
|
suggest = "https://" + domain + "/api/v2/search?q=" + q
|
||||||
if (suggest != oldSuggest) {
|
if (suggest != oldSuggest) {
|
||||||
console.log("Try to get suggest at " + suggest)
|
console.log("Try to get suggest at " + suggest)
|
||||||
fetch(suggest, {
|
fetch(suggest, {
|
||||||
|
@ -81,18 +81,43 @@ input.addEventListener("focus", function () {
|
||||||
todo(error);
|
todo(error);
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}).then(function (json) {
|
}).then(function (json) {
|
||||||
|
console.log(["Search", json]);
|
||||||
|
//ハッシュタグ
|
||||||
if (json.hashtags[0] && tag) {
|
if (json.hashtags[0] && tag) {
|
||||||
if (tag[1]) {
|
if (tag[1]) {
|
||||||
var tags = "";
|
var tags = [];
|
||||||
Object.keys(json.hashtags).forEach(function (key4) {
|
Object.keys(json.hashtags).forEach(function (key4) {
|
||||||
var tag = json.hashtags[key4];
|
var tag = json.hashtags[key4];
|
||||||
if (tag != q) {
|
var his = tag.history;
|
||||||
tags = tags + '<a onclick="tagInsert(\'#' + tag + '\',\'#' + q +
|
var uses = his[0].uses * 1 + his[1].uses * 1 + his[2].uses * 1 + his[3].uses * 1 + his[4].uses * 1 + his[5].uses * 1 + his[6].uses * 1;
|
||||||
'\')" class="pointer">#' + tag + '</a><br>';
|
tagHTML = '<br><a onclick="tagInsert(\'#' + escapeHTML(tag.name) + '\',\'#' + q + '\')" class="pointer">#' +
|
||||||
|
escapeHTML(tag.name) + '</a> ' + uses + 'toot(s)'
|
||||||
|
var item = {
|
||||||
|
"uses": uses,
|
||||||
|
"html": tagHTML
|
||||||
|
}
|
||||||
|
tags.push(item)
|
||||||
|
});
|
||||||
|
var num_a = -1;
|
||||||
|
var num_b = 1;
|
||||||
|
tags = tags.sort(function (a, b) {
|
||||||
|
var x = a["uses"];
|
||||||
|
var y = b["uses"];
|
||||||
|
if (x > y) return num_a;
|
||||||
|
if (x < y) return num_b;
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
var ins = ""
|
||||||
|
var nev = false
|
||||||
|
Object.keys(tags).forEach(function (key7) {
|
||||||
|
ins = ins + tags[key7].html
|
||||||
|
if (key7 <= 0 && !nev) {
|
||||||
|
ins = ins + '<br>'
|
||||||
|
nev = true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$("#suggest").html(ins);
|
||||||
$("#right-side").show()
|
$("#right-side").show()
|
||||||
$("#suggest").html("Tags:<br>" + tags);
|
|
||||||
$("#poll").addClass("hide")
|
$("#poll").addClass("hide")
|
||||||
$("#emoji").addClass("hide")
|
$("#emoji").addClass("hide")
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ function details(id, acct_id, tlid, mode) {
|
||||||
} else {
|
} else {
|
||||||
$("#tootmodal").attr("data-user", scn);
|
$("#tootmodal").attr("data-user", scn);
|
||||||
}
|
}
|
||||||
context(id, acct_id);
|
getContext(id, acct_id);
|
||||||
var dom = null;
|
var dom = null;
|
||||||
if (!local) {
|
if (!local) {
|
||||||
dom = scn.replace(/.+@/g, '');
|
dom = scn.replace(/.+@/g, '');
|
||||||
|
@ -156,7 +156,7 @@ function replyTL(id, acct_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//コンテクストってなんですか
|
//コンテクストってなんですか
|
||||||
function context(id, acct_id) {
|
function getContext(id, acct_id) {
|
||||||
var domain = localStorage.getItem("domain_" + acct_id);
|
var domain = localStorage.getItem("domain_" + acct_id);
|
||||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||||
|
|
|
@ -1001,7 +1001,6 @@ function connectMisskey(acct_id, re) {
|
||||||
var mute = [];
|
var mute = [];
|
||||||
if (data.body.id.indexOf("notf:") !== -1) {
|
if (data.body.id.indexOf("notf:") !== -1) {
|
||||||
var obj = JSON.parse(mess.data).body;
|
var obj = JSON.parse(mess.data).body;
|
||||||
console.log(obj);
|
|
||||||
var popup = localStorage.getItem("popup");
|
var popup = localStorage.getItem("popup");
|
||||||
if (!popup) {
|
if (!popup) {
|
||||||
popup = 0;
|
popup = 0;
|
||||||
|
|
|
@ -491,10 +491,9 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
||||||
if (urlCont) {
|
if (urlCont) {
|
||||||
urlindv = urlindv.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&")
|
urlindv = urlindv.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&")
|
||||||
var encoded = encodeURI(urlCont[4])
|
var encoded = encodeURI(urlCont[4])
|
||||||
var punycoded = "xn--"+punycode.encode(urlCont[2])
|
var punycoded = "xn--" + punycode.encode(urlCont[2])
|
||||||
var eUrl = urlCont[1] + "://" + punycoded + "." + urlCont[3] + "/" + encoded
|
var eUrl = urlCont[1] + "://" + punycoded + "." + urlCont[3] + "/" + encoded
|
||||||
var regExp = new RegExp('href="' + urlindv + '"', "g")
|
var regExp = new RegExp('href="' + urlindv + '"', "g")
|
||||||
console.log(eUrl, regExp)
|
|
||||||
content = content.replace(regExp, 'href="' + eUrl + '"')
|
content = content.replace(regExp, 'href="' + eUrl + '"')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -542,60 +541,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
||||||
'"><i class="far fa-calendar-times"></i>' +
|
'"><i class="far fa-calendar-times"></i>' +
|
||||||
ended + '</span></div>';
|
ended + '</span></div>';
|
||||||
}
|
}
|
||||||
if (toot.emojis) {
|
|
||||||
var emojick = toot.emojis[0];
|
|
||||||
} else {
|
|
||||||
var emojick = false;
|
|
||||||
}
|
|
||||||
//絵文字があれば
|
|
||||||
if (emojick) {
|
|
||||||
Object.keys(toot.emojis).forEach(function (key5) {
|
|
||||||
var emoji = toot.emojis[key5];
|
|
||||||
var shortcode = emoji.shortcode;
|
|
||||||
var emoji_url = '<img draggable="false" src="' + emoji.url +
|
|
||||||
'" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">';
|
|
||||||
var regExp = new RegExp(":" + shortcode + ":", "g");
|
|
||||||
content = content.replace(regExp, emoji_url);
|
|
||||||
spoil = spoil.replace(regExp, emoji_url);
|
|
||||||
poll = poll.replace(regExp, emoji_url);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//ニコフレ絵文字
|
|
||||||
if (toot.profile_emojis) {
|
|
||||||
var nicoemojick = toot.profile_emojis[0];
|
|
||||||
} else {
|
|
||||||
var nicoemojick = false;
|
|
||||||
}
|
|
||||||
//絵文字があれば(nico)
|
|
||||||
if (nicoemojick) {
|
|
||||||
Object.keys(toot.profile_emojis).forEach(function (keynico) {
|
|
||||||
var emoji = toot.profile_emojis[keynico];
|
|
||||||
var shortcode = emoji.shortcode;
|
|
||||||
var emoji_url = '<img draggable="false" src="' + emoji.url +
|
|
||||||
'" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">';
|
|
||||||
var regExp = new RegExp(":" + shortcode + ":", "g");
|
|
||||||
content = content.replace(regExp, emoji_url);
|
|
||||||
spoil = spoil.replace(regExp, emoji_url);
|
|
||||||
poll = poll.replace(regExp, emoji_url);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//デフォ絵文字
|
|
||||||
content = twemoji.parse(content);
|
|
||||||
if (dis_name) {
|
|
||||||
dis_name = twemoji.parse(dis_name);
|
|
||||||
}
|
|
||||||
if (spoil) {
|
|
||||||
spoil = twemoji.parse(spoil);
|
|
||||||
}
|
|
||||||
if (noticetext) {
|
|
||||||
noticetext = twemoji.parse(noticetext);
|
|
||||||
}
|
|
||||||
if (notice) {
|
|
||||||
notice = twemoji.parse(notice);
|
|
||||||
}
|
|
||||||
if (poll) {
|
|
||||||
poll = twemoji.parse(poll);
|
|
||||||
}
|
|
||||||
var mediack = toot.media_attachments[0];
|
var mediack = toot.media_attachments[0];
|
||||||
//メディアがあれば
|
//メディアがあれば
|
||||||
var media_ids = "";
|
var media_ids = "";
|
||||||
|
@ -611,8 +557,8 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
||||||
if (toot.sensitive && nsfw) {
|
if (toot.sensitive && nsfw) {
|
||||||
var sense = "sensitive"
|
var sense = "sensitive"
|
||||||
var blur = media.blurhash
|
var blur = media.blurhash
|
||||||
|
nsfwmes = '<div class="nsfw-media">' + lang.lang_parse_nsfw + '</div>'
|
||||||
if (blur) {
|
if (blur) {
|
||||||
nsfwmes = '<div class="nsfw-media">' + lang.lang_parse_nsfw + '</div>'
|
|
||||||
purl = parseBlur(blur)
|
purl = parseBlur(blur)
|
||||||
var sense = ""
|
var sense = ""
|
||||||
}
|
}
|
||||||
|
@ -625,7 +571,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
||||||
acct_id + ')" id="' + id + '-image-' + key2 + '" data-url="' + url +
|
acct_id + ')" id="' + id + '-image-' + key2 + '" data-url="' + url +
|
||||||
'" data-type="video" class="img-parsed"><video src="' +
|
'" data-type="video" class="img-parsed"><video src="' +
|
||||||
purl + '" class="' + sense +
|
purl + '" class="' + sense +
|
||||||
' toot-img pointer" style="max-width:100%;"></a></span>';
|
' toot-img pointer" style="max-width:100%;" loop="true"></a></span>';
|
||||||
} else {
|
} else {
|
||||||
if (media.type == "unknown") {
|
if (media.type == "unknown") {
|
||||||
viewer = viewer + '<a href="' + media.remote_url + '" title="' + media.remote_url + '">[' + lang.lang_parse_unknown + ']</a> '
|
viewer = viewer + '<a href="' + media.remote_url + '" title="' + media.remote_url + '">[' + lang.lang_parse_unknown + ']</a> '
|
||||||
|
@ -777,6 +723,60 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (toot.emojis) {
|
||||||
|
var emojick = toot.emojis[0];
|
||||||
|
} else {
|
||||||
|
var emojick = false;
|
||||||
|
}
|
||||||
|
//絵文字があれば
|
||||||
|
if (emojick) {
|
||||||
|
Object.keys(toot.emojis).forEach(function (key5) {
|
||||||
|
var emoji = toot.emojis[key5];
|
||||||
|
var shortcode = emoji.shortcode;
|
||||||
|
var emoji_url = '<img draggable="false" src="' + emoji.url +
|
||||||
|
'" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">';
|
||||||
|
var regExp = new RegExp(":" + shortcode + ":", "g");
|
||||||
|
content = content.replace(regExp, emoji_url);
|
||||||
|
spoil = spoil.replace(regExp, emoji_url);
|
||||||
|
poll = poll.replace(regExp, emoji_url);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//ニコフレ絵文字
|
||||||
|
if (toot.profile_emojis) {
|
||||||
|
var nicoemojick = toot.profile_emojis[0];
|
||||||
|
} else {
|
||||||
|
var nicoemojick = false;
|
||||||
|
}
|
||||||
|
//絵文字があれば(nico)
|
||||||
|
if (nicoemojick) {
|
||||||
|
Object.keys(toot.profile_emojis).forEach(function (keynico) {
|
||||||
|
var emoji = toot.profile_emojis[keynico];
|
||||||
|
var shortcode = emoji.shortcode;
|
||||||
|
var emoji_url = '<img draggable="false" src="' + emoji.url +
|
||||||
|
'" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">';
|
||||||
|
var regExp = new RegExp(":" + shortcode + ":", "g");
|
||||||
|
content = content.replace(regExp, emoji_url);
|
||||||
|
spoil = spoil.replace(regExp, emoji_url);
|
||||||
|
poll = poll.replace(regExp, emoji_url);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//デフォ絵文字
|
||||||
|
content = twemoji.parse(content);
|
||||||
|
if (dis_name) {
|
||||||
|
dis_name = twemoji.parse(dis_name);
|
||||||
|
}
|
||||||
|
if (spoil) {
|
||||||
|
spoil = twemoji.parse(spoil);
|
||||||
|
}
|
||||||
|
if (noticetext) {
|
||||||
|
noticetext = twemoji.parse(noticetext);
|
||||||
|
}
|
||||||
|
if (notice) {
|
||||||
|
notice = twemoji.parse(notice);
|
||||||
|
}
|
||||||
|
if (poll) {
|
||||||
|
poll = twemoji.parse(poll);
|
||||||
|
}
|
||||||
//日本語じゃない
|
//日本語じゃない
|
||||||
if (toot.language != lang.language && toot.language) {
|
if (toot.language != lang.language && toot.language) {
|
||||||
var trans = '<div class="action pin"><a onclick="trans(\'' + toot.language + '\',\'' + lang.language + '\')" class="waves-effect waves-dark btn-flat actct" style="padding:0" title="' + lang.lang_parse_trans + '"><i class="material-icons">g_translate</i></a></div>';
|
var trans = '<div class="action pin"><a onclick="trans(\'' + toot.language + '\',\'' + lang.language + '\')" class="waves-effect waves-dark btn-flat actct" style="padding:0" title="' + lang.lang_parse_trans + '"><i class="material-icons">g_translate</i></a></div>';
|
||||||
|
@ -913,119 +913,122 @@ function userparse(obj, auth, acct_id, tlid, popup) {
|
||||||
var datetype = localStorage.getItem("datetype");
|
var datetype = localStorage.getItem("datetype");
|
||||||
Object.keys(obj).forEach(function (key) {
|
Object.keys(obj).forEach(function (key) {
|
||||||
var toot = obj[key];
|
var toot = obj[key];
|
||||||
console.log(["Parsing", toot])
|
if (toot) {
|
||||||
if (!toot.username) {
|
console.log(["Parsing", toot])
|
||||||
var raw = toot;
|
if (!toot.username) {
|
||||||
toot = toot.account;
|
var raw = toot;
|
||||||
var notf = true;
|
toot = toot.account;
|
||||||
} else {
|
var notf = true;
|
||||||
var notf = false;
|
} else {
|
||||||
}
|
var notf = false;
|
||||||
if (toot.locked) {
|
|
||||||
var locked = ' <i class="fas fa-lock red-text"></i>';
|
|
||||||
} else {
|
|
||||||
var locked = "";
|
|
||||||
}
|
|
||||||
if (auth == "request") {
|
|
||||||
var authhtml = '<i class="material-icons gray pointer" onclick="request(\'' +
|
|
||||||
toot.id + '\',\'authorize\',' + acct_id + ')" title="Accept">person_add</i> <i class="material-icons gray pointer" onclick="request(\'' +
|
|
||||||
toot.id + '\',\'reject\',' + acct_id + ')" title="Reject">person_add_disabled</i>';
|
|
||||||
} else {
|
|
||||||
var authhtml = "";
|
|
||||||
}
|
|
||||||
var ftxt = lang.lang_parse_followed;
|
|
||||||
if (!locale && localStorage.getItem("followlocale_" + acct_id)) {
|
|
||||||
ftxt = localStorage.getItem("followlocale_" + acct_id);
|
|
||||||
}
|
|
||||||
if (popup > 0 || popup == -1 || notf) {
|
|
||||||
var notftext = ftxt + '<br>';
|
|
||||||
} else {
|
|
||||||
var notftext = "";
|
|
||||||
}
|
|
||||||
var memory = localStorage.getItem("notice-mem");
|
|
||||||
if (popup >= 0 && obj.length < 5 && notftext != memory) {
|
|
||||||
M.toast({ html: escapeHTML(toot.display_name) + ":" + ftxt, displayLength: popup * 1000 })
|
|
||||||
$(".notf-icon_" + tlid).addClass("red-text");
|
|
||||||
localStorage.setItem("notice-mem", notftext);
|
|
||||||
notftext = "";
|
|
||||||
var native = localStorage.getItem("nativenotf");
|
|
||||||
if (!native) {
|
|
||||||
native = "yes";
|
|
||||||
}
|
}
|
||||||
if (native == "yes") {
|
if (toot.locked) {
|
||||||
var os = localStorage.getItem("platform");
|
var locked = ' <i class="fas fa-lock red-text"></i>';
|
||||||
var options = {
|
} else {
|
||||||
body: toot.display_name + "(" + toot.acct + ")" + ftxt,
|
var locked = "";
|
||||||
icon: toot.avatar
|
}
|
||||||
};
|
if (auth == "request") {
|
||||||
var domain = localStorage.getItem("domain_" + acct_id);
|
var authhtml = '<i class="material-icons gray pointer" onclick="request(\'' +
|
||||||
if (os == "darwin") {
|
toot.id + '\',\'authorize\',' + acct_id + ')" title="Accept">person_add</i> <i class="material-icons gray pointer" onclick="request(\'' +
|
||||||
var n = new Notification('TheDesk:' + domain, options);
|
toot.id + '\',\'reject\',' + acct_id + ')" title="Reject">person_add_disabled</i>';
|
||||||
} else {
|
} else {
|
||||||
var nativeNotfOpt = [
|
var authhtml = "";
|
||||||
'TheDesk:' + domain,
|
}
|
||||||
toot.display_name + "(" + toot.acct + ")" + ftxt,
|
var ftxt = lang.lang_parse_followed;
|
||||||
toot.avatar,
|
if (!locale && localStorage.getItem("followlocale_" + acct_id)) {
|
||||||
"userdata",
|
ftxt = localStorage.getItem("followlocale_" + acct_id);
|
||||||
acct_id,
|
}
|
||||||
toot.id
|
if (popup > 0 || popup == -1 || notf) {
|
||||||
]
|
var notftext = ftxt + '<br>';
|
||||||
postMessage(["nativeNotf", nativeNotfOpt], "*")
|
} else {
|
||||||
|
var notftext = "";
|
||||||
|
}
|
||||||
|
var memory = localStorage.getItem("notice-mem");
|
||||||
|
if (popup >= 0 && obj.length < 5 && notftext != memory) {
|
||||||
|
M.toast({ html: escapeHTML(toot.display_name) + ":" + ftxt, displayLength: popup * 1000 })
|
||||||
|
$(".notf-icon_" + tlid).addClass("red-text");
|
||||||
|
localStorage.setItem("notice-mem", notftext);
|
||||||
|
notftext = "";
|
||||||
|
var native = localStorage.getItem("nativenotf");
|
||||||
|
if (!native) {
|
||||||
|
native = "yes";
|
||||||
|
}
|
||||||
|
if (native == "yes") {
|
||||||
|
var os = localStorage.getItem("platform");
|
||||||
|
var options = {
|
||||||
|
body: toot.display_name + "(" + toot.acct + ")" + ftxt,
|
||||||
|
icon: toot.avatar
|
||||||
|
};
|
||||||
|
var domain = localStorage.getItem("domain_" + acct_id);
|
||||||
|
if (os == "darwin") {
|
||||||
|
var n = new Notification('TheDesk:' + domain, options);
|
||||||
|
} else {
|
||||||
|
var nativeNotfOpt = [
|
||||||
|
'TheDesk:' + domain,
|
||||||
|
toot.display_name + "(" + toot.acct + ")" + ftxt,
|
||||||
|
toot.avatar,
|
||||||
|
"userdata",
|
||||||
|
acct_id,
|
||||||
|
toot.id
|
||||||
|
]
|
||||||
|
postMessage(["nativeNotf", nativeNotfOpt], "*")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (toot.display_name) {
|
||||||
if (toot.display_name) {
|
var dis_name = escapeHTML(toot.display_name);
|
||||||
var dis_name = escapeHTML(toot.display_name);
|
} else {
|
||||||
} else {
|
var dis_name = toot.username;
|
||||||
var dis_name = toot.username;
|
}
|
||||||
}
|
//ネイティブ通知
|
||||||
//ネイティブ通知
|
|
||||||
|
|
||||||
if (toot.emojis) {
|
if (toot.emojis) {
|
||||||
var actemojick = toot.emojis[0];
|
var actemojick = toot.emojis[0];
|
||||||
} else {
|
} else {
|
||||||
var actemojick = false;
|
var actemojick = false;
|
||||||
}
|
}
|
||||||
//絵文字があれば
|
//絵文字があれば
|
||||||
if (actemojick) {
|
if (actemojick) {
|
||||||
Object.keys(toot.emojis).forEach(function (key5) {
|
Object.keys(toot.emojis).forEach(function (key5) {
|
||||||
var emoji = toot.emojis[key5];
|
var emoji = toot.emojis[key5];
|
||||||
var shortcode = emoji.shortcode;
|
var shortcode = emoji.shortcode;
|
||||||
var emoji_url = '<img draggable="false" src="' + emoji.url +
|
var emoji_url = '<img draggable="false" src="' + emoji.url +
|
||||||
'" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">';
|
'" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">';
|
||||||
var regExp = new RegExp(":" + shortcode + ":", "g");
|
var regExp = new RegExp(":" + shortcode + ":", "g");
|
||||||
dis_name = dis_name.replace(regExp, emoji_url);
|
dis_name = dis_name.replace(regExp, emoji_url);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (dis_name) {
|
if (dis_name) {
|
||||||
dis_name = twemoji.parse(dis_name);
|
dis_name = twemoji.parse(dis_name);
|
||||||
}
|
}
|
||||||
if (toot.avatar) {
|
if (toot.avatar) {
|
||||||
var avatar = toot.avatar;
|
var avatar = toot.avatar;
|
||||||
} else {
|
} else {
|
||||||
var avatar = "../../img/missing.svg";
|
var avatar = "../../img/missing.svg";
|
||||||
|
}
|
||||||
|
|
||||||
|
templete = templete +
|
||||||
|
'<div class="cvo" style="padding-top:5px;" user-id="' + toot.id + '"><div class="area-notice">' +
|
||||||
|
notftext +
|
||||||
|
'</div><div class="area-icon"><a onclick="udg(\'' + toot.id + '\',' +
|
||||||
|
acct_id + ');" user="' + toot.acct + '" class="udg">' +
|
||||||
|
'<img draggable="false" src="' + avatar + '" width="40" class="prof-img" user="' + toot
|
||||||
|
.acct + '"></a></div>' +
|
||||||
|
'<div class="area-display_name"><div class="flex-name"><span class="user">' +
|
||||||
|
dis_name + '</span>' +
|
||||||
|
'<span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"> @' +
|
||||||
|
toot.acct + locked + '</span>' +
|
||||||
|
'</div>' +
|
||||||
|
'</div>' +
|
||||||
|
'<div style="justify-content:space-around" class="area-toot"> <div class="cbadge" style="width:100px;">Follows:' +
|
||||||
|
toot.following_count +
|
||||||
|
'</div><div class="cbadge" style="width:100px;">Followers:' + toot.followers_count +
|
||||||
|
'</div>' + authhtml +
|
||||||
|
'</div>' +
|
||||||
|
'</div>' +
|
||||||
|
'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
templete = templete +
|
|
||||||
'<div class="cvo" style="padding-top:5px;" user-id="' + toot.id + '"><div class="area-notice">' +
|
|
||||||
notftext +
|
|
||||||
'</div><div class="area-icon"><a onclick="udg(\'' + toot.id + '\',' +
|
|
||||||
acct_id + ');" user="' + toot.acct + '" class="udg">' +
|
|
||||||
'<img draggable="false" src="' + avatar + '" width="40" class="prof-img" user="' + toot
|
|
||||||
.acct + '"></a></div>' +
|
|
||||||
'<div class="area-display_name"><div class="flex-name"><span class="user">' +
|
|
||||||
dis_name + '</span>' +
|
|
||||||
'<span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"> @' +
|
|
||||||
toot.acct + locked + '</span>' +
|
|
||||||
'</div>' +
|
|
||||||
'</div>' +
|
|
||||||
'<div style="justify-content:space-around" class="area-toot"> <div class="cbadge" style="width:100px;">Follows:' +
|
|
||||||
toot.following_count +
|
|
||||||
'</div><div class="cbadge" style="width:100px;">Followers:' + toot.followers_count +
|
|
||||||
'</div>' + authhtml +
|
|
||||||
'</div>' +
|
|
||||||
'</div>' +
|
|
||||||
'</div>';
|
|
||||||
|
|
||||||
});
|
});
|
||||||
return templete;
|
return templete;
|
||||||
|
@ -1046,7 +1049,6 @@ function client(name) {
|
||||||
showCloseButton: true,
|
showCloseButton: true,
|
||||||
focusConfirm: false,
|
focusConfirm: false,
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
console.log(result)
|
|
||||||
if (result.dismiss == "cancel") {
|
if (result.dismiss == "cancel") {
|
||||||
//Emp
|
//Emp
|
||||||
var cli = localStorage.getItem("client_emp");
|
var cli = localStorage.getItem("client_emp");
|
||||||
|
|
|
@ -177,12 +177,12 @@ function graphDraw(tag, acct_id) {
|
||||||
var zero = 50 - (his[0].uses / max * 50);
|
var zero = 50 - (his[0].uses / max * 50);
|
||||||
if (max === 0) {
|
if (max === 0) {
|
||||||
tags = '<br><br><svg version="1.1" viewbox="0 0 60 50" width="60" height="50">' +
|
tags = '<br><br><svg version="1.1" viewbox="0 0 60 50" width="60" height="50">' +
|
||||||
'</svg><span style="font-size:200%">' + his[0].uses + '</span>toots <a onclick="tl(\'tag\',\'' + escapeHTML(tag.name) + '\',\'' + acct_id +
|
'</svg><span style="font-size:200%">' + his[0].uses + '</span>toot(s) <a onclick="tl(\'tag\',\'' + escapeHTML(tag.name) + '\',\'' + acct_id +
|
||||||
'\',\'add\')" class="pointer">#' + escapeHTML(tag.name) + '</a> ' + his[0].accounts + lang.lang_src_people;
|
'\',\'add\')" class="pointer">#' + escapeHTML(tag.name) + '</a> ' + his[0].accounts + lang.lang_src_people;
|
||||||
} else {
|
} else {
|
||||||
tags = '<br><br><svg version="1.1" viewbox="0 0 60 50" width="60" height="50">' +
|
tags = '<br><br><svg version="1.1" viewbox="0 0 60 50" width="60" height="50">' +
|
||||||
'<g><path d="M0,' + six + ' L10,' + five + ' 20,' + four + ' 30,' + three + ' 40,' + two + ' 50,' + one + ' 60,' + zero + '" style="stroke: #9e9e9e; stroke-width: 1;fill: none;"></path></g>' +
|
'<g><path d="M0,' + six + ' L10,' + five + ' 20,' + four + ' 30,' + three + ' 40,' + two + ' 50,' + one + ' 60,' + zero + '" style="stroke: #9e9e9e; stroke-width: 1;fill: none;"></path></g>' +
|
||||||
'</svg><span style="font-size:200%">' + his[0].uses + '</span>toots <a onclick="tl(\'tag\',\'' + escapeHTML(tag.name) + '\',\'' + acct_id +
|
'</svg><span style="font-size:200%">' + his[0].uses + '</span>toot <a onclick="tl(\'tag\',\'' + escapeHTML(tag.name) + '\',\'' + acct_id +
|
||||||
'\',\'add\')" class="pointer">#' + escapeHTML(tag.name) + '</a> ' + his[0].accounts + lang.lang_src_people;
|
'\',\'add\')" class="pointer">#' + escapeHTML(tag.name) + '</a> ' + his[0].accounts + lang.lang_src_people;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,6 @@ if (location.search) {
|
||||||
var mode = m[1];
|
var mode = m[1];
|
||||||
var codex = m[2];
|
var codex = m[2];
|
||||||
if (mode == "share") {
|
if (mode == "share") {
|
||||||
console.log(codex);
|
|
||||||
$('textarea').focus();
|
$('textarea').focus();
|
||||||
$("#textarea").val(decodeURI(codex));
|
$("#textarea").val(decodeURI(codex));
|
||||||
show();
|
show();
|
||||||
|
|
|
@ -357,7 +357,6 @@ function relations(user, acct_id) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}).then(function (json) {
|
}).then(function (json) {
|
||||||
var json = json[0];
|
var json = json[0];
|
||||||
console.log(json);
|
|
||||||
if (json.following) {
|
if (json.following) {
|
||||||
//自分がフォローしている
|
//自分がフォローしている
|
||||||
$("#his-data").addClass("following");
|
$("#his-data").addClass("following");
|
||||||
|
|
|
@ -667,7 +667,7 @@
|
||||||
<!-- Modal Structure Video-->
|
<!-- Modal Structure Video-->
|
||||||
<div id="videomodal" class="modal modal-fixed-footer">
|
<div id="videomodal" class="modal modal-fixed-footer">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<video src="" id="video" style="max-width:100%; max-height:100%;" controls>
|
<video src="" id="video" style="max-width:100%; max-height:100%;" controls loop="true" autoplay="true">
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat">Close</a>
|
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat">Close</a>
|
||||||
|
|
|
@ -667,7 +667,7 @@
|
||||||
<!-- Modal Structure Video-->
|
<!-- Modal Structure Video-->
|
||||||
<div id="videomodal" class="modal modal-fixed-footer">
|
<div id="videomodal" class="modal modal-fixed-footer">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<video src="" id="video" style="max-width:100%; max-height:100%;" controls>
|
<video src="" id="video" style="max-width:100%; max-height:100%;" controls loop="true" autoplay="true">
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat">Close</a>
|
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat">Close</a>
|
||||||
|
|
|
@ -668,7 +668,7 @@
|
||||||
<!-- Modal Structure Video-->
|
<!-- Modal Structure Video-->
|
||||||
<div id="videomodal" class="modal modal-fixed-footer">
|
<div id="videomodal" class="modal modal-fixed-footer">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<video src="" id="video" style="max-width:100%; max-height:100%;" controls>
|
<video src="" id="video" style="max-width:100%; max-height:100%;" controls loop="true" autoplay="true">
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat">@@close@@</a>
|
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat">@@close@@</a>
|
||||||
|
|
|
@ -667,7 +667,7 @@
|
||||||
<!-- Modal Structure Video-->
|
<!-- Modal Structure Video-->
|
||||||
<div id="videomodal" class="modal modal-fixed-footer">
|
<div id="videomodal" class="modal modal-fixed-footer">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<video src="" id="video" style="max-width:100%; max-height:100%;" controls>
|
<video src="" id="video" style="max-width:100%; max-height:100%;" controls loop="true" autoplay="true">
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat">crwdns385:0crwdne385:0</a>
|
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat">crwdns385:0crwdne385:0</a>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user